Skip to contentSkip to conversation

systemd: disable linker GCS warning on aarch64

PATCH New Trevor Woerner 1 participant 1 message May 7, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 systemd: disable linker GCS warning on aarch64

openssl has some assembler code that has PAC and BTI hints but not GCS. The systemd recipe then links to libcrypto from openssl with GCS enabled (as that is a distro-wide setting) and it - correctly - warns that it is being told to use GCS but one of the inputs does not have GCS. This would not be a problem but systemd also links with —fatal-warnings, so the build explodes.

libcrypto.so: warning: GCS is required by -z gcs, but this shared library lacks the necessary property note. The dynamic loader might not enable GCS or refuse to load the program unless all the shared library dependencies have the GCS marking. | collect2: error: ld returned 1 exit status

---
 meta/recipes-core/systemd/systemd_257.5.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-core/systemd/systemd_257.5.bb +1 -0
index acf97517a94a..995b55580e4a 100644
@@ -240,6 +240,7 @@ RESOLV_CONF ??= ""
 # bpf-framework: pass the recipe-sysroot to the compiler used to build
 # the eBPFs, so that it can find needed system includes in there.
 CFLAGS:append = " --sysroot=${STAGING_DIR_TARGET}"
+LDFLAGS:append:aarch64 = " ${@bb.utils.contains('PACKAGECONFIG', 'openssl', '-Wl,-z,gcs-report-dynamic=none', '', d)}"
 
 EXTRA_OEMESON += "-Dnobody-user=nobody \
                   -Dnobody-group=nogroup \
Signature · 1 line
2.44.0.501.g19981daefd7c