diff mbox series

[1/4] llvm-project-source.inc: fix string replacements in do_preconfigure

Message ID 20260622132021.37598-2-joaomarcos.costa@bootlin.com
State Under Review
Headers show
Series llvm/clang: fix some syntax issues in llvm-project-source | expand

Commit Message

João Marcos Costa June 22, 2026, 1:20 p.m. UTC
Both CLANG_EXTRA_OE_DISTRO_CASE and CLANG_EXTRA_OE_DISTRO_TRIPLE are
added by the same patch:

0016-llvm-clang-Insert-anchor-for-adding-OE-distro-vendor.patch

and they are supposed to be replaced by a couple of sed commands in
do_preconfigure. However, sed looks for CLANG_EXTRA_OE_DISTRO_CASES (and
CLANG_EXTRA_OE_DISTRO_TRIPLES) and since none is found, the code is left
with the dangling comment like so:

@ clang/lib/Driver/ToolChains/Linux.cpp
82     if (TargetEnvironment == llvm::Triple::GNUX32)
83       return "x86_64-linux-gnux32";
84     //CLANG_EXTRA_OE_DISTRO_TRIPLE
85     return "x86_64-linux-gnu";

Fix that by removing the 'S' in the end of ..._CASES and ..._TRIPLES.

Another way to fix this would be to directly change the patch, but
simply changing do_preconfigure feels cleaner.

Signed-off-by: João Marcos Costa <joaomarcos.costa@bootlin.com>
---
 meta/recipes-devtools/clang/llvm-project-source.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/recipes-devtools/clang/llvm-project-source.inc b/meta/recipes-devtools/clang/llvm-project-source.inc
index ba6cbf9a8d..6540d1cc7c 100644
--- a/meta/recipes-devtools/clang/llvm-project-source.inc
+++ b/meta/recipes-devtools/clang/llvm-project-source.inc
@@ -82,9 +82,9 @@  python do_preconfigure() {
     subprocess.check_output(cmd, stderr=subprocess.STDOUT)
     cmd = ['sed', '-i', 's#//CLANG_EXTRA_OE_DISTRO_CHECK#%s#g' % check, source + '/clang/include/clang/Driver/Distro.h']
     subprocess.check_output(cmd, stderr=subprocess.STDOUT)
-    cmd = ['sed', '-i', 's#//CLANG_EXTRA_OE_DISTRO_TRIPLES#%s#g' % triple, source + '/clang/lib/Driver/ToolChains/Linux.cpp']
+    cmd = ['sed', '-i', 's#//CLANG_EXTRA_OE_DISTRO_TRIPLE#%s#g' % triple, source + '/clang/lib/Driver/ToolChains/Linux.cpp']
     subprocess.check_output(cmd, stderr=subprocess.STDOUT)
-    cmd = ['sed', '-i', 's#//CLANG_EXTRA_OE_DISTRO_CASES#%s#g' % case, source + '/clang/lib/Driver/Distro.cpp']
+    cmd = ['sed', '-i', 's#//CLANG_EXTRA_OE_DISTRO_CASE#%s#g' % case, source + '/clang/lib/Driver/Distro.cpp']
     subprocess.check_output(cmd, stderr=subprocess.STDOUT)
 }