meson: specify fuzz linker script as a project arg
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>
This commit is contained in:
parent
789035f123
commit
c46f76d158
@ -58,6 +58,14 @@ add_project_link_arguments(config_host['QEMU_LDFLAGS'].split(),
|
|||||||
add_project_arguments(config_host['QEMU_INCLUDES'].split(),
|
add_project_arguments(config_host['QEMU_INCLUDES'].split(),
|
||||||
language: ['c', 'cpp', 'objc'])
|
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 = meson.get_external_property('link_language', 'cpp')
|
link_language = meson.get_external_property('link_language', 'cpp')
|
||||||
if link_language == 'cpp'
|
if link_language == 'cpp'
|
||||||
add_languages('cpp', required: true, native: false)
|
add_languages('cpp', required: true, native: false)
|
||||||
@ -1084,7 +1092,6 @@ foreach target : target_dirs
|
|||||||
'gui': false,
|
'gui': false,
|
||||||
'sources': specific_fuzz.sources(),
|
'sources': specific_fuzz.sources(),
|
||||||
'dependencies': specific_fuzz.dependencies(),
|
'dependencies': specific_fuzz.dependencies(),
|
||||||
'link_depends': [files('tests/qtest/fuzz/fork_fuzz.ld')],
|
|
||||||
}]
|
}]
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
|
@ -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_NET', if_true: files('virtio_net_fuzz.c'))
|
||||||
specific_fuzz_ss.add(when: 'CONFIG_VIRTIO_SCSI', if_true: files('virtio_scsi_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(
|
fork_fuzz = declare_dependency(
|
||||||
link_args: ['-fsanitize=fuzzer',
|
link_args: ['-fsanitize=fuzzer',
|
||||||
'-Wl,-T,' + (meson.current_source_dir() / 'fork_fuzz.ld'),
|
|
||||||
'-Wl,-wrap,qtest_inb',
|
'-Wl,-wrap,qtest_inb',
|
||||||
'-Wl,-wrap,qtest_inw',
|
'-Wl,-wrap,qtest_inw',
|
||||||
'-Wl,-wrap,qtest_inl',
|
'-Wl,-wrap,qtest_inl',
|
||||||
|
Loading…
Reference in New Issue
Block a user