Skip to content

[v8] Fix Windows build relocation error#3763

Merged
anujc25 merged 1 commit intocloudfoundry:v8from
anujc25:anujc/fix-windows-build
Apr 13, 2026
Merged

[v8] Fix Windows build relocation error#3763
anujc25 merged 1 commit intocloudfoundry:v8from
anujc25:anujc/fix-windows-build

Conversation

@anujc25
Copy link
Copy Markdown
Contributor

@anujc25 anujc25 commented Apr 13, 2026

Description of the Change

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.

Before the change:

❯ make out/cf-cli_win32.exe
make out/cf-cli_winx64.exe
rsrc -ico cf.ico -o rsrc.syso
GOARCH=386 GOOS=windows go build -tags="forceposix" -o out/cf-cli_win32.exe -ldflags "-w -s -X code.cloudfoundry.org/cli/v8/version.binarySHA=$(git rev-parse --short HEAD) -X code.cloudfoundry.org/cli/v8/version.binaryBuildDate=$(date -u +"%Y-%m-%d") -X code.cloudfoundry.org/cli/v8/version.binaryVersion=$(git describe --tags --abbrev=0)" .
# code.cloudfoundry.org/cli/v8
$WORK/b001/_pkg_.a(rsrc.syso): 814043: unknown relocation type 3
make: *** [out/cf-cli_win32.exe] Error 1
GOARCH=amd64 GOOS=windows go build -tags="forceposix" -o out/cf-cli_winx64.exe -ldflags "-w -s -X code.cloudfoundry.org/cli/v8/version.binarySHA=$(git rev-parse --short HEAD) -X code.cloudfoundry.org/cli/v8/version.binaryBuildDate=$(date -u +"%Y-%m-%d") -X code.cloudfoundry.org/cli/v8/version.binaryVersion=$(git describe --tags --abbrev=0)" .
rm rsrc.syso

After the change:

❯ make out/cf-cli_win32.exe
make out/cf-cli_winx64.exe
rsrc -arch 386 -ico cf.ico -o rsrc_windows_386.syso
GOARCH=386 GOOS=windows go build -tags="forceposix" -o out/cf-cli_win32.exe -ldflags "-w -s -X code.cloudfoundry.org/cli/v8/version.binarySHA=$(git rev-parse --short HEAD) -X code.cloudfoundry.org/cli/v8/version.binaryBuildDate=$(date -u +"%Y-%m-%d") -X code.cloudfoundry.org/cli/v8/version.binaryVersion=$(git describe --tags --abbrev=0)" .
rm rsrc_windows_386.syso
rsrc -arch amd64 -ico cf.ico -o rsrc_windows_amd64.syso
GOARCH=amd64 GOOS=windows go build -tags="forceposix" -o out/cf-cli_winx64.exe -ldflags "-w -s -X code.cloudfoundry.org/cli/v8/version.binarySHA=$(git rev-parse --short HEAD) -X code.cloudfoundry.org/cli/v8/version.binaryBuildDate=$(date -u +"%Y-%m-%d") -X code.cloudfoundry.org/cli/v8/version.binaryVersion=$(git describe --tags --abbrev=0)" .
rm rsrc_windows_amd64.syso

Why Is This PR Valuable?

Unblocks the release.

Applicable Issues

How Urgent Is The Change?

time-sensitive to unblock the release.

Other Relevant Parties

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.
@Gerg Gerg requested review from a team April 13, 2026 17:19
Copy link
Copy Markdown
Contributor

@vuil vuil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

Copy link
Copy Markdown
Contributor

@prkalle prkalle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@anujc25 anujc25 merged commit d6318e3 into cloudfoundry:v8 Apr 13, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants