diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-12-02 16:15:23 -0500 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-12-02 23:16:58 -0500 |
commit | 32b3cb66eec33d1c8ba3e412fb749777fdcba8bc (patch) | |
tree | e6c1c5e50cca417cb8adc48c6d9c38a566f13b23 | |
parent | ui: only set "(out of date)" window title if admin user (diff) | |
download | wireguard-windows-32b3cb66eec33d1c8ba3e412fb749777fdcba8bc.tar.xz wireguard-windows-32b3cb66eec33d1c8ba3e412fb749777fdcba8bc.zip |
build: update to go 1.17.4 and drop upstreamed patches
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | build.bat | 2 | ||||
-rw-r--r-- | go-patches/0003-release-branch.go1.17-runtime-support-non-cooperativ.patch (renamed from go-patches/0005-release-branch.go1.17-runtime-support-non-cooperativ.patch) | 0 | ||||
-rw-r--r-- | go-patches/0003-runtime-on-windows-read-nanotime-with-one-instructio.patch | 200 | ||||
-rw-r--r-- | go-patches/0004-runtime-support-non-cooperative-preemption-on-window.patch (renamed from go-patches/0006-runtime-support-non-cooperative-preemption-on-window.patch) | 0 | ||||
-rw-r--r-- | go-patches/0004-runtime-use-correct-constant-when-computing-nsec-rem.patch | 81 | ||||
-rw-r--r-- | go.mod | 4 | ||||
-rw-r--r-- | go.sum | 6 |
8 files changed, 7 insertions, 288 deletions
@@ -25,7 +25,7 @@ define download = if ! mv $$@.unverified $$@; then rm -f $$@.unverified; exit 1; fi endef -$(eval $(call download,go.tar.gz,https://go.dev/dl/go1.17.3.linux-amd64.tar.gz,550f9845451c0c94be679faf116291e7807a8d78b43149f9506c1b15eb89008c)) +$(eval $(call download,go.tar.gz,https://go.dev/dl/go1.17.4.linux-amd64.tar.gz,adab2483f644e2f8a10ae93122f0018cef525ca48d0b8764dae87cb5f4fd4206)) $(eval $(call download,wireguard-nt.zip,https://download.wireguard.com/wireguard-nt/wireguard-nt-0.10.1.zip,772c0b1463d8d2212716f43f06f4594d880dea4f735165bd68e388fc41b81605)) .deps/go/prepared: .distfiles/go.tar.gz $(wildcard go-patches/*.patch) @@ -13,7 +13,7 @@ if exist .deps\prepared goto :render rmdir /s /q .deps 2> NUL mkdir .deps || goto :error cd .deps || goto :error - call :download go.zip https://go.dev/dl/go1.17.3.windows-amd64.zip e78684b955742e215926204afc6ed62b9d165b509e25a687d62902516f08726b || goto :error + call :download go.zip https://go.dev/dl/go1.17.4.windows-amd64.zip 903cffeb7c6ab7490b9101086a2b978076bd9356e56369404b9c45dff866da77 || goto :error rem Mirror of https://github.com/mstorsjo/llvm-mingw/releases/download/20201020/llvm-mingw-20201020-msvcrt-x86_64.zip call :download llvm-mingw-msvcrt.zip https://download.wireguard.com/windows-toolchain/distfiles/llvm-mingw-20201020-msvcrt-x86_64.zip 2e46593245090df96d15e360e092f0b62b97e93866e0162dca7f93b16722b844 || goto :error rem Mirror of https://imagemagick.org/download/binaries/ImageMagick-7.0.8-42-portable-Q16-x64.zip diff --git a/go-patches/0005-release-branch.go1.17-runtime-support-non-cooperativ.patch b/go-patches/0003-release-branch.go1.17-runtime-support-non-cooperativ.patch index dbab4ba0..dbab4ba0 100644 --- a/go-patches/0005-release-branch.go1.17-runtime-support-non-cooperativ.patch +++ b/go-patches/0003-release-branch.go1.17-runtime-support-non-cooperativ.patch diff --git a/go-patches/0003-runtime-on-windows-read-nanotime-with-one-instructio.patch b/go-patches/0003-runtime-on-windows-read-nanotime-with-one-instructio.patch deleted file mode 100644 index 2ff79368..00000000 --- a/go-patches/0003-runtime-on-windows-read-nanotime-with-one-instructio.patch +++ /dev/null @@ -1,200 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: "Jason A. Donenfeld" <Jason@zx2c4.com> -Date: Wed, 3 Nov 2021 18:19:04 +0100 -Subject: [PATCH] runtime: on windows, read nanotime with one instruction or - issue barrier - -On 64-bit, this is more efficient, and on ARM64, this prevents the time -from moving backwards due to the weaker memory model. On ARM32 due to -the weaker memory model, we issue a memory barrier. - -Updates #48072. - -Change-Id: If4695716c3039d8af14e14808af217f5c99fc93a -Reviewed-on: https://go-review.googlesource.com/c/go/+/361057 -Trust: Jason A. Donenfeld <Jason@zx2c4.com> -Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> -TryBot-Result: Go Bot <gobot@golang.org> -Reviewed-by: Austin Clements <austin@google.com> ---- - src/runtime/sys_windows_amd64.s | 13 +++---------- - src/runtime/sys_windows_arm.s | 2 ++ - src/runtime/sys_windows_arm64.s | 10 +--------- - src/runtime/time_windows.h | 1 + - src/runtime/time_windows_amd64.s | 19 +++---------------- - src/runtime/time_windows_arm.s | 4 ++++ - src/runtime/time_windows_arm64.s | 22 +++------------------- - 7 files changed, 17 insertions(+), 54 deletions(-) - -diff --git a/src/runtime/sys_windows_amd64.s b/src/runtime/sys_windows_amd64.s -index e7782846b2..64fa6791f4 100644 ---- a/src/runtime/sys_windows_amd64.s -+++ b/src/runtime/sys_windows_amd64.s -@@ -348,16 +348,9 @@ TEXT runtime·nanotime1(SB),NOSPLIT,$0-8 - CMPB runtime·useQPCTime(SB), $0 - JNE useQPC - MOVQ $_INTERRUPT_TIME, DI --loop: -- MOVL time_hi1(DI), AX -- MOVL time_lo(DI), BX -- MOVL time_hi2(DI), CX -- CMPL AX, CX -- JNE loop -- SHLQ $32, CX -- ORQ BX, CX -- IMULQ $100, CX -- MOVQ CX, ret+0(FP) -+ MOVQ time_lo(DI), AX -+ IMULQ $100, AX -+ MOVQ AX, ret+0(FP) - RET - useQPC: - JMP runtime·nanotimeQPC(SB) -diff --git a/src/runtime/sys_windows_arm.s b/src/runtime/sys_windows_arm.s -index 48f8c7dedf..d7ad244161 100644 ---- a/src/runtime/sys_windows_arm.s -+++ b/src/runtime/sys_windows_arm.s -@@ -350,7 +350,9 @@ TEXT runtime·nanotime1(SB),NOSPLIT|NOFRAME,$0-8 - MOVW $_INTERRUPT_TIME, R3 - loop: - MOVW time_hi1(R3), R1 -+ DMB MB_ISH - MOVW time_lo(R3), R0 -+ DMB MB_ISH - MOVW time_hi2(R3), R2 - CMP R1, R2 - BNE loop -diff --git a/src/runtime/sys_windows_arm64.s b/src/runtime/sys_windows_arm64.s -index 7a2e11f5ae..183128dd09 100644 ---- a/src/runtime/sys_windows_arm64.s -+++ b/src/runtime/sys_windows_arm64.s -@@ -415,15 +415,7 @@ TEXT runtime·nanotime1(SB),NOSPLIT|NOFRAME,$0-8 - CMP $0, R0 - BNE useQPC - MOVD $_INTERRUPT_TIME, R3 --loop: -- MOVWU time_hi1(R3), R1 -- MOVWU time_lo(R3), R0 -- MOVWU time_hi2(R3), R2 -- CMP R1, R2 -- BNE loop -- -- // wintime = R1:R0, multiply by 100 -- ORR R1<<32, R0 -+ MOVD time_lo(R3), R0 - MOVD $100, R1 - MUL R1, R0 - MOVD R0, ret+0(FP) -diff --git a/src/runtime/time_windows.h b/src/runtime/time_windows.h -index cd16fd163b..7c2e65c328 100644 ---- a/src/runtime/time_windows.h -+++ b/src/runtime/time_windows.h -@@ -9,6 +9,7 @@ - // http://web.archive.org/web/20210411000829/https://wrkhpi.wordpress.com/2007/08/09/getting-os-information-the-kuser_shared_data-structure/ - - // Must read hi1, then lo, then hi2. The snapshot is valid if hi1 == hi2. -+// Or, on 64-bit, just read lo:hi1 all at once atomically. - #define _INTERRUPT_TIME 0x7ffe0008 - #define _SYSTEM_TIME 0x7ffe0014 - #define time_lo 0 -diff --git a/src/runtime/time_windows_amd64.s b/src/runtime/time_windows_amd64.s -index 93ab960b06..045f64eb46 100644 ---- a/src/runtime/time_windows_amd64.s -+++ b/src/runtime/time_windows_amd64.s -@@ -12,27 +12,14 @@ - TEXT time·now(SB),NOSPLIT,$0-24 - CMPB runtime·useQPCTime(SB), $0 - JNE useQPC -+ - MOVQ $_INTERRUPT_TIME, DI --loop: -- MOVL time_hi1(DI), AX -- MOVL time_lo(DI), BX -- MOVL time_hi2(DI), CX -- CMPL AX, CX -- JNE loop -- SHLQ $32, AX -- ORQ BX, AX -+ MOVQ time_lo(DI), AX - IMULQ $100, AX - MOVQ AX, mono+16(FP) - - MOVQ $_SYSTEM_TIME, DI --wall: -- MOVL time_hi1(DI), AX -- MOVL time_lo(DI), BX -- MOVL time_hi2(DI), CX -- CMPL AX, CX -- JNE wall -- SHLQ $32, AX -- ORQ BX, AX -+ MOVQ time_lo(DI), AX - MOVQ $116444736000000000, DI - SUBQ DI, AX - IMULQ $100, AX -diff --git a/src/runtime/time_windows_arm.s b/src/runtime/time_windows_arm.s -index 7c763b66ed..6552d75ff1 100644 ---- a/src/runtime/time_windows_arm.s -+++ b/src/runtime/time_windows_arm.s -@@ -17,7 +17,9 @@ TEXT time·now(SB),NOSPLIT|NOFRAME,$0-20 - MOVW $_INTERRUPT_TIME, R3 - loop: - MOVW time_hi1(R3), R1 -+ DMB MB_ISH - MOVW time_lo(R3), R0 -+ DMB MB_ISH - MOVW time_hi2(R3), R2 - CMP R1, R2 - BNE loop -@@ -34,7 +36,9 @@ loop: - MOVW $_SYSTEM_TIME, R3 - wall: - MOVW time_hi1(R3), R1 -+ DMB MB_ISH - MOVW time_lo(R3), R0 -+ DMB MB_ISH - MOVW time_hi2(R3), R2 - CMP R1, R2 - BNE wall -diff --git a/src/runtime/time_windows_arm64.s b/src/runtime/time_windows_arm64.s -index ef52ce4c99..e8a0eb2f93 100644 ---- a/src/runtime/time_windows_arm64.s -+++ b/src/runtime/time_windows_arm64.s -@@ -13,34 +13,18 @@ TEXT time·now(SB),NOSPLIT|NOFRAME,$0-24 - MOVB runtime·useQPCTime(SB), R0 - CMP $0, R0 - BNE useQPC -- MOVD $_INTERRUPT_TIME, R3 --loop: -- MOVWU time_hi1(R3), R1 -- MOVWU time_lo(R3), R0 -- MOVWU time_hi2(R3), R2 -- CMP R1, R2 -- BNE loop - -- // wintime = R1:R0, multiply by 100 -- ORR R1<<32, R0 -+ MOVD $_INTERRUPT_TIME, R3 -+ MOVD time_lo(R3), R0 - MOVD $100, R1 - MUL R1, R0 - MOVD R0, mono+16(FP) - - MOVD $_SYSTEM_TIME, R3 --wall: -- MOVWU time_hi1(R3), R1 -- MOVWU time_lo(R3), R0 -- MOVWU time_hi2(R3), R2 -- CMP R1, R2 -- BNE wall -- -- // w = R1:R0 in 100ns units -+ MOVD time_lo(R3), R0 - // convert to Unix epoch (but still 100ns units) - #define delta 116444736000000000 -- ORR R1<<32, R0 - SUB $delta, R0 -- - // Convert to nSec - MOVD $100, R1 - MUL R1, R0 diff --git a/go-patches/0006-runtime-support-non-cooperative-preemption-on-window.patch b/go-patches/0004-runtime-support-non-cooperative-preemption-on-window.patch index c99ea390..c99ea390 100644 --- a/go-patches/0006-runtime-support-non-cooperative-preemption-on-window.patch +++ b/go-patches/0004-runtime-support-non-cooperative-preemption-on-window.patch diff --git a/go-patches/0004-runtime-use-correct-constant-when-computing-nsec-rem.patch b/go-patches/0004-runtime-use-correct-constant-when-computing-nsec-rem.patch deleted file mode 100644 index 4a826068..00000000 --- a/go-patches/0004-runtime-use-correct-constant-when-computing-nsec-rem.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: "Jason A. Donenfeld" <Jason@zx2c4.com> -Date: Fri, 5 Nov 2021 00:10:31 +0100 -Subject: [PATCH] runtime: use correct constant when computing nsec remainder - -A code comment on amd64 for windows and plan9 contained a snippet for -splitting apart the sec and nsec components of a unix timestamp, with -produced assembly below, which was then cleaned up by hand. When arm64 -was ported, that code snippet in the comment went through the compiler -to produce some code that was then pasted and cleaned up. Unfortunately, -the comment had a typo in it, containing 8 zeros instead of 9. - -This resulted in the constant used in the assembly being wrong, spotted -by @bufflig's eagle eyes. So, this commit fixes the comment on all three -platforms, and the assembly on windows/arm64. - -Fixes #48072. - -Change-Id: I786fe89147328b0d25544f52c927ddfdb9f6f1cf -Reviewed-on: https://go-review.googlesource.com/c/go/+/361474 -Trust: Jason A. Donenfeld <Jason@zx2c4.com> -Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> -Reviewed-by: Patrik Nyblom <pnyb@google.com> -TryBot-Result: Go Bot <gobot@golang.org> ---- - src/runtime/sys_plan9_amd64.s | 2 +- - src/runtime/time_windows_amd64.s | 2 +- - src/runtime/time_windows_arm64.s | 9 +++------ - 3 files changed, 5 insertions(+), 8 deletions(-) - -diff --git a/src/runtime/sys_plan9_amd64.s b/src/runtime/sys_plan9_amd64.s -index 731306ab44..068200b7f3 100644 ---- a/src/runtime/sys_plan9_amd64.s -+++ b/src/runtime/sys_plan9_amd64.s -@@ -94,7 +94,7 @@ TEXT runtime·walltime(SB),NOSPLIT,$8-12 - MOVQ 0(SP), AX - - // generated code for -- // func f(x uint64) (uint64, uint64) { return x/1000000000, x%100000000 } -+ // func f(x uint64) (uint64, uint64) { return x/1000000000, x%1000000000 } - // adapted to reduce duplication - MOVQ AX, CX - MOVQ $1360296554856532783, AX -diff --git a/src/runtime/time_windows_amd64.s b/src/runtime/time_windows_amd64.s -index 045f64eb46..70f6a008cd 100644 ---- a/src/runtime/time_windows_amd64.s -+++ b/src/runtime/time_windows_amd64.s -@@ -25,7 +25,7 @@ TEXT time·now(SB),NOSPLIT,$0-24 - IMULQ $100, AX - - // generated code for -- // func f(x uint64) (uint64, uint64) { return x/1000000000, x%100000000 } -+ // func f(x uint64) (uint64, uint64) { return x/1000000000, x%1000000000 } - // adapted to reduce duplication - MOVQ AX, CX - MOVQ $1360296554856532783, AX -diff --git a/src/runtime/time_windows_arm64.s b/src/runtime/time_windows_arm64.s -index e8a0eb2f93..ef5b848473 100644 ---- a/src/runtime/time_windows_arm64.s -+++ b/src/runtime/time_windows_arm64.s -@@ -32,17 +32,14 @@ TEXT time·now(SB),NOSPLIT|NOFRAME,$0-24 - // Code stolen from compiler output for: - // - // var x uint64 -- // func f() (sec uint64, nsec uint32) { return x / 1000000000, uint32(x % 100000000) } -+ // func f() (sec uint64, nsec uint32) { return x / 1000000000, uint32(x % 1000000000) } - // - LSR $1, R0, R1 - MOVD $-8543223759426509416, R2 -- UMULH R2, R1, R1 -+ UMULH R1, R2, R1 - LSR $28, R1, R1 - MOVD R1, sec+0(FP) -- MOVD $-6067343680855748867, R1 -- UMULH R0, R1, R1 -- LSR $26, R1, R1 -- MOVD $100000000, R2 -+ MOVD $1000000000, R2 - MSUB R1, R0, R2, R0 - MOVW R0, nsec+8(FP) - RET @@ -5,8 +5,8 @@ go 1.17 require ( github.com/lxn/walk v0.0.0-20210112085537-c389da54e794 github.com/lxn/win v0.0.0-20210218163916-a377121e959e - golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 - golang.org/x/net v0.0.0-20211123203042-d83791d6bcd9 + golang.org/x/crypto v0.0.0-20211202192323-5770296d904e + golang.org/x/net v0.0.0-20211201190559-0a0e4e1bb54c golang.org/x/sys v0.0.0-20211124211545-fe61309f8881 golang.org/x/text v0.3.8-0.20211105212822-18b340fc7af2 golang.zx2c4.com/go118/netip v0.0.0-20211111135330-a4a02eeacf9d @@ -1,12 +1,12 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 h1:/pEO3GD/ABYAjuakUS6xSEmmlyVS4kxBNkeA9tLJiTI= -golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20211202192323-5770296d904e h1:MUP6MR3rJ7Gk9LEia0LP2ytiH6MuCfs7qYz+47jGdD8= +golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20211123203042-d83791d6bcd9/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211201190559-0a0e4e1bb54c/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |