mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-04-21 13:42:32 +02:00
35 lines
1.6 KiB
Diff
35 lines
1.6 KiB
Diff
Required to fix build with -buildmode=pie.
|
|
|
|
See: https://gitlab.alpinelinux.org/alpine/aports/-/issues/15862
|
|
|
|
diff -upr etcd-3.5.12.orig/build.sh etcd-3.5.12/build.sh
|
|
--- etcd-3.5.12.orig/build.sh 2024-03-12 11:11:53.893435301 +0100
|
|
+++ etcd-3.5.12/build.sh 2024-03-12 11:12:24.966849620 +0100
|
|
@@ -18,7 +18,7 @@ GOARCH=${GOARCH:-$(go env GOARCH)}
|
|
# Set GO_LDFLAGS="-s" for building without symbols for debugging.
|
|
# shellcheck disable=SC2206
|
|
GO_LDFLAGS=(${GO_LDFLAGS:-} "-X=${VERSION_SYMBOL}=${GIT_SHA}")
|
|
-GO_BUILD_ENV=("CGO_ENABLED=0" "GO_BUILD_FLAGS=${GO_BUILD_FLAGS:-}" "GOOS=${GOOS}" "GOARCH=${GOARCH}")
|
|
+GO_BUILD_ENV=("GO_BUILD_FLAGS=${GO_BUILD_FLAGS:-}" "GOOS=${GOOS}" "GOARCH=${GOARCH}")
|
|
|
|
GOFAIL_VERSION=$(cd tools/mod && go list -m -f {{.Version}} go.etcd.io/gofail)
|
|
# enable/disable failpoints
|
|
@@ -116,7 +116,7 @@ tools_build() {
|
|
echo "Building" "'${tool}'"...
|
|
run rm -f "${out}/${tool}"
|
|
# shellcheck disable=SC2086
|
|
- run env GO_BUILD_FLAGS="${GO_BUILD_FLAGS:-}" CGO_ENABLED=0 go build ${GO_BUILD_FLAGS:-} \
|
|
+ run env GO_BUILD_FLAGS="${GO_BUILD_FLAGS:-}" go build ${GO_BUILD_FLAGS:-} \
|
|
-trimpath \
|
|
-installsuffix=cgo \
|
|
"-ldflags=${GO_LDFLAGS[*]}" \
|
|
@@ -140,7 +140,7 @@ tests_build() {
|
|
run rm -f "../${out}/${tool}"
|
|
|
|
# shellcheck disable=SC2086
|
|
- run env CGO_ENABLED=0 GO_BUILD_FLAGS="${GO_BUILD_FLAGS:-}" go build ${GO_BUILD_FLAGS:-} \
|
|
+ run env GO_BUILD_FLAGS="${GO_BUILD_FLAGS:-}" go build ${GO_BUILD_FLAGS:-} \
|
|
-installsuffix=cgo \
|
|
"-ldflags=${GO_LDFLAGS[*]}" \
|
|
-o="../${out}/${tool}" "./${tool}" || return 2
|