This is an archive of the discontinued LLVM Phabricator instance.

[clang] Do not instrument the rtti_proxies under hwasan
ClosedPublic

Authored by leonardchan on Aug 25 2022, 11:42 AM.

Details

Summary

We run into a duplicate symbol error when instrumenting the rtti_proxies generated as part of the relative vtables ABI with hwasan:

ld.lld: error: duplicate symbol: typeinfo for icu_71::UObject (.rtti_proxy)
>>> defined at brkiter.cpp
>>>            arm64-hwasan-shared/obj/third_party/icu/source/common/libicuuc.brkiter.cpp.o:(typeinfo for icu_71::UObject (.rtti_proxy))
>>> defined at locavailable.cpp
>>>            arm64-hwasan-shared/obj/third_party/icu/source/common/libicuuc.locavailable.cpp.o:(.data.rel.ro..L_ZTIN6icu_717UObjectE.rtti_proxy.hwasan+0xE00000000000000)

The issue here is that the hwasan alias carries over the visibility and linkage of the original proxy, so we have duplicate external symbols that participate in linking. Similar to D132425 we can just disable hwasan for the proxies for now.

Diff Detail

Event Timeline

leonardchan created this revision.Aug 25 2022, 11:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2022, 11:42 AM
leonardchan requested review of this revision.Aug 25 2022, 11:42 AM
mcgrathr accepted this revision.Aug 26 2022, 10:21 AM
This revision is now accepted and ready to land.Aug 26 2022, 10:21 AM
This revision was landed with ongoing or failed builds.Aug 26 2022, 11:23 AM
This revision was automatically updated to reflect the committed changes.