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]

Re: [Revised][PATCH] PR41260 link with -no_compact_unwind on darwin10 and later


On Mon, Sep 21, 2009 at 01:21:23PM -0700, Mike Stump wrote:
> On Sep 21, 2009, at 8:35 AM, Jack Howarth wrote:
>> 	PR middle-end/41260
>> 	* gcc/config/darwin.h: Pass -no_compact_unwind to linker
>> 	on darwin10 and later since it always uses the unwinder in
>> 	libSystem which is derived from the gcc 4.2.1 unwinder.
>>
>>
>> Index: gcc/config/darwin.h
>> ===================================================================
>> --- gcc/config/darwin.h	(revision 151908)
>> +++ gcc/config/darwin.h	(working copy)
>> @@ -372,7 +372,9 @@
>>
>> /* Machine dependent libraries.  */
>>
>> -#define LIB_SPEC "%{!static:-lSystem}"
>> +#define LIB_SPEC "%{!static:\
>> +       %:version-compare(>= 10.6 mmacosx-version-min= - 
>> no_compact_unwind)  \
>> +       -lSystem}"
>>
>> /* Support -mmacosx-version-min by supplying different (stub)  
>> libgcc_s.dylib
>>    libraries to link against, and by not linking against libgcc_s on
>
> Close.  I'd say put it in a file called config/darwin10.h, and then just 
> realize that people that instal newer tools (ld), must reconfigure, 
> rebuild and reinstall gcc.  Doesn't seem to be too bad.  The one just 
> needs to wire config/darwin10.h to be included, something like:
>
> case ${target} in
> *-*-darwin*)
>   tm_file="${tm_file} darwin.h"
>   case ${target} in
>   *-*-darwin9*)
>     tm_file="${tm_file} darwin9.h"
>     ;;
>     # APPLE LOCAL begin .file/.loc 6349436
>   *-*-darwin[12][0-9]*)
>     tm_file="${tm_file} darwin9.h darwin10.h"
>     ;;
>     # APPLE LOCAL end .file/.loc 6349436
>   esac
>
> in config.gcc.  Benefit, targeting 10.5 works, targeting 10.6 works.   
> darwin9 builds works...
>
> Also, please put in a big comment that points to the FSF bug number  
> where the details are discussed, as well as any pointers to any Apple  
> bug numbers for ld, if this is a bug in ld.  This way, people can just  
> follow them and tell at a glance if the underlying issue is resolved,  
> and why the flag is used.
>
> Ok with that mod.

Doh! I don't want to use...

+#define LIB_SPEC "%{!static:\
+%:version-compare(>= 10.6 mmacosx-version-min= -no_compact_unwind) \
+-lSystem}"

but just...

+#define LIB_SPEC "%{!static: -no_compact_unwind -lSystem}"

Thia will ensure that binaries built targeting 10.5 on SL will
work properly on SL itself. Also, if I understand Nick's comments
correctly, compact unwinding only got defaulted on in SL so
we are basically just restoring the default behavior of Leopard
when compiling with FSF gcc 4.5 on Snow Leopard, right?
          Jack


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