diff options
author | Yi Fan Yu <yifan.yu@windriver.com> | 2021-04-14 14:38:22 -0400 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2021-04-15 13:31:18 -0700 |
commit | 56c399be01a1fa78ad9c08498b736ec067efc25d (patch) | |
tree | b6979a3ad10126135d0a30ab6860848bc02fdbb5 | |
parent | 8ece1206261505321572e2e05f7b19531ed17ba3 (diff) | |
download | meta-clang-56c399be01a1fa78ad9c08498b736ec067efc25d.tar.gz |
llvm-project-source: Add multilib vendor support
Generate all possible vendor name that a multilib build could use
by using the variable MULTILIB_VARIANTS.
ex: {TARGET_VENDOR} {TARGET_VENDOR}mllib32
Fixes build issue when compiling lib32-compiler-rt
where clang has issue detecting gcc toolchain.
when clang --print-search-dirs:
lib32-recipe-sysroot//usr/lib/i686-wrsmllib32-linux
should be
lib32-recipe-sysroot//usr/lib/i686-wrsmllib32-linux/10.2.0/
Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com>
-rw-r--r-- | recipes-devtools/clang/llvm-project-source.inc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/recipes-devtools/clang/llvm-project-source.inc b/recipes-devtools/clang/llvm-project-source.inc index 8ccc4b1..e4e0671 100644 --- a/recipes-devtools/clang/llvm-project-source.inc +++ b/recipes-devtools/clang/llvm-project-source.inc | |||
@@ -28,13 +28,25 @@ python add_distro_vendor() { | |||
28 | case = "" | 28 | case = "" |
29 | triple = "" | 29 | triple = "" |
30 | vendors = d.getVar('CLANG_EXTRA_OE_VENDORS') | 30 | vendors = d.getVar('CLANG_EXTRA_OE_VENDORS') |
31 | multilib_variants = d.getVar('MULTILIB_VARIANTS').split() | ||
32 | vendors_to_add = [] | ||
31 | for vendor in vendors.split(): | 33 | for vendor in vendors.split(): |
32 | # convert -yoe into yoe | 34 | # convert -yoe into yoe |
33 | vendor = vendor.lstrip('-') | 35 | vendor = vendor.lstrip('-') |
34 | if vendor == "oe": | 36 | # generate possible multilib vendor names for yoe |
35 | continue | 37 | # such as yoemllib32 |
36 | case += '\\n .Case("' + vendor + '", Triple::OpenEmbedded)' | 38 | vendors_to_add.extend([vendor + 'ml' + variant for variant in multilib_variants]) |
37 | triple += ' "x86_64-' + vendor + '-linux",' | 39 | # skip oe since already part of the cpp file |
40 | if vendor != "oe": | ||
41 | vendors_to_add.append(vendor) | ||
42 | |||
43 | for vendor_to_add in vendors_to_add: | ||
44 | case += '\\n .Case("' + vendor_to_add + '", Triple::OpenEmbedded)' | ||
45 | triple += ' "x86_64-' + vendor_to_add + '-linux",' | ||
46 | |||
47 | bb.note("Adding support following TARGET_VENDOR values") | ||
48 | bb.note(str(vendors_to_add)) | ||
49 | bb.note("in llvm/lib/Support/Triple.cpp and ${S}/clang/lib/Driver/ToolChains/Gnu.cpp") | ||
38 | cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_VENDORS_TRIPLES#%s#g' ${S}/clang/lib/Driver/ToolChains/Gnu.cpp" % (triple)) | 50 | cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_VENDORS_TRIPLES#%s#g' ${S}/clang/lib/Driver/ToolChains/Gnu.cpp" % (triple)) |
39 | subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) | 51 | subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) |
40 | cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_VENDORS_CASES#%s#g' -i ${S}/llvm/lib/Support/Triple.cpp" % (case)) | 52 | cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_VENDORS_CASES#%s#g' -i ${S}/llvm/lib/Support/Triple.cpp" % (case)) |