diff options
-rw-r--r-- | README.md | 10 | ||||
-rw-r--r-- | classes/clang.bbclass | 18 | ||||
-rw-r--r-- | conf/layer.conf | 2 | ||||
-rw-r--r-- | recipes-devtools/clang/clang_git.bb | 6 | ||||
-rw-r--r-- | recipes-devtools/clang/compiler-rt-sanitizers_git.bb | 2 | ||||
-rw-r--r-- | recipes-devtools/clang/libcxx_git.bb | 6 | ||||
-rw-r--r-- | recipes-extended/ghostscript/ghostscript_%.bbappend | 2 |
7 files changed, 23 insertions, 23 deletions
@@ -67,17 +67,17 @@ PROVIDES:pn-nativesdk-clang = "nativesdk-llvm" | |||
67 | ``` | 67 | ``` |
68 | # Default Compiler Runtime | 68 | # Default Compiler Runtime |
69 | 69 | ||
70 | Default is to use GNU runtime `RUNTIME = "gnu"` which consists of libgcc, libstdc++ to provide C/C++ | 70 | Default is to use GNU runtime `TC_CXX_RUNTIME = "gnu"` which consists of libgcc, libstdc++ to provide C/C++ |
71 | runtime support. However it's possible to use LLVM runtime to replace it where | 71 | runtime support. However it's possible to use LLVM runtime to replace it where |
72 | compile-rt, llvm libunwind, and libc++ are used to provide C/C++ runtime, while | 72 | compile-rt, llvm libunwind, and libc++ are used to provide C/C++ runtime, while |
73 | GNU runtime works with both GCC and Clang, LLVM runtime is only tested with Clang | 73 | GNU runtime works with both GCC and Clang, LLVM runtime is only tested with Clang |
74 | compiler, switching to use LLVM runtime is done via a config metadata knob | 74 | compiler, switching to use LLVM runtime is done via a config metadata knob |
75 | 75 | ||
76 | ```shell | 76 | ```shell |
77 | RUNTIME = "llvm" | 77 | TC_CXX_RUNTIME = "llvm" |
78 | ``` | 78 | ``` |
79 | 79 | ||
80 | RUNTIME variable influences individual runtime elements and can be set explicitly as well | 80 | TC_CXX_RUNTIME variable influences individual runtime elements and can be set explicitly as well |
81 | e.g. `LIBCPLUSPLUS` `COMPILER_RT` and `UNWINDLIB`. | 81 | e.g. `LIBCPLUSPLUS` `COMPILER_RT` and `UNWINDLIB`. |
82 | 82 | ||
83 | Please note that this will still use crt files from GNU compiler always, while llvm now | 83 | Please note that this will still use crt files from GNU compiler always, while llvm now |
@@ -85,8 +85,8 @@ do provide crt files, they have not been yet integrated into the toolchain. | |||
85 | 85 | ||
86 | # Default C++ Standard Library Switch | 86 | # Default C++ Standard Library Switch |
87 | 87 | ||
88 | Using RUNTIME variable will select which C++ runtime is used, however it can be overridden | 88 | Using TC_CXX_RUNTIME variable will select which C++ runtime is used, however it can be overridden |
89 | if needed to by modifying `LIBCPLUSPLUS` variable, usually defaults used by `RUNTIME` are | 89 | if needed to by modifying `LIBCPLUSPLUS` variable, usually defaults used by `TC_CXX_RUNTIME` are |
90 | best fit. e.g. below we select LLVM C++ as default C++ runtime. | 90 | best fit. e.g. below we select LLVM C++ as default C++ runtime. |
91 | 91 | ||
92 | ```shell | 92 | ```shell |
diff --git a/classes/clang.bbclass b/classes/clang.bbclass index 605bfd5..f0330b3 100644 --- a/classes/clang.bbclass +++ b/classes/clang.bbclass | |||
@@ -75,11 +75,11 @@ DEBUG_PREFIX_MAP:remove:toolchain-clang = "-fcanon-prefix-map" | |||
75 | # choose between 'gcc' 'clang' an empty '' can be used as well | 75 | # choose between 'gcc' 'clang' an empty '' can be used as well |
76 | TOOLCHAIN ??= "gcc" | 76 | TOOLCHAIN ??= "gcc" |
77 | # choose between 'gnu' 'llvm' | 77 | # choose between 'gnu' 'llvm' |
78 | RUNTIME ??= "gnu" | 78 | TC_CXX_RUNTIME ??= "gnu" |
79 | # Using gcc or llvm runtime is only available when using clang for compiler | 79 | # Using gcc or llvm runtime is only available when using clang for compiler |
80 | #RUNTIME:toolchain-gcc = "gnu" | 80 | #TC_CXX_RUNTIME:toolchain-gcc = "gnu" |
81 | RUNTIME:armeb = "gnu" | 81 | TC_CXX_RUNTIME:armeb = "gnu" |
82 | RUNTIME:armv5 = "gnu" | 82 | TC_CXX_RUNTIME:armv5 = "gnu" |
83 | 83 | ||
84 | TOOLCHAIN:class-native = "gcc" | 84 | TOOLCHAIN:class-native = "gcc" |
85 | TOOLCHAIN:class-nativesdk = "gcc" | 85 | TOOLCHAIN:class-nativesdk = "gcc" |
@@ -88,8 +88,8 @@ TOOLCHAIN:class-crosssdk = "gcc" | |||
88 | TOOLCHAIN:class-cross = "gcc" | 88 | TOOLCHAIN:class-cross = "gcc" |
89 | 89 | ||
90 | OVERRIDES =. "${@['', 'toolchain-${TOOLCHAIN}:']['${TOOLCHAIN}' != '']}" | 90 | OVERRIDES =. "${@['', 'toolchain-${TOOLCHAIN}:']['${TOOLCHAIN}' != '']}" |
91 | OVERRIDES =. "${@['', 'runtime-${RUNTIME}:']['${RUNTIME}' != '']}" | 91 | OVERRIDES =. "${@['', 'runtime-${TC_CXX_RUNTIME}:']['${TC_CXX_RUNTIME}' != '']}" |
92 | OVERRIDES[vardepsexclude] += "TOOLCHAIN RUNTIME" | 92 | OVERRIDES[vardepsexclude] += "TOOLCHAIN TC_CXX_RUNTIME" |
93 | 93 | ||
94 | YOCTO_ALTERNATE_EXE_PATH:toolchain-clang:class-target = "${STAGING_BINDIR}/llvm-config" | 94 | YOCTO_ALTERNATE_EXE_PATH:toolchain-clang:class-target = "${STAGING_BINDIR}/llvm-config" |
95 | YOCTO_ALTERNATE_LIBDIR:toolchain-clang:class-target = "/${BASELIB}" | 95 | YOCTO_ALTERNATE_LIBDIR:toolchain-clang:class-target = "/${BASELIB}" |
@@ -104,16 +104,16 @@ def clang_base_deps(d): | |||
104 | if not d.getVar('INHIBIT_DEFAULT_DEPS', False): | 104 | if not d.getVar('INHIBIT_DEFAULT_DEPS', False): |
105 | if not oe.utils.inherits(d, 'allarch') : | 105 | if not oe.utils.inherits(d, 'allarch') : |
106 | ret = " ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/libc " | 106 | ret = " ${MLPREFIX}clang-cross-${TARGET_ARCH} virtual/libc " |
107 | if (d.getVar('RUNTIME').find('android') != -1): | 107 | if (d.getVar('TC_CXX_RUNTIME').find('android') != -1): |
108 | ret += " libcxx" | 108 | ret += " libcxx" |
109 | return ret | 109 | return ret |
110 | if (d.getVar('RUNTIME').find('llvm') != -1): | 110 | if (d.getVar('TC_CXX_RUNTIME').find('llvm') != -1): |
111 | ret += " compiler-rt" | 111 | ret += " compiler-rt" |
112 | elif (d.getVar('COMPILER_RT').find('-rtlib=compiler-rt') != -1): | 112 | elif (d.getVar('COMPILER_RT').find('-rtlib=compiler-rt') != -1): |
113 | ret += " compiler-rt " | 113 | ret += " compiler-rt " |
114 | else: | 114 | else: |
115 | ret += " libgcc " | 115 | ret += " libgcc " |
116 | if (d.getVar('RUNTIME').find('llvm') != -1): | 116 | if (d.getVar('TC_CXX_RUNTIME').find('llvm') != -1): |
117 | ret += " libcxx" | 117 | ret += " libcxx" |
118 | elif (d.getVar('COMPILER_RT').find('--unwindlib=libunwind') != -1): | 118 | elif (d.getVar('COMPILER_RT').find('--unwindlib=libunwind') != -1): |
119 | ret += " libcxx " | 119 | ret += " libcxx " |
diff --git a/conf/layer.conf b/conf/layer.conf index 67baca0..3f1fee1 100644 --- a/conf/layer.conf +++ b/conf/layer.conf | |||
@@ -27,7 +27,7 @@ BBFILES_DYNAMIC += " \ | |||
27 | 27 | ||
28 | PREFERRED_PROVIDER_libgcc-initial = "libgcc-initial" | 28 | PREFERRED_PROVIDER_libgcc-initial = "libgcc-initial" |
29 | #PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs_forcevariable = "libcxx" | 29 | #PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs_forcevariable = "libcxx" |
30 | PREFERRED_PROVIDER_libunwind = "${@bb.utils.contains_any("RUNTIME", "llvm android", "libcxx", "libunwind", d)}" | 30 | PREFERRED_PROVIDER_libunwind = "${@bb.utils.contains_any("TC_CXX_RUNTIME", "llvm android", "libcxx", "libunwind", d)}" |
31 | INHERIT += "clang" | 31 | INHERIT += "clang" |
32 | 32 | ||
33 | # Do not include clang in SDK unless user wants to | 33 | # Do not include clang in SDK unless user wants to |
diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index f735090..1d9ff2e 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb | |||
@@ -57,11 +57,11 @@ def get_clang_experimental_target_arch(bb, d): | |||
57 | 57 | ||
58 | PACKAGECONFIG ??= "compiler-rt libcplusplus shared-libs lldb-wchar \ | 58 | PACKAGECONFIG ??= "compiler-rt libcplusplus shared-libs lldb-wchar \ |
59 | ${@bb.utils.filter('DISTRO_FEATURES', 'thin-lto lto', d)} \ | 59 | ${@bb.utils.filter('DISTRO_FEATURES', 'thin-lto lto', d)} \ |
60 | ${@bb.utils.contains('RUNTIME', 'llvm', 'compiler-rt libcplusplus unwindlib libomp', '', d)} \ | 60 | ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'compiler-rt libcplusplus unwindlib libomp', '', d)} \ |
61 | rtti eh libedit terminfo \ | 61 | rtti eh libedit terminfo \ |
62 | " | 62 | " |
63 | PACKAGECONFIG:class-native = "rtti eh libedit shared-libs ${@bb.utils.contains('RUNTIME', 'llvm', 'compiler-rt libcplusplus unwindlib libomp', '', d)}" | 63 | PACKAGECONFIG:class-native = "rtti eh libedit shared-libs ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'compiler-rt libcplusplus unwindlib libomp', '', d)}" |
64 | PACKAGECONFIG:class-nativesdk = "rtti eh libedit shared-libs ${@bb.utils.filter('DISTRO_FEATURES', 'thin-lto lto', d)} ${@bb.utils.contains('RUNTIME', 'llvm', 'compiler-rt libcplusplus unwindlib libomp', '', d)}" | 64 | PACKAGECONFIG:class-nativesdk = "rtti eh libedit shared-libs ${@bb.utils.filter('DISTRO_FEATURES', 'thin-lto lto', d)} ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'compiler-rt libcplusplus unwindlib libomp', '', d)}" |
65 | 65 | ||
66 | PACKAGECONFIG[compiler-rt] = "-DCLANG_DEFAULT_RTLIB=compiler-rt,," | 66 | PACKAGECONFIG[compiler-rt] = "-DCLANG_DEFAULT_RTLIB=compiler-rt,," |
67 | PACKAGECONFIG[libcplusplus] = "-DCLANG_DEFAULT_CXX_STDLIB=libc++,," | 67 | PACKAGECONFIG[libcplusplus] = "-DCLANG_DEFAULT_CXX_STDLIB=libc++,," |
diff --git a/recipes-devtools/clang/compiler-rt-sanitizers_git.bb b/recipes-devtools/clang/compiler-rt-sanitizers_git.bb index 6c413b2..bc72861 100644 --- a/recipes-devtools/clang/compiler-rt-sanitizers_git.bb +++ b/recipes-devtools/clang/compiler-rt-sanitizers_git.bb | |||
@@ -40,7 +40,7 @@ EXTRA_OECMAKE += "-DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |||
40 | -DCMAKE_C_COMPILER_TARGET=${HOST_ARCH}${HOST_VENDOR}-${HOST_OS}${HF} \ | 40 | -DCMAKE_C_COMPILER_TARGET=${HOST_ARCH}${HOST_VENDOR}-${HOST_OS}${HF} \ |
41 | -DCOMPILER_RT_BUILD_BUILTINS=OFF \ | 41 | -DCOMPILER_RT_BUILD_BUILTINS=OFF \ |
42 | -DCOMPILER_RT_INCLUDE_TESTS=OFF \ | 42 | -DCOMPILER_RT_INCLUDE_TESTS=OFF \ |
43 | -DSANITIZER_CXX_ABI_LIBNAME=${@bb.utils.contains("RUNTIME", "llvm", "libc++", "libstdc++", d)} \ | 43 | -DSANITIZER_CXX_ABI_LIBNAME=${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "libc++", "libstdc++", d)} \ |
44 | -DCOMPILER_RT_BUILD_XRAY=ON \ | 44 | -DCOMPILER_RT_BUILD_XRAY=ON \ |
45 | -DCOMPILER_RT_BUILD_SANITIZERS=ON \ | 45 | -DCOMPILER_RT_BUILD_SANITIZERS=ON \ |
46 | -DCOMPILER_RT_BUILD_LIBFUZZER=ON \ | 46 | -DCOMPILER_RT_BUILD_LIBFUZZER=ON \ |
diff --git a/recipes-devtools/clang/libcxx_git.bb b/recipes-devtools/clang/libcxx_git.bb index 13136fc..3d5ce54 100644 --- a/recipes-devtools/clang/libcxx_git.bb +++ b/recipes-devtools/clang/libcxx_git.bb | |||
@@ -10,7 +10,7 @@ require common-source.inc | |||
10 | 10 | ||
11 | inherit cmake cmake-native python3native | 11 | inherit cmake cmake-native python3native |
12 | 12 | ||
13 | PACKAGECONFIG ??= "compiler-rt exceptions ${@bb.utils.contains("RUNTIME", "llvm", "unwind unwind-shared", "", d)}" | 13 | PACKAGECONFIG ??= "compiler-rt exceptions ${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "unwind unwind-shared", "", d)}" |
14 | PACKAGECONFIG:append:armv5 = " no-atomics" | 14 | PACKAGECONFIG:append:armv5 = " no-atomics" |
15 | PACKAGECONFIG:remove:class-native = "compiler-rt" | 15 | PACKAGECONFIG:remove:class-native = "compiler-rt" |
16 | PACKAGECONFIG[unwind] = "-DLIBCXXABI_USE_LLVM_UNWINDER=ON -DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON,-DLIBCXXABI_USE_LLVM_UNWINDER=OFF,," | 16 | PACKAGECONFIG[unwind] = "-DLIBCXXABI_USE_LLVM_UNWINDER=ON -DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON,-DLIBCXXABI_USE_LLVM_UNWINDER=OFF,," |
@@ -50,7 +50,7 @@ LIC_FILES_CHKSUM = "file://libcxx/LICENSE.TXT;md5=55d89dd7eec8d3b4204b680e27da39 | |||
50 | " | 50 | " |
51 | 51 | ||
52 | OECMAKE_TARGET_COMPILE = "cxxabi cxx" | 52 | OECMAKE_TARGET_COMPILE = "cxxabi cxx" |
53 | OECMAKE_TARGET_INSTALL = "install-cxx install-cxxabi ${@bb.utils.contains("RUNTIME", "llvm", "install-unwind", "", d)}" | 53 | OECMAKE_TARGET_INSTALL = "install-cxx install-cxxabi ${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "install-unwind", "", d)}" |
54 | 54 | ||
55 | OECMAKE_SOURCEPATH = "${S}/llvm" | 55 | OECMAKE_SOURCEPATH = "${S}/llvm" |
56 | EXTRA_OECMAKE += "\ | 56 | EXTRA_OECMAKE += "\ |
@@ -97,7 +97,7 @@ ALLOW_EMPTY:${PN} = "1" | |||
97 | PROVIDES:append:runtime-llvm = " libunwind" | 97 | PROVIDES:append:runtime-llvm = " libunwind" |
98 | 98 | ||
99 | do_install:append() { | 99 | do_install:append() { |
100 | if ${@bb.utils.contains("RUNTIME", "llvm", "true", "false", d)} | 100 | if ${@bb.utils.contains("TC_CXX_RUNTIME", "llvm", "true", "false", d)} |
101 | then | 101 | then |
102 | for f in libunwind.h __libunwind_config.h unwind.h unwind_itanium.h unwind_arm_ehabi.h | 102 | for f in libunwind.h __libunwind_config.h unwind.h unwind_itanium.h unwind_arm_ehabi.h |
103 | do | 103 | do |
diff --git a/recipes-extended/ghostscript/ghostscript_%.bbappend b/recipes-extended/ghostscript/ghostscript_%.bbappend index c1496d0..49cf24e 100644 --- a/recipes-extended/ghostscript/ghostscript_%.bbappend +++ b/recipes-extended/ghostscript/ghostscript_%.bbappend | |||
@@ -1,7 +1,7 @@ | |||
1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" | 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" |
2 | 2 | ||
3 | do_configure:prepend:toolchain-clang () { | 3 | do_configure:prepend:toolchain-clang () { |
4 | if ${@bb.utils.contains('RUNTIME', 'llvm', 'true', 'false', d)}; then | 4 | if ${@bb.utils.contains('TC_CXX_RUNTIME', 'llvm', 'true', 'false', d)}; then |
5 | sed -i -e "s|-stdlib=libstdc++|-stdlib=libc++|g" ${S}/configure.ac | 5 | sed -i -e "s|-stdlib=libstdc++|-stdlib=libc++|g" ${S}/configure.ac |
6 | fi | 6 | fi |
7 | } | 7 | } |