-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
linker error using zig cc with Go tests using race detection (again, __popcountdi2 not defined) #14989
Comments
Zig's compiler_rt does provide this symbol, and zig will unconditionally provide compiler_rt when it is used as a linker. I don't know why this symbol would be missing. Perhaps a helpful next step would be to examine the linker line. |
It looks like Go does not invoke Zig as linker. Instead it picks up Here's the end of the build log (verbosity is enabled in the repo linked above, so can easily be reproduced):
And indeed |
I got the following error while compiling a Go fyne application with latest Go 1.20 and zig 0.11.0-dev.632+d69e97ae1:
Do you think it could be the same problem? It only affect build for Linux all other OS are fine. |
@Bluebugs Looks different, in your case the error is emitted by |
Thanks, I will open a new bug report for this then. |
This has been fixed as of 7e6aeea
There is one unsolved issue in Go when it's using the internal linker, reported in golang/go#59735. May be the same issue. |
I upgraded zig to 0.11.0, and still get this error. Anything else I'm missing?
Here is my environment:
|
I'm getting the same error as above with
|
Zig Version
0.11.0-dev.1987+a2c6ecd6d
Steps to Reproduce and Observed Behavior
I'm not sure it's not a Go bug again, so please help me investigate.
CC='zig cc' go test -race .
fails for me inmaster
build with the failure different from #11398:This is with Go 1.20.1 that includes fix for golang/go#52690
This symbol is present in Go repository in a single file:
src/runtime/race/internal/amd64v1/race_linux.syso
. Indeed, bumping version of amd64 ISA usingGOAMD64=v3
makes this problem disappear.The repository with reproducer (using Docker to make sure no host libraries can be accidentally linked): https://github.com/misha-ridge/zig-race-test-repo, just clone and
docker build .
to reproduce.Expected Behavior
CC='zig cc' go test -race .
works.The text was updated successfully, but these errors were encountered: