From 39a1934ad7f2fcbc55fefcbdc00b3d1db6a9ce2d Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 11 Nov 2020 20:28:10 +0100 Subject: build: opt-in to resource loading of wintun.dll Signed-off-by: Jason A. Donenfeld --- Makefile | 2 +- build.bat | 2 +- embeddable-dll-service/build.bat | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f9f7814c..63707498 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -GOFLAGS := -ldflags="-H windowsgui -s -w" -v -trimpath +GOFLAGS := -tags load_wintun_from_rsrc -ldflags="-H windowsgui -s -w" -v -trimpath export GOOS := windows export PATH := $(CURDIR)/.deps/go/bin:$(PATH) diff --git a/build.bat b/build.bat index c4bf6138..ccbdf6bc 100644 --- a/build.bat +++ b/build.bat @@ -85,7 +85,7 @@ if exist .deps\prepared goto :render if %1==arm64 ( copy "arm\wireguard.exe" "%~1\wireguard.exe" || exit /b 1 ) else ( - go build -ldflags="-H windowsgui -s -w" -trimpath -v -o "%~1\wireguard.exe" || exit /b 1 + go build -tags load_wintun_from_rsrc -ldflags="-H windowsgui -s -w" -trimpath -v -o "%~1\wireguard.exe" || exit /b 1 ) if not exist "%~1\wg.exe" ( echo [+] Building command line tools %1 diff --git a/embeddable-dll-service/build.bat b/embeddable-dll-service/build.bat index cae35f70..ecf5acc9 100644 --- a/embeddable-dll-service/build.bat +++ b/embeddable-dll-service/build.bat @@ -18,9 +18,7 @@ if exist ..\.deps\prepared goto :build set GOROOT=%BUILDDIR%..\.deps\go set CGO_ENABLED=1 set CGO_CFLAGS=-O3 -Wall -Wno-unused-function -Wno-switch -std=gnu11 -DWINVER=0x0601 - set CGO_LDFLAGS=-Wl,--dynamicbase -Wl,--nxcompat -Wl,--export-all-symbols call :build_plat x86 i686 386 || goto :error - set CGO_LDFLAGS=%CGO_LDFLAGS% -Wl,--high-entropy-va call :build_plat amd64 x86_64 amd64 || goto :error :success -- cgit v1.2.3-59-g8ed1b