This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] fix PR ada/42554 by dropping -c from ranlib on darwin10 and later
- From: Tristan Gingold <gingold at adacore dot com>
- To: Jack Howarth <howarth at bromo dot med dot uc dot edu>
- Cc: gcc-patches at gcc dot gnu dot org, mrs at apple dot com
- Date: Thu, 4 Feb 2010 11:17:36 +0100
- Subject: Re: [PATCH] fix PR ada/42554 by dropping -c from ranlib on darwin10 and later
- References: <20100204042054.GA1791@bromo.med.uc.edu>
On Feb 4, 2010, at 5:20 AM, Jack Howarth wrote:
> 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?
The PR comment contains everything.
Note that 'ranlib -c' is used elsewhere. For example in mlib-tgt-specific-darwin.adb
You will also hit this issue if you are using 'gnatmake -f -a' for example.
As the semantic of archives on Darwin are different from the standard UNIX one with regards to common
symbols, at AdaCore we avoided the whole issue by forcing -fno-common.
Tristan.