[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/21] build: fix check for -fsanitize-coverage-allowlist
|
From: |
Paolo Bonzini |
|
Subject: |
[PULL 18/21] build: fix check for -fsanitize-coverage-allowlist |
|
Date: |
Thu, 16 Jun 2022 10:32:06 +0200 |
From: Alexander Bulekov <alxndr@bu.edu>
The existing check has two problems:
1. Meson uses a private directory for the get_supported_arguments check.
./instrumentation-filter does not exist in that private directory (it is
copied into the root of the build-directory).
2. fsanitize-coverage-allowlist is unused when coverage instrumentation
is not configured. No instrumentation are passed for the
get_supported_arguments check
Thus the check always fails. To work around this, change the check to an
"if cc.compiles" check and provide /dev/null, instead of the real
filter.
Meson log:
Working directory: build/meson-private/tmpl6wld2d9
Command line: clang-13 -m64 -mcx16
build/meson-private/tmpl6wld2d9/output.obj -c -O3 -D_FILE_OFFSET_BITS=64
-O0 -Werror=implicit-function-declaration -Werror=unknown-warning-option
-Werror=unused-command-line-argument
-Werror=ignored-optimization-argument
-fsanitize-coverage-allowlist=instrumentation-filter
Error:
error: argument unused during compilation:
'-fsanitize-coverage-allowlist=instrumentation-filter'
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Message-Id: <20220614155415.4023833-1-alxndr@bu.edu>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
meson.build | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/meson.build b/meson.build
index 21cd949082..fe5d6632fb 100644
--- a/meson.build
+++ b/meson.build
@@ -209,9 +209,13 @@ if get_option('fuzzing')
configure_file(output: 'instrumentation-filter',
input: 'scripts/oss-fuzz/instrumentation-filter-template',
copy: true)
- add_global_arguments(
-
cc.get_supported_arguments('-fsanitize-coverage-allowlist=instrumentation-filter'),
- native: false, language: ['c', 'cpp', 'objc'])
+
+ if cc.compiles('int main () { return 0; }',
+ name: '-fsanitize-coverage-allowlist=/dev/null',
+ args: ['-fsanitize-coverage-allowlist=/dev/null'] )
+
add_global_arguments('-fsanitize-coverage-allowlist=instrumentation-filter',
+ native: false, language: ['c', 'cpp', 'objc'])
+ endif
if get_option('fuzzing_engine') == ''
# Add CFLAGS to tell clang to add fuzzer-related instrumentation to all the
--
2.36.1
- [PULL 09/21] hmp: add filtering of statistics by name, (continued)
- [PULL 09/21] hmp: add filtering of statistics by name, Paolo Bonzini, 2022/06/16
- [PULL 04/21] cutils: add functions for IEC and SI prefixes, Paolo Bonzini, 2022/06/16
- [PULL 06/21] qmp: add filtering of statistics by provider, Paolo Bonzini, 2022/06/16
- [PULL 01/21] qmp: Support for querying stats, Paolo Bonzini, 2022/06/16
- [PULL 07/21] hmp: add filtering of statistics by provider, Paolo Bonzini, 2022/06/16
- [PULL 10/21] block: add more commands to preconfig mode, Paolo Bonzini, 2022/06/16
- [PULL 11/21] s390x: simplify virtio_ccw_reset_virtio, Paolo Bonzini, 2022/06/16
- [PULL 12/21] virtio-mmio: stop ioeventfd on legacy reset, Paolo Bonzini, 2022/06/16
- [PULL 13/21] virtio: stop ioeventfd on reset, Paolo Bonzini, 2022/06/16
- [PULL 15/21] configure: update list of preserved environment variables, Paolo Bonzini, 2022/06/16
- [PULL 18/21] build: fix check for -fsanitize-coverage-allowlist,
Paolo Bonzini <=
- [PULL 14/21] virtio-mmio: cleanup reset, Paolo Bonzini, 2022/06/16
- [PULL 16/21] configure: cleanup -fno-pie detection, Paolo Bonzini, 2022/06/16
- [PULL 17/21] tests/vm: allow running tests in an unconfigured source tree, Paolo Bonzini, 2022/06/16
- [PULL 20/21] meson: put cross compiler info in a separate section, Paolo Bonzini, 2022/06/16
- [PULL 21/21] build: include pc-bios/ part in the ROMS variable, Paolo Bonzini, 2022/06/16
- [PULL 19/21] q35:Enable TSEG only when G_SMRAME and TSEG_EN both enabled, Paolo Bonzini, 2022/06/16
- Re: [PULL 00/21] Statistics, preconfig and cleanup patches for 2022-06-16, Richard Henderson, 2022/06/16