http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47558
--- Comment #53 from Iain Sandoe <iains at gcc dot gnu.org> 2011-02-04 11:26:14 UTC --- (In reply to comment #52) > ain, > I think the key misassumption you are making is that the internal linker > and dyld behavior for 10.5 is valid under 10.6. Remember that unlike under > Leopard, where /usr/lib/libgcc_s.1.dylib is still a physically unique file... > > [MacPro:Leopard HD/usr/lib] howarth% ls -l libgcc* > lrwxr-xr-x 1 howarth howarth 16 Jul 24 2009 libgcc_s.1.0.dylib -> > libgcc_s.1.dylib > -rw-r--r-- 1 howarth howarth 264016 Oct 6 2007 libgcc_s.1.dylib > -rw-r--r-- 1 howarth howarth 33256 Feb 19 2008 libgcc_s.10.4.dylib > -rw-r--r-- 1 howarth howarth 33620 Feb 19 2008 libgcc_s.10.5.dylib > lrwxr-xr-x 1 howarth howarth 16 Jul 24 2009 libgcc_s_ppc64.1.dylib -> > libgcc_s.1.dylib > lrwxr-xr-x 1 howarth howarth 16 Jul 24 2009 libgcc_s_x86_64.1.dylib -> > libgcc_s.1.dylib > > under 10.6, it is only a symlink for libSystem itself... No, don't think I'm missing this ... if you read back through the comments, you will see that I've already made the point ;) > [MacPro:/usr/lib] howarth% ls -l libgcc* > lrwxr-xr-x 1 root wheel 17 Nov 4 19:37 libgcc_s.1.dylib -> > libSystem.B.dylib > lrwxr-xr-x 1 root wheel 19 Nov 4 20:32 libgcc_s.10.4.dylib -> > libgcc_s.10.5.dylib > -rwxr-xr-x 1 root wheel 40668 Apr 23 2010 libgcc_s.10.5.dylib > > So under -mmacosx-version-min=10.6, the linker and dyld only have to use the > magic symbols to properly disregard the duplicate symbols in the > libgcc_s.*.dylib symlinks. When these changes were designed, Apple likely > didn't consider that someone would come along with an additional > libgcc_s.1.dylib and start linking that in as well. We need to treat the > linkage of -lgcc_ext.10.5 under -mmacosx-version-min=10.6 as in the same > category as the linkage of -lgcc and wrapper it with -lSystem as well, well the 'magic symbols' are AFAICT undocumented. However, the behaviors of two-level namespace and -flat_namespace are documented. Whilst it is quite possible that Apple were not expecting someone to add libgcc_ext - it is no different than any other case where potential duplicates are involved. Since 'magic symbols' are undocumented and we are speculating, my view is that they are there so that, when you link -mmacosx-version-min=10.5 on a 10.6 box, the result contains a reference to /usr/lib/libgcc_s.1.dylib for the Unwinder symbols (because they do not exist in libSystem before 10.6). (I suggest that we take any more discussion of magic symbols off-line since we have no factual basis to decide at the moment)