From 8de2df7665017e851b319056170dc367edf2b017 Mon Sep 17 00:00:00 2001
From: yangjiaqi <yangjiaqi16@huawei.com>
Date: Fri, 10 May 2024 15:28:22 +0800
Subject: [PATCH] static compilation for cross-version use

Signed-off-by: vegbir <yangjiaqi16@huawei.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index c750d94..d3b3af3 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) -linkmode=external -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-pie -Wl,-z,relro,-z,now" -X main.gitCommit=${COMMIT} -X main.version=${VERSION}'
 
 ENV = GOPATH=${GOPATH} \
       CGO_ENABLED=1 \
-- 
2.33.0

