summaryrefslogtreecommitdiffstats
path: root/classes/clang.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'classes/clang.bbclass')
-rw-r--r--classes/clang.bbclass43
1 files changed, 37 insertions, 6 deletions
diff --git a/classes/clang.bbclass b/classes/clang.bbclass
index f6cb648..b560289 100644
--- a/classes/clang.bbclass
+++ b/classes/clang.bbclass
@@ -1,10 +1,41 @@
1
2# Add the necessary override 1# Add the necessary override
3TOOLCHAINOVERRIDES = ":toolchain-${TOOLCHAIN}" 2CC_toolchain-clang = "${TARGET_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
4TOOLCHAINOVERRIDES[vardepsexclude] = "TOOLCHAIN" 3CXX_toolchain-clang = "${TARGET_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
4CPP_toolchain-clang = "${TARGET_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} -E"
5CCLD_toolchain-clang = "${TARGET_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
6THUMB_TUNE_CCARGS_remove_toolchain-clang = "-mthumb-interwork"
7TUNE_CCARGS_append_toolchain-clang = " -D__extern_always_inline=inline -no-integrated-as"
8
9TOOLCHAIN_OPTIONS_append_toolchain-clang_class-nativesdk_x86-64 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux-x86-64.so.2"
10TOOLCHAIN_OPTIONS_append_toolchain-clang_class-nativesdk_x86 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux.so.2"
11
12# choose between 'gcc' 'clang' an empty '' can be used as well
13TOOLCHAIN ??= "clang"
14
15TOOLCHAIN_class-native = "gcc"
16
17OVERRIDES .= "${@['', ':toolchain-${TOOLCHAIN}']['${TOOLCHAIN}' != '']}"
18OVERRIDES[vardepsexclude] += "TOOLCHAIN"
19
20#DEPENDS_append_toolchain-clang_class-target = " clang-cross-${TARGET_ARCH} "
21#DEPENDS_remove_toolchain-clang_allarch = "clang-cross-${TARGET_ARCH}"
22
23def clang_dep_prepend(d):
24 #
25 # Ideally this will check a flag so we will operate properly in
26 # the case where host == build == target, for now we don't work in
27 # that case though.
28 #
5 29
6OVERRIDES .= "${TOOLCHAINOVERRIDES}" 30 deps = ""
7OVERRIDES[vardepsexclude] += "TOOLCHAINOVERRIDES" 31 # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command. Whether or not
32 # we need that built is the responsibility of the patch function / class, not
33 # the application.
34 if not d.getVar('INHIBIT_DEFAULT_DEPS', False):
35 if not oe.utils.inherits(d, 'allarch'):
36 deps += " clang-cross-${TARGET_ARCH} "
37 return deps
8 38
9require conf/clang.conf 39CLANGDEPENDS = "${@clang_dep_prepend(d)}"
10 40
41DEPENDS_prepend_toolchain-clang_class-target = "${CLANGDEPENDS} "