Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

build of clang with LLVM_TARGETS_TO_BUILD set to X86 breaks when building clang shared library #41979

Closed Quuxplusone closed 5 years ago

Quuxplusone commented 5 years ago
Bugzilla Link PR43009
Status RESOLVED INVALID
Importance P normal
Reported by Jerry Scharf (jscharf@purestorage.com)
Reported on 2019-08-15 11:11:36 -0700
Last modified on 2019-08-19 10:52:29 -0700
Version 8.0
Hardware PC Linux
CC llvm-bugs@lists.llvm.org, tstellar@redhat.com
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
I was building clang 8.0.1 from source and tried using -
DLLVM_TARGETS_TO_BUILD="X86" as part of the cmake input along with shared
libraries. LLVM builds fine, the clang executable builds fine but the clang .so
fails, saying all the other arch entry points are missing. As soon as I change
X86 to all for both llvm and clang, it works fine. I am bootstrapping with
gcc9/ld first in this case.

cmake command for llvm:
 LD_LIBRARY_PATH="/usr/local/compilers/gcc9/lib64" cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/local/compilers/gcc9/bin/gcc -DCMAKE_CXX_COMPILER=/usr/local/compilers/gcc9/bin/g++ -DCMAKE_INSTALL_PREFIX=/usr/local/compilers/clang8 -DLLVM_TARGETS_TO_BUILD="all" -DLLVM_BUILD_LLVM_DYLIB=true -DLLVM_LINK_LLVM_DYLIB=true ../../llvm-8.0.1.src

clang:

LD_LIBRARY_PATH="/usr/local/compilers/gcc9/lib64" cmake -G "Unix Makefiles" -
DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/local/compilers/gcc9/bin/gcc -
DCMAKE_CXX_COMPILER=/usr/local/compilers/gcc9/bin/g++ -
DCMAKE_INSTALL_PREFIX=/usr/local/compilers/clang8 -DLLVM_TARGETS_TO_BUILD="all"
-DLLVM_BUILD_LLVM_DYLIB=true -DLLVM_LINK_LLVM_DYLIB=true -DCMAKE_C_FLAGS="-
L/usr/local/compilers/c
lang8/lib" -DCMAKE_CXX_FLAGS="-L/usr/local/compilers/clang8/lib" ../../cfe-
8.0.1.src
Quuxplusone commented 5 years ago

Were you passing -DLLVM_TARGETS_TO_BUILD="X86" to cmake when building both clang and llvm?

Quuxplusone commented 5 years ago

This was a configuration mistake on my part. I conformed that with the correct configuration, this is working correctly.