clang: Allow user to add extra build target on class_target
PATCH 1/1 clang: Allow user to add extra build target on class_target
Originally TARGETS_TO_BUILD was limited to the target architecture, which is not enough to build code for heterogenous systems such as (in my case) AMDGPU.
--- recipes-devtools/clang/clang_git.bb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
recipes-devtools/clang/clang_git.bb +4 -1
@@ -62,6 +62,9 @@ PACKAGECONFIG[libcplusplus] = "-DCLANG_DEFAULT_CXX_STDLIB=libc++,,libcxx" LLVM_TARGETS_TO_BUILD ?= "AArch64;ARM;Mips;PowerPC;X86" LLVM_TARGETS_TO_BUILD_append = ";${@get_clang_host_arch(bb, d)};${@get_clang_target_arch(bb, d)}" +LLVM_TARGETS_TO_BUILD_TARGET ?= "" +LLVM_TARGETS_TO_BUILD_TARGET_append ?= "${@get_clang_target_arch(bb, d)}" + EXTRA_OECMAKE="-DLLVM_ENABLE_RTTI=True \ -DLLVM_ENABLE_EH=True \ -DLLVM_ENABLE_FFI=False \
@@ -84,7 +87,7 @@ EXTRA_OECMAKE_append_class-target = "\ -DLLVM_ENABLE_PIC=ON \ -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ -DCLANG_TABLEGEN=${STAGING_BINDIR_NATIVE}/clang-tblgen \ - -DLLVM_TARGETS_TO_BUILD=${@get_clang_target_arch(bb, d)} \ + -DLLVM_TARGETS_TO_BUILD='${LLVM_TARGETS_TO_BUILD_TARGET}' \ -DLLVM_TARGET_ARCH=${@get_clang_target_arch(bb, d)} \ -DLLVM_DEFAULT_TARGET_TRIPLE=${TARGET_SYS} \ "
Signature · 1 line
2.13.2
PATCH 1/1 clang: Fix name of .so file
When we are building an unreleased version the so name is:
libLLVM-MAJOR.MINORsvn.so
instead of just
libLLVM-MAJOR.MINOR.so
E.g.:
libLLVM-5.0svn.so
--- recipes-devtools/clang/clang_git.bb | 1 + 1 file changed, 1 insertion(+)
recipes-devtools/clang/clang_git.bb +1 -0
@@ -131,6 +131,7 @@ FILES_${PN} += "\ FILES_${PN}-libllvm += "\ ${libdir}/libLLVM-${MAJOR_VER}.${MINOR_VER}.so \ + ${libdir}/libLLVM-${MAJOR_VER}.${MINOR_VER}svn.so \ " FILES_${PN}-dev += "\
Signature · 1 line
2.13.2
PATCH 1/1 lld_git: Only apply -stdlib flag to clang toolchain
In reply to Ricardo Ribalda DelgadoGCC does not understand the stdlib flag. Resulting in this error during configuration:
| x86_64-poky-linux-g++: error: unrecognized command line option | '-stdlib=libc++'
--- recipes-devtools/clang/lld_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-devtools/clang/lld_git.bb +1 -1
@@ -34,7 +34,7 @@ OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH" EXTRA_OECMAKE = "\ -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ " -CXXFLAGS += "-stdlib=libc++" +CXXFLAGS_toolchain-clang += "-stdlib=libc++" do_compile() { cd ${B}/tools/lld
Signature · 1 line
2.13.2
PATCH 1/1 llvm-config: Fix implementation of --libs flag
In reply to Ricardo Ribalda Delgadollvm-config is called by mesa with the following parameters:
llvm-config --libs liba libb libc libd .....
This result in an invalid call of llvm config:
llvm-config --libs
llvm-config liba
llvm-config libb
llvm-config libc
....
Fix this use.
--- recipes-devtools/clang/llvm-common/llvm-config | 4 ++++ 1 file changed, 4 insertions(+)
recipes-devtools/clang/llvm-common/llvm-config +4 -0
@@ -14,6 +14,10 @@ if [[ $# == 0 ]]; then exec "$NEXT_LLVM_CONFIG" fi +if [[ $1 == "--libs" ]]; then + exec "$NEXT_LLVM_CONFIG" $@ +fi + for arg in "$@"; do case "$arg" in --cppflags)
Signature · 1 line
2.13.2