diff mbox series

[v2] libucontext: use hard/soft float

Message ID 20250701132723.3214755-1-jdmason@kudzu.us
State New
Headers show
Series [v2] libucontext: use hard/soft float | expand

Commit Message

Jon Mason July 1, 2025, 1:27 p.m. UTC
From: Jon Mason <jon.mason@arm.com>

When building for qemuarm-secureboot in meta-arn with musl and clang,
the following compile error is seen:
- | ../sources/libucontext-1.3.2/arch/arm/swapcontext.S:23:11: error: unknown token in expression
- |  ldr r4, =#0x56465001
- |           ^

This is happening because 1.3 added ifdefs for assembly code for both
hard and soft float, and bcause neither is being defined, it is taking
this path with the issue.

Since we can tell if soft or hard float is being used via the TARGET_FPU
variable, use that and set the relevant makefile flag.

Signed-off-by: Jon Mason <jon.mason@arm.com>
---
 meta/recipes-core/musl/libucontext_1.3.2.bb | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/meta/recipes-core/musl/libucontext_1.3.2.bb b/meta/recipes-core/musl/libucontext_1.3.2.bb
index 2362cba5c8a2..1d14a527a850 100644
--- a/meta/recipes-core/musl/libucontext_1.3.2.bb
+++ b/meta/recipes-core/musl/libucontext_1.3.2.bb
@@ -48,3 +48,9 @@  def map_kernel_arch(a, d):
 
 EXTRA_OEMESON = "-Dcpu=${@map_kernel_arch(d.getVar('TARGET_ARCH'), d)}"
 inherit meson
+
+ARM_TARGET_CPPFLAGS = ""
+ARM_TARGET_CPPFLAGS:append:arm = "${@bb.utils.contains('TARGET_FPU', 'hard', '-DFORCE_HARD_FLOAT', '', d)}"
+ARM_TARGET_CPPFLAGS:append:arm = "${@bb.utils.contains('TARGET_FPU', 'soft', '-DFORCE_SOFT_FLOAT', '', d)}"
+
+TARGET_CPPFLAGS .= "${ARM_TARGET_CPPFLAGS}"