[cfe-dev] __attribute__((weak)) possible regression in clang 3.6 since 3.5

Ben Pope benpope81 at gmail.com
Tue Feb 17 22:48:41 PST 2015


On Wednesday, February 18, 2015 01:07 PM, Ben Pope wrote:
> On Wednesday, February 18, 2015 12:35 AM, Rafael EspĂ­ndola wrote:
>>
>> On 16 February 2015 at 05:00, Ben Pope
>> <benpope81 at gmail.com> wrote:
>>> Whilst compiling RxCpp with clang 3.6 I get this error (and lots more
>>> very
>>> similar):
>>> `.text.startup' referenced in section `.text.startup' of
>>> CMakeFiles/rxcppv2_test.dir/home/ben/development/test/rxcpp/RxCpp/Rx/v2/test/subscriptions/subscription.cpp.o:
>>>
>>> defined in discarded section
>>> `.text.startup[_ZN5rxcpp22composite_subscription12shared_emptyE]' of
>>> CMakeFiles/rxcppv2_test.dir/home/ben/development/test/rxcpp/RxCpp/Rx/v2/test/subscriptions/subscription.cpp.o
>>>
>>>
>>> shared_empty is declared like this, in a header file:
>>> __attribute__((weak)) composite_subscription
>>> composite_subscription::shared_empty =
>>> composite_subscription(detail::tag_composite_subscription_empty());
>  >
>  > Can you report a bug with a preprocessed file that shows the warning?
>  > Or at least detailed instructions on how to build RxCpp?
>
> http://llvm.org/bugs/show_bug.cgi?id=22623
>
> I went with build instructions as I don't know how to create the
> preprocessed file, as it has to link a lot of files together, and
> besides, they're huge.

Optimisation affects the result, and it appears to only be on the 3.6 
branch.

clang version 3.7.0 (trunk 229351)
-O0, -02 succeeds

clang version 3.6.0 (branches/release_36 229488)
-O0, -O1 fails, -O2, -O3 succeeds

clang version 3.6.0 (branches/release_36 229639)
-O0 fails, -O2 succeeds

clang version 3.7.0 (trunk 229639)
-O0 succeeds

Ben






More information about the cfe-dev mailing list