From: Changqing Li <[email protected]>

Signed-off-by: Changqing Li <[email protected]>
---
 .../0001-Makefile-add-EXTRA_LDFLAGS.patch     | 33 +++++++++++++++++++
 .../oci-runtime-tools_git.bb                  |  2 ++
 2 files changed, 35 insertions(+)
 create mode 100644 
recipes-containers/oci-runtime-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch

diff --git 
a/recipes-containers/oci-runtime-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch
 
b/recipes-containers/oci-runtime-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch
new file mode 100644
index 00000000..59ae82c5
--- /dev/null
+++ 
b/recipes-containers/oci-runtime-tools/files/0001-Makefile-add-EXTRA_LDFLAGS.patch
@@ -0,0 +1,33 @@
+From c8ceb663f7e27a786714d31abeb8da7e1e3d0984 Mon Sep 17 00:00:00 2001
+From: Changqing Li <[email protected]>
+Date: Wed, 7 Jan 2026 15:48:37 +0800
+Subject: [PATCH] Makefile: add EXTRA_LDFLAGS
+
+Add EXTRA_LDFLAGS to support add extra ldflags
+
+Upstream-Status: Submitted 
[https://github.com/opencontainers/runtime-tools/pull/803]
+
+Signed-off-by: Changqing Li <[email protected]>
+---
+ Makefile | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index e79aa74..2827f54 100644
+--- a/Makefile
++++ b/Makefile
+@@ -6,8 +6,9 @@ BUILDTAGS=
+ RUNTIME ?= runc
+ COMMIT ?= $(shell git describe --dirty --long --always --tags 2> /dev/null)
+ VERSION := ${shell cat ./VERSION}
+-BUILD_FLAGS := -tags "$(BUILDTAGS)" -ldflags "-X main.gitCommit=$(COMMIT) -X 
main.version=$(VERSION)" $(EXTRA_FLAGS)
+-STATIC_BUILD_FLAGS := -tags "$(BUILDTAGS) netgo osusergo" -ldflags 
"-extldflags -static -X main.gitCommit=$(COMMIT) -X main.version=$(VERSION)" 
$(EXTRA_FLAGS)
++EXTRA_LDFLAGS ?= ""
++BUILD_FLAGS := -tags "$(BUILDTAGS)" -ldflags "-X main.gitCommit=$(COMMIT) -X 
main.version=$(VERSION) ${EXTRA_LDFLAGS}" $(EXTRA_FLAGS)
++STATIC_BUILD_FLAGS := -tags "$(BUILDTAGS) netgo osusergo" -ldflags 
"-extldflags -static -X main.gitCommit=$(COMMIT) -X main.version=$(VERSION) 
${EXTRA_LDFLAGS}" $(EXTRA_FLAGS)
+ VALIDATION_TESTS ?= $(patsubst %.go,%.t,$(shell find ./validation/ -name *.go 
| grep -v util))
+ 
+ all: tool runtimetest validation-executables
+-- 
+2.34.1
+
diff --git a/recipes-containers/oci-runtime-tools/oci-runtime-tools_git.bb 
b/recipes-containers/oci-runtime-tools/oci-runtime-tools_git.bb
index 81f51f9c..60c54ea8 100644
--- a/recipes-containers/oci-runtime-tools/oci-runtime-tools_git.bb
+++ b/recipes-containers/oci-runtime-tools/oci-runtime-tools_git.bb
@@ -5,6 +5,7 @@ LIC_FILES_CHKSUM = 
"file://LICENSE;md5=b355a61a394a504dacde901c958f662c"
 
 SRC_URI = 
"git://github.com/opencontainers/runtime-tools.git;branch=master;protocol=https;destsuffix=git/src/github.com/opencontainers/runtime-tools
 \
            file://0001-build-use-for-cross-compiler.patch \
+           file://0001-Makefile-add-EXTRA_LDFLAGS.patch \
            "
 
 SRCREV = "0105384f68e16803891d0a17d9067b1def6a2778"
@@ -39,6 +40,7 @@ do_compile() {
        #        cannot open file : open : no such file or directory
        # export GO_BUILD_FLAGS="-a -pkgdir dontusecurrentpkgs"
        export EXTRA_FLAGS="-trimpath"
+       export EXTRA_LDFLAGS="-buildid="
 
        cd ${S}
 
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9545): 
https://lists.yoctoproject.org/g/meta-virtualization/message/9545
Mute This Topic: https://lists.yoctoproject.org/mt/117148705/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to