* [PATCH v5 1/5] clang-native: Add class to use clang as native compiler
@ 2025-07-02 5:32 Khem Raj
2025-07-02 5:32 ` [PATCH v5 2/5] base.bbclass: Deferred inherit native toolchain class Khem Raj
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Khem Raj @ 2025-07-02 5:32 UTC (permalink / raw)
To: openembedded-core; +Cc: Khem Raj
Some recipes demand full clang/llvm builds e.g. chromium we need to use
clang as native toolchain. This class collects all needed bits to enable
OE built clang to provide the clang native toolchain
Setting
TOOLCHAIN_NATIVE = "clang"
in recipe will chose clang for native toolchain
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/classes/toolchain/clang-native.bbclass | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
create mode 100644 meta/classes/toolchain/clang-native.bbclass
diff --git a/meta/classes/toolchain/clang-native.bbclass b/meta/classes/toolchain/clang-native.bbclass
new file mode 100644
index 00000000000..4de491a1cb5
--- /dev/null
+++ b/meta/classes/toolchain/clang-native.bbclass
@@ -0,0 +1,18 @@
+BUILD_CC = "${CCACHE}${BUILD_PREFIX}clang ${BUILD_CC_ARCH}"
+BUILD_CXX = "${CCACHE}${BUILD_PREFIX}clang++ ${BUILD_CC_ARCH}"
+BUILD_FC = "${BUILD_PREFIX}gfortran ${BUILD_CC_ARCH}"
+BUILD_CPP = "${BUILD_PREFIX}clang ${BUILD_CC_ARCH} -E"
+BUILD_LD = "${BUILD_PREFIX}ld ${BUILD_LD_ARCH}"
+BUILD_CCLD = "${BUILD_PREFIX}clang ${BUILD_CC_ARCH}"
+BUILD_AR = "${BUILD_PREFIX}llvm-ar"
+BUILD_AS = "${BUILD_PREFIX}as ${BUILD_AS_ARCH}"
+BUILD_RANLIB = "${BUILD_PREFIX}llvm-ranlib -D"
+BUILD_STRIP = "${BUILD_PREFIX}llvm-strip"
+BUILD_OBJCOPY = "${BUILD_PREFIX}llvm-objcopy"
+BUILD_OBJDUMP = "${BUILD_PREFIX}llvm-objdump"
+BUILD_NM = "${BUILD_PREFIX}llvm-nm"
+BUILD_READELF = "${BUILD_PREFIX}llvm-readelf"
+
+DEPENDS += "clang-native libcxx-native compiler-rt-native"
+
+LDFLAGS += " --rtlib=libgcc --unwindlib=libgcc"
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v5 2/5] base.bbclass: Deferred inherit native toolchain class
2025-07-02 5:32 [PATCH v5 1/5] clang-native: Add class to use clang as native compiler Khem Raj
@ 2025-07-02 5:32 ` Khem Raj
2025-07-02 5:32 ` [PATCH v5 3/5] compiler-rt,libcxx: Use clang for native versions as well Khem Raj
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Khem Raj @ 2025-07-02 5:32 UTC (permalink / raw)
To: openembedded-core; +Cc: Khem Raj
use TOOLCHAIN_NATIVE variable for selecting native compiler
Default it to PREFERRED_TOOLCHAIN_NATIVE, a recipe which wants
to enforce a toolchain can do so with
for cross toolchains ( e.g. target, nativesdk )
TOOLCHAIN = "gcc"
For native
TOOLCHAIN_NATIVE = "gcc"
This helps build native recipe with clang as native compiler.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/classes-global/base.bbclass | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass
index ac145d9fd64..6be1f5c2df2 100644
--- a/meta/classes-global/base.bbclass
+++ b/meta/classes-global/base.bbclass
@@ -30,8 +30,9 @@ PREFERRED_TOOLCHAIN:class-crosssdk = "${PREFERRED_TOOLCHAIN_SDK}"
PREFERRED_TOOLCHAIN:class-nativesdk = "${PREFERRED_TOOLCHAIN_SDK}"
TOOLCHAIN ??= "${PREFERRED_TOOLCHAIN}"
+TOOLCHAIN_NATIVE ??= "${PREFERRED_TOOLCHAIN_NATIVE}"
-inherit toolchain/gcc-native
+inherit_defer toolchain/${TOOLCHAIN_NATIVE}-native
inherit_defer toolchain/${TOOLCHAIN}
def lsb_distro_identifier(d):
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v5 3/5] compiler-rt,libcxx: Use clang for native versions as well
2025-07-02 5:32 [PATCH v5 1/5] clang-native: Add class to use clang as native compiler Khem Raj
2025-07-02 5:32 ` [PATCH v5 2/5] base.bbclass: Deferred inherit native toolchain class Khem Raj
@ 2025-07-02 5:32 ` Khem Raj
2025-07-02 5:32 ` [PATCH v5 4/5] sanity/utils: Directly use gcc, not BUILD_CC Khem Raj
2025-07-02 5:32 ` [PATCH v5 5/5] sanity/utils: Directly use gcc instead of BUILD_CC in host_gcc_version Khem Raj
3 siblings, 0 replies; 8+ messages in thread
From: Khem Raj @ 2025-07-02 5:32 UTC (permalink / raw)
To: openembedded-core; +Cc: Khem Raj
Set TOOLCHAIN_NATIVE for using clang
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb | 1 +
meta/recipes-devtools/clang/compiler-rt_git.bb | 2 ++
meta/recipes-devtools/clang/libcxx_git.bb | 2 ++
3 files changed, 5 insertions(+)
diff --git a/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb b/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb
index 47438014b23..087a7663023 100644
--- a/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb
+++ b/meta/recipes-devtools/clang/compiler-rt-sanitizers_git.bb
@@ -37,6 +37,7 @@ CFLAGS += "${COMPILER_RT}"
CXXFLAGS += "${COMPILER_RT} ${LIBCPLUSPLUS}"
TOOLCHAIN = "clang"
+TOOLCHAIN_NATIVE = "clang"
DEPENDS += "ninja-native virtual/crypt compiler-rt"
DEPENDS:append:class-native = " clang-native libxcrypt-native libcxx-native"
diff --git a/meta/recipes-devtools/clang/compiler-rt_git.bb b/meta/recipes-devtools/clang/compiler-rt_git.bb
index ff6cc29bf32..c7bf38c33d2 100644
--- a/meta/recipes-devtools/clang/compiler-rt_git.bb
+++ b/meta/recipes-devtools/clang/compiler-rt_git.bb
@@ -29,6 +29,7 @@ DEPENDS += "ninja-native libgcc"
DEPENDS:append:class-target = " virtual/cross-c++ clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc gcc-runtime"
DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-native clang-crosssdk-${SDK_SYS} nativesdk-gcc-runtime"
DEPENDS:append:class-native = " clang-native"
+DEPENDS:remove:class-native = "libcxx-native compiler-rt-native"
# Trick clang.bbclass into not creating circular dependencies
UNWINDLIB:class-nativesdk = "--unwindlib=libgcc"
@@ -58,6 +59,7 @@ LDFLAGS += "${COMPILER_RT} ${UNWINDLIB}"
CXXFLAGS += "${LIBCPLUSPLUS}"
TOOLCHAIN = "clang"
+TOOLCHAIN_NATIVE = "clang"
def get_compiler_rt_arch(bb, d):
if bb.utils.contains('TUNE_FEATURES', 'armv5 thumb dsp', True, False, d):
diff --git a/meta/recipes-devtools/clang/libcxx_git.bb b/meta/recipes-devtools/clang/libcxx_git.bb
index f5bf17f30ae..d355fc3a0f8 100644
--- a/meta/recipes-devtools/clang/libcxx_git.bb
+++ b/meta/recipes-devtools/clang/libcxx_git.bb
@@ -25,6 +25,7 @@ DEPENDS += "ninja-native"
DEPENDS:append:class-target = " virtual/cross-c++ clang-cross-${TARGET_ARCH} virtual/${MLPREFIX}libc virtual/${MLPREFIX}compilerlibs"
DEPENDS:append:class-nativesdk = " virtual/cross-c++ clang-crosssdk-${SDK_SYS} nativesdk-compiler-rt"
DEPENDS:append:class-native = " clang-native compiler-rt-native"
+DEPENDS:remove:class-native = "libcxx-native"
COMPILER_RT ?= "${@bb.utils.contains("PACKAGECONFIG", "compiler-rt", "-rtlib=compiler-rt", "-rtlib=libgcc", d)}"
UNWINDLIB ?= "${@bb.utils.contains("PACKAGECONFIG", "unwind", "-unwindlib=none", "-unwindlib=libgcc", d)}"
@@ -55,6 +56,7 @@ LDFLAGS += "${COMPILER_RT} ${UNWINDLIB} ${LIBCPLUSPLUS}"
CXXFLAGS += "${LIBCPLUSPLUS}"
TOOLCHAIN = "clang"
+TOOLCHAIN_NATIVE = "clang"
OECMAKE_SOURCEPATH = "${S}/llvm"
EXTRA_OECMAKE += "\
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v5 4/5] sanity/utils: Directly use gcc, not BUILD_CC
2025-07-02 5:32 [PATCH v5 1/5] clang-native: Add class to use clang as native compiler Khem Raj
2025-07-02 5:32 ` [PATCH v5 2/5] base.bbclass: Deferred inherit native toolchain class Khem Raj
2025-07-02 5:32 ` [PATCH v5 3/5] compiler-rt,libcxx: Use clang for native versions as well Khem Raj
@ 2025-07-02 5:32 ` Khem Raj
2025-07-02 5:48 ` Patchtest results for " patchtest
2025-07-02 5:32 ` [PATCH v5 5/5] sanity/utils: Directly use gcc instead of BUILD_CC in host_gcc_version Khem Raj
3 siblings, 1 reply; 8+ messages in thread
From: Khem Raj @ 2025-07-02 5:32 UTC (permalink / raw)
To: openembedded-core; +Cc: Richard Purdie, Khem Raj
From: Richard Purdie <richard.purdie@linuxfoundation.org>
The test/helper is written assuming gcc, so just call that and stop
accessing BUILD_CC which may be set to clang.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/classes-global/sanity.bbclass | 9 +++------
meta/lib/oe/utils.py | 17 ++++++-----------
2 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/meta/classes-global/sanity.bbclass b/meta/classes-global/sanity.bbclass
index d1452967fc1..3c103d3bfb3 100644
--- a/meta/classes-global/sanity.bbclass
+++ b/meta/classes-global/sanity.bbclass
@@ -514,12 +514,9 @@ def check_userns():
# built buildtools-extended-tarball)
#
def check_gcc_version(sanity_data):
- import subprocess
-
- build_cc, version = oe.utils.get_host_compiler_version(sanity_data)
- if build_cc.strip() == "gcc":
- if bb.utils.vercmp_string_op(version, "8.0", "<"):
- return "Your version of gcc is older than 8.0 and will break builds. Please install a newer version of gcc (you could use the project's buildtools-extended-tarball or use scripts/install-buildtools).\n"
+ version = oe.utils.get_host_gcc_version(sanity_data)
+ if bb.utils.vercmp_string_op(version, "8.0", "<"):
+ return "Your version of gcc is older than 8.0 and will break builds. Please install a newer version of gcc (you could use the project's buildtools-extended-tarball or use scripts/install-buildtools).\n"
return None
# Tar version 1.24 and onwards handle overwriting symlinks correctly
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index a11db5f3cd9..27d304ec72d 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -415,34 +415,29 @@ def format_pkg_list(pkg_dict, ret_format=None, pkgdata_dir=None):
return output_str
-# Helper function to get the host compiler version
-# Do not assume the compiler is gcc
-def get_host_compiler_version(d, taskcontextonly=False):
+# Helper function to get the host gcc version
+def get_host_gcc_version(d, taskcontextonly=False):
import re, subprocess
if taskcontextonly and d.getVar('BB_WORKERCONTEXT') != '1':
return
- compiler = d.getVar("BUILD_CC")
- # Get rid of ccache since it is not present when parsing.
- if compiler.startswith('ccache '):
- compiler = compiler[7:]
try:
env = os.environ.copy()
# datastore PATH does not contain session PATH as set by environment-setup-...
# this breaks the install-buildtools use-case
# env["PATH"] = d.getVar("PATH")
- output = subprocess.check_output("%s --version" % compiler, \
+ output = subprocess.check_output("gcc --version", \
shell=True, env=env, stderr=subprocess.STDOUT).decode("utf-8")
except subprocess.CalledProcessError as e:
- bb.fatal("Error running %s --version: %s" % (compiler, e.output.decode("utf-8")))
+ bb.fatal("Error running gcc --version: %s" % (e.output.decode("utf-8")))
match = re.match(r".* (\d+\.\d+)\.\d+.*", output.split('\n')[0])
if not match:
- bb.fatal("Can't get compiler version from %s --version output" % compiler)
+ bb.fatal("Can't get compiler version from gcc --version output")
version = match.group(1)
- return compiler, version
+ return version
def host_gcc_version(d, taskcontextonly=False):
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v5 5/5] sanity/utils: Directly use gcc instead of BUILD_CC in host_gcc_version
2025-07-02 5:32 [PATCH v5 1/5] clang-native: Add class to use clang as native compiler Khem Raj
` (2 preceding siblings ...)
2025-07-02 5:32 ` [PATCH v5 4/5] sanity/utils: Directly use gcc, not BUILD_CC Khem Raj
@ 2025-07-02 5:32 ` Khem Raj
2025-07-02 10:33 ` [OE-core] " Antonin Godard
3 siblings, 1 reply; 8+ messages in thread
From: Khem Raj @ 2025-07-02 5:32 UTC (permalink / raw)
To: openembedded-core; +Cc: Khem Raj
This assumes GCC compiler, so feed it one, BUILD_CC might point to
clang as well in that case it fails.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/lib/oe/utils.py | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 27d304ec72d..d31f8c3db36 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -446,21 +446,17 @@ def host_gcc_version(d, taskcontextonly=False):
if taskcontextonly and d.getVar('BB_WORKERCONTEXT') != '1':
return
- compiler = d.getVar("BUILD_CC")
- # Get rid of ccache since it is not present when parsing.
- if compiler.startswith('ccache '):
- compiler = compiler[7:]
try:
env = os.environ.copy()
env["PATH"] = d.getVar("PATH")
- output = subprocess.check_output("%s --version" % compiler, \
+ output = subprocess.check_output("gcc --version", \
shell=True, env=env, stderr=subprocess.STDOUT).decode("utf-8")
except subprocess.CalledProcessError as e:
- bb.fatal("Error running %s --version: %s" % (compiler, e.output.decode("utf-8")))
+ bb.fatal("Error running gcc --version: %s" % (e.output.decode("utf-8")))
match = re.match(r".* (\d+\.\d+)\.\d+.*", output.split('\n')[0])
if not match:
- bb.fatal("Can't get compiler version from %s --version output" % compiler)
+ bb.fatal("Can't get compiler version from gcc --version output")
version = match.group(1)
return "-%s" % version if version in ("4.8", "4.9") else ""
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Patchtest results for [PATCH v5 4/5] sanity/utils: Directly use gcc, not BUILD_CC
2025-07-02 5:32 ` [PATCH v5 4/5] sanity/utils: Directly use gcc, not BUILD_CC Khem Raj
@ 2025-07-02 5:48 ` patchtest
0 siblings, 0 replies; 8+ messages in thread
From: patchtest @ 2025-07-02 5:48 UTC (permalink / raw)
To: Khem Raj; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 3086 bytes --]
Thank you for your submission. Patchtest identified one
or more issues with the patch. Please see the log below for
more information:
---
Testing patch /home/patchtest/share/mboxes/v5-4-5-sanity-utils-Directly-use-gcc-not-BUILD_CC.patch
FAIL: test max line length: Patch line too long (current length 210, maximum is 200) (test_metadata.TestMetadata.test_max_line_length)
PASS: pretest pylint (test_python_pylint.PyLint.pretest_pylint)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test pylint (test_python_pylint.PyLint.test_pylint)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)
SKIP: pretest src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
---
Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this
email with an explanation of why the patch should be accepted. If you
believe these results are due to an error in patchtest, please submit a
bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category
under 'Yocto Project Subprojects'). For more information on specific
failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank
you!
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [OE-core] [PATCH v5 5/5] sanity/utils: Directly use gcc instead of BUILD_CC in host_gcc_version
2025-07-02 5:32 ` [PATCH v5 5/5] sanity/utils: Directly use gcc instead of BUILD_CC in host_gcc_version Khem Raj
@ 2025-07-02 10:33 ` Antonin Godard
2025-07-02 10:37 ` Richard Purdie
0 siblings, 1 reply; 8+ messages in thread
From: Antonin Godard @ 2025-07-02 10:33 UTC (permalink / raw)
To: raj.khem, openembedded-core
On Wed Jul 2, 2025 at 7:32 AM CEST, Khem Raj via lists.openembedded.org wrote:
> This assumes GCC compiler, so feed it one, BUILD_CC might point to
> clang as well in that case it fails.
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> meta/lib/oe/utils.py | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
> index 27d304ec72d..d31f8c3db36 100644
> --- a/meta/lib/oe/utils.py
> +++ b/meta/lib/oe/utils.py
> @@ -446,21 +446,17 @@ def host_gcc_version(d, taskcontextonly=False):
> if taskcontextonly and d.getVar('BB_WORKERCONTEXT') != '1':
> return
>
> - compiler = d.getVar("BUILD_CC")
> - # Get rid of ccache since it is not present when parsing.
> - if compiler.startswith('ccache '):
> - compiler = compiler[7:]
> try:
> env = os.environ.copy()
> env["PATH"] = d.getVar("PATH")
> - output = subprocess.check_output("%s --version" % compiler, \
> + output = subprocess.check_output("gcc --version", \
> shell=True, env=env, stderr=subprocess.STDOUT).decode("utf-8")
> except subprocess.CalledProcessError as e:
> - bb.fatal("Error running %s --version: %s" % (compiler, e.output.decode("utf-8")))
> + bb.fatal("Error running gcc --version: %s" % (e.output.decode("utf-8")))
>
> match = re.match(r".* (\d+\.\d+)\.\d+.*", output.split('\n')[0])
> if not match:
> - bb.fatal("Can't get compiler version from %s --version output" % compiler)
> + bb.fatal("Can't get compiler version from gcc --version output")
>
> version = match.group(1)
> return "-%s" % version if version in ("4.8", "4.9") else ""
I can't apply this patch locally, isn't redundant with patch 4/5?
Antonin
--
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [OE-core] [PATCH v5 5/5] sanity/utils: Directly use gcc instead of BUILD_CC in host_gcc_version
2025-07-02 10:33 ` [OE-core] " Antonin Godard
@ 2025-07-02 10:37 ` Richard Purdie
0 siblings, 0 replies; 8+ messages in thread
From: Richard Purdie @ 2025-07-02 10:37 UTC (permalink / raw)
To: antonin.godard, raj.khem, openembedded-core
On Wed, 2025-07-02 at 12:33 +0200, Antonin Godard via
lists.openembedded.org wrote:
> On Wed Jul 2, 2025 at 7:32 AM CEST, Khem Raj via
> lists.openembedded.org wrote:
> > This assumes GCC compiler, so feed it one, BUILD_CC might point to
> > clang as well in that case it fails.
> >
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ---
> > meta/lib/oe/utils.py | 10 +++-------
> > 1 file changed, 3 insertions(+), 7 deletions(-)
> >
> > diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
> > index 27d304ec72d..d31f8c3db36 100644
> > --- a/meta/lib/oe/utils.py
> > +++ b/meta/lib/oe/utils.py
> > @@ -446,21 +446,17 @@ def host_gcc_version(d,
> > taskcontextonly=False):
> > if taskcontextonly and d.getVar('BB_WORKERCONTEXT') != '1':
> > return
> >
> > - compiler = d.getVar("BUILD_CC")
> > - # Get rid of ccache since it is not present when parsing.
> > - if compiler.startswith('ccache '):
> > - compiler = compiler[7:]
> > try:
> > env = os.environ.copy()
> > env["PATH"] = d.getVar("PATH")
> > - output = subprocess.check_output("%s --version" %
> > compiler, \
> > + output = subprocess.check_output("gcc --version", \
> > shell=True, env=env,
> > stderr=subprocess.STDOUT).decode("utf-8")
> > except subprocess.CalledProcessError as e:
> > - bb.fatal("Error running %s --version: %s" % (compiler,
> > e.output.decode("utf-8")))
> > + bb.fatal("Error running gcc --version: %s" %
> > (e.output.decode("utf-8")))
> >
> > match = re.match(r".* (\d+\.\d+)\.\d+.*",
> > output.split('\n')[0])
> > if not match:
> > - bb.fatal("Can't get compiler version from %s --version
> > output" % compiler)
> > + bb.fatal("Can't get compiler version from gcc --version
> > output")
> >
> > version = match.group(1)
> > return "-%s" % version if version in ("4.8", "4.9") else ""
>
> I can't apply this patch locally, isn't redundant with patch 4/5?
For the sanity gcc/c++ ones, go with what is in master-next as that
appears to be building ok at this point.
Cheers.
Richard
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-07-02 10:37 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02 5:32 [PATCH v5 1/5] clang-native: Add class to use clang as native compiler Khem Raj
2025-07-02 5:32 ` [PATCH v5 2/5] base.bbclass: Deferred inherit native toolchain class Khem Raj
2025-07-02 5:32 ` [PATCH v5 3/5] compiler-rt,libcxx: Use clang for native versions as well Khem Raj
2025-07-02 5:32 ` [PATCH v5 4/5] sanity/utils: Directly use gcc, not BUILD_CC Khem Raj
2025-07-02 5:48 ` Patchtest results for " patchtest
2025-07-02 5:32 ` [PATCH v5 5/5] sanity/utils: Directly use gcc instead of BUILD_CC in host_gcc_version Khem Raj
2025-07-02 10:33 ` [OE-core] " Antonin Godard
2025-07-02 10:37 ` Richard Purdie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.