diff --git a/0004-enable-external-linkmode-for-cgo-build.patch b/0004-enable-external-linkmode-for-cgo-build.patch new file mode 100644 index 0000000..37c5192 --- /dev/null +++ b/0004-enable-external-linkmode-for-cgo-build.patch @@ -0,0 +1,26 @@ +From df6545261395654bdba369e23b7b4fd6705cad93 Mon Sep 17 00:00:00 2001 +From: zhangsong234 +Date: Thu, 2 Sep 2021 20:49:07 +0800 +Subject: [PATCH] enable external linkmode for cgo build + +Signed-off-by: zhangsong234 +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 792a861..5881aec 100644 +--- a/Makefile ++++ b/Makefile +@@ -20,7 +20,7 @@ VERSION := $(shell cat ./VERSION) + BEP_DIR=/tmp/syscontainer-tools-build-bep + BEP_FLAGS=-tmpdir=/tmp/syscontainer-tools-build-bep + +-GO_LDFLAGS="-buildid=IdByiSula $(BEP_FLAGS) -extldflags=-static -extldflags=-Wl,-z,relro,-z,now -X main.gitCommit=${COMMIT} -X main.version=${VERSION}" ++GO_LDFLAGS="-buildid=IdByiSula $(BEP_FLAGS) -linkmode=external -extldflags=-static -extldflags=-Wl,-z,relro,-z,now -X main.gitCommit=${COMMIT} -X main.version=${VERSION}" + + ENV = GOPATH=${GOPATH} \ + CGO_ENABLED=1 \ +-- +1.8.3.1 + diff --git a/syscontainer-tools.spec b/syscontainer-tools.spec index e380d07..5feb3c2 100644 --- a/syscontainer-tools.spec +++ b/syscontainer-tools.spec @@ -4,7 +4,7 @@ #Basic Information Name: syscontainer-tools Version: 0.9 -Release: 48 +Release: 49 Summary: syscontainer tools for IT, work with iSulad License: Mulan PSL v2 URL: https://gitee.com/openeuler/syscontainer-tools @@ -14,6 +14,7 @@ BuildRoot: %{_tmppath}/%{name}-root Patch1: 0001-fix-failed-build-with-golang-1.15.5.patch Patch2: 0002-syscontainer-tools-build-security-option.patch Patch3: 0003-add-dt-test.patch +Patch4: 0004-enable-external-linkmode-for-cgo-build.patch #Dependency BuildRequires: glibc-static @@ -30,6 +31,8 @@ This is syscontainer tools, to make it work, you need a isulad and util-linux %build make init && make +strip build/syscontainer-hooks +strip build/syscontainer-tools %install HOOK_DIR=$RPM_BUILD_ROOT/var/lib/isulad/hooks @@ -115,6 +118,9 @@ chmod 0640 ${HOOK_SPEC}/hookspec.json rm -rfv %{buildroot} %changelog +* Mon Nov 13 2023 yangjiaqi - 0.9-49 +- fix compile option + * Wed Feb 15 2023 yangjiaqi - 0.9-48 - add dt test for util.go