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

Running xgo on Mac M3 cross compiling to Linux x86_64 has a link error #124

Open
rcowham opened this issue Mar 27, 2024 · 0 comments
Open

Comments

@rcowham
Copy link

rcowham commented Mar 27, 2024

/usr/local/go/pkg/tool/linux_arm64/link: running x86_64-linux-gnu-gcc failed: exit status 1 /usr/lib/gcc-cross/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/bin/ld: cannot find /usr/lib/x86_64-linux-gnu/libm-2.31.a /usr/lib/gcc-cross/x86_64-linux-gnu/9/../../../../x86_64-linux-gnu/bin/ld: cannot find /usr/lib/x86_64-linux-gnu/libmvec.a

I discovered by looking inside the Docker container, that the relevant libraries were located in /usr/x86_64-linux-gnu/lib/

Tried a few things to fix, but ended up with modifying the Dockerfile and adding this near the end:

RUN ln -s /usr/x86_64-linux-gnu/lib/* /usr/lib/x86_64-linux-gnu/

Seems a bit clunky but works...

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

No branches or pull requests

1 participant