mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-23 19:03:59 +08:00
f39b7a4d37
I've noticed an inconsistency with the other sanitizers. For -fsanitize={address,thread,leak} we link into binaries lib*san_preinit.o such that the -lasan, -ltsan or -llsan libraries are initialized as early as possible through .preinit_array. The hwasan library has the same thing, but we strangely compiled it into the library (where it apparently didn't do anything, .preinit_array doesn't seem to be created for shared libraries), rather than installing it like in the other 3 cases. The following patch handles it for hwasan similarly to asan, tsan and lsan. I don't have any hw with hwasan support, so I've just checked it builds and installs as expected and that gcc -fsanitize=hwaddress -o a a.c -mlam=u57 on trivial main results in .preinit_array section in the binary. 2022-12-19 Jakub Jelinek <jakub@redhat.com> * config/gnu-user.h (LIBHWASAN_EARLY_SPEC): Add libhwasan_preinit.o to link spec if not -shared. * hwasan/Makefile.am (nodist_toolexeclib_HEADERS): Set to libhwasan_preinit.o. (hwasan_files): Remove hwasan_preinit.cpp. (libhwasan_preinit.o): Copy from hwasan_preinit.o. * hwasan/Makefile.in: Regenerated. |
||
---|---|---|
.. | ||
asan | ||
builtins | ||
hwasan | ||
include | ||
interception | ||
libbacktrace | ||
lsan | ||
sanitizer_common | ||
tsan | ||
ubsan | ||
acinclude.m4 | ||
aclocal.m4 | ||
ChangeLog | ||
config.h.in | ||
configure | ||
configure.ac | ||
configure.tgt | ||
HOWTO_MERGE | ||
libsanitizer.spec.in | ||
LICENSE.TXT | ||
LOCAL_PATCHES | ||
Makefile.am | ||
Makefile.in | ||
MERGE | ||
merge.sh | ||
README.gcc |
AddressSanitizer and ThreadSanitizer (https://github.com/google/sanitizers) are projects initially developed by Google Inc. Both tools consist of a compiler module and a run-time library. The sources of the run-time library for these projects are hosted at https://github.com/llvm/llvm-project in the following directories: compiler-rt/include/sanitizer compiler-rt/lib/sanitizer_common compiler-rt/lib/interception compiler-rt/lib/asan compiler-rt/lib/tsan compiler-rt/lib/lsan compiler-rt/lib/ubsan compiler-rt/lib/hwasan Trivial and urgent fixes (portability, build fixes, etc.) may go directly to the GCC tree. All non-trivial changes, functionality improvements, etc. should go through the upstream tree first and then be merged back to the GCC tree. The merges from upstream should be done with the aid of the merge.sh script; it will also update the file MERGE to contain the upstream revision we merged with.