1 Star 0 Fork 40

zhongtao/kubernetes

forked from src-openEuler/kubernetes 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0002-fix-compile-options.patch 1.48 KB
一键复制 编辑 原始数据 按行查看 历史
wangfengtu 提交于 2021-03-22 14:37 . fix compile options
From 64a21ff088bc4271f596cd1e622d50293eb9566a Mon Sep 17 00:00:00 2001
From: WangFengTu <wangfengtu@huawei.com>
Date: Mon, 22 Mar 2021 14:31:00 +0800
Subject: [PATCH] fix compile options
Signed-off-by: WangFengTu <wangfengtu@huawei.com>
---
hack/lib/golang.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh
index bef1d837..6d467a8e 100755
--- a/hack/lib/golang.sh
+++ b/hack/lib/golang.sh
@@ -701,6 +701,7 @@ kube::golang::build_binaries_for_platform() {
-installsuffix static
${goflags:+"${goflags[@]}"}
-gcflags "${gogcflags:-}"
+ -buildmode=pie
-asmflags "${goasmflags:-}"
-ldflags "${goldflags:-}"
-tags "${gotags:-}"
@@ -712,6 +713,7 @@ kube::golang::build_binaries_for_platform() {
build_args=(
${goflags:+"${goflags[@]}"}
-gcflags "${gogcflags:-}"
+ -buildmode=pie
-asmflags "${goasmflags:-}"
-ldflags "${goldflags:-}"
-tags "${gotags:-}"
@@ -787,7 +789,7 @@ kube::golang::build_binaries() {
# Disable SC2153 for this, as it will throw a warning that the local
# variable goldflags will exist, and it suggest changing it to this.
# shellcheck disable=SC2153
- goldflags="${GOLDFLAGS=-s -w -buildid=} $(kube::version::ldflags)"
+ goldflags="${GOLDFLAGS=-s -w -buildid=} $(kube::version::ldflags) -linkmode=external"
goasmflags="-trimpath=${KUBE_ROOT}"
gogcflags="${GOGCFLAGS:-} -trimpath=${KUBE_ROOT}"
--
2.25.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/taotao-sauce/kubernetes.git
git@gitee.com:taotao-sauce/kubernetes.git
taotao-sauce
kubernetes
kubernetes
master

搜索帮助