Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Pass -64 to goversioninfo on amd64 #6767

Closed
wants to merge 1 commit into from

Conversation

imsodin
Copy link
Member

@imsodin imsodin commented Jun 20, 2020

Trying to build syncthing on windows with mingw-w64 I got the following error:

 // c:\go\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1
// C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: i386 architecture of input file `C:\Users\2007p\AppData\Local\Temp\go-link-332898159\000000.o' is incompatible with i386:x86-64 output
// collect2.exe: error: ld returned 1 exit status

Passing -w64 to goversioninfo fixed that. However I am not sure which arch setting is relevant here: The host system (probably not), the c++ compiler binary or go target architecture. I would expect the latter (and proposed the change like that), however CI right now is building both 32 and 64 bit binaries for windows and it works, without the -64 flag.

@AudriusButkevicius
Copy link
Member

I don't see why we even need a C compiler. Pulling in badger introduced it, so I think we should just build with CGO_ENABLED=0 on windows.

@imsodin
Copy link
Member Author

imsodin commented Jun 20, 2020

Hmm, ok, didn't realize badger was the only thing using cgo. Annoying... Luckily that cgo requirement is hopefully going away soon on badger (dgraph-io/badger#1162), I wouldn't want to fork it to remove cgo...

But yeah, not having to go through the hassle of getting a C compiler setup in the first place is nice, so lets do CGO_ENABLED=0 instead.

@imsodin imsodin closed this Jun 20, 2020
@imsodin imsodin deleted the build/win64VerisonInfo branch June 20, 2020 12:25
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Jun 21, 2021
@syncthing syncthing locked and limited conversation to collaborators Jun 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants