Files
build_soong/cc
Mitch Phillips 34b493fec5 Disable LTO when building with fuzzer support.
Bug: 131771163

LTO is currently broken when building with SANITIZE_TARGET=fuzzer. The
compiler bug is currently being addressed upstream (see linked bug), but
we have applied a local workaround in the build system to disable LTO
when building using the fuzzer config.

There is a bug here however. In the sanitizer mutator we explicitly
remove -flto and add -fno-lto. The sanitizer mutator runs after the LTO
mutator, so (in general) this works just fine. The problem exists when a
target specifies an explicit 'lto: { ... }' flag in their Android.bp. In
this case, the sanitizer mutator disables LTO, then the flags are parsed
from the Android.bp, re-enabling LTO.

This patch fixes this issue. If the sanitizer mutator has added the
-fsanitize=fuzzer-no-link flags, then the LTO mutator won't add the LTO
flags after this fact.

Test: Build a target with SANITIZE_TARGET=fuzzer (or a cc_fuzz target),
where there is an explitiy 'lto: { ... }' and watch it now succeed in
building.

Change-Id: I6643909417f666539c23469816926b806e204b06
2019-08-02 16:57:55 -07:00
..
2019-07-16 16:30:53 -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-07-24 21:13:05 +00:00
2017-11-17 11:22:04 -08:00
2019-07-18 15:58:58 +01:00
2019-04-02 16:38:55 +00:00
2016-08-01 14:36:22 -07:00
2019-04-11 17:54:48 -07:00
2019-02-13 23:32:51 +00:00
2019-07-23 17:29:57 +01:00