buglibffcall - foreign function call libraries - Bugs: bug #23474, Shared libraries on Darwin don't...


bug #23474: Shared libraries on Darwin don't work

Submitted by:  Sam Steingold <sds>
Submitted on:  Tue Jun 3 22:17:22 2008  
Category: NoneSeverity: 3 - Normal
Item Group: buildStatus: Fixed
Privacy: PublicAssigned to: Bruno Haible <haible>
Open/Closed: Closed

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Fri Dec 30 01:30:34 2016, comment #1:

The collision of '__structcpy' between libavcall and libcallback should be fixed by http://git.savannah.gnu.org/gitweb/?p=libffcall.git;a=commitdiff;h=24b4a84a135250259ae3e0336dbdede0f2326def

The collision of '__va_error1' and '__va_error2' between libvacall and libcallback should not be a problem in practice: No program should link with both libvacall and libcallback. libvacall is for programs that are not multithread-safe. libcallback is for programs that are multithread-safe.

Bruno Haible <haible>
Project AdministratorIn charge of this item.
Tue Jun 3 22:17:22 2008, original submission:

Dynamic libraries created on *-apple-darwin8 don't work. This seems to be due to libavcall and libcallback both defining ___structcpy. Static libraries are not affected.

Building the attached file with

cc callback2.c -lavcall -lvacall -ltrampoline -lcallback -o callback2


/usr/bin/ld: multiple definitions of symbol ___structcpy
/usr/local/lib/libavcall.dylib(libavcall.0.0.0.dylib-master.o) definition of ___structcpy
definition of ___structcpy
/usr/bin/ld: warning multiple definitions of symbol ___va_error1
/usr/local/lib/libvacall.a(misc.o) definition of ___va_error1 in section (__TEXT,__text)
definition of ___va_error1
/usr/bin/ld: warning multiple definitions of symbol ___va_error2
/usr/local/lib/libvacall.a(misc.o) definition of ___va_error2 in section (__TEXT,__text)
definition of ___va_error2
collect2: ld returned 1 exit status
make: *** [callback2] Error 1

Replacing each -l<lib> with /usr/local/lib/lib<lib>.a builds without problems and produces a fully functioning executable.

uname -a

Darwin apple2.local 8.11.0 Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC Power Macintosh powerpc

cc --version

powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5363)

ffcall 1.10


Sam Steingold <sds>
Project Administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #15790:  callback2.c added by sds (305B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by haible (Posted a comment)
  • -unavailable- added by sds (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri Dec 30 01:30:34 2016haibleItem GroupNone=>build
    Tue Jun 3 22:19:18 2008sdsAttached File-=>Added callback2.c, #15790

    Back to the top

    Powered by Savane 3.1-cleanup1