From bfa67c067f749e6cc9c0733a03207fb77d4e175f Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 30 Sep 2019 10:34:07 -0700 Subject: clang-runtime: Use INHIBIT_DEFAULT_DEPS = "1" This ensures that clang-runtime elements e.g. llvm-libunwind can be used with gcc as well Signed-off-by: Khem Raj --- classes/clang.bbclass | 14 ++++++++++---- recipes-devtools/clang/compiler-rt_git.bb | 4 +++- recipes-devtools/clang/libcxx_git.bb | 3 +++ recipes-devtools/clang/llvm-libunwind.bb | 4 +++- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/classes/clang.bbclass b/classes/clang.bbclass index a8f2c90..2e5bab1 100644 --- a/classes/clang.bbclass +++ b/classes/clang.bbclass @@ -60,7 +60,7 @@ OVERRIDES[vardepsexclude] += "TOOLCHAIN" #DEPENDS_append_toolchain-clang_class-target = " clang-cross-${TARGET_ARCH} " #DEPENDS_remove_toolchain-clang_allarch = "clang-cross-${TARGET_ARCH}" -def clang_dep_prepend(d): +def clang_base_deps(d): if not d.getVar('INHIBIT_DEFAULT_DEPS', False): if not oe.utils.inherits(d, 'allarch') : ret = " clang-cross-${TARGET_ARCH} virtual/libc " @@ -79,10 +79,16 @@ def clang_dep_prepend(d): def clang_remove_deps(d): ret = "" - if (d.getVar('COMPILER_RT').find('--unwindlib=libunwind') != -1): + if (d.getVar('UNWINDLIB').find('--unwindlib=libunwind') != -1): ret += "libunwind" return ret -BASE_DEFAULT_DEPS_toolchain-clang_class-target = "${@clang_dep_prepend(d)}" -DEPENDS_remove_toolchain-clang_class-target = "${@clang_remove_deps(d)}" +def clang_add_deps(d): + ret = "" + if (d.getVar('UNWINDLIB').find('--unwindlib=libunwind') != -1): + ret += " llvm-libunwind " + return ret +BASE_DEFAULT_DEPS_toolchain-clang_class-target = "${@clang_base_deps(d)}" +DEPENDS_remove_class-target = "${@clang_remove_deps(d)}" +BASE_DEFAULT_DEPS_append_class-target = "${@clang_add_deps(d)}" diff --git a/recipes-devtools/clang/compiler-rt_git.bb b/recipes-devtools/clang/compiler-rt_git.bb index c24329c..3d335ef 100644 --- a/recipes-devtools/clang/compiler-rt_git.bb +++ b/recipes-devtools/clang/compiler-rt_git.bb @@ -17,7 +17,9 @@ LIBCPLUSPLUS = "" COMPILER_RT = "" TUNE_CCARGS_remove = "-no-integrated-as" -DEPENDS += "ninja-native" +INHIBIT_DEFAULT_DEPS = "1" + +DEPENDS += "ninja-native clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc virtual/${TARGET_PREFIX}compilerlibs" DEPENDS_append_class-nativesdk = " clang-native" THUMB_TUNE_CCARGS = "" diff --git a/recipes-devtools/clang/libcxx_git.bb b/recipes-devtools/clang/libcxx_git.bb index 6d94ac4..ed07f2e 100644 --- a/recipes-devtools/clang/libcxx_git.bb +++ b/recipes-devtools/clang/libcxx_git.bb @@ -11,9 +11,12 @@ require common-source.inc inherit cmake pythonnative DEPENDS += "ninja-native" +DEPENDS += "ninja-native compiler-rt clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc virtual/${TARGET_PREFIX}compilerlibs llvm-libunwind" LIBCPLUSPLUS = "" +INHIBIT_DEFAULT_DEPS = "1" + LIC_FILES_CHKSUM = "file://libcxx/LICENSE.TXT;md5=55d89dd7eec8d3b4204b680e27da3953 \ file://libcxxabi/LICENSE.TXT;md5=7b9334635b542c56868400a46b272b1e \ " diff --git a/recipes-devtools/clang/llvm-libunwind.bb b/recipes-devtools/clang/llvm-libunwind.bb index 7dbdf4f..49e060b 100644 --- a/recipes-devtools/clang/llvm-libunwind.bb +++ b/recipes-devtools/clang/llvm-libunwind.bb @@ -11,9 +11,10 @@ require common-source.inc inherit cmake pythonnative DEPENDS += "ninja-native" - +DEPENDS += "ninja-native compiler-rt clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc virtual/${TARGET_PREFIX}compilerlibs" LIBCPLUSPLUS = "" UNWINDLIB = "" +INHIBIT_DEFAULT_DEPS = "1" COMPATIBLE_HOST_powerpc = "null" COMPATIBLE_HOST_riscv32 = "null" @@ -32,6 +33,7 @@ EXTRA_OECMAKE += "\ -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY=OFF \ -DLIBCXXABI_LIBUNWIND_INCLUDES=${S}/projects/libunwind/include \ -DLIBUNWIND_ENABLE_THREADS=OFF \ + -DLIBUNWIND_WEAK_PTHREAD_LIB=ON \ -DLIBUNWIND_ENABLE_CROSS_UNWINDING=ON \ -DLLVM_ENABLE_LIBCXX=ON \ -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${S}/libcxxabi/include \ -- cgit v1.2.3-54-g00ecf