-
Notifications
You must be signed in to change notification settings - Fork 248
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
Apple Silicon can't build hiredis repo, error: ld: symbol(s) not found for architecture x86_64 #810
Comments
Here is the full log message in
|
I hit this when working on envoy as well, I believe the issue might be that the version of make being built here hasn't been updated itself to correctly support apple silicon since this script is deferring this to its build system, but I haven't dug in here |
Thank you for your response. I am wondering whether the guile used in the building process is the local guile or the guile in the sandbox. My local machine uses Make versions 4.3 and 3.81. The 4.3 was built on apple silicon and installed using Homebrew, the 3.81 might be installed using Xcode, so I think the 3.81 version supports apple silicon as well. Both of them work well on the hiredis repo. |
To temporarily workaround this you can tell rules_foreign_cc not to build these tools itself https://github.com/envoyproxy/envoy/blob/d60f86c6b54e4ba376f67474d4e5a11f2c8d4dfb/bazel/dependency_imports.bzl#L18 This isn't idea for reproducibility but might unblock you in the short term |
It works. I tried the command before, but I manually installed cmake in another path such that it raised an error. Now I am using homebrew's cmake, and all works very well. Thanks! |
#814 may help with this - it seems like make's configure script is escaping the sandbox (see references to homebrew guile) so by explicitly disabling this it will hopefully fix this issue on Apple Silicon (I don't have access to such a machine to test). |
Yes. It works after I set:
I reinstalled the cmake using bazel, previous I used alias to link my cmake in application, and it raised an error. By removing the alias in .zshrc, it works now. |
@poinwater that PR should remove the need to set |
You should also be able to remove |
Yes, I tested. It works without |
Environment
rules_foreign_cc: 0.6.0
Bazel: 4.2.1
MacOS: Big Sur 11.4
Cmake: 3.21.2
Make: 3.81
Guile: 3.0.7
WORDSPACE:
hiredis.BUILD
build command:
bazel build @hiredis//:hiredis
Error message:
Description
Hi, I tried to build the hiredis repo on my MacBook with Apple Silicon, but I got this error
ld: symbol(s) not found for architecture x86_64
.I thought the error may indicate my local Guile was built on x86_64, since the path is /opt/homebrew/opt/..; But my homebrew installation message shows the Guile was built on arm64, and my local cmake can build hiredis without problem.
I tried different versions' bazel and rules_foreign_cc, and tried to set
None of my attempts works, I got the same error message
ld: symbol(s) not found for architecture x86_64
again and again.I also tried to install guile from source, but I failed in the second step. In the second step of installation, I used
make check
command, and it shows three errors so I can't continually install guile.I noticed the building process freezes during the GNUmake Process, it might have issue.
FYI, I tried to build the examples in the rules_foreign_cc repository, and some examples built on apple silicon on the issue section, but I can't build any of them successfully.
Could you help me?
The text was updated successfully, but these errors were encountered: