From 56c399be01a1fa78ad9c08498b736ec067efc25d Mon Sep 17 00:00:00 2001 From: Yi Fan Yu Date: Wed, 14 Apr 2021 14:38:22 -0400 Subject: 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 --- recipes-devtools/clang/llvm-project-source.inc | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'recipes-devtools') 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() { case = "" triple = "" vendors = d.getVar('CLANG_EXTRA_OE_VENDORS') + multilib_variants = d.getVar('MULTILIB_VARIANTS').split() + vendors_to_add = [] for vendor in vendors.split(): # convert -yoe into yoe vendor = vendor.lstrip('-') - if vendor == "oe": - continue - case += '\\n .Case("' + vendor + '", Triple::OpenEmbedded)' - triple += ' "x86_64-' + vendor + '-linux",' + # generate possible multilib vendor names for yoe + # such as yoemllib32 + vendors_to_add.extend([vendor + 'ml' + variant for variant in multilib_variants]) + # skip oe since already part of the cpp file + if vendor != "oe": + vendors_to_add.append(vendor) + + for vendor_to_add in vendors_to_add: + case += '\\n .Case("' + vendor_to_add + '", Triple::OpenEmbedded)' + triple += ' "x86_64-' + vendor_to_add + '-linux",' + + bb.note("Adding support following TARGET_VENDOR values") + bb.note(str(vendors_to_add)) + bb.note("in llvm/lib/Support/Triple.cpp and ${S}/clang/lib/Driver/ToolChains/Gnu.cpp") cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_VENDORS_TRIPLES#%s#g' ${S}/clang/lib/Driver/ToolChains/Gnu.cpp" % (triple)) subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_VENDORS_CASES#%s#g' -i ${S}/llvm/lib/Support/Triple.cpp" % (case)) -- cgit v1.2.3-54-g00ecf