------- Additional Comments From lucier at math dot purdue dot edu 2005-06-15 19:19 ------- Subject: Re: Can't link 64-bit shared libraries with Xcode 2.1
On Jun 15, 2005, at 1:56 PM, pinskia at gcc dot gnu dot org wrote: > > ------- Additional Comments From pinskia at gcc dot gnu dot org > 2005-06-15 18:56 ------- > (In reply to comment #6) > >> [descartes:~/programs/gambc40b13] lucier% file lib/libgambc.dylib >> lib/libgambc.dylib: Mach-O 64-bit executable ppc64 >> > > executable, that means it is not linkable. I would double check > you GCC invocation for making > libgambc.dylib because it is not generating a library. Thank you very much for this suggestion, I see /pkgs/gcc-4.0-branch/bin/gcc -mcpu=970 -m64 -force_cpusubtype_ALL - flat_namespace -undefined suppress -o libgambc.dylib main.o setup.o mem.o c_intf.o os.o os_base.o os_time.o os_shell.o os_files.o os_dyn.o os_tty.o os_io.o _kernel.o _system.o _num.o _std.o _eval.o _io.o _nonstd.o _thread.o _repl.o _gambc.o versus /pkgs/gcc-4.0.0/bin/gcc -mcpu=970 -m64 -force_cpusubtype_ALL - dynamiclib -flat_namespace -undefined suppress -o libgambc.dylib main.o setup.o mem.o c_intf.o os.o os_base.o os_time.o os_shell.o os_files.o os_dyn.o os_tty.o os_io.o _kernel.o _system.o _num.o _std.o _eval.o _io.o _nonstd.o _thread.o _repl.o _gambc.o and the configuration log for gcc-4.0-branch says configure:15317: checking whether /pkgs/gcc-4.0-branch/bin/gcc - mcpu=970 -m64 -force_cpusubtype_ALL accepts -dynamiclib configure:15338: /pkgs/gcc-4.0-branch/bin/gcc -mcpu=970 -m64 - force_cpusubtype_ALL -o conftest -dynamiclib conftest.c >&5 ld64 failed: library not found for -lgcc_s /usr/bin/libtool: internal link edit command failed (which is as you've been saying) versus for 4.0.0 configure:15317: checking whether /pkgs/gcc-4.0.0/bin/gcc -mcpu=970 - m64 -force_cpusubtype_ALL accepts -dynamiclib configure:15338: /pkgs/gcc-4.0.0/bin/gcc -mcpu=970 -m64 - force_cpusubtype_ALL -o conftest -dynamiclib conftest.c >&5 configure:15341: $? = 0 configure:15355: result: -dynamiclib And it does work with 4.0.0: [descartes:/pkgs/gcc-4.0.0] lucier% cat conftest.c int main () { return 0; } [descartes:/pkgs/gcc-4.0.0] lucier% /pkgs/gcc-4.0.0/bin/gcc -mcpu=970 -m64 -force_cpusubtype_ALL -o conftest -dynamiclib conftest.c -v Using built-in specs. Target: powerpc-apple-darwin8.1.0 Configured with: ../configure --prefix=/pkgs/gcc-4.0.0 --with-gmp=/ pkgs/gmp-4.1.3 --with-mpfr=/pkgs/gmp-4.1.3 Thread model: posix gcc version 4.0.0 /pkgs/gcc-4.0.0/libexec/gcc/powerpc-apple-darwin8.1.0/4.0.0/cc1 - quiet -v -D__DYNAMIC__ -D__APPLE_CC__=1 conftest.c -fPIC -quiet - dumpbase conftest.c -mcpu=970 -m64 -auxbase conftest -version -o /var/ tmp//ccKu5zS6.s ignoring nonexistent directory "/usr/local/include" ignoring nonexistent directory "/pkgs/gcc-4.0.0/lib/gcc/powerpc-apple- darwin8.1.0/4.0.0/../../../../powerpc-apple-darwin8.1.0/include" #include "..." search starts here: #include <...> search starts here: /pkgs/gcc-4.0.0/include /pkgs/gcc-4.0.0/lib/gcc/powerpc-apple-darwin8.1.0/4.0.0/include /usr/include /System/Library/Frameworks /Library/Frameworks End of search list. GNU C version 4.0.0 (powerpc-apple-darwin8.1.0) compiled by GNU C version 4.0.0. GGC heuristics: --param ggc-min-expand=100 --param ggc-min- heapsize=131072 as -arch ppc64 -force_cpusubtype_ALL -o /var/tmp//ccCtfLGH.o /var/ tmp//ccKu5zS6.s /usr/bin/libtool -dynamic -arch_only ppc64 -noall_load - weak_reference_mismatches non-weak -o conftest -L/pkgs/gcc-4.0.0/lib/ gcc/powerpc-apple-darwin8.1.0/4.0.0 -L/pkgs/gcc-4.0.0/lib/gcc/powerpc- apple-darwin8.1.0/4.0.0/../../.. /var/tmp//ccCtfLGH.o -lgcc_s -lgcc - lSystemStubs -lmx -lSystem [descartes:/pkgs/gcc-4.0.0] lucier% file conftest conftest: Mach-O 64-bit dynamically linked shared library ppc64 So it works with 4.0.0, but not with 4.0-branch: [descartes:~/programs/gambc40b13] lucier% /pkgs/gcc-4.0-branch/bin/ gcc -mcpu=970 -m64 -force_cpusubtype_ALL -o conftest.o -dynamiclib conftest.c -v Using built-in specs. Target: powerpc-apple-darwin8.1.0 Configured with: ../configure --prefix=/pkgs/gcc-4.0-branch --with- gmp=/pkgs/gmp-4.1.3 --with-mpfr=/pkgs/gmp-4.1.3 Thread model: posix gcc version 4.0.1 20050615 (prerelease) /pkgs/gcc-4.0-branch/libexec/gcc/powerpc-apple-darwin8.1.0/4.0.1/cc1 - quiet -v -D__DYNAMIC__ -D__APPLE_CC__=1 conftest.c -fPIC -quiet - dumpbase conftest.c -mcpu=970 -m64 -auxbase conftest -version -o /var/ tmp//cctbhV9h.s ignoring nonexistent directory "/usr/local/include" ignoring nonexistent directory "/pkgs/gcc-4.0-branch/lib/gcc/powerpc- apple-darwin8.1.0/4.0.1/../../../../powerpc-apple-darwin8.1.0/include" #include "..." search starts here: #include <...> search starts here: /pkgs/gcc-4.0-branch/include /pkgs/gcc-4.0-branch/lib/gcc/powerpc-apple-darwin8.1.0/4.0.1/include /usr/include /System/Library/Frameworks /Library/Frameworks End of search list. GNU C version 4.0.1 20050615 (prerelease) (powerpc-apple-darwin8.1.0) compiled by GNU C version 4.0.1 20050615 (prerelease). GGC heuristics: --param ggc-min-expand=100 --param ggc-min- heapsize=131072 as -arch ppc64 -force_cpusubtype_ALL -o /var/tmp//ccsSIHVj.o /var/ tmp//cctbhV9h.s /usr/bin/libtool -dynamic -arch_only ppc64 -noall_load - weak_reference_mismatches non-weak -o conftest.o -L/pkgs/gcc-4.0- branch/lib/gcc/powerpc-apple-darwin8.1.0/4.0.1 -L/pkgs/gcc-4.0-branch/ lib/gcc/powerpc-apple-darwin8.1.0/4.0.1/../../.. /var/tmp//ccsSIHVj.o -lgcc_s -lgcc -lSystemStubs -lmx -lSystem ld64 failed: library not found for -lgcc_s /usr/bin/libtool: internal link edit command failed -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22082