Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Khem Raj <raj.khem@gmail.com>
Subject: [PATCH 1/5] libcap: Pass OE defined BUILD_CC and BUILD_LDFLAGS
Date: Tue, 21 Oct 2025 22:08:06 -0700	[thread overview]
Message-ID: <20251022050810.1572184-1-raj.khem@gmail.com> (raw)

This ensures that, native pieces in target builds
are build with correct flags to be able to run on build host

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...Add-build-ldflags-to-_makenames-rule.patch | 29 +++++++++++++++++++
 meta/recipes-support/libcap/libcap_2.76.bb    |  6 +++-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-support/libcap/files/0001-libcap-Add-build-ldflags-to-_makenames-rule.patch

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 00000000000..10ddf649359
--- /dev/null
+++ b/meta/recipes-support/libcap/files/0001-libcap-Add-build-ldflags-to-_makenames-rule.patch
@@ -0,0 +1,29 @@
+From e52d3232882c263f5bd4b1980195ac633d706a53 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 21 Oct 2025 18:27:51 -0700
+Subject: [PATCH] libcap: Add build ldflags to _makenames rule
+
+its calling compiler and linker in single step
+ensure that build ldflags are respected as it
+might have important information like which runtime
+to use.
+
+Upstream-Status: Backport [https://git.kernel.org/pub/scm/libs/libcap/libcap.git/commit/?id=c3ddf45d9afaab85d3b7db0dc7bfd1aafb8fde50]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libcap/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libcap/Makefile b/libcap/Makefile
+index e90a950..f0eb87e 100644
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -80,7 +80,7 @@ $(PSXTITLE).pc: $(PSXTITLE).pc.in
+ 		$< >$@
+
+ _makenames: _makenames.c cap_names.list.h
+-	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
++	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@ $(BUILD_LDFLAGS)
+
+ cap_names.h: _makenames
+ 	./_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 c842246fc09..27093ff3e72 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 \
 
 DEPENDS = "hostperl-runtime-native gperf-native"
 
-SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${PV}.tar.xz"
+SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${PV}.tar.xz \
+           file://0001-libcap-Add-build-ldflags-to-_makenames-rule.patch \
+		   "
 SRC_URI:append:class-nativesdk = " \
            file://0001-nativesdk-libcap-Raise-the-size-of-arrays-containing.patch \
            "
@@ -37,6 +39,8 @@ EXTRA_OEMAKE = " \
 do_compile() {
 	oe_runmake \
 		AR="${AR}" \
+		BUILD_CC="${BUILD_CC}" \
+		BUILD_LDFLAGS="${BUILD_LDFLAGS}" \
 		CC="${CC}" \
 		RANLIB="${RANLIB}" \
 		OBJCOPY="${OBJCOPY}"


             reply	other threads:[~2025-10-22  5:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22  5:08 Khem Raj [this message]
2025-10-22  5:08 ` [PATCH 2/5] gcc: Pin native toolchain to GCC as well Khem Raj
2025-10-22  5:08 ` [PATCH 3/5] pseudo: Pin native compiler to gcc " Khem Raj
2025-10-22  5:08 ` [PATCH 4/5] pkgconfig: Always use gcc for native compiler Khem Raj
2025-10-23 12:16   ` [OE-core] " Ross Burton
2025-10-24  2:24     ` Khem Raj
2025-10-22  5:08 ` [PATCH 5/5] elfutils: " Khem Raj
2025-10-23 12:16   ` [OE-core] " Ross Burton
2025-10-24  2:25     ` Khem Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251022050810.1572184-1-raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox