From e99755cc89167cf60d2c711f997992ece5f26d58 Mon Sep 17 00:00:00 2001 From: Anuj Chaudhari Date: Mon, 13 Apr 2026 10:00:40 -0700 Subject: [PATCH] [v8] Fix Windows build relocation error Generate architecture-specific rsrc syso files with explicit -arch flags to prevent GOARCH linking conflicts where an amd64 syso file gets linked into a 386 executable. --- Makefile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 26b1637990..253ef761b7 100644 --- a/Makefile +++ b/Makefile @@ -188,16 +188,19 @@ out/cf-cli_macosarm: $(GOSRC) GOARCH=arm64 GOOS=darwin go build \ -a -ldflags "$(LD_FLAGS)" -o out/cf-cli_macosarm . -out/cf-cli_win32.exe: $(GOSRC) rsrc.syso +out/cf-cli_win32.exe: $(GOSRC) rsrc_windows_386.syso GOARCH=386 GOOS=windows go build -tags="forceposix" -o out/cf-cli_win32.exe -ldflags "$(LD_FLAGS)" . - rm rsrc.syso + rm rsrc_windows_386.syso -out/cf-cli_winx64.exe: $(GOSRC) rsrc.syso +out/cf-cli_winx64.exe: $(GOSRC) rsrc_windows_amd64.syso GOARCH=amd64 GOOS=windows go build -tags="forceposix" -o out/cf-cli_winx64.exe -ldflags "$(LD_FLAGS)" . - rm rsrc.syso + rm rsrc_windows_amd64.syso -rsrc.syso: - rsrc -ico cf.ico -o rsrc.syso +rsrc_windows_386.syso: + rsrc -arch 386 -ico cf.ico -o rsrc_windows_386.syso + +rsrc_windows_amd64.syso: + rsrc -arch amd64 -ico cf.ico -o rsrc_windows_amd64.syso test: units ## (synonym for units)