I'm sorry, I don't know enough about shared libraries to build a small test
case, but I don't think it should be hard to do for someone who does know.

It's simple to reproduce the problem.  I installed Xcode 2.1 and built mainline
and 4.0-branch with

[descartes:~/programs] lucier% /pkgs/gcc-4.0-mainline/bin/gcc -v
Using built-in specs.
Target: powerpc-apple-darwin8.1.0
Configured with: ../configure --prefix=/pkgs/gcc-4.0-mainline
--with-gmp=/pkgs/gmp-4.1.3 --with-mpfr=/pkgs/gmp-4.1.3
Thread model: posix
gcc version 4.1.0 20050615 (experimental)
[descartes:~/programs] lucier% /pkgs/gcc-4.0-branch/bin/gcc -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)

Next I downloaded

http://www.math.purdue.edu/~lucier/bugzilla/7/gambc40b13.tar.gz

expanded it, cd'ed to gambc40b13, configured with

[descartes:~/programs/gambc40b13] lucier% env CC='/pkgs/gcc-4.0-mainline/bin/gcc
-mcpu=970 -m64 -force_cpusubtype_ALL' ./configure --enable-shared

and ran "make"

The library routines were compiled with, for example,

/pkgs/gcc-4.0-mainline/bin/gcc -mcpu=970 -m64 -force_cpusubtype_ALL -I../include
-I. -no-cpp-precomp -Wall -W -Wno-unused -O1 -fno-math-errno -fschedule-insns2
-fno-trapping-math -fno-strict-aliasing -fomit-frame-pointer -fPIC -fno-common
-DHAVE_CONFIG_H -D___PRIMAL -D___LIBRARY -D___GAMBCDIR=\"/usr/local/Gambit-C\"
-c _num.c

and they were linked with

/pkgs/gcc-4.0-mainline/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 
making all in gsi
/pkgs/gcc-4.0-mainline/bin/gcc -mcpu=970 -m64 -force_cpusubtype_ALL -I../include
-no-cpp-precomp -Wall -W -Wno-unused -O1 -fno-math-errno -fschedule-insns2
-fno-trapping-math -fno-strict-aliasing -fomit-frame-pointer -fPIC -fno-common
-DHAVE_CONFIG_H -c _gsi.c
gcc: unrecognized option '-no-cpp-precomp'
/pkgs/gcc-4.0-mainline/bin/gcc -mcpu=970 -m64 -force_cpusubtype_ALL -I../include
-no-cpp-precomp -Wall -W -Wno-unused -O1 -fno-math-errno -fschedule-insns2
-fno-trapping-math -fno-strict-aliasing -fomit-frame-pointer -fPIC -fno-common
-DHAVE_CONFIG_H -c _gsi_.c
gcc: unrecognized option '-no-cpp-precomp'
/pkgs/gcc-4.0-mainline/bin/gcc -mcpu=970 -m64 -force_cpusubtype_ALL  _gsi.o
_gsi_.o -L../lib -lgambc  -o gsi
ld64 failed: in ../lib/libgambc.dylib, unknown mach-o file type
collect2: ld returned 1 exit status
make[1]: *** [gsi] Error 1
make: *** [all-recursive] Error 1
[descartes:~/programs/gambc40b13] lucier% ld64 -v
@(#)PROGRAM:ld64  PROJECT:ld64-26.0.80  DEVELOPER:root  BUILT:May 26 2005 
16:00:10
[descartes:~/programs/gambc40b13] lucier% ld -v
Apple Computer, Inc. version cctools-590.obj~12
[descartes:~/programs/gambc40b13] lucier% as -v
Apple Computer, Inc. version cctools-590.obj~12, GNU assembler version 1.38

The same thing happens with 4.0-branch, i.e., the 4.0.1 release candidate, which
is more troubling.

It doesn't happen with 4.0.0, so this is a regression from 4.0.0 to 4.0.1.

Brad

-- 
           Summary: Can't link 64-bit shared libraries with Xcode 2.1
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: lucier at math dot purdue dot edu
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powerpc-apple-darwin8.1.0
  GCC host triplet: powerpc-apple-darwin8.1.0
GCC target triplet: powerpc-apple-darwin8.1.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22082

Reply via email to