diff options
Diffstat (limited to 'meta/classes-global/sanity.bbclass')
-rw-r--r-- | meta/classes-global/sanity.bbclass | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/meta/classes-global/sanity.bbclass b/meta/classes-global/sanity.bbclass index 192582b82e..1044ed9cc6 100644 --- a/meta/classes-global/sanity.bbclass +++ b/meta/classes-global/sanity.bbclass | |||
@@ -514,12 +514,9 @@ def check_userns(): | |||
514 | # built buildtools-extended-tarball) | 514 | # built buildtools-extended-tarball) |
515 | # | 515 | # |
516 | def check_gcc_version(sanity_data): | 516 | def check_gcc_version(sanity_data): |
517 | import subprocess | 517 | version = oe.utils.get_host_gcc_version(sanity_data) |
518 | 518 | if bb.utils.vercmp_string_op(version, "8.0", "<"): | |
519 | build_cc, version = oe.utils.get_host_compiler_version(sanity_data) | 519 | 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" |
520 | if build_cc.strip() == "gcc": | ||
521 | if bb.utils.vercmp_string_op(version, "8.0", "<"): | ||
522 | 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" | ||
523 | return None | 520 | return None |
524 | 521 | ||
525 | # Tar version 1.24 and onwards handle overwriting symlinks correctly | 522 | # Tar version 1.24 and onwards handle overwriting symlinks correctly |
@@ -609,7 +606,7 @@ def drop_v14_cross_builds(d): | |||
609 | 606 | ||
610 | def check_cpp_toolchain_flag(d, flag, error_message=None): | 607 | def check_cpp_toolchain_flag(d, flag, error_message=None): |
611 | """ | 608 | """ |
612 | Checks if the C++ toolchain support the given flag | 609 | Checks if the g++ compiler supports the given flag |
613 | """ | 610 | """ |
614 | import shlex | 611 | import shlex |
615 | import subprocess | 612 | import subprocess |
@@ -622,7 +619,7 @@ def check_cpp_toolchain_flag(d, flag, error_message=None): | |||
622 | } | 619 | } |
623 | """ | 620 | """ |
624 | 621 | ||
625 | cmd = shlex.split(d.getVar("BUILD_CXX")) + ["-x", "c++","-", "-o", "/dev/null", flag] | 622 | cmd = ["g++", "-x", "c++","-", "-o", "/dev/null", flag] |
626 | try: | 623 | try: |
627 | 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) |
628 | return None | 625 | return None |
@@ -700,11 +697,11 @@ def check_sanity_version_change(status, d): | |||
700 | if not check_app_exists("${MAKE}", d): | 697 | if not check_app_exists("${MAKE}", d): |
701 | missing = missing + "GNU make," | 698 | missing = missing + "GNU make," |
702 | 699 | ||
703 | if not check_app_exists('${BUILD_CC}', d): | 700 | if not check_app_exists('gcc', d): |
704 | missing = missing + "C Compiler (%s)," % d.getVar("BUILD_CC") | 701 | missing = missing + "C Compiler (gcc)," |
705 | 702 | ||
706 | if not check_app_exists('${BUILD_CXX}', d): | 703 | if not check_app_exists('g++', d): |
707 | missing = missing + "C++ Compiler (%s)," % d.getVar("BUILD_CXX") | 704 | missing = missing + "C++ Compiler (g++)," |
708 | 705 | ||
709 | required_utilities = d.getVar('SANITY_REQUIRED_UTILITIES') | 706 | required_utilities = d.getVar('SANITY_REQUIRED_UTILITIES') |
710 | 707 | ||
@@ -733,14 +730,14 @@ def check_sanity_version_change(status, d): | |||
733 | status.addresult("TMPDIR is setuid, please don't build in a setuid directory") | 730 | status.addresult("TMPDIR is setuid, please don't build in a setuid directory") |
734 | 731 | ||
735 | # Check that a user isn't building in a path in PSEUDO_IGNORE_PATHS | 732 | # Check that a user isn't building in a path in PSEUDO_IGNORE_PATHS |
736 | pseudoignorepaths = d.getVar('PSEUDO_IGNORE_PATHS', expand=True).split(",") | 733 | pseudoignorepaths = (d.getVar('PSEUDO_IGNORE_PATHS', expand=True) or "").split(",") |
737 | workdir = d.getVar('WORKDIR', expand=True) | 734 | workdir = d.getVar('WORKDIR', expand=True) |
738 | for i in pseudoignorepaths: | 735 | for i in pseudoignorepaths: |
739 | if i and workdir.startswith(i): | 736 | if i and workdir.startswith(i): |
740 | status.addresult("You are building in a path included in PSEUDO_IGNORE_PATHS " + str(i) + " please locate the build outside this path.\n") | 737 | status.addresult("You are building in a path included in PSEUDO_IGNORE_PATHS " + str(i) + " please locate the build outside this path.\n") |
741 | 738 | ||
742 | # Check if PSEUDO_IGNORE_PATHS and paths under pseudo control overlap | 739 | # Check if PSEUDO_IGNORE_PATHS and paths under pseudo control overlap |
743 | pseudoignorepaths = d.getVar('PSEUDO_IGNORE_PATHS', expand=True).split(",") | 740 | pseudoignorepaths = (d.getVar('PSEUDO_IGNORE_PATHS', expand=True) or "").split(",") |
744 | pseudo_control_dir = "${D},${PKGD},${PKGDEST},${IMAGEROOTFS},${SDK_OUTPUT}" | 741 | pseudo_control_dir = "${D},${PKGD},${PKGDEST},${IMAGEROOTFS},${SDK_OUTPUT}" |
745 | pseudocontroldir = d.expand(pseudo_control_dir).split(",") | 742 | pseudocontroldir = d.expand(pseudo_control_dir).split(",") |
746 | for i in pseudoignorepaths: | 743 | for i in pseudoignorepaths: |