[LLVMdev] OT: intel darwin losing primary target status

Nick Kledzik kledzik at apple.com
Fri Sep 18 14:40:17 PDT 2009


I thought of another work around.  The FSF gcc driver can implicitly  
add -no_compact_unwind to the link line.  This tells the linker to not  
produce compact unwind information from the dwarf unwind info in .o  
files.  Then at runtime the darwin unwinder will fallback and use the  
slow dwarf unwind info.

-Nick

On Sep 18, 2009, at 2:27 PM, Nick Kledzik wrote:
> I dug into this.  Based on the .s files in bugzilla, the latest gcc is
> now adding dwarf unwind info to describe the function epilog.  If you
> run dwarfdump --eh-frame on the .o files made with the new compiler,
> you'll see extra dwarf unwind instructions at the end like:
>
>                 ...
>                 DW_CFA_advance_loc4 (64)  #<-- advance to near end of
> function
>                 DW_CFA_restore (rbp)
>                 DW_CFA_def_cfa (rsp, 8)
>                 DW_CFA_nop
>                 DW_CFA_nop
>
> The linker's conversion to compact unwind "runs" the dwarf unwind info
> for a function and then records the state at the end.  Adding unwind
> info for the epilog breaks this.  In the long term, I can add
> heuristics to the linker to detect that what looks like unwind info
> for the epilog and stop processing the dwarf instructions.
>
> The short term fix for gcc is to *not* add epilog unwind information
> for Darwin.
>
> Epilog unwind information is never needed for exception processing.
> Its only use is for debugging or sampling when you want to
> asynchronously make a stack back trace.
>
> -Nick
>
> On Sep 18, 2009, at 11:40 AM, Jack Howarth wrote:
>> I am not sure if some of these problems were latent and only
>> exposed by the change, but the mass regressions in the g++
>> and libjava testsuites were triggered by the commit...
>>
>> Author: rth
>> Date: Sat May 30 00:33:46 2009
>> New Revision: 147995
>>
>> URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147995
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list