gcc/libsanitizer
Jakub Jelinek f39b7a4d37 hwasan: Add libhwasan_preinit.o
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.
2022-12-19 11:14:55 +01:00
..
asan libsanitizer: Apply local patches 2022-11-15 16:44:59 +01:00
builtins libsanitizer: merge from upstream (0a1bcab9f3bf75c4c5d3e53bafb3eeb80320af46). 2022-05-04 11:00:48 +02:00
hwasan hwasan: Add libhwasan_preinit.o 2022-12-19 11:14:55 +01:00
include libsanitizer: merge from upstream ae59131d3ef311fb4b1e50627c6457be00e60dc9 2022-11-15 16:44:55 +01:00
interception libsanitizer: merge from master (84a71d5259c2682403cdbd8710592410a2f128ab) 2022-08-30 12:53:50 +02:00
libbacktrace libsanitizer: Fix up libbacktrace build after r13-4547 [PR108072] 2022-12-13 10:30:36 +01:00
lsan libsanitizer: merge from upstream ae59131d3ef311fb4b1e50627c6457be00e60dc9 2022-11-15 16:44:55 +01:00
sanitizer_common libsanitizer: Apply local patches 2022-11-15 16:44:59 +01:00
tsan libsanitizer: Apply local patches 2022-11-15 16:44:59 +01:00
ubsan libsanitizer: Apply local patches 2022-11-15 16:44:59 +01:00
acinclude.m4 Enable building libsanitizer with Intel CET 2017-11-17 22:34:50 +01:00
aclocal.m4 make -Werror optional in libatomic/libbacktrace/libgomp/libitm/libsanitizer 2022-02-03 16:10:18 +01:00
ChangeLog Daily bump. 2022-12-14 00:18:37 +00:00
config.h.in Update build system: include new files and run autoheader, autoconf, automake 2018-10-31 11:15:57 +00:00
configure libsanitizer: regenerate configure 2022-10-19 08:44:43 +02:00
configure.ac libsanitizer: Avoid implicit function declaration in configure test 2022-10-18 16:58:48 +02:00
configure.tgt Enable hwasan for x86-64. 2022-12-09 09:37:36 +08:00
HOWTO_MERGE Remove references to SVN in libsanitizer. 2020-05-29 11:50:54 +02:00
libsanitizer.spec.in libsanitizer: Tie the hwasan library into our build system 2020-11-25 16:35:33 +00:00
LICENSE.TXT
LOCAL_PATCHES libsanitizer: update LOCAL_PATCHES 2022-11-15 16:45:21 +01:00
Makefile.am Fix PR 62157: disclean in libsanitizer not working 2021-11-28 22:40:36 +00:00
Makefile.in libsanitizer: Update Makefile.am files. 2022-05-04 11:00:53 +02:00
MERGE libsanitizer: merge from upstream ae59131d3ef311fb4b1e50627c6457be00e60dc9 2022-11-15 16:44:55 +01:00
merge.sh libsanitizer: use git clone --depth 1 2022-11-15 14:18:27 +01:00
README.gcc libsanitizer: add hwasan. 2020-11-25 16:35:30 +00:00

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.