summaryrefslogtreecommitdiffhomepage
path: root/tunnel/tools/libwg-go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2023-04-04 14:20:02 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2023-04-04 15:14:28 +0200
commit9fae3273156fc4adfd631424c812ab83e563dd36 (patch)
tree5b57b27136986b98c279301309e70f3fa5d5a955 /tunnel/tools/libwg-go
parenta6f5eb0dd2674f9285209a9f46e6e0f9ee15962e (diff)
tools: pass -Wl,--build-id=none and -buildid= to toolchain
Unfortunately, we need to fix this up in both the Makefile and in CMake, because add_link_options doesn't immediately reflect on the CMake variables in scope. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'tunnel/tools/libwg-go')
-rw-r--r--tunnel/tools/libwg-go/Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/tunnel/tools/libwg-go/Makefile b/tunnel/tools/libwg-go/Makefile
index 10c695e4..22405da3 100644
--- a/tunnel/tools/libwg-go/Makefile
+++ b/tunnel/tools/libwg-go/Makefile
@@ -12,9 +12,10 @@ NDK_GO_ARCH_MAP_arm64 := arm64
NDK_GO_ARCH_MAP_mips := mipsx
NDK_GO_ARCH_MAP_mips64 := mips64x
+comma := ,
CLANG_FLAGS := --target=$(TARGET) --sysroot=$(SYSROOT)
export CGO_CFLAGS := $(CLANG_FLAGS) $(subst -mthumb,-marm,$(CFLAGS))
-export CGO_LDFLAGS := $(CLANG_FLAGS) $(LDFLAGS) -Wl,-soname=libwg-go.so
+export CGO_LDFLAGS := $(CLANG_FLAGS) $(patsubst -Wl$(comma)--build-id=%,-Wl$(comma)--build-id=none,$(LDFLAGS)) -Wl,-soname=libwg-go.so
export GOARCH := $(NDK_GO_ARCH_MAP_$(ANDROID_ARCH_NAME))
export GOOS := android
export CGO_ENABLED := 1
@@ -46,6 +47,6 @@ $(BUILDDIR)/go-$(GO_VERSION)/.prepared: $(GRADLE_USER_HOME)/caches/golang/$(GO_T
$(DESTDIR)/libwg-go.so: export PATH := $(BUILDDIR)/go-$(GO_VERSION)/bin/:$(PATH)
$(DESTDIR)/libwg-go.so: $(BUILDDIR)/go-$(GO_VERSION)/.prepared go.mod
- go build -tags linux -ldflags="-X golang.zx2c4.com/wireguard/ipc.socketDirectory=/data/data/$(ANDROID_PACKAGE_NAME)/cache/wireguard" -v -trimpath -o "$@" -buildmode c-shared
+ go build -tags linux -ldflags="-X golang.zx2c4.com/wireguard/ipc.socketDirectory=/data/data/$(ANDROID_PACKAGE_NAME)/cache/wireguard -buildid=" -v -trimpath -o "$@" -buildmode c-shared
.DELETE_ON_ERROR: