X-Spam-Check-By: sourceware.org From: "Dave Korn" To: "'Salvatore D'Angelo'" , Subject: RE: [Fwd: Re: ld: cannot perform PE operations on not PE files ...] Date: Wed, 15 Nov 2006 10:11:17 -0000 Message-ID: <02a501c7089e$6395b8c0$a501a8c0@CAM.ARTIMI.COM> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <455A00A3.5090801@tiscali.it> Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 wget http://tinyurl.com/y7a7hu 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 makefile. > please cc my address since I am not subscribed at the list I remembered this time! cheers, DaveK [*] - the tinyurl points to http://www.mirrorservice.org/sites/ftp.gnu.org/gnu/binutils/binutils-2.17.tar. bz2 but avoids getting line-wrapped by the mailer! -- Can't think of a witty .sigline today.... -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/