Files
build_soong/cc
Mitch Phillips b8e593d600 Workaround unexported sancov symbols. Fix multiple sanitizer RT deps.
Fuzz targets currently have dependencies on multiple libclang_rt runtime
libraries when building with ASan/HWAsan on device. This is an error.

This happens as Soong adds the dependency on the ASan/HWASan shared
runtime library. These libraries should provide the required UBSan
components. The clang driver was previously being passed
-fsanitize=fuzzer-no-link at link time, and as it doesn't know about the
already-established dependency on ASan/HWASan, it mistakenly thinks that
there is not runtime providing the UBSan components.

This patch fixes that problem by not adding -fsanitize=fuzzer-no-link to
the link-time flags.

This revealed a underlying issue in the upstream runtime compilation.
Android uses emulated TLS, which changes the symbol names from
<my_symbol_name> to __emutls_v._<my_symbol_name>. In particular, this
fails to account for the '__sancov_lowest_stack' symbol, as it no longer
matches the linker script rule for '__sancov*', and the symbol is no
longer exported in the shared library variant of ASan/HWASan.

This patch works around the discovered issue, which is being tracked in
the linked bug. It disables stack depth instrumentation, and we no
longer depend on this symbol. This means we get a missing sanitizer
coverage feature when fuzzing, but shouldn't be too detrimental.

Bug: 142430592
Test: SANITIZE_TARGET=hwaddress m example_fuzzer && \
readelf -d example_fuzzer # ensure only ONE libclang_rt dep (in this
case, hwasan)

Change-Id: Iea6df55d592a801732511c9b690134367429d62a
2019-10-10 10:53:48 -07:00
..
2018-11-19 15:26:14 -08:00
2017-10-19 22:39:32 +09:00
2018-10-09 02:16:58 +00:00
2019-06-27 14:46:10 -07:00
2019-08-07 13:06:06 -07:00
2019-08-22 13:21:37 -07:00
2019-09-19 10:51:03 -07:00
2019-09-10 11:22:59 +09:00
2019-09-22 08:21:27 +09:00
2019-04-02 16:38:55 +00:00
2016-08-01 14:36:22 -07:00
2019-08-07 13:40:11 +08:00
2019-08-27 15:10:27 +00:00
2019-09-13 12:18:47 -07:00
2019-09-18 10:53:30 +09:00