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: Unable to link


Hi, cygwiners,

2009/8/12 Dave Korn <dave.korn.cygwin@googlemail.com>:
> 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@ender:~/prj/uc3m/ao/Labs_J/LibAO> nm libao-g.a | grep _testBP_1
>> jsedano@ender:~/prj/uc3m/ao/Labs_J/LibAO> nm libao-g.a | grep testBP_1
>> 00000166 T testBP_1
>
> ?You're trying to use a library binary that was originally compiled on Linux,
> aren't you? ?That 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@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 = __aoAsBypassCall(&testBP_1, // Function to call
jsedano@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@ender:~/prj/uc3m/ao/Labs_J/LibAO>



-- 
--
Javier Sedano
javier.sedano@gmail.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


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