From: João Marcos Costa Date: Tue, 23 Jun 2026 12:08:14 +0000 (+0200) Subject: llvm-project-source.inc: fix string replacements in do_preconfigure X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ada629665268db6a38030e4a03469183c19163fa;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git llvm-project-source.inc: fix string replacements in do_preconfigure 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 Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- 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) }