aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/embeddable-dll-service
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-02-08 16:16:15 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2021-02-18 22:17:01 +0100
commit4bacf4a37c8ed4091c3201835a0e3db919a6464a (patch)
treeb91f462e47bd4f967ac505571d33ae4b4ba960aa /embeddable-dll-service
parenttunnel: retry wintun creation a few times at early boot (diff)
downloadwireguard-windows-4bacf4a37c8ed4091c3201835a0e3db919a6464a.tar.xz
wireguard-windows-4bacf4a37c8ed4091c3201835a0e3db919a6464a.zip
build: port to arm64
We build Go from modified-source with a bootstrap version, rather than shipping so many patches in this repo. This commit also removes the previous WOW hacks, and goes back to strictly forbidding WOW. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'embeddable-dll-service')
-rw-r--r--embeddable-dll-service/build.bat27
1 files changed, 6 insertions, 21 deletions
diff --git a/embeddable-dll-service/build.bat b/embeddable-dll-service/build.bat
index 85d01ca6..0d2cbdbb 100644
--- a/embeddable-dll-service/build.bat
+++ b/embeddable-dll-service/build.bat
@@ -4,47 +4,32 @@ rem Copyright (C) 2019-2021 WireGuard LLC. All Rights Reserved.
setlocal
set BUILDDIR=%~dp0
-set PATH=%BUILDDIR%..\.deps\go\bin;%BUILDDIR%..\.deps;%PATH%
+set PATH=%BUILDDIR%..\.deps\llvm-mingw\bin;%BUILDDIR%..\.deps\go\bin;%PATH%
set PATHEXT=.exe
cd /d %BUILDDIR% || exit /b 1
-if exist .prepared goto :build
+if exist ..\.deps\prepared goto :build
:installdeps
call ..\build.bat || goto :error
- pushd ..\.deps || goto :error
- rem Mirror of https://musl.cc/i686-w64-mingw32-native.zip
- call :download mingw-x86.zip https://download.wireguard.com/windows-toolchain/distfiles/i686-w64-mingw32-native-20200907.zip c972c00993727ac9bff83c799f4df65662adb95bc871fa30cfa8857e744a7fbd || goto :error
- rem Mirror of https://musl.cc/x86_64-w64-mingw32-native.zip
- call :download mingw-amd64.zip https://download.wireguard.com/windows-toolchain/distfiles/x86_64-w64-mingw32-native-20200907.zip e34fbacbd25b007a8074fc96f7e08f886241e0473a055987ee57483c37567aa5 || goto :error
- popd || goto :error
- copy /y NUL .prepared > NUL || goto :error
:build
set GOOS=windows
+ set GOARM=7
set GOPATH=%BUILDDIR%..\.deps\gopath
set GOROOT=%BUILDDIR%..\.deps\go
set CGO_ENABLED=1
set CGO_CFLAGS=-O3 -Wall -Wno-unused-function -Wno-switch -std=gnu11 -DWINVER=0x0601
call :build_plat x86 i686 386 || goto :error
call :build_plat amd64 x86_64 amd64 || goto :error
+ rem Uncomment when cgo is implemented:
+ rem call :build_plat arm armv7 arm || goto :error
+ rem call :build_plat arm64 aarch64 arm64 || goto :error
:success
echo [+] Success
exit /b 0
-:download
- echo [+] Downloading %1
- curl -#fLo %1 %2 || exit /b 1
- echo [+] Verifying %1
- for /f %%a in ('CertUtil -hashfile %1 SHA256 ^| findstr /r "^[0-9a-f]*$"') do if not "%%a"=="%~3" exit /b 1
- echo [+] Extracting %1
- tar -xf %1 %~4 || exit /b 1
- echo [+] Cleaning up %1
- del %1 || exit /b 1
- goto :eof
-
:build_plat
- set PATH=%BUILDDIR%..\.deps\%~2-w64-mingw32-native\bin;%PATH%
set CC=%~2-w64-mingw32-gcc
set GOARCH=%~3
mkdir %1 >NUL 2>&1