* [PATCH] systemd: Disable linker GCS warning on aarch64 when using compiler-rt
@ 2025-08-07 2:46 Khem Raj
2025-08-07 21:32 ` Khem Raj
0 siblings, 1 reply; 3+ messages in thread
From: Khem Raj @ 2025-08-07 2:46 UTC (permalink / raw)
To: openembedded-core; +Cc: Khem Raj
when Distros set TC_RUNTIME_CXX = 'llvm', it will use LLVM provided
runtime libraries for unwinding/Compiler-builtins and C++ runtime
( compiler-rt/libunwind/libc++ ), systemd -> libc++ -> compiler-rt,
assembly routines in compiler-rt are not GCS compliant so the link step
for libc++.so does not emit this into .note.gnu.property section
Displaying notes found in: .note.gnu.property
Owner Data size Description
GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
Properties: AArch64 feature: BTI, PAC
it should have been
Properties: AArch64 feature: BTI, PAC, GCS
if it has GCS support.
When libsystemd links the C++ standard library then it also does not
get the GCS flags and it gets reported when some tests in systemd
tries to link with libsystemd. The reason for warning-as-error is same
as [1]
[1] https://git.openembedded.org/openembedded-core/commit/meta/recipes-core/systemd?id=295e30eac69e152778246c7271b72f7e8498a40a
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/recipes-core/systemd/systemd_257.6.bb | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/meta/recipes-core/systemd/systemd_257.6.bb b/meta/recipes-core/systemd/systemd_257.6.bb
index adc27f6cff1..b487683f5f8 100644
--- a/meta/recipes-core/systemd/systemd_257.6.bb
+++ b/meta/recipes-core/systemd/systemd_257.6.bb
@@ -240,6 +240,10 @@ RESOLV_CONF ??= ""
# 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)}"
+# compiler-rt assembly routines do not yet support GCS
+# see - https://github.com/llvm/llvm-project/issues/152427
+# check again when this gets implemented in compiler-rt to remove it
+LDFLAGS:append:aarch64 = "${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', ' -Wl,-z,gcs-report-dynamic=none', '', d)}"
EXTRA_OEMESON += "-Dnobody-user=nobody \
-Dnobody-group=nogroup \
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] systemd: Disable linker GCS warning on aarch64 when using compiler-rt
2025-08-07 2:46 [PATCH] systemd: Disable linker GCS warning on aarch64 when using compiler-rt Khem Raj
@ 2025-08-07 21:32 ` Khem Raj
2025-08-08 5:35 ` [OE-core] " Mathieu Dubois-Briand
0 siblings, 1 reply; 3+ messages in thread
From: Khem Raj @ 2025-08-07 21:32 UTC (permalink / raw)
To: openembedded-core
I have sent a fix which is a backport from llvm upstream to fix compiler-rt
https://lore.kernel.org/openembedded-core/20250807212937.2927262-1-raj.khem@gmail.com/T/#u
Please use that patch, this means that this patch is no longer needed. So please
drop it from staging branches
On Wed, Aug 6, 2025 at 7:46 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> when Distros set TC_RUNTIME_CXX = 'llvm', it will use LLVM provided
> runtime libraries for unwinding/Compiler-builtins and C++ runtime
> ( compiler-rt/libunwind/libc++ ), systemd -> libc++ -> compiler-rt,
> assembly routines in compiler-rt are not GCS compliant so the link step
> for libc++.so does not emit this into .note.gnu.property section
>
> Displaying notes found in: .note.gnu.property
> Owner Data size Description
> GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
> Properties: AArch64 feature: BTI, PAC
>
> it should have been
>
> Properties: AArch64 feature: BTI, PAC, GCS
>
> if it has GCS support.
>
> When libsystemd links the C++ standard library then it also does not
> get the GCS flags and it gets reported when some tests in systemd
> tries to link with libsystemd. The reason for warning-as-error is same
> as [1]
>
> [1] https://git.openembedded.org/openembedded-core/commit/meta/recipes-core/systemd?id=295e30eac69e152778246c7271b72f7e8498a40a
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> meta/recipes-core/systemd/systemd_257.6.bb | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/meta/recipes-core/systemd/systemd_257.6.bb b/meta/recipes-core/systemd/systemd_257.6.bb
> index adc27f6cff1..b487683f5f8 100644
> --- a/meta/recipes-core/systemd/systemd_257.6.bb
> +++ b/meta/recipes-core/systemd/systemd_257.6.bb
> @@ -240,6 +240,10 @@ RESOLV_CONF ??= ""
> # 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)}"
> +# compiler-rt assembly routines do not yet support GCS
> +# see - https://github.com/llvm/llvm-project/issues/152427
> +# check again when this gets implemented in compiler-rt to remove it
> +LDFLAGS:append:aarch64 = "${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', ' -Wl,-z,gcs-report-dynamic=none', '', d)}"
>
> EXTRA_OEMESON += "-Dnobody-user=nobody \
> -Dnobody-group=nogroup \
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-08 5:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-07 2:46 [PATCH] systemd: Disable linker GCS warning on aarch64 when using compiler-rt Khem Raj
2025-08-07 21:32 ` Khem Raj
2025-08-08 5:35 ` [OE-core] " Mathieu Dubois-Briand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox