From: "Antonin Godard" <antonin.godard@bootlin.com>
To: <raj.khem@gmail.com>, <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [PATCH v5 5/5] sanity/utils: Directly use gcc instead of BUILD_CC in host_gcc_version
Date: Wed, 02 Jul 2025 12:33:59 +0200 [thread overview]
Message-ID: <DB1I2N3JADAI.3AFKK4PYIHWQW@bootlin.com> (raw)
In-Reply-To: <20250702053220.4104358-5-raj.khem@gmail.com>
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
next prev parent reply other threads:[~2025-07-02 10:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Antonin Godard [this message]
2025-07-02 10:37 ` [OE-core] " Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DB1I2N3JADAI.3AFKK4PYIHWQW@bootlin.com \
--to=antonin.godard@bootlin.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=raj.khem@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.