[llvm-commits] [compiler-rt] r172041 - in /compiler-rt/trunk/lib/ubsan: ubsan_handlers.h ubsan_handlers_cxx.h

Will Dietz wdietz2 at illinois.edu
Thu Jan 10 09:25:56 PST 2013


Thanks for reporting this, fixed in r172078.

Turns out gcc doesn't like the attribute specifier placement I used,
so I moved it to after the 'extern "C"' linkage specification which
fixes the issue locally.  This is also the placement used in their
documentation[1] so hopefully resolves this issue for others as well.

~Will

[1] http://gcc.gnu.org/wiki/Visibility

On Thu, Jan 10, 2013 at 4:32 AM, Evgeniy Stepanov
<eugeni.stepanov at gmail.com> wrote:
> Hi,
>
> this broke gcc build:
>
> /build/llvm/projects/compiler-rt/lib/ubsan/ubsan_handlers.h:36:1:
> error: expected unqualified-id before string constant
>
> sounds like you need to move the sanitizer* header include a bit higher.
>
>
> On Thu, Jan 10, 2013 at 7:37 AM, Will Dietz <wdietz2 at illinois.edu> wrote:
>> Author: wdietz2
>> Date: Wed Jan  9 21:37:30 2013
>> New Revision: 172041
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=172041&view=rev
>> Log:
>> [ubsan] Give entry methods default (not hidden) visibility.
>>
>> Fixes using ubsan on shared libraries in linux, for example.
>>
>> Modified:
>>     compiler-rt/trunk/lib/ubsan/ubsan_handlers.h
>>     compiler-rt/trunk/lib/ubsan/ubsan_handlers_cxx.h
>>
>> Modified: compiler-rt/trunk/lib/ubsan/ubsan_handlers.h
>> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/ubsan_handlers.h?rev=172041&r1=172040&r2=172041&view=diff
>> ==============================================================================
>> --- compiler-rt/trunk/lib/ubsan/ubsan_handlers.h (original)
>> +++ compiler-rt/trunk/lib/ubsan/ubsan_handlers.h Wed Jan  9 21:37:30 2013
>> @@ -25,7 +25,9 @@
>>  };
>>
>>  #define RECOVERABLE(checkname, ...) \
>> +  SANITIZER_INTERFACE_ATTRIBUTE \
>>    extern "C" void __ubsan_handle_ ## checkname( __VA_ARGS__ ); \
>> +  SANITIZER_INTERFACE_ATTRIBUTE \
>>    extern "C" void __ubsan_handle_ ## checkname ## _abort( __VA_ARGS__ );
>>
>>  /// \brief Handle a runtime type check failure, caused by either a misaligned
>> @@ -70,8 +72,10 @@
>>  };
>>
>>  /// \brief Handle a __builtin_unreachable which is reached.
>> +SANITIZER_INTERFACE_ATTRIBUTE
>>  extern "C" void __ubsan_handle_builtin_unreachable(UnreachableData *Data);
>>  /// \brief Handle reaching the end of a value-returning function.
>> +SANITIZER_INTERFACE_ATTRIBUTE
>>  extern "C" void __ubsan_handle_missing_return(UnreachableData *Data);
>>
>>  struct VLABoundData {
>>
>> Modified: compiler-rt/trunk/lib/ubsan/ubsan_handlers_cxx.h
>> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/ubsan/ubsan_handlers_cxx.h?rev=172041&r1=172040&r2=172041&view=diff
>> ==============================================================================
>> --- compiler-rt/trunk/lib/ubsan/ubsan_handlers_cxx.h (original)
>> +++ compiler-rt/trunk/lib/ubsan/ubsan_handlers_cxx.h Wed Jan  9 21:37:30 2013
>> @@ -28,8 +28,10 @@
>>  /// \brief Handle a runtime type check failure, caused by an incorrect vptr.
>>  /// When this handler is called, all we know is that the type was not in the
>>  /// cache; this does not necessarily imply the existence of a bug.
>> +SANITIZER_INTERFACE_ATTRIBUTE
>>  extern "C" void __ubsan_handle_dynamic_type_cache_miss(
>>    DynamicTypeCacheMissData *Data, ValueHandle Pointer, ValueHandle Hash);
>> +SANITIZER_INTERFACE_ATTRIBUTE
>>  extern "C" void __ubsan_handle_dynamic_type_cache_miss_abort(
>>    DynamicTypeCacheMissData *Data, ValueHandle Pointer, ValueHandle Hash);
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list