Closed hikari-no-yume closed 1 year ago
Yeah, the USE_SYSTEM_LLVM stuff seems non-sensical to me on first glance. Perhaps it can be removed?
My experience was it worked properly on Ubuntu, so I'm wondering if it's some sort of workaround for weird distribution packaging. With that said, maybe it would work without the flag too. When I can use my Ubuntu machine again, I'll experiment a bit.
I checked, and if I do the same commenting out on my Ubuntu machine with the system packaged LLVM, it has its own linking errors. So it clearly has some purpose…
There's a couple different shared library configurations in the llvm cmake. I think this option is supposed to reflect one of them? (But for some reason doesn't just use the relevant flags themselves)
We now have a CI build that verifies using pre-built LLVM on MacOS #166
The precompiled LLVM 10 for macOS on llvm.org (https://releases.llvm.org/download.html#10.0.1) has many libraries beginning with “libLLVM” rather than a single libLLVM file.
I had no problems configuring with
cmake
once I specifiedLLVM_DIR
, but I got “Undefined symbols for architecture x86_64” when I tried to build it (make -j4 llvm-cbe
).The fix for me was to edit
tools/llvm-cbe/CMakeLists.txt
and comment out theif (NOT USE_SYSTEM_LLVM)
and matchingendif()
, and all the lines in theif(USE_SYSTEM_LLVM)
block.No idea why this is how it is, but it seems to work.
By contrast I didn't have this problem on Ubuntu with the LLVM package from the standard distribution repository.
I hope this is useful if anyone else encounters this issue.