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

Build issue when using pre-compiled LLVM that is several files (not just libLLVM) #96

Closed
hikari-no-yume opened this issue Apr 21, 2021 · 5 comments

Comments

@hikari-no-yume
Copy link
Collaborator

hikari-no-yume commented Apr 21, 2021

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 specified LLVM_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 the if (NOT USE_SYSTEM_LLVM) and matching endif(), and all the lines in the if(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.

@vtjnash
Copy link
Member

vtjnash commented Apr 21, 2021

Yeah, the USE_SYSTEM_LLVM stuff seems non-sensical to me on first glance. Perhaps it can be removed?

@hikari-no-yume
Copy link
Collaborator Author

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.

@hikari-no-yume
Copy link
Collaborator Author

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…

@vtjnash
Copy link
Member

vtjnash commented Apr 24, 2021

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)

@dpaoliello
Copy link
Collaborator

We now have a CI build that verifies using pre-built LLVM on MacOS #166

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

3 participants