This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] fix PR ada/42554 by dropping -c from ranlib on darwin10 and later


   The use of -c for common symbols with ranlib is considered
a legacy option in Darwin10. The Xcode 3.2 linker doesn't
properly ignore duplicate symbols from static libraries when
they are prepared with 'ranlib -c' (radar 6320843). Apple's
response to this was...

> Darwin static archives traditionally do not have common symbols in there table of contents.  
> The -c option forces common symbols into the table of contents and causes this problem.

The use of 'ranlib -c' was introduced with...

http://gcc.gnu.org/ml/gcc-patches/2002-12/msg01183.html

The original purpose of that patch (to eliminate failures in g77) no
longer exists on darwin10 as FSF gcc built without 'ranlib -c'
shows no regressions on x86_64-apple-darwin10.

http://gcc.gnu.org/ml/gcc-testresults/2010-02/msg00298.html

The attached patch limits the use of the -c option with
ranlib to darwin9 and earlier. This change will eliminate the
linkage failures in ada on darwin10 (PR42554)...

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42554#c5

Okay for gcc trunk? 
                Jack



2009-11-25  Jack Howarth <howarth@bromo.med.uc.edu>

	PR ada/42554
	* configure.ac: Only pass -c to ranlib for darwin9 and earlier.
	* configure: Regenerate.

Index: configure.ac
===================================================================
--- configure.ac	(revision 156483)
+++ configure.ac	(working copy)
@@ -2405,8 +2405,8 @@
     extra_arflags_for_target=" -X32_64"
     extra_nmflags_for_target=" -B -X32_64"
     ;;
-  *-*-darwin*)
-    # ranlib from Darwin requires the -c flag to look at common symbols.
+  *-*-darwin[[3-9]].*)
+    # ranlib before Darwin10 requires the -c flag to look at common symbols.
     extra_ranlibflags_for_target=" -c"
     ;;
   mips*-*-pe | sh*-*-pe | *arm-wince-pe)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]