Skip to content

Commit 4408155

Browse files
committed
meson: Drop the .fa library suffix
The non-standard .fa library suffix breaks the link source de-duplication done by Meson so drop it. The lack of link source de-duplication causes AddressSanitizer to complain ODR violations, and makes GNU ld abort when combined with clang's LTO. Fortunately, the non-standard suffix is not necessary anymore for two reasons. First, the non-standard suffix was necessary for fork-fuzzing. Meson wraps all standard-suffixed libraries with --start-group and --end-group. This made a fork-fuzz.ld linker script wrapped as well and broke builds. Commit d2e6f92 ("fuzz: remove fork-fuzzing scaffolding") dropped fork-fuzzing so we can now restore the standard suffix. Second, the libraries are not even built anymore, because it is possible to just use the object files directly via extract_all_objects(). The occurences of the suffix were detected and removed by performing a tree-wide search with 'fa' and .fa (note the quotes and dot). Signed-off-by: Akihiko Odaki <[email protected]> Message-ID: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 7b1070a commit 4408155

File tree

9 files changed

+4
-31
lines changed

9 files changed

+4
-31
lines changed

.gitlab-ci.d/buildtest-template.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@
4545
exclude:
4646
- build/**/*.p
4747
- build/**/*.a.p
48-
- build/**/*.fa.p
4948
- build/**/*.c.o
5049
- build/**/*.c.o.d
51-
- build/**/*.fa
5250

5351
.common_test_job_template:
5452
extends: .base_job_template

.gitlab-ci.d/buildtest.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,8 @@ build-previous-qemu:
178178
exclude:
179179
- build-previous/**/*.p
180180
- build-previous/**/*.a.p
181-
- build-previous/**/*.fa.p
182181
- build-previous/**/*.c.o
183182
- build-previous/**/*.c.o.d
184-
- build-previous/**/*.fa
185183
needs:
186184
job: amd64-opensuse-leap-container
187185
variables:

docs/devel/build-system.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,16 +235,11 @@ Subsystem sourcesets:
235235
are then turned into static libraries as follows::
236236

237237
libchardev = static_library('chardev', chardev_ss.sources(),
238-
name_suffix: 'fa',
239238
build_by_default: false)
240239

241240
chardev = declare_dependency(objects: libchardev.extract_all_objects(recursive: false),
242241
dependencies: chardev_ss.dependencies())
243242

244-
As of Meson 0.55.1, the special ``.fa`` suffix should be used for everything
245-
that is used with ``link_whole``, to ensure that the link flags are placed
246-
correctly in the command line.
247-
248243
Target-independent emulator sourcesets:
249244
Various general purpose helper code is compiled only once and
250245
the .o files are linked into all output binaries that need it.

gdbstub/meson.build

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ gdb_system_ss = gdb_system_ss.apply({})
1919

2020
libgdb_user = static_library('gdb_user',
2121
gdb_user_ss.sources() + genh,
22-
name_suffix: 'fa',
2322
c_args: '-DCONFIG_USER_ONLY',
2423
build_by_default: false)
2524

2625
libgdb_system = static_library('gdb_system',
2726
gdb_system_ss.sources() + genh,
28-
name_suffix: 'fa',
2927
build_by_default: false)
3028

3129
gdb_user = declare_dependency(objects: libgdb_user.extract_all_objects(recursive: false))

meson.build

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3467,15 +3467,13 @@ endif
34673467
qom_ss = qom_ss.apply({})
34683468
libqom = static_library('qom', qom_ss.sources() + genh,
34693469
dependencies: [qom_ss.dependencies()],
3470-
name_suffix: 'fa',
34713470
build_by_default: false)
34723471
qom = declare_dependency(objects: libqom.extract_all_objects(recursive: false),
34733472
dependencies: qom_ss.dependencies())
34743473

34753474
event_loop_base = files('event-loop-base.c')
34763475
event_loop_base = static_library('event-loop-base',
34773476
sources: event_loop_base + genh,
3478-
name_suffix: 'fa',
34793477
build_by_default: false)
34803478
event_loop_base = declare_dependency(objects: event_loop_base.extract_all_objects(recursive: false),
34813479
dependencies: [qom])
@@ -3728,7 +3726,6 @@ qemu_syms = custom_target('qemu.syms', output: 'qemu.syms',
37283726
authz_ss = authz_ss.apply({})
37293727
libauthz = static_library('authz', authz_ss.sources() + genh,
37303728
dependencies: [authz_ss.dependencies()],
3731-
name_suffix: 'fa',
37323729
build_by_default: false)
37333730

37343731
authz = declare_dependency(objects: libauthz.extract_all_objects(recursive: false),
@@ -3737,7 +3734,6 @@ authz = declare_dependency(objects: libauthz.extract_all_objects(recursive: fals
37373734
crypto_ss = crypto_ss.apply({})
37383735
libcrypto = static_library('crypto', crypto_ss.sources() + genh,
37393736
dependencies: [crypto_ss.dependencies()],
3740-
name_suffix: 'fa',
37413737
build_by_default: false)
37423738

37433739
crypto = declare_dependency(objects: libcrypto.extract_all_objects(recursive: false),
@@ -3747,14 +3743,12 @@ io_ss = io_ss.apply({})
37473743
libio = static_library('io', io_ss.sources() + genh,
37483744
dependencies: [io_ss.dependencies()],
37493745
link_with: libqemuutil,
3750-
name_suffix: 'fa',
37513746
build_by_default: false)
37523747

37533748
io = declare_dependency(objects: libio.extract_all_objects(recursive: false),
37543749
dependencies: [io_ss.dependencies(), crypto, qom])
37553750

37563751
libmigration = static_library('migration', sources: migration_files + genh,
3757-
name_suffix: 'fa',
37583752
build_by_default: false)
37593753
migration = declare_dependency(objects: libmigration.extract_all_objects(recursive: false),
37603754
dependencies: [qom, io])
@@ -3763,7 +3757,6 @@ system_ss.add(migration)
37633757
block_ss = block_ss.apply({})
37643758
libblock = static_library('block', block_ss.sources() + genh,
37653759
dependencies: block_ss.dependencies(),
3766-
name_suffix: 'fa',
37673760
build_by_default: false)
37683761

37693762
block = declare_dependency(objects: libblock.extract_all_objects(recursive: false),
@@ -3772,7 +3765,6 @@ block = declare_dependency(objects: libblock.extract_all_objects(recursive: fals
37723765
blockdev_ss = blockdev_ss.apply({})
37733766
libblockdev = static_library('blockdev', blockdev_ss.sources() + genh,
37743767
dependencies: blockdev_ss.dependencies(),
3775-
name_suffix: 'fa',
37763768
build_by_default: false)
37773769

37783770
blockdev = declare_dependency(objects: libblockdev.extract_all_objects(recursive: false),
@@ -3781,14 +3773,12 @@ blockdev = declare_dependency(objects: libblockdev.extract_all_objects(recursive
37813773
qmp_ss = qmp_ss.apply({})
37823774
libqmp = static_library('qmp', qmp_ss.sources() + genh,
37833775
dependencies: qmp_ss.dependencies(),
3784-
name_suffix: 'fa',
37853776
build_by_default: false)
37863777

37873778
qmp = declare_dependency(objects: libqmp.extract_all_objects(recursive: false),
37883779
dependencies: qmp_ss.dependencies())
37893780

37903781
libchardev = static_library('chardev', chardev_ss.sources() + genh,
3791-
name_suffix: 'fa',
37923782
dependencies: chardev_ss.dependencies(),
37933783
build_by_default: false)
37943784

@@ -3797,7 +3787,6 @@ chardev = declare_dependency(objects: libchardev.extract_all_objects(recursive:
37973787

37983788
hwcore_ss = hwcore_ss.apply({})
37993789
libhwcore = static_library('hwcore', sources: hwcore_ss.sources() + genh,
3800-
name_suffix: 'fa',
38013790
build_by_default: false)
38023791
hwcore = declare_dependency(objects: libhwcore.extract_all_objects(recursive: false))
38033792
common_ss.add(hwcore)
@@ -3820,8 +3809,7 @@ common_all = static_library('common',
38203809
sources: common_ss.all_sources() + genh,
38213810
include_directories: common_user_inc,
38223811
implicit_include_directories: false,
3823-
dependencies: common_ss.all_dependencies(),
3824-
name_suffix: 'fa')
3812+
dependencies: common_ss.all_dependencies())
38253813

38263814
feature_to_c = find_program('scripts/feature_to_c.py')
38273815

@@ -3930,8 +3918,7 @@ foreach target : target_dirs
39303918
objects: objects,
39313919
include_directories: target_inc,
39323920
c_args: c_args,
3933-
build_by_default: false,
3934-
name_suffix: 'fa')
3921+
build_by_default: false)
39353922

39363923
if target.endswith('-softmmu')
39373924
execs = [{

stubs/blk-exp-close-all.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "qemu/osdep.h"
22
#include "block/export.h"
33

4-
/* Only used in programs that support block exports (libblockdev.fa) */
4+
/* Only used in programs that support block exports (libblockdev.a) */
55
void blk_exp_close_all(void)
66
{
77
}

tcg/meson.build

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ tcg_ss = tcg_ss.apply({})
3131

3232
libtcg_user = static_library('tcg_user',
3333
tcg_ss.sources() + genh,
34-
name_suffix: 'fa',
3534
dependencies: tcg_ss.dependencies(),
3635
c_args: '-DCONFIG_USER_ONLY',
3736
build_by_default: false)
@@ -42,7 +41,6 @@ user_ss.add(tcg_user)
4241

4342
libtcg_system = static_library('tcg_system',
4443
tcg_ss.sources() + genh,
45-
name_suffix: 'fa',
4644
dependencies: tcg_ss.dependencies(),
4745
c_args: '-DCONFIG_SOFTMMU',
4846
build_by_default: false)

tests/Makefile.include

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ distclean-tcg: $(DISTCLEAN_TCG_TARGET_RULES)
8787
.PHONY: check-venv check-avocado check-acceptance check-acceptance-deprecated-warning
8888

8989
# Build up our target list from the filtered list of ninja targets
90-
TARGETS=$(patsubst libqemu-%.fa, %, $(filter libqemu-%.fa, $(ninja-targets)))
90+
TARGETS=$(patsubst libqemu-%.a, %, $(filter libqemu-%.a, $(ninja-targets)))
9191

9292
TESTS_VENV_TOKEN=$(BUILD_DIR)/pyvenv/tests.group
9393
TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results

tests/qtest/libqos/meson.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ if have_virtfs
6969
endif
7070

7171
libqos = static_library('qos', libqos_srcs + genh,
72-
name_suffix: 'fa',
7372
build_by_default: false)
7473

7574
qos = declare_dependency(objects: libqos.extract_all_objects(recursive: false))

0 commit comments

Comments
 (0)