Skip to content

Commit d6318e3

Browse files
authored
[v8] Fix Windows build relocation error (#3763)
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.
1 parent 3370f5f commit d6318e3

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Makefile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,19 @@ out/cf-cli_macosarm: $(GOSRC)
188188
GOARCH=arm64 GOOS=darwin go build \
189189
-a -ldflags "$(LD_FLAGS)" -o out/cf-cli_macosarm .
190190

191-
out/cf-cli_win32.exe: $(GOSRC) rsrc.syso
191+
out/cf-cli_win32.exe: $(GOSRC) rsrc_windows_386.syso
192192
GOARCH=386 GOOS=windows go build -tags="forceposix" -o out/cf-cli_win32.exe -ldflags "$(LD_FLAGS)" .
193-
rm rsrc.syso
193+
rm rsrc_windows_386.syso
194194

195-
out/cf-cli_winx64.exe: $(GOSRC) rsrc.syso
195+
out/cf-cli_winx64.exe: $(GOSRC) rsrc_windows_amd64.syso
196196
GOARCH=amd64 GOOS=windows go build -tags="forceposix" -o out/cf-cli_winx64.exe -ldflags "$(LD_FLAGS)" .
197-
rm rsrc.syso
197+
rm rsrc_windows_amd64.syso
198198

199-
rsrc.syso:
200-
rsrc -ico cf.ico -o rsrc.syso
199+
rsrc_windows_386.syso:
200+
rsrc -arch 386 -ico cf.ico -o rsrc_windows_386.syso
201+
202+
rsrc_windows_amd64.syso:
203+
rsrc -arch amd64 -ico cf.ico -o rsrc_windows_amd64.syso
201204

202205
test: units ## (synonym for units)
203206

0 commit comments

Comments
 (0)