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

please document how llvm is expected to be built for linking #26

Open
matthiaskrgr opened this issue Jan 7, 2018 · 3 comments
Open

Comments

@matthiaskrgr
Copy link

matthiaskrgr commented Jan 7, 2018

Hi, I have my own setup of llvm/clang and enforce its use using CXX/CC flags.

When building osmesa-src I can see it finds directory where my custom llvm lives

        LLVM_CFLAGS:     -I/home/matthias/LLVM/LLVM_5_1/stage_2/build/include   -DLLVM_BUILD_GLOBAL_ISEL -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
        LLVM_CXXFLAGS:   -I/home/matthias/LLVM/LLVM_5_1/stage_2/build/include -std=c++11 -fno-rtti -DLLVM_BUILD_GLOBAL_ISEL -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
        LLVM_CPPFLAGS:   -I/home/matthias/LLVM/LLVM_5_1/stage_2/build/include   -DLLVM_BUILD_GLOBAL_ISEL -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
        LLVM_LDFLAGS:    -L/home/matthias/LLVM/LLVM_5_1/stage_2/build/lib64 

but it fails linking against it

--- stderr
llvm-config: error: missing: /home/matthias/LLVM/LLVM_5_1/stage_2/build/lib64/libLLVMDemangle.so
llvm-config: error: missing: /home/matthias/LLVM/LLVM_5_1/stage_2/build/lib64/libLLVMSupport.so
llvm-config: error: missing: /home/matthias/LLVM/LLVM_5_1/stage_2/build/lib64/libLLVMBinaryFormat.so
llvm-config: error: missing: /home/matthias/LLVM/LLVM_5_1/stage_2/build/lib64/libLLVMCore.so
llvm-config: error: missing: /home/matthias/LLVM/LLVM_5_1/stage_2/build/lib64/libLLVMBitReader.so
llvm-config: error: missing: /home/matthias/LLVM/LLVM_5_1/stage_2/build/lib64/libLLVMMC.so
llvm-config: error: missing: /home/matthias/LLVM/LLVM_5_1/stage_2/build/lib64/libLLVMMCParser.so
llvm-config: error: missing: /home/matthias/LLVM/LLVM_5_1/stage_2/build/lib64/libLLVMObject.so
....

I tried building llvm with LLVM_BUILD_LLVM_DYLIB but that didn't help. https://llvm.org/docs/CMake.html

How does osmesa-src expect llvm to be compiled?

EDIT: also: what llvm versions are required/supported? travis uses 3.9 it seems, I am using 5.0.1.

@emilio
Copy link
Member

emilio commented Jan 10, 2018

I think LLVMCore and such should really be there. You could link statically with --disable-llvm-shared-libs, but that's usually not recommended.

You could pass down to configure, but I'd really try to figure out why your LLVM libraries are not built. On a local debug build of clang trunk I get libLLVMCore.so, for example.

There's extra docs on https://www.mesa3d.org/llvmpipe.html.

Any recent clang version >= 3.9 should be supported, modulo trunk which sometimes breaks (and thus needs a OsMesa update).

Sorry for the lag replying here, happy to help more if I can.

@matthiaskrgr
Copy link
Author

I just tried the meson branch and it seems to build fine with that!

@peteasa
Copy link

peteasa commented Jun 23, 2020

Ref: https://llvm.org/docs/CMake.html

LLVM_BUILD_LLVM_DYLIB:BOOL -> all of LLVM’s components in a single shared library

BUILD_SHARED_LIBS -> each LLVM component is built as a shared library (only recommended for use by LLVM developers)

So to fix the build try building LLVM with BUILD_SHARED_LIBS configured!

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