Skip to content

Commit c3f6e71

Browse files
committed
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 <[email protected]>
1 parent c2a5d35 commit c3f6e71

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tunnel/tools/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
cmake_minimum_required(VERSION 3.4.1)
66
project("WireGuard")
77
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
8+
add_link_options(LINKER:--build-id=none)
89

910
add_executable(libwg-quick.so wireguard-tools/src/wg-quick/android.c ndk-compat/compat.c)
1011
target_compile_options(libwg-quick.so PUBLIC -O3 -std=gnu11 -Wall -include ${CMAKE_CURRENT_SOURCE_DIR}/ndk-compat/compat.h -DWG_PACKAGE_NAME=\"${ANDROID_PACKAGE_NAME}\")

tunnel/tools/libwg-go/Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ NDK_GO_ARCH_MAP_arm64 := arm64
1212
NDK_GO_ARCH_MAP_mips := mipsx
1313
NDK_GO_ARCH_MAP_mips64 := mips64x
1414

15+
comma := ,
1516
CLANG_FLAGS := --target=$(TARGET) --sysroot=$(SYSROOT)
1617
export CGO_CFLAGS := $(CLANG_FLAGS) $(subst -mthumb,-marm,$(CFLAGS))
17-
export CGO_LDFLAGS := $(CLANG_FLAGS) $(LDFLAGS) -Wl,-soname=libwg-go.so
18+
export CGO_LDFLAGS := $(CLANG_FLAGS) $(patsubst -Wl$(comma)--build-id=%,-Wl$(comma)--build-id=none,$(LDFLAGS)) -Wl,-soname=libwg-go.so
1819
export GOARCH := $(NDK_GO_ARCH_MAP_$(ANDROID_ARCH_NAME))
1920
export GOOS := android
2021
export CGO_ENABLED := 1
@@ -46,6 +47,6 @@ $(BUILDDIR)/go-$(GO_VERSION)/.prepared: $(GRADLE_USER_HOME)/caches/golang/$(GO_T
4647

4748
$(DESTDIR)/libwg-go.so: export PATH := $(BUILDDIR)/go-$(GO_VERSION)/bin/:$(PATH)
4849
$(DESTDIR)/libwg-go.so: $(BUILDDIR)/go-$(GO_VERSION)/.prepared go.mod
49-
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
50+
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
5051

5152
.DELETE_ON_ERROR:

0 commit comments

Comments
 (0)