Re: [PATCH 13/X] [libsanitizer][options] Add hwasan flags and argument parsing

2019-11-08 Thread Andrey Konovalov via gcc-patches
OK, let's keep the macros district then. In the kernel it doesn't give you a lot, since you actually know which ASAN you're using based on the kernel CONFIG_ values, but looks like it's important for userspace. Thanks! On Thu, Nov 7, 2019 at 7:01 PM Evgenii Stepanov wrote: > > Clang has a

Re: [PATCH 13/X] [libsanitizer][options] Add hwasan flags and argument parsing

2019-11-07 Thread Evgenii Stepanov via gcc-patches
Clang has a function level attribute, __attribute__((no_sanitize("hwaddress"))) a feature macro #if __has_feature(hwaddress_sanitizer) and a blacklist section [hwaddress] https://clang.llvm.org/docs/SanitizerSpecialCaseList.html I think it makes sense for the compiler to err on the side

Re: [PATCH 13/X] [libsanitizer][options] Add hwasan flags and argument parsing

2019-11-07 Thread Andrey Konovalov via gcc-patches
On Thu, Nov 7, 2019 at 1:48 PM Matthew Malcomson wrote: > > On 05/11/2019 13:11, Andrey Konovalov wrote: > > On Tue, Nov 5, 2019 at 12:34 PM Matthew Malcomson > > wrote: > >> > >> NOTE: > >> -- > >> I have defined a new macro of __SANITIZE_HWADDRESS__ that gets > >> automatically defined

Re: [PATCH 13/X] [libsanitizer][options] Add hwasan flags and argument parsing

2019-11-07 Thread Matthew Malcomson
On 05/11/2019 13:11, Andrey Konovalov wrote: > On Tue, Nov 5, 2019 at 12:34 PM Matthew Malcomson > wrote: >> >> NOTE: >> -- >> I have defined a new macro of __SANITIZE_HWADDRESS__ that gets >> automatically defined when compiling with hwasan. This is analogous to >> __SANITIZE_ADDRESS__

Re: [PATCH 13/X] [libsanitizer][options] Add hwasan flags and argument parsing

2019-11-05 Thread Joseph Myers
On Tue, 5 Nov 2019, Matthew Malcomson wrote: > +DEFHOOK > +(can_tag_addresses, > + "True if backend architecture naturally supports ignoring the top byte of\ > + pointers. This feature means that -fsanitize=hwaddress can work.", > + bool, (), default_memtag_can_tag_addresses)

Re: [PATCH 13/X] [libsanitizer][options] Add hwasan flags and argument parsing

2019-11-05 Thread Andrey Konovalov via gcc-patches
On Tue, Nov 5, 2019 at 12:34 PM Matthew Malcomson wrote: > > These flags can't be used at the same time as any of the other > sanitizers. > We add an equivalent flag to -static-libasan in -static-libhwasan to > ensure static linking. > > The -fsanitize=kernel-hwaddress option is for compiling