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
cmd/link: command line too long running gcc #60183
Comments
Thanks for reporting this issue @jernejs. I can reproduce it with go1.20.2, but it seems to be unintentionally fixed on master thanks to https://go-review.googlesource.com/c/go/+/414654. Could you try building on master? You can get it like this: go install golang.org/dl/gotip@latest
gotip download And then use |
Unfortunately getting the latest golang doesn't seem to work – when I ran Note that I'm using msys2, because the program I'm trying to build depends on GTK4, and I have no desire to compile GTK and its dependencies myself. I'll test again once this lands in msys2, but from the description of 414654, it'll probably solve my problem. |
gotip will be in $GOPATH/bin |
OK, found it – for some reason $GOPATH points to my Windows user profile\go instead of inside msys2 root. Anyway, |
Could you build gtkcord4 with gotip? |
Sorry, I wasn't clear – gtkcord4 built fine with gotip. |
Then I'll close this issue as done. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Unsure how to test
What operating system and processor architecture are you using (
go env
)?Windows 11 22H2, msys2 environment
go env
OutputWhat did you do?
I tried building gtkcord4. The build works fine right up to the link step, where it fails with
W:\msys64-gtk4\mingw64\lib\go\pkg\tool\windows_amd64\link.exe: running gcc failed: fork/exec W:\msys64-gtk4\mingw64\bin\gcc.exe: The filename or extension is too long.
. Running the linker manually with -v parameter shows that it's trying to pass over 1000 .o files with full path to gcc, resulting in command line that's almost 60 kB, while the command line length in Windows is limited to 32 kB.What did you expect to see?
Successful link.
What did you see instead?
W:\msys64-gtk4\mingw64\lib\go\pkg\tool\windows_amd64\link.exe: running gcc failed: fork/exec W:\msys64-gtk4\mingw64\bin\gcc.exe: The filename or extension is too long.
Is there any way to tell link.exe to use a @response file instead?
The text was updated successfully, but these errors were encountered: