summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2025-10-21 22:08:06 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-10-27 11:37:43 +0000
commit7c8852a5992f0c199faa5063d06a41c533c9cdfd (patch)
tree7940de2fb085091384ccbc483cefca9feadbc308
parent9ff81e0a51b3137244f333147af5adf7495b5b5d (diff)
downloadpoky-7c8852a5992f0c199faa5063d06a41c533c9cdfd.tar.gz
libcap: Pass OE defined BUILD_CC and BUILD_LDFLAGS
This ensures that, native pieces in target builds are build with correct flags to be able to run on build host (From OE-Core rev: c82e49d1707f2057baa3f7fbaeea0b785712a11f) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-support/libcap/files/0001-libcap-Add-build-ldflags-to-_makenames-rule.patch29
-rw-r--r--meta/recipes-support/libcap/libcap_2.76.bb6
2 files changed, 34 insertions, 1 deletions
diff --git a/meta/recipes-support/libcap/files/0001-libcap-Add-build-ldflags-to-_makenames-rule.patch b/meta/recipes-support/libcap/files/0001-libcap-Add-build-ldflags-to-_makenames-rule.patch
new file mode 100644
index 0000000000..10ddf64935
--- /dev/null
+++ b/meta/recipes-support/libcap/files/0001-libcap-Add-build-ldflags-to-_makenames-rule.patch
@@ -0,0 +1,29 @@
1From e52d3232882c263f5bd4b1980195ac633d706a53 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 21 Oct 2025 18:27:51 -0700
4Subject: [PATCH] libcap: Add build ldflags to _makenames rule
5
6its calling compiler and linker in single step
7ensure that build ldflags are respected as it
8might have important information like which runtime
9to use.
10
11Upstream-Status: Backport [https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=c3ddf45d9afaab85d3b7db0dc7bfd1aafb8fde50]
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 libcap/Makefile | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/libcap/Makefile b/libcap/Makefile
18index e90a950..f0eb87e 100644
19--- a/libcap/Makefile
20+++ b/libcap/Makefile
21@@ -80,7 +80,7 @@ $(PSXTITLE).pc: $(PSXTITLE).pc.in
22 $< >$@
23
24 _makenames: _makenames.c cap_names.list.h
25- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
26+ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@ $(BUILD_LDFLAGS)
27
28 cap_names.h: _makenames
29 ./_makenames > cap_names.h
diff --git a/meta/recipes-support/libcap/libcap_2.76.bb b/meta/recipes-support/libcap/libcap_2.76.bb
index c842246fc0..27093ff3e7 100644
--- a/meta/recipes-support/libcap/libcap_2.76.bb
+++ b/meta/recipes-support/libcap/libcap_2.76.bb
@@ -12,7 +12,9 @@ LIC_FILES_CHKSUM = "file://License;md5=2965a646645b72ecee859b43c592dcaa \
12 12
13DEPENDS = "hostperl-runtime-native gperf-native" 13DEPENDS = "hostperl-runtime-native gperf-native"
14 14
15SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${PV}.tar.xz" 15SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${PV}.tar.xz \
16 file://0001-libcap-Add-build-ldflags-to-_makenames-rule.patch \
17 "
16SRC_URI:append:class-nativesdk = " \ 18SRC_URI:append:class-nativesdk = " \
17 file://0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch \ 19 file://0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch \
18 " 20 "
@@ -37,6 +39,8 @@ EXTRA_OEMAKE = " \
37do_compile() { 39do_compile() {
38 oe_runmake \ 40 oe_runmake \
39 AR="${AR}" \ 41 AR="${AR}" \
42 BUILD_CC="${BUILD_CC}" \
43 BUILD_LDFLAGS="${BUILD_LDFLAGS}" \
40 CC="${CC}" \ 44 CC="${CC}" \
41 RANLIB="${RANLIB}" \ 45 RANLIB="${RANLIB}" \
42 OBJCOPY="${OBJCOPY}" 46 OBJCOPY="${OBJCOPY}"