diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-07-01 22:44:02 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-07-03 10:40:16 +0100 |
| commit | 57f1eb2e6657d601d94768d04f92a5ab66144458 (patch) | |
| tree | 9e70fd0c1274c1c121629e428939def7b181f5c9 /meta | |
| parent | 862447427783352dbab916d901ad38d4792f5328 (diff) | |
| download | poky-57f1eb2e6657d601d94768d04f92a5ab66144458.tar.gz | |
sanity: Reference gcc/g++ directly
BUILD_CC and BUILD_CXX can be overridden on a per recipe context now so
these tests don't make sense in this form any more. They assume gcc/g++
so lets just use those directly.
This fixes things to work with toolchain selection for the native
case.
(From OE-Core rev: cc93781667cf4f6971bcb9319ab8ab21320852de)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/classes-global/sanity.bbclass | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/meta/classes-global/sanity.bbclass b/meta/classes-global/sanity.bbclass index 3c103d3bfb..1044ed9cc6 100644 --- a/meta/classes-global/sanity.bbclass +++ b/meta/classes-global/sanity.bbclass | |||
| @@ -606,7 +606,7 @@ def drop_v14_cross_builds(d): | |||
| 606 | 606 | ||
| 607 | def check_cpp_toolchain_flag(d, flag, error_message=None): | 607 | def check_cpp_toolchain_flag(d, flag, error_message=None): |
| 608 | """ | 608 | """ |
| 609 | Checks if the C++ toolchain support the given flag | 609 | Checks if the g++ compiler supports the given flag |
| 610 | """ | 610 | """ |
| 611 | import shlex | 611 | import shlex |
| 612 | import subprocess | 612 | import subprocess |
| @@ -619,7 +619,7 @@ def check_cpp_toolchain_flag(d, flag, error_message=None): | |||
| 619 | } | 619 | } |
| 620 | """ | 620 | """ |
| 621 | 621 | ||
| 622 | cmd = shlex.split(d.getVar("BUILD_CXX")) + ["-x", "c++","-", "-o", "/dev/null", flag] | 622 | cmd = ["g++", "-x", "c++","-", "-o", "/dev/null", flag] |
| 623 | try: | 623 | try: |
| 624 | subprocess.run(cmd, input=cpp_code, capture_output=True, text=True, check=True) | 624 | subprocess.run(cmd, input=cpp_code, capture_output=True, text=True, check=True) |
| 625 | return None | 625 | return None |
| @@ -697,11 +697,11 @@ def check_sanity_version_change(status, d): | |||
| 697 | if not check_app_exists("${MAKE}", d): | 697 | if not check_app_exists("${MAKE}", d): |
| 698 | missing = missing + "GNU make," | 698 | missing = missing + "GNU make," |
| 699 | 699 | ||
| 700 | if not check_app_exists('${BUILD_CC}', d): | 700 | if not check_app_exists('gcc', d): |
| 701 | missing = missing + "C Compiler (%s)," % d.getVar("BUILD_CC") | 701 | missing = missing + "C Compiler (gcc)," |
| 702 | 702 | ||
| 703 | if not check_app_exists('${BUILD_CXX}', d): | 703 | if not check_app_exists('g++', d): |
| 704 | missing = missing + "C++ Compiler (%s)," % d.getVar("BUILD_CXX") | 704 | missing = missing + "C++ Compiler (g++)," |
| 705 | 705 | ||
| 706 | required_utilities = d.getVar('SANITY_REQUIRED_UTILITIES') | 706 | required_utilities = d.getVar('SANITY_REQUIRED_UTILITIES') |
| 707 | 707 | ||
