This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt][Fuchsia] Disable interceptors while enabling new/delete replacements
ClosedPublic

Authored by leonardchan on Jun 2 2021, 11:33 AM.

Details

Summary

This disables use of hwasan interceptors which we do not use on Fuchsia. This explicitly sets the macro for defining the hwasan versions of new/delete.

Diff Detail

Event Timeline

leonardchan created this revision.Jun 2 2021, 11:33 AM
leonardchan requested review of this revision.Jun 2 2021, 11:33 AM
Herald added a subscriber: Restricted Project. · View Herald TranscriptJun 2 2021, 11:33 AM
mcgrathr added inline comments.Jun 2 2021, 12:06 PM
compiler-rt/lib/hwasan/CMakeLists.txt
45

It might be better to force the value of COMPILER_RT_HWASAN_WITH_INTERCEPTORS to OFF instead.

But I'll leave the cmake details to Petr.

phosek added inline comments.Jun 2 2021, 2:17 PM
compiler-rt/lib/hwasan/CMakeLists.txt
45

That would be my preference. The patter we usually use is:

if(FUCHSIA)
  set(COMPILER_RT_HWASAN_WITH_INTERCEPTORS_DEFAULT OFF)
else()
  set(COMPILER_RT_HWASAN_WITH_INTERCEPTORS_DEFAULT ON)
endif()
set(COMPILER_RT_HWASAN_WITH_INTERCEPTORS ${COMPILER_RT_HWASAN_WITH_INTERCEPTORS_DEFAULT} CACHE BOOL "Enable libc interceptors in HWASan (testing mode)")

which would be set in https://github.com/llvm/llvm-project/blob/07c2a912ddf1641b969fdbae3418f77c362f67c6/compiler-rt/CMakeLists.txt#L70.

leonardchan marked 2 inline comments as done.
mcgrathr accepted this revision.Jul 5 2021, 1:40 PM

lgtm

This revision is now accepted and ready to land.Jul 5 2021, 1:40 PM