]> git.ipfire.org Git - thirdparty/systemd.git/commit
meson: detect and use __attribute__((no_reorder))
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Thu, 2 Apr 2026 20:20:48 +0000 (22:20 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Fri, 3 Apr 2026 11:05:27 +0000 (13:05 +0200)
commitfec559d034ed32929771c80922fd2c2249edba15
treedfdf1875eb5096be2514082a003ce737a2bb664f
parent4419840ad1d86cf388d5fd8e9b2710faff02c284
meson: detect and use __attribute__((no_reorder))

In some builds (package builds, so with optimization and lto, but I
haven't been able to pin down the exact combination on options that
matters), we end up with items in the verbs array reordered. The order
matters (because of groups, but also because we have some specific order
for display), so this reordering is something that we don't want.

From what I was able to read, the compiler + linker generally keep the
order within a single translation unit, but this is more of a convention
and implementation choice than a guarantee. Add this attribute [1]. It
seems to have the desired effect in CI.

[1] https://gcc.gnu.org/onlinedocs/gcc-15.2.0/gcc/Common-Function-Attributes.html#index-no_005freorder-function-attribute
meson.build
src/fundamental/macro-fundamental.h
src/shared/options.h
src/shared/verbs.h