X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: <4A82E3ED.9020406@gmail.com> References: <4A82DC03 DOT 7040800 AT gmail DOT com> <4A82E3ED DOT 9020406 AT gmail DOT com> Date: Thu, 13 Aug 2009 08:05:31 +0200 Message-ID: Subject: Re: Unable to link From: Javier Sedano To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: 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 Hi, cygwiners, 2009/8/12 Dave Korn : > Javier Sedano wrote: > >> /home/jsedano/prj/uc3m/ao/Labs_J/LibAO/testBypass.c:26: undefined >> reference to `_testBP_1' >> /home/jsedano/prj/uc3m/ao/Labs_J/LibAO/testBypass.c:26: undefined >> reference to `___aoAsBypassCall' > >> jsedano AT ender:~/prj/uc3m/ao/Labs_J/LibAO> nm libao-g.a | grep _testBP_1 >> jsedano AT ender:~/prj/uc3m/ao/Labs_J/LibAO> nm libao-g.a | grep testBP_1 >> 00000166 T testBP_1 > > =A0You're trying to use a library binary that was originally compiled on = Linux, > aren't you? =A0That can't work, sorry; you need to recompile the library = from > source on Cygwin. > On a first though I was about to say "no"... but on second though... not sure. I've got several .s files (assembly code) that seems to be hand-written (they have lots of the kind of comments that humans use to do, so does not seem to be compiled). See trace below. So let's see if I understand the problem: when I define (and implement) a function f1(), gcc on Linux will use the name f1 for the function, but gcc on cygwin will use _f1. So if my .s has been created with Linux on mind, the developer used f1, and cygwin can not find it. Right so far? So any other idea? Any modifier to gcc not to use the leading _? jsedano AT ender:~/prj/uc3m/ao/Labs_J/LibAO> grep -r testBP_1 . ./bypassCall.s: .global testBP_1, testBP_2, testBP_3, testBP_4, testBP_5, testBP_6 ./bypassCall.s:testBP_1: ./testBypass.c:void testBP_1(); ./testBypass.c: returned =3D __aoAsBypassCall(&testBP_1, // Function to = call jsedano AT ender:~/prj/uc3m/ao/Labs_J/LibAO> grep -B5 -A5 testBP_1 bypassCall.s toTransfer: .int 0 .text .globl __aoAsBypassDiagnostics, __aoAsBypassCall .global testBP_1, testBP_2, testBP_3, testBP_4, testBP_5, testBP_6 # Function to catch the invocation of certain function and # perform some checks in the way parameters and result is # manipulated. Also this method allows to transfer the result # from an arbitrary register in to %eax to facilitate the -- ###########################################################################= ##### # ---------------------------------------------------------------------- # Does nothing # ---------------------------------------------------------------------- testBP_1: ret # ---------------------------------------------------------------------- # Returns 31 in ebx # ---------------------------------------------------------------------- jsedano AT ender:~/prj/uc3m/ao/Labs_J/LibAO> --=20 -- Javier Sedano javier DOT sedano AT gmail DOT com -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple