This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Fwd: Re: ld: cannot perform PE operations on not PE files ...]

Thx Dave for suggestion, but Loic Grein (member of the list) told me that your patch should work fine both on linux and cygwin.
I tried and it work fine.
Thanks a lot to everybody for your help.

Dave Korn ha scritto:

On 14 November 2006 17:45, Salvatore D'Angelo wrote:

Dave you're right. I forgot to add -r.
Thanks a lot. Your solution work fine.

The problem now is that I should change the Makefile in order to have
two different behaviour in CYGWIN and linux.

Actually, if I haven't messed up, the workaround method using -r should be fine for linux too - have you tried it?

The solutions are:

1. use if statements in order to execute different statements on linux
and cygwin. The question now is how I can do that. I mean what is the
variable I have to check with ifdef?

If you actually /needed/ to know, you could find out by $(shell uname) or some similar variant, but I think the solution I gave should work fine on linux and cygwin without needing to do anything different between the two.

2. Install binutils cross and set target i686-pc-linux. In this way I
have to change only the name of tools used to compile and link. But I do
not know how to do that. Could someone suggest me a link?

Oh, it'll be easier to just show you how. (Bulding a cross-compiler can be ever so tricky, but building cross binutils is almost always a breeze):

Step 1: Download and untar the sources, create a directory for building in.

cd /tmp
tar xfvj binutils-2.17.tar.bz2
mkdir obj

Step 2: Configure, build and install the sources.

cd obj
../binutils-2.17/configure -v --prefix=/usr/local \
       --target=i686-pc-linux 2>&1 | tee conf.log
make all 2>&1 | tee build.log
make install 2>&1 | tee install.log
[optional] make -k check 2>&1 | tee check.log

Step 3: Tidy up.

cd ..
rm -rf obj binutils-2.17

 Now all you need to do is make sure you've got /usr/local/bin in your $PATH,
and away you go; set AS to i686-pc-linux-as and LD to i686-pc-linux-ld in your

please cc my address since I am not subscribed at the list

I remembered this time!


[*] - the tinyurl points to
bz2 but avoids getting line-wrapped by the mailer!

-- Unsubscribe info: Problem reports: Documentation: FAQ:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]