Patchwork prune warn_compact_unwind warnings on darwin

login
register
mail settings
Submitter Jack Howarth
Date March 12, 2011, 9:01 p.m.
Message ID <20110312210105.GA15542@bromo.med.uc.edu>
Download mbox | patch
Permalink /patch/86557/
State New
Headers show

Comments

Jack Howarth - March 12, 2011, 9:01 p.m.
Xcode 4.0's linker now defaults on...

     -warn_compact_unwind
                 When producing a final linked image, the linker processes the __eh_frame section and produces an
                 __unwind_info section. Most FDE entries in the __eh_frame can be represented by a 32-bit value in
                 the __unwind_info section.  The option issues a warning for any function whose FDE cannot be
                 expressed in the compact unwind format.

regardless of whether -no_compact_unwind is passed to the linker. This results in many bogus excess error failures
in the testsuite due to these bogus warnings of the form...

ld: warning: could not create compact unwind for I<int>::operator+(int =const&) const: dwarf uses DW_CFA_GNU_args_size

The attached patch adds a regsub statement to prune.exp to suppress this testsuite noise on darwin when linking
with Xcode 4.0. Tested on x86_64-apple-darwin10.
               Jack

2011-03-12  Jack Howarth  <howarth@bromo.med.uc.edu>

libstdc++-v3/
	* testsuite/lib/prune.exp: Prune "could not create compact unwind for" warnings.

gcc/
	* testsuite/lib/prune.exp: Ditto.
Mike Stump - March 19, 2011, 6:22 a.m.
On Mar 12, 2011, at 1:01 PM, Jack Howarth wrote:
>  Xcode 4.0's linker now defaults on...
> 
>     -warn_compact_unwind

So, if this is a flag, and we can turn the warning off, and we truly don't care about the warnings, why not just use -no_warn_compact_unwind?  That would be preferable, I think.
IainS - March 19, 2011, 8:52 a.m.
On 19 Mar 2011, at 06:22, Mike Stump wrote:

> On Mar 12, 2011, at 1:01 PM, Jack Howarth wrote:
>> Xcode 4.0's linker now defaults on...
>>
>>    -warn_compact_unwind
>
> So, if this is a flag, and we can turn the warning off, and we truly  
> don't care about the warnings, why not just use - 
> no_warn_compact_unwind?  That would be preferable, I think.


1/
Hm.  AFAIK we set "-no_compact_unwind", when the target is 10.6

#define LINK_GCC_C_SEQUENCE_SPEC \
"%:version-compare(>= 10.6 mmacosx-version-min= -no_compact_unwind) \

- it would seem to be a tool bug to flag a warning for something  
specifically excluded.

2/
unless "-no_compact_unwind" is now ignored?

3/
maybe we are going to have to follow clang et. al in having a tools  
version runtime flag (this would especially ease the issues in making  
canadians to early Darwin versions).   OSX ld and cctools version are  
detectable at runtime for native builds - say:  -mmacosx-ld-version= - 
mmacosx-cctools-version= ...  so we don't ask people to put this for  
the native case (we can also pick sensible defaults for other  
systems).    [trunk clang uses -target-linker-version xx.yy.zz - but  
that's not consistent with our general scheme].

(I know Mike hates additional flags - and tool capabilities can, of  
course, be detected at runtime for native builds - but we also cater -  
by design - for cross-builds to earlier versions of the OS)

cheers
Iain
Jack Howarth - March 19, 2011, 10:41 a.m.
On Fri, Mar 18, 2011 at 11:22:11PM -0700, Mike Stump wrote:
> On Mar 12, 2011, at 1:01 PM, Jack Howarth wrote:
> >  Xcode 4.0's linker now defaults on...
> > 
> >     -warn_compact_unwind
> 
> So, if this is a flag, and we can turn the warning off, and we truly don't care about the warnings, why not just use -no_warn_compact_unwind?  That would be preferable, I think.

Mike,
   Unfortunately, there is no such -no_warn_compact_unwind flag in the Xcode 3.2.6/4.0 linkers. Since the
-warn_compact_unwind option in the past was set as a default-in option, Apple never bothered to add a flag to
turn it off and forgot to do so (or even to document the fact that the flag was defaulted on now for the
new Xcode releases).
        Jack
Jack Howarth - March 19, 2011, 10:55 a.m.
On Sat, Mar 19, 2011 at 08:52:32AM +0000, IainS wrote:
>
> On 19 Mar 2011, at 06:22, Mike Stump wrote:
>
>> On Mar 12, 2011, at 1:01 PM, Jack Howarth wrote:
>>> Xcode 4.0's linker now defaults on...
>>>
>>>    -warn_compact_unwind
>>
>> So, if this is a flag, and we can turn the warning off, and we truly  
>> don't care about the warnings, why not just use - 
>> no_warn_compact_unwind?  That would be preferable, I think.
>
>
> 1/
> Hm.  AFAIK we set "-no_compact_unwind", when the target is 10.6
>
> #define LINK_GCC_C_SEQUENCE_SPEC \
> "%:version-compare(>= 10.6 mmacosx-version-min= -no_compact_unwind) \
>
> - it would seem to be a tool bug to flag a warning for something  
> specifically excluded.

Yes it could be considered a tool bug but we are stuck with it. We might
be able to get that fixed in Xcode 4.1 but I have doubts about 3.2.6 or
even 4.0 getting such a fix. Unfortunately it generates a lot of noise on
the testsuite results with bogus excessive error failures.

Note that Nick said...

 Yes.  -warn_compact_unwind is on by default in the Xcode4 linker.  And there is no 
 option to turn of the warnings (other than -Wl,-w which suppresses all linker warnings).

>
> 2/
> unless "-no_compact_unwind" is now ignored?
>
> 3/
> maybe we are going to have to follow clang et. al in having a tools  
> version runtime flag (this would especially ease the issues in making  
> canadians to early Darwin versions).   OSX ld and cctools version are  
> detectable at runtime for native builds - say:  -mmacosx-ld-version= - 
> mmacosx-cctools-version= ...  so we don't ask people to put this for the 
> native case (we can also pick sensible defaults for other systems).    
> [trunk clang uses -target-linker-version xx.yy.zz - but that's not 
> consistent with our general scheme].
>
> (I know Mike hates additional flags - and tool capabilities can, of  
> course, be detected at runtime for native builds - but we also cater -  
> by design - for cross-builds to earlier versions of the OS)
>
> cheers
> Iain
Mike Stump - March 21, 2011, 7:18 p.m.
On Mar 12, 2011, at 1:01 PM, Jack Howarth wrote:
> 2011-03-12  Jack Howarth  <howarth@bromo.med.uc.edu>
> 
> libstdc++-v3/
> 	* testsuite/lib/prune.exp: Prune "could not create compact unwind for" warnings.
> 
> gcc/
> 	* testsuite/lib/prune.exp: Ditto.

Checked in r171263.  I modified the Changelogs slightly, as Ditto doesn't work across changelog files, and I included the routine name (add-changelog does this in emacs) and wrapped them.

I didn't put them into the release branch yet...  RM?  You have a preference on timing?  Now, after .0 goes out?
Jakub Jelinek - March 21, 2011, 7:24 p.m.
On Mon, Mar 21, 2011 at 12:18:43PM -0700, Mike Stump wrote:
> I didn't put them into the release branch yet...  RM?  You have a
> preference on timing?  Now, after .0 goes out?

After .0 goes out.  RC2 is building already and the fewer changes after RC2,
the better.

	Jakub

Patch

Index: libstdc++-v3/testsuite/lib/prune.exp
===================================================================
--- libstdc++-v3/testsuite/lib/prune.exp	(revision 170906)
+++ libstdc++-v3/testsuite/lib/prune.exp	(working copy)
@@ -55,6 +55,9 @@  proc libstdc++-dg-prune { system text } 
     regsub -all "(^|\n)\[^\n\]*warning: DWARFDebugInfoEntry::AppendDependants\[^\n\]*AT_\[^\n\]*_bound\[^\n\]*FORM_ref4\[^\n\]*" $text "" text
     regsub -all "(^|\n)\[^\n\]*warning:\[^\n\]*TAG_variable:  AT_location\[^\n\]*didn't have valid function low pc\[^\n\]*" $text "" text
 
+    # Ignore harmless warnings from Xcode 4.0.
+    regsub -all "(^|\n)\[^\n\]*ld: warning: could not create compact unwind for\[^\n\]*" $text "" text
+
     foreach p $additional_prunes {
 	if { [string length $p] > 0 } {
 	    # Following regexp matches a complete line containing $p.
Index: gcc/testsuite/lib/prune.exp
===================================================================
--- gcc/testsuite/lib/prune.exp	(revision 170906)
+++ gcc/testsuite/lib/prune.exp	(working copy)
@@ -56,6 +56,9 @@  proc prune_gcc_output { text } {
     regsub -all "(^|\n)\[^\n\]*ld: warning: can't add line info to anonymous symbol\[^\n\]*" $text "" text
     regsub -all "(^|\n)\[^\n\]*warning: DWARFDebugInfoEntry::AppendDependants\[^\n\]*AT_\[^\n\]*_bound\[^\n\]*FORM_ref4\[^\n\]*" $text "" text
     regsub -all "(^|\n)\[^\n\]*warning:\[^\n\]*TAG_variable:  AT_location\[^\n\]*didn't have valid function low pc\[^\n\]*" $text "" text
+
+    # Ignore harmless warnings from Xcode 4.0.
+    regsub -all "(^|\n)\[^\n\]*ld: warning: could not create compact unwind for\[^\n\]*" $text "" text
     
     #send_user "After:$text\n"