summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2021-03-27 11:22:07 -0700
committerKhem Raj <raj.khem@gmail.com>2021-03-30 13:02:50 -0700
commit9d190cb3b31ce9b959302f28933f8cddef701497 (patch)
tree5bb9fe1e3ab61187f0ff2cb0f4767c7a2d4e9904
parentf234d64d3b22e09792011e620c431e8df126b460 (diff)
downloadmeta-clang-9d190cb3b31ce9b959302f28933f8cddef701497.tar.gz
llvm-project-source: Re-implement add_more_target_vendors in python
This is to avoid a ton of shell variables becoming dependencies Add every case in a new line Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--recipes-devtools/clang/clang/0026-For-x86_64-set-Yocto-based-GCC-install-search-path.patch6
-rw-r--r--recipes-devtools/clang/llvm-project-source.inc31
2 files changed, 21 insertions, 16 deletions
diff --git a/recipes-devtools/clang/clang/0026-For-x86_64-set-Yocto-based-GCC-install-search-path.patch b/recipes-devtools/clang/clang/0026-For-x86_64-set-Yocto-based-GCC-install-search-path.patch
index dd4317f..dd5a9a2 100644
--- a/recipes-devtools/clang/clang/0026-For-x86_64-set-Yocto-based-GCC-install-search-path.patch
+++ b/recipes-devtools/clang/clang/0026-For-x86_64-set-Yocto-based-GCC-install-search-path.patch
@@ -56,15 +56,13 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
56 clang/lib/Driver/ToolChains/Gnu.cpp | 1 + 56 clang/lib/Driver/ToolChains/Gnu.cpp | 1 +
57 1 file changed, 1 insertion(+) 57 1 file changed, 1 insertion(+)
58 58
59diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
60index 05d1d3003881..e56812145e6d 100644
61--- a/clang/lib/Driver/ToolChains/Gnu.cpp 59--- a/clang/lib/Driver/ToolChains/Gnu.cpp
62+++ b/clang/lib/Driver/ToolChains/Gnu.cpp 60+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
63@@ -2109,6 +2109,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( 61@@ -2109,6 +2109,7 @@ void Generic_GCC::GCCInstallationDetecto
64 "x86_64-redhat-linux", "x86_64-suse-linux", 62 "x86_64-redhat-linux", "x86_64-suse-linux",
65 "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", 63 "x86_64-manbo-linux-gnu", "x86_64-linux-gnu",
66 "x86_64-slackware-linux", "x86_64-unknown-linux", 64 "x86_64-slackware-linux", "x86_64-unknown-linux",
67+ "x86_64-oe-linux", //CLANG_EXTRA_OE_VENDORS_TRIPLES 65+ "x86_64-oe-linux",//CLANG_EXTRA_OE_VENDORS_TRIPLES
68 "x86_64-amazon-linux", "x86_64-linux-android"}; 66 "x86_64-amazon-linux", "x86_64-linux-android"};
69 static const char *const X32LibDirs[] = {"/libx32"}; 67 static const char *const X32LibDirs[] = {"/libx32"};
70 static const char *const X86LibDirs[] = {"/lib32", "/lib"}; 68 static const char *const X86LibDirs[] = {"/lib32", "/lib"};
diff --git a/recipes-devtools/clang/llvm-project-source.inc b/recipes-devtools/clang/llvm-project-source.inc
index c954f4e..8ccc4b1 100644
--- a/recipes-devtools/clang/llvm-project-source.inc
+++ b/recipes-devtools/clang/llvm-project-source.inc
@@ -19,19 +19,26 @@ INHIBIT_DEFAULT_DEPS = "1"
19DEPENDS = "" 19DEPENDS = ""
20PACKAGES = "" 20PACKAGES = ""
21 21
22# additional TARGET_VENDOR values we want to support 22# space separated list of additional distro vendor values we want to support e.g.
23# "yoe webos" or "-yoe -webos" '-' is optional
23CLANG_EXTRA_OE_VENDORS ?= "${TARGET_VENDOR}" 24CLANG_EXTRA_OE_VENDORS ?= "${TARGET_VENDOR}"
24 25
25add_more_target_vendors() { 26python add_distro_vendor() {
26 local cases="" triples="" 27 import subprocess
27 for dash_vendor in ${CLANG_EXTRA_OE_VENDORS}; do 28 case = ""
28 vendor=`echo $dash_vendor | sed 's/^-//g'` 29 triple = ""
29 cases="$cases.Case(\"$vendor\", Triple::OpenEmbedded)" 30 vendors = d.getVar('CLANG_EXTRA_OE_VENDORS')
30 triples="$triples\"x86_64-$vendor-linux\"," 31 for vendor in vendors.split():
31 done 32 # convert -yoe into yoe
32 bbnote "Adding support following TARGET_VENDOR values: ${CLANG_EXTRA_OE_VENDORS} in ${S}/llvm/lib/Support/Triple.cpp and ${S}/clang/lib/Driver/ToolChains/Gnu.cpp" 33 vendor = vendor.lstrip('-')
33 sed "s#//CLANG_EXTRA_OE_VENDORS_CASES#$cases#g" -i ${S}/llvm/lib/Support/Triple.cpp 34 if vendor == "oe":
34 sed "s#//CLANG_EXTRA_OE_VENDORS_TRIPLES#$triples#g" -i ${S}/clang/lib/Driver/ToolChains/Gnu.cpp 35 continue
36 case += '\\n .Case("' + vendor + '", Triple::OpenEmbedded)'
37 triple += ' "x86_64-' + vendor + '-linux",'
38 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)
40 cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_VENDORS_CASES#%s#g' -i ${S}/llvm/lib/Support/Triple.cpp" % (case))
41 subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
35} 42}
36 43
37do_patch[postfuncs] += "add_more_target_vendors" 44do_patch[postfuncs] += "add_distro_vendor"