Open wangkuiyi opened 1 year ago
The error went away after I commented out the -fuse-ld=ldd
option from the .bazelrc
file.
Is it a good idea to add a paragraph to https://github.com/llvm/llvm-project/blob/main/utils/bazel/README.md to explain this trick to contributors working on and for macOS?
@wangkuiyi I'm not too familiar with MacOS, but I've seen that there are two variants of Clang on MacOS. a stripped-down "AppleClang" and a "Clang" that you'd get from building Clang yourself. My guess is that generic_clang
will only work with the latter.
If the above is correct, WDYT about an apple_clang
config for users using "AppleClang"?
In Short
When I used Bazel on my M1 MacBook Pro to build the main branch, I got the following error.
I then built lld using CMake and installed it to
/usr/local/bin
and reset the PATH environment variable. After all these, the above error is still there.Details
Chip: Apple M1 Max macOS: Ventura 13.0.1 Xcode version: 14.1 (14B47b) MacOS SDK: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk
I followed the steps in https://github.com/llvm/llvm-project/blob/main/utils/bazel/README.md to build LLVM on the above system.
Here attaches the bazel build command-line, which includes the
--sandbox_debug
option so to print more details.I assumed that I do not have lld on my system, because when I ran Clang to build a hello world C program, it complains
I then built lld using CMake by following this document https://lld.llvm.org/. I copied
ld.lld
from the./build
directory to/usr/local/bin
and reset the PATH environment variable to/usr/local/bin:$PATH
. Unfortunately, the above problem is still there.