[Bug c++/27408] New: g++ -force_flat_namespace fails due to crt3.o multiply defined symbols
03-May-2006 12:37 PM Peter O'Gorman: g++ -force_flat_namespace dies with multiple definition of symbols in libSystem and crt3.o on Mac OS X 10.4. peter$ /opt/gcc_mainline/bin/g++ -force_flat_namespace -o foo foo.cpp /opt/odcctools/bin/ld: multiple definitions of symbol _atexit /opt/gcc_mainline/lib/gcc/powerpc-apple-darwin8.6.0/4.2.0/crt3.o private external definition of _atexit in section (__TEXT,__text) /usr/lib/libSystem.dylib(atexit.So) definition of _atexit /opt/odcctools/bin/ld: multiple definitions of symbol ___cxa_atexit /opt/gcc_mainline/lib/gcc/powerpc-apple-darwin8.6.0/4.2.0/crt3.o private external definition of ___cxa_atexit in section (__TEXT,__text) /usr/lib/libSystem.dylib(atexit.So) definition of ___cxa_atexit collect2: ld returned 1 exit status I expected the link to succeed. This bug is also an Apple radar - rdar://problem/4535166 Peter -- Summary: g++ -force_flat_namespace fails due to crt3.o multiply defined symbols Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: peter at pogma dot com GCC host triplet: *-*-darwin8* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27408
[Bug driver/21366] The -bundle linking option does not get processed right on darwin
--- Additional Comments From peter at pogma dot com 2005-08-04 12:52 --- New(ish) patch: http://gcc.gnu.org/ml/gcc-patches/2005-08/msg00266.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21366
[Bug target/20366] AIX g++ -D_LARGE_FILES fails to compile #include
--- Comment #17 from peter at pogma dot com 2007-12-31 19:28 --- (In reply to comment #16) > This was also a problem on solaris: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4850 I mean http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4886 -- peter at pogma dot com changed: What|Removed |Added CC| |peter at pogma dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20366
[Bug bootstrap/18810] Operation not supported while installing 4.0.0 on apple-darmin-7.6.0.
--- Additional Comments From peter at pogma dot com 2005-02-10 03:08 --- My /dev/null also gets unlinked during 'sudo make install', so I decided to find the problem. I made a shared library that contained an unlink function: #include #include int unlink(const char *path) { if (!strcmp("/dev/null",path)) { sleep(180); return 0; } return syscall(SYS_unlink,path); } and used DYLD_INSERT_LIBRARIES before doing make install as root. Doing this, I discovered that my gcc/libgcc.mk contains: vis_hide := $(strip $(subst @,-,\ $(shell if echo 'void foo(void); void foo(void) {}' | \ $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -fvisibility=hidden -Werror \ -c -xc - -o /dev/null 2> /dev/null; \ then echo @fvisibility=hidden @DHIDE_EXPORTS; \ fi))) and that darwin's as has a write_object.c which at aoround line 582 has: (void)unlink(out_file_name); I suggest changing the bit of gcc/mklibgcc.in that says: # Test -fvisibility=hidden. We need both a -fvisibility=hidden on # the command line, and a #define to prevent libgcc2.h etc from # overriding that with #pragmas. The dance with @ is to prevent # echo from seeing anything it might take for an option. echo "vis_hide := \$(strip \$(subst @,-,\\" echo "\$(shell if echo 'void foo(void); void foo(void) {}' | \\" echo " $gcc_compile -fvisibility=hidden -Werror \\" echo " -c -xc - -o /dev/null 2> /dev/null; \\" echo " then echo @fvisibility=hidden @DHIDE_EXPORTS; \\" echo " fi)))" echo So the -o /dev/null goes away. It shouldn't be too hard to make a temporary file name and rm the temp file here. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18810
[Bug bootstrap/18810] Operation not supported while installing 4.0.0 on apple-darmin-7.6.0.
--- Additional Comments From peter at pogma dot com 2005-02-10 03:49 --- I filed a radar that /dev/null shouldn't be unlinkable. But gcc should probably avoid '-o /dev/null', it is just used to check if -fvisibility=hidden is available. There must either be another way to do that check or use the temp file method. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18810
[Bug bootstrap/18810] [4.0 Regression] Darwin's as unlinks /dev/null
--- Additional Comments From peter at pogma dot com 2005-02-10 04:05 --- Okay, I'll try. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18810
[Bug bootstrap/18810] [4.0 Regression] Darwin's as unlinks /dev/null
--- Additional Comments From peter at pogma dot com 2005-02-10 14:15 --- http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00439.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18810
[Bug libfortran/17748] libgfortran contains undefined references to _environ
--- Additional Comments From peter at pogma dot com 2004-10-15 13:04 --- You want additional checks besides the crt_externs.h check in my patch? I think it highly unlikely that other platforms have this header, but if you like I can also check for the _NSGetEnviron function. It may take a little while though, I rm'ed the gcc tree I had checked out, was running out of disk space. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17748
[Bug libfortran/17748] New: libgfortran contains undefined references to _environ
libgfortran references environ which is not available to shared libraries directly on darwin. This means that we can not build fortran shared libraries without undefined symbols. The solution is to use crt_externs.h and #define environ (*_NSGetEnviron()) in libgfortran/runtime/ environ.c. -- Summary: libgfortran contains undefined references to _environ Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: libfortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: peter at pogma dot com CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: powerpc-apple-darwin GCC host triplet: powerpc-apple-darwin GCC target triplet: powerpc-apple-darwin http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17748
[Bug libfortran/17748] libgfortran contains undefined references to _environ
--- Additional Comments From peter at pogma dot com 2004-09-30 13:43 --- Created an attachment (id=7245) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7245&action=view) proposed patch -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17748
[Bug libfortran/17748] libgfortran contains undefined references to _environ
--- Additional Comments From peter at pogma dot com 2004-09-30 14:04 --- Yeah, but with undefined references in shared libraries in gfortran it means that it is impossible to create shared fortran libraries twolevel namespace on darwin. This was possible with f77. In fact I see on closer inspection that libgcj.dylib has the same issue, I noticed the f77 issue by trying to run the libtool test suite with cvs gcc 4.0 and it skipped the f77 tests due to missing environ symbols. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17748