build: fix windows/amd64 build and icon/version embedding #4304

The parameters were being passed to goversioninfo in the wrong order
so that the 64 bit .syso was actually a 32 bit .syso thus calling the
linker to fail.
This commit is contained in:
Nick Craig-Wood 2020-06-18 15:01:33 +01:00
parent 5e6f4ab281
commit 33c8709439
2 changed files with 4 additions and 4 deletions

View File

@ -172,7 +172,7 @@ func buildDebAndRpm(dir, version, goarch string) []string {
}
// generate system object (syso) file to be picked up by a following go build for embedding icon and version info resources into windows executable
func buildWindowsResourceSyso(goarch string, versionTag string) (string) {
func buildWindowsResourceSyso(goarch string, versionTag string) string {
type M map[string]interface{}
version := strings.TrimPrefix(versionTag, "v")
semanticVersion := semver.New(version)
@ -238,11 +238,11 @@ func buildWindowsResourceSyso(goarch string, versionTag string) (string) {
"goversioninfo",
"-o",
sysoPath,
jsonPath,
}
if goarch == "amd64" {
args = append(args, "-64") // Make the syso a 64-bit coff file (but does not matter, results are identical)
args = append(args, "-64") // Make the syso a 64-bit coff file
}
args = append(args, jsonPath)
err = runEnv(args, nil)
if err != nil {
return ""

View File

@ -2,5 +2,5 @@
echo Setting environment variables for mingw+WinFsp compile
set GOPATH=Z:\go
rem set PATH=C:\Program Files\mingw-w64\i686-7.1.0-win32-dwarf-rt_v5-rev0\mingw32\bin;%PATH%
set PATH=C:\Program Files\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\bin;%PATH%
set PATH=C:\Program Files\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\bin;%GOPATH%/bin;%PATH%
set CPATH=C:\Program Files\WinFsp\inc\fuse;C:\Program Files (x86)\WinFsp\inc\fuse