Sorry for the slow review. Matthew Malcomson <matthew.malcom...@arm.com> writes: > This patch tries to tie libhwasan into the GCC build system in the same way > that the other sanitizer runtime libraries are handled. > > libsanitizer/ChangeLog: > > * Makefile.am: Build libhwasan. > * Makefile.in: Build libhwasan. > * asan/Makefile.in: Build libhwasan. > * configure: Build libhwasan. > * configure.ac: Build libhwasan. > * hwasan/Makefile.am: New file. > * hwasan/Makefile.in: New file. > * hwasan/libtool-version: New file. > * interception/Makefile.in: Build libhwasan. > * libbacktrace/Makefile.in: Build libhwasan. > * libsanitizer.spec.in: Build libhwasan. > * lsan/Makefile.in: Build libhwasan. > * sanitizer_common/Makefile.in: Build libhwasan. > * tsan/Makefile.in: Build libhwasan. > * ubsan/Makefile.in: Build libhwasan.
I think this should also update README.gcc and merge.sh. Could you try locally merging in a dummy change to the llvm sources with merge.sh, to make sure it works correctly? > new file mode 100644 > index > 0000000000000000000000000000000000000000..aaa39b4536a5c5f54910a951470814bbc8a20946 > --- /dev/null > +++ b/libsanitizer/hwasan/Makefile.am > @@ -0,0 +1,88 @@ > +AM_CPPFLAGS = -I $(top_srcdir)/include -I $(top_srcdir) > + > +# May be used by toolexeclibdir. > +gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER) > + > +DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS > -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DCAN_SANITIZE_UB=0 > -DHWASAN_WITH_INTERCEPTORS=1 > +AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic > -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti > -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros > -fno-ipa-icf I realise this is just taken from the other Makefile.ams, but do you know the reason behind -fomit-frame-pointer? I think we should avoid building aarch64 libraries with that flag unless there's a specific reason. Otherwise looks good to me, although I'm definitely not an expert on this stuff. Thanks, Richard