<div dir="ltr">I believe that it is merely a compile-time issue (warning), it doesn't prevent the use of compiler-rt on ARM as a libgcc replacement.  I need to understand why my attempt to remove the `struct` modifier failed on one of the buildbots.<br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 22, 2017 at 2:45 PM, Evgenii Stepanov <span dir="ltr"><<a href="mailto:eugeni.stepanov@gmail.com" target="_blank">eugeni.stepanov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">No. I don't have a easy way of reproducing this.<br>
<div class="HOEnZb"><div class="h5"><br>
On Tue, Aug 22, 2017 at 11:10 AM, Hans Wennborg <<a href="mailto:hans@chromium.org">hans@chromium.org</a>> wrote:<br>
> Is there a bug filed? Since this was merged to 5.0.0, I'd like to know<br>
> if we broke something and if that is something that needs to be fixed.<br>
><br>
> On Tue, Aug 22, 2017 at 10:46 AM, Evgenii Stepanov<br>
> <<a href="mailto:eugeni.stepanov@gmail.com">eugeni.stepanov@gmail.com</a>> wrote:<br>
>> As I understand, using compiler-rt as libgcc replacement on ARM is<br>
>> currently broken because of this change, but I have not looked since<br>
>> my last message.<br>
>><br>
>> On Mon, Aug 21, 2017 at 4:56 PM, Hans Wennborg <<a href="mailto:hans@chromium.org">hans@chromium.org</a>> wrote:<br>
>>> Is there something we need for 5.0.0 here?<br>
>>><br>
>>> On Sat, Aug 12, 2017 at 9:58 PM, Saleem Abdulrasool<br>
>>> <<a href="mailto:compnerd@compnerd.org">compnerd@compnerd.org</a>> wrote:<br>
>>>> Yeah, we should adjust that.  Technically, it is `_Unwind_Control_Block on<br>
>>>> ARM EHABI.  However, _Unwind_Exception is aliased to that, which is why we<br>
>>>> can use that in the personality routine.  We should adjust the sources for<br>
>>>> the personality routine.<br>
>>>><br>
>>>> On Fri, Aug 11, 2017 at 1:12 PM, Evgenii Stepanov<br>
>>>> <<a href="mailto:eugeni.stepanov@gmail.com">eugeni.stepanov@gmail.com</a>> wrote:<br>
>>>>><br>
>>>>> Hi,<br>
>>>>><br>
>>>>> I've noticed that the code in<br>
>>>>> compiler-rt/lib/builtins/gcc_<wbr>personality_v0.c refers to<br>
>>>>> _Unwind_Exception as "struct _Unwind_Exception". With this change, it<br>
>>>>> is not a struct anymore on ARM. Should that code be fixed, or is it a<br>
>>>>> problem in this change?<br>
>>>>><br>
>>>>> compiler-rt/lib/builtins/gcc_<wbr>personality_v0.c:153:23: error:<br>
>>>>> declaration of 'struct _Unwind_Exception' will not be visible outside<br>
>>>>> of this function [-Werror,-Wvisibility]<br>
>>>>> continueUnwind(struct _Unwind_Exception *exceptionObject,<br>
>>>>><br>
>>>>> On Thu, Jul 27, 2017 at 9:46 AM, Hans Wennborg via cfe-commits<br>
>>>>> <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br>
>>>>> > Merged to 5.0 in r309290.<br>
>>>>> ><br>
>>>>> > On Wed, Jul 26, 2017 at 3:55 PM, Saleem Abdulrasool via cfe-commits<br>
>>>>> > <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br>
>>>>> >> Author: compnerd<br>
>>>>> >> Date: Wed Jul 26 15:55:23 2017<br>
>>>>> >> New Revision: 309226<br>
>>>>> >><br>
>>>>> >> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=309226&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=309226&view=rev</a><br>
>>>>> >> Log:<br>
>>>>> >> Headers: improve ARM EHABI coverage of unwind.h<br>
>>>>> >><br>
>>>>> >> Ensure that we define the `_Unwind_Control_Block` structure used on ARM<br>
>>>>> >> EHABI targets.  This is needed for building libc++abi with the unwind.h<br>
>>>>> >> from the resource dir.  A minor fallout of this is that we needed to<br>
>>>>> >> create a typedef for _Unwind_Exception to work across ARM EHABI and<br>
>>>>> >> non-EHABI targets.  The structure definitions here are based originally<br>
>>>>> >> on the documentation from ARM under the "Exception Handling ABI for the<br>
>>>>> >> ARM® Architecture" Section 7.2.  They are then adjusted to more closely<br>
>>>>> >> reflect the definition in libunwind from LLVM.  Those changes are<br>
>>>>> >> compatible in layout but permit easier use in libc++abi and help<br>
>>>>> >> maintain compatibility between libunwind and the compiler provided<br>
>>>>> >> definition.<br>
>>>>> >><br>
>>>>> >> Modified:<br>
>>>>> >>     cfe/trunk/lib/Headers/unwind.h<br>
>>>>> >><br>
>>>>> >> Modified: cfe/trunk/lib/Headers/unwind.h<br>
>>>>> >> URL:<br>
>>>>> >> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/unwind.h?rev=309226&r1=309225&r2=309226&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Headers/<wbr>unwind.h?rev=309226&r1=309225&<wbr>r2=309226&view=diff</a><br>
>>>>> >><br>
>>>>> >> ==============================<wbr>==============================<wbr>==================<br>
>>>>> >> --- cfe/trunk/lib/Headers/unwind.h (original)<br>
>>>>> >> +++ cfe/trunk/lib/Headers/unwind.h Wed Jul 26 15:55:23 2017<br>
>>>>> >> @@ -76,7 +76,13 @@ typedef intptr_t _sleb128_t;<br>
>>>>> >>  typedef uintptr_t _uleb128_t;<br>
>>>>> >><br>
>>>>> >>  struct _Unwind_Context;<br>
>>>>> >> +#if defined(__arm__) && !(defined(__USING_SJLJ_<wbr>EXCEPTIONS__) ||<br>
>>>>> >> defined(__ARM_DWARF_EH___))<br>
>>>>> >> +struct _Unwind_Control_Block;<br>
>>>>> >> +typedef struct _Unwind_Control_Block _Unwind_Exception; /* Alias */<br>
>>>>> >> +#else<br>
>>>>> >>  struct _Unwind_Exception;<br>
>>>>> >> +typedef struct _Unwind_Exception _Unwind_Exception;<br>
>>>>> >> +#endif<br>
>>>>> >>  typedef enum {<br>
>>>>> >>    _URC_NO_REASON = 0,<br>
>>>>> >>  #if defined(__arm__) && !defined(__USING_SJLJ_<wbr>EXCEPTIONS__) && \<br>
>>>>> >> @@ -109,8 +115,42 @@ typedef enum {<br>
>>>>> >>  } _Unwind_Action;<br>
>>>>> >><br>
>>>>> >>  typedef void (*_Unwind_Exception_Cleanup_<wbr>Fn)(_Unwind_Reason_Code,<br>
>>>>> >> -                                             struct _Unwind_Exception<br>
>>>>> >> *);<br>
>>>>> >> +                                             _Unwind_Exception *);<br>
>>>>> >><br>
>>>>> >> +#if defined(__arm__) && !(defined(__USING_SJLJ_<wbr>EXCEPTIONS__) ||<br>
>>>>> >> defined(__ARM_DWARF_EH___))<br>
>>>>> >> +typedef struct _Unwind_Control_Block _Unwind_Control_Block;<br>
>>>>> >> +typedef uint32_t _Unwind_EHT_Header;<br>
>>>>> >> +<br>
>>>>> >> +struct _Unwind_Control_Block {<br>
>>>>> >> +  uint64_t exception_class;<br>
>>>>> >> +  void (*exception_cleanup)(_Unwind_<wbr>Reason_Code, _Unwind_Control_Block<br>
>>>>> >> *);<br>
>>>>> >> +  /* unwinder cache (private fields for the unwinder's use) */<br>
>>>>> >> +  struct {<br>
>>>>> >> +    uint32_t reserved1; /* forced unwind stop function, 0 if not<br>
>>>>> >> forced */<br>
>>>>> >> +    uint32_t reserved2; /* personality routine */<br>
>>>>> >> +    uint32_t reserved3; /* callsite */<br>
>>>>> >> +    uint32_t reserved4; /* forced unwind stop argument */<br>
>>>>> >> +    uint32_t reserved5;<br>
>>>>> >> +  } unwinder_cache;<br>
>>>>> >> +  /* propagation barrier cache (valid after phase 1) */<br>
>>>>> >> +  struct {<br>
>>>>> >> +    uint32_t sp;<br>
>>>>> >> +    uint32_t bitpattern[5];<br>
>>>>> >> +  } barrier_cache;<br>
>>>>> >> +  /* cleanup cache (preserved over cleanup) */<br>
>>>>> >> +  struct {<br>
>>>>> >> +    uint32_t bitpattern[4];<br>
>>>>> >> +  } cleanup_cache;<br>
>>>>> >> +  /* personality cache (for personality's benefit) */<br>
>>>>> >> +  struct {<br>
>>>>> >> +    uint32_t fnstart;         /* function start address */<br>
>>>>> >> +    _Unwind_EHT_Header *ehtp; /* pointer to EHT entry header word */<br>
>>>>> >> +    uint32_t additional;      /* additional data */<br>
>>>>> >> +    uint32_t reserved1;<br>
>>>>> >> +  } pr_cache;<br>
>>>>> >> +  long long int : 0; /* force alignment of next item to 8-byte<br>
>>>>> >> boundary */<br>
>>>>> >> +};<br>
>>>>> >> +#else<br>
>>>>> >>  struct _Unwind_Exception {<br>
>>>>> >>    _Unwind_Exception_Class exception_class;<br>
>>>>> >>    _Unwind_Exception_Cleanup_Fn exception_cleanup;<br>
>>>>> >> @@ -120,16 +160,18 @@ struct _Unwind_Exception {<br>
>>>>> >>     * aligned".  GCC has interpreted this to mean "use the maximum<br>
>>>>> >> useful<br>
>>>>> >>     * alignment for the target"; so do we. */<br>
>>>>> >>  } __attribute__((__aligned__));<br>
>>>>> >> +#endif<br>
>>>>> >><br>
>>>>> >>  typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)(int, _Unwind_Action,<br>
>>>>> >><br>
>>>>> >> _Unwind_Exception_Class,<br>
>>>>> >> -                                               struct<br>
>>>>> >> _Unwind_Exception *,<br>
>>>>> >> +                                               _Unwind_Exception *,<br>
>>>>> >>                                                 struct _Unwind_Context<br>
>>>>> >> *,<br>
>>>>> >>                                                 void *);<br>
>>>>> >><br>
>>>>> >> -typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)(<br>
>>>>> >> -    int, _Unwind_Action, _Unwind_Exception_Class, struct<br>
>>>>> >> _Unwind_Exception *,<br>
>>>>> >> -    struct _Unwind_Context *);<br>
>>>>> >> +typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)(int,<br>
>>>>> >> _Unwind_Action,<br>
>>>>> >> +<br>
>>>>> >> _Unwind_Exception_Class,<br>
>>>>> >> +<br>
>>>>> >> _Unwind_Exception *,<br>
>>>>> >> +                                                      struct<br>
>>>>> >> _Unwind_Context *);<br>
>>>>> >>  typedef _Unwind_Personality_Fn __personality_routine;<br>
>>>>> >><br>
>>>>> >>  typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)(struct _Unwind_Context<br>
>>>>> >> *,<br>
>>>>> >> @@ -224,13 +266,12 @@ _Unwind_Ptr _Unwind_GetRegionStart(struc<br>
>>>>> >><br>
>>>>> >>  /* DWARF EH functions; currently not available on Darwin/ARM */<br>
>>>>> >>  #if !defined(__APPLE__) || !defined(__arm__)<br>
>>>>> >> -<br>
>>>>> >> -_Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception<br>
>>>>> >> *);<br>
>>>>> >> -_Unwind_Reason_Code _Unwind_ForcedUnwind(struct _Unwind_Exception *,<br>
>>>>> >> -                                         _Unwind_Stop_Fn, void *);<br>
>>>>> >> -void _Unwind_DeleteException(struct _Unwind_Exception *);<br>
>>>>> >> -void _Unwind_Resume(struct _Unwind_Exception *);<br>
>>>>> >> -_Unwind_Reason_Code _Unwind_Resume_or_Rethrow(<wbr>struct _Unwind_Exception<br>
>>>>> >> *);<br>
>>>>> >> +_Unwind_Reason_Code _Unwind_RaiseException(_<wbr>Unwind_Exception *);<br>
>>>>> >> +_Unwind_Reason_Code _Unwind_ForcedUnwind(_Unwind_<wbr>Exception *,<br>
>>>>> >> _Unwind_Stop_Fn,<br>
>>>>> >> +                                         void *);<br>
>>>>> >> +void _Unwind_DeleteException(_<wbr>Unwind_Exception *);<br>
>>>>> >> +void _Unwind_Resume(_Unwind_<wbr>Exception *);<br>
>>>>> >> +_Unwind_Reason_Code _Unwind_Resume_or_Rethrow(_<wbr>Unwind_Exception *);<br>
>>>>> >><br>
>>>>> >>  #endif<br>
>>>>> >><br>
>>>>> >> @@ -241,11 +282,11 @@ typedef struct SjLj_Function_Context *_U<br>
>>>>> >><br>
>>>>> >>  void _Unwind_SjLj_Register(_Unwind_<wbr>FunctionContext_t);<br>
>>>>> >>  void _Unwind_SjLj_Unregister(_<wbr>Unwind_FunctionContext_t);<br>
>>>>> >> -_Unwind_Reason_Code _Unwind_SjLj_RaiseException(<wbr>struct<br>
>>>>> >> _Unwind_Exception *);<br>
>>>>> >> -_Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind(<wbr>struct _Unwind_Exception<br>
>>>>> >> *,<br>
>>>>> >> +_Unwind_Reason_Code _Unwind_SjLj_RaiseException(_<wbr>Unwind_Exception *);<br>
>>>>> >> +_Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind(_<wbr>Unwind_Exception *,<br>
>>>>> >>                                                _Unwind_Stop_Fn, void<br>
>>>>> >> *);<br>
>>>>> >> -void _Unwind_SjLj_Resume(struct _Unwind_Exception *);<br>
>>>>> >> -_Unwind_Reason_Code _Unwind_SjLj_Resume_or_<wbr>Rethrow(struct<br>
>>>>> >> _Unwind_Exception *);<br>
>>>>> >> +void _Unwind_SjLj_Resume(_Unwind_<wbr>Exception *);<br>
>>>>> >> +_Unwind_Reason_Code _Unwind_SjLj_Resume_or_<wbr>Rethrow(_Unwind_Exception<br>
>>>>> >> *);<br>
>>>>> >><br>
>>>>> >>  void *_Unwind_<wbr>FindEnclosingFunction(void *);<br>
>>>>> >><br>
>>>>> >><br>
>>>>> >><br>
>>>>> >> ______________________________<wbr>_________________<br>
>>>>> >> cfe-commits mailing list<br>
>>>>> >> <a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
>>>>> >> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
>>>>> > ______________________________<wbr>_________________<br>
>>>>> > cfe-commits mailing list<br>
>>>>> > <a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
>>>>> > <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>>> --<br>
>>>> Saleem Abdulrasool<br>
>>>> compnerd (at) compnerd (dot) org<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org</div>
</div></div>