diff mbox series

[v2,2/2] insane: Check if the C++ toolchain supports --std=gnu++20

Message ID 20250320134009.2631475-2-yoann.congal@smile.fr
State New
Headers show
Series [v2,1/2] sanity: Refactor "C++ toolchain support this flag" check | expand

Commit Message

Yoann Congal March 20, 2025, 1:40 p.m. UTC
From: Yoann Congal <yoann.congal@smile.fr>

This is needed to build nodejs from meta-oe. Check this early to avoid
an error later in the build.

Fixes [YOCTO #15804]

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
WARNING: as discussed in previous threads [0][1], this will disqualify
builds on Ubuntu 20.04 (its g++ does not support the option)
[0]: https://lists.openembedded.org/g/openembedded-devel/topic/111740469
[1]: https://lists.yoctoproject.org/g/yocto-patches/topic/yocto_autobuilder2_patch/111757761

v1->v2:
* Changed error message
* Refactor C++ toolchain flag check
---
 meta/classes-global/sanity.bbclass | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Richard Purdie March 20, 2025, 2:13 p.m. UTC | #1
On Thu, 2025-03-20 at 14:40 +0100, Yoann Congal via lists.openembedded.org wrote:
> From: Yoann Congal <yoann.congal@smile.fr>
> 
> This is needed to build nodejs from meta-oe. Check this early to
> avoid
> an error later in the build.
> 
> Fixes [YOCTO #15804]
> 
> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>

Subject should be sanity: as insane is something different. I tweaked
on master-next though, no need to resend.

Cheers,

Richard
Yoann Congal March 20, 2025, 2:37 p.m. UTC | #2
Le 20/03/2025 à 15:13, Richard Purdie a écrit :
> On Thu, 2025-03-20 at 14:40 +0100, Yoann Congal via lists.openembedded.org wrote:
>> From: Yoann Congal <yoann.congal@smile.fr>
>>
>> This is needed to build nodejs from meta-oe. Check this early to
>> avoid
>> an error later in the build.
>>
>> Fixes [YOCTO #15804]
>>
>> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
> 
> Subject should be sanity: as insane is something different. I tweaked
> on master-next though, no need to resend.

d'oh! Sorry, and thanks!

> 
> Cheers,
> 
> Richard
diff mbox series

Patch

diff --git a/meta/classes-global/sanity.bbclass b/meta/classes-global/sanity.bbclass
index dc317e846d..ce52bcdf90 100644
--- a/meta/classes-global/sanity.bbclass
+++ b/meta/classes-global/sanity.bbclass
@@ -804,6 +804,11 @@  def check_sanity_version_change(status, d):
     # Check if linking with lstdc++ is failing
     status.addresult(check_cpp_toolchain_flag(d, "-lstdc++"))
 
+    # Check if the C++ toochain support the "--std=gnu++20" flag
+    status.addresult(check_cpp_toolchain_flag(d, "--std=gnu++20",
+        "An error occurred during checking the C++ toolchain for '--std=gnu++20' support. "
+        "Please use a g++ compiler that supports C++20 (e.g. g++ version 10 onwards)."))
+
 def sanity_check_locale(d):
     """
     Currently bitbake switches locale to en_US.UTF-8 so check that this locale actually exists.