mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
ldmode=pie is not supported for the mips arch
reference:
https://github.com/docker/cli/pull/2507
4c99c81326
Signed-off-by: Xiaodong Liu <liuxiaodong@loongson.cn>
This commit is contained in:
parent
e573542078
commit
0c350e87a0
10 changed files with 18 additions and 9 deletions
|
@ -13,7 +13,7 @@ install_containerd() (
|
||||||
git checkout -q "$CONTAINERD_COMMIT"
|
git checkout -q "$CONTAINERD_COMMIT"
|
||||||
|
|
||||||
export BUILDTAGS='netgo osusergo static_build'
|
export BUILDTAGS='netgo osusergo static_build'
|
||||||
export EXTRA_FLAGS='-buildmode=pie'
|
export EXTRA_FLAGS=${GO_BUILDMODE}
|
||||||
export EXTRA_LDFLAGS='-extldflags "-fno-PIC -static"'
|
export EXTRA_LDFLAGS='-extldflags "-fno-PIC -static"'
|
||||||
|
|
||||||
# Reset build flags to nothing if we want a dynbinary
|
# Reset build flags to nothing if we want a dynbinary
|
||||||
|
|
|
@ -26,5 +26,5 @@ build_dockercli() {
|
||||||
git checkout -q "v$DOCKERCLI_VERSION"
|
git checkout -q "v$DOCKERCLI_VERSION"
|
||||||
mkdir -p "$GOPATH/src/github.com/docker"
|
mkdir -p "$GOPATH/src/github.com/docker"
|
||||||
mv components/cli "$GOPATH/src/github.com/docker/cli"
|
mv components/cli "$GOPATH/src/github.com/docker/cli"
|
||||||
go build -buildmode=pie -o "${PREFIX}/docker" "github.com/docker/cli/cmd/docker"
|
go build ${GO_BUILDMODE} -o "${PREFIX}/docker" "github.com/docker/cli/cmd/docker"
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ install_golangci_lint() {
|
||||||
commitDate="$(git show -s --format=%cd)"
|
commitDate="$(git show -s --format=%cd)"
|
||||||
|
|
||||||
go build \
|
go build \
|
||||||
-buildmode=pie \
|
${GO_BUILDMODE} \
|
||||||
-ldflags "-s -w -X \"main.version=${version}\" -X \"main.commit=${commit}\" -X \"main.date=${commitDate}\"" \
|
-ldflags "-s -w -X \"main.version=${version}\" -X \"main.commit=${commit}\" -X \"main.date=${commitDate}\"" \
|
||||||
-o "${PREFIX}/golangci-lint" "github.com/golangci/golangci-lint/cmd/golangci-lint"
|
-o "${PREFIX}/golangci-lint" "github.com/golangci/golangci-lint/cmd/golangci-lint"
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,6 @@ install_gotestsum() (
|
||||||
set -e
|
set -e
|
||||||
export GO111MODULE=on
|
export GO111MODULE=on
|
||||||
go get -d "gotest.tools/gotestsum@${GOTESTSUM_COMMIT}"
|
go get -d "gotest.tools/gotestsum@${GOTESTSUM_COMMIT}"
|
||||||
go build -buildmode=pie -o "${PREFIX}/gotestsum" 'gotest.tools/gotestsum'
|
go build ${GO_BUILDMODE} -o "${PREFIX}/gotestsum" 'gotest.tools/gotestsum'
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -15,6 +15,15 @@ if [ -z "$TMP_GOPATH" ]; then
|
||||||
else
|
else
|
||||||
export GOPATH="$TMP_GOPATH"
|
export GOPATH="$TMP_GOPATH"
|
||||||
fi
|
fi
|
||||||
|
case "$(go env GOARCH)" in
|
||||||
|
mips* | ppc64)
|
||||||
|
# pie build mode is not supported on mips architectures
|
||||||
|
export GO_BUILDMODE=""
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
export GO_BUILDMODE="-buildmode=pie"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
dir="$(dirname $0)"
|
dir="$(dirname $0)"
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ install_proxy() {
|
||||||
|
|
||||||
install_proxy_dynamic() {
|
install_proxy_dynamic() {
|
||||||
export PROXY_LDFLAGS="-linkmode=external" install_proxy
|
export PROXY_LDFLAGS="-linkmode=external" install_proxy
|
||||||
export BUILD_MODE="-buildmode=pie"
|
export BUILD_MODE=${GO_BUILDMODE}
|
||||||
_install_proxy
|
_install_proxy
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ install_rootlesskit() {
|
||||||
|
|
||||||
install_rootlesskit_dynamic() {
|
install_rootlesskit_dynamic() {
|
||||||
export ROOTLESSKIT_LDFLAGS="-linkmode=external" install_rootlesskit
|
export ROOTLESSKIT_LDFLAGS="-linkmode=external" install_rootlesskit
|
||||||
export BUILD_MODE="-buildmode=pie"
|
export BUILD_MODE=${GO_BUILDMODE}
|
||||||
_install_rootlesskit
|
_install_rootlesskit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,5 +7,5 @@ install_shfmt() {
|
||||||
git clone https://github.com/mvdan/sh.git "$GOPATH/src/github.com/mvdan/sh"
|
git clone https://github.com/mvdan/sh.git "$GOPATH/src/github.com/mvdan/sh"
|
||||||
cd "$GOPATH/src/github.com/mvdan/sh" || exit 1
|
cd "$GOPATH/src/github.com/mvdan/sh" || exit 1
|
||||||
git checkout -q "$SHFMT_COMMIT"
|
git checkout -q "$SHFMT_COMMIT"
|
||||||
GO111MODULE=on go build -buildmode=pie -v -o "${PREFIX}/shfmt" ./cmd/shfmt
|
GO111MODULE=on go build ${GO_BUILDMODE} -v -o "${PREFIX}/shfmt" ./cmd/shfmt
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,5 +8,5 @@ install_tomlv() {
|
||||||
echo "Install tomlv version $TOMLV_COMMIT"
|
echo "Install tomlv version $TOMLV_COMMIT"
|
||||||
git clone https://github.com/BurntSushi/toml.git "$GOPATH/src/github.com/BurntSushi/toml"
|
git clone https://github.com/BurntSushi/toml.git "$GOPATH/src/github.com/BurntSushi/toml"
|
||||||
cd "$GOPATH/src/github.com/BurntSushi/toml" && git checkout -q "$TOMLV_COMMIT"
|
cd "$GOPATH/src/github.com/BurntSushi/toml" && git checkout -q "$TOMLV_COMMIT"
|
||||||
go build -v -buildmode=pie -o "${PREFIX}/tomlv" "github.com/BurntSushi/toml/cmd/tomlv"
|
go build -v ${GO_BUILDMODE} -o "${PREFIX}/tomlv" "github.com/BurntSushi/toml/cmd/tomlv"
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,5 +7,5 @@ install_vndr() {
|
||||||
git clone https://github.com/LK4D4/vndr.git "$GOPATH/src/github.com/LK4D4/vndr"
|
git clone https://github.com/LK4D4/vndr.git "$GOPATH/src/github.com/LK4D4/vndr"
|
||||||
cd "$GOPATH/src/github.com/LK4D4/vndr" || exit 1
|
cd "$GOPATH/src/github.com/LK4D4/vndr" || exit 1
|
||||||
git checkout -q "$VNDR_COMMIT"
|
git checkout -q "$VNDR_COMMIT"
|
||||||
go build -buildmode=pie -v -o "${PREFIX}/vndr" .
|
go build ${GO_BUILDMODE} -v -o "${PREFIX}/vndr" .
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue