[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 43/46] meson: specify fuzz linker script as a project arg
From: |
Paolo Bonzini |
Subject: |
[PULL 43/46] meson: specify fuzz linker script as a project arg |
Date: |
Fri, 4 Sep 2020 07:41:19 -0400 |
From: Alexander Bulekov <alxndr@bu.edu>
With this change, the fuzzer-linker script should be specified outside
any --start-group/--end-group pairs. We need this on oss-fuzz, where
partially applying the linker-script results in a linker failure
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Message-Id: <20200902173652.307222-2-alxndr@bu.edu>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
meson.build | 9 ++++++++-
tests/qtest/fuzz/meson.build | 3 ---
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/meson.build b/meson.build
index a10239cfa4..9473b42da3 100644
--- a/meson.build
+++ b/meson.build
@@ -56,6 +56,14 @@
add_project_link_arguments(config_host['QEMU_LDFLAGS'].split(),
add_project_arguments(config_host['QEMU_INCLUDES'].split(),
language: ['c', 'cpp', 'objc'])
+# Specify linker-script with add_project_link_arguments so that it is not
placed
+# within a linker --start-group/--end-group pair
+if 'CONFIG_FUZZ' in config_host
+ add_project_link_arguments(['-Wl,-T,',
+ (meson.current_source_dir() /
'tests/qtest/fuzz/fork_fuzz.ld')],
+ native: false, language: ['c', 'cpp', 'objc'])
+endif
+
link_language = 'c'
if add_languages('cpp', required: false, native: false)
cxx = meson.get_compiler('cpp')
@@ -1094,7 +1102,6 @@ foreach target : target_dirs
'gui': false,
'sources': specific_fuzz.sources(),
'dependencies': specific_fuzz.dependencies(),
- 'link_depends': [files('tests/qtest/fuzz/fork_fuzz.ld')],
}]
endif
else
diff --git a/tests/qtest/fuzz/meson.build b/tests/qtest/fuzz/meson.build
index bb0a3f271d..bcc393828e 100644
--- a/tests/qtest/fuzz/meson.build
+++ b/tests/qtest/fuzz/meson.build
@@ -6,11 +6,8 @@ specific_fuzz_ss.add(when: 'CONFIG_I440FX', if_true:
files('i440fx_fuzz.c'))
specific_fuzz_ss.add(when: 'CONFIG_VIRTIO_NET', if_true:
files('virtio_net_fuzz.c'))
specific_fuzz_ss.add(when: 'CONFIG_VIRTIO_SCSI', if_true:
files('virtio_scsi_fuzz.c'))
-# unfortunately declare_dependency does not support link_depends, so
-# this will be duplicated in meson.build
fork_fuzz = declare_dependency(
link_args: ['-fsanitize=fuzzer',
- '-Wl,-T,' + (meson.current_source_dir() / 'fork_fuzz.ld'),
'-Wl,-wrap,qtest_inb',
'-Wl,-wrap,qtest_inw',
'-Wl,-wrap,qtest_inl',
--
2.26.2
- [PULL 33/46] meson: keep all compiler flags detection together, (continued)
- [PULL 33/46] meson: keep all compiler flags detection together, Paolo Bonzini, 2020/09/04
- [PULL 35/46] configure: remove unnecessary libm test, Paolo Bonzini, 2020/09/04
- [PULL 40/46] docs: suggest Meson replacements for various configure functions, Paolo Bonzini, 2020/09/04
- [PULL 41/46] configure: update dtc submodule, Paolo Bonzini, 2020/09/04
- [PULL 34/46] configure: move -ldl test to meson, Paolo Bonzini, 2020/09/04
- [PULL 37/46] meson: get glib compilation flags from GLIB_CFLAGS, Paolo Bonzini, 2020/09/04
- [PULL 30/46] Makefile: inline the relevant parts of rules.mak, Paolo Bonzini, 2020/09/04
- [PULL 36/46] configure: do not look for install(1), Paolo Bonzini, 2020/09/04
- [PULL 39/46] configure: drop dead variables and functions, Paolo Bonzini, 2020/09/04
- [PULL 38/46] configure: do not include dependency flags in QEMU_CFLAGS and LIBS, Paolo Bonzini, 2020/09/04
- [PULL 43/46] meson: specify fuzz linker script as a project arg,
Paolo Bonzini <=
- [PULL 46/46] meson: remove linkage of sdl to baum, Paolo Bonzini, 2020/09/04
- [PULL 44/46] fuzz: Add support for custom fuzzing library, Paolo Bonzini, 2020/09/04
- [PULL 45/46] meson: Convert undefsym.sh to undefsym.py, Paolo Bonzini, 2020/09/04
- [PULL 42/46] oss-fuzz: fix rpath, Paolo Bonzini, 2020/09/04
- Re: [PULL 00/46] Next round of Meson bugfixes and cleanups, Peter Maydell, 2020/09/06