summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorTim Orling <timothy.t.orling@linux.intel.com>2020-03-31 13:03:05 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-04-01 11:44:24 +0100
commit37833137005980c41bc2c898d0e011f74da8cf8c (patch)
tree188736953bc178d3736a4f5acf25ebde22c9e59e /meta
parentd5d634f682d58f50bf8f8f4502ac00dddd2c048d (diff)
downloadpoky-37833137005980c41bc2c898d0e011f74da8cf8c.tar.gz
sanity.bbclass: add test for gcc < 4.8
It is known that old versions of gcc prior to 4.8 causes builds to fail. Add a test for BUILD_CC == 'gcc' and gcc < 4.8 and recommend using scripts/install-buildtools or user built buildtools-extended-tarball. Use the new get_host_compiler_version function from lib/oe/utils.py NOTE: another solution is to install devtoolset-6+ from scl [1], but this is a rather large install (> 1 Gb) and fairly invasive. [1] https://www.softwarecollections.org/en/scls/rhscl/devtoolset-6/ Adding this code means we can increase the minimum version easily in the future too (which will soon be needed). RP: Change minimum version from 5.0 to 4.8 for initial patch (From OE-Core rev: 3bb3b9cbad82b2f09386153226d1d4e769b7347b) Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/sanity.bbclass21
1 files changed, 20 insertions, 1 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index fef05fb012..88888e814a 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -521,6 +521,24 @@ def check_wsl(d):
521 return "OpenEmbedded doesn't work under WSL at this time, sorry" 521 return "OpenEmbedded doesn't work under WSL at this time, sorry"
522 return None 522 return None
523 523
524# Require at least gcc version 4.8.
525#
526# This can be fixed on CentOS-7 with devtoolset-6+
527# https://www.softwarecollections.org/en/scls/rhscl/devtoolset-6/
528#
529# A less invasive fix is with scripts/install-buildtools (or with user
530# built buildtools-extended-tarball)
531#
532def check_gcc_version(sanity_data):
533 from distutils.version import LooseVersion
534 import subprocess
535
536 build_cc, version = oe.utils.get_host_compiler_version(sanity_data)
537 if build_cc.strip() == "gcc":
538 if LooseVersion(version) < LooseVersion("4.8"):
539 return "Your version of gcc is older than 4.8 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"
540 return None
541
524# Tar version 1.24 and onwards handle overwriting symlinks correctly 542# Tar version 1.24 and onwards handle overwriting symlinks correctly
525# but earlier versions do not; this needs to work properly for sstate 543# but earlier versions do not; this needs to work properly for sstate
526# Version 1.28 is needed so opkg-build works correctly when reproducibile builds are enabled 544# Version 1.28 is needed so opkg-build works correctly when reproducibile builds are enabled
@@ -533,7 +551,7 @@ def check_tar_version(sanity_data):
533 return "Unable to execute tar --version, exit code %d\n%s\n" % (e.returncode, e.output) 551 return "Unable to execute tar --version, exit code %d\n%s\n" % (e.returncode, e.output)
534 version = result.split()[3] 552 version = result.split()[3]
535 if LooseVersion(version) < LooseVersion("1.28"): 553 if LooseVersion(version) < LooseVersion("1.28"):
536 return "Your version of tar is older than 1.28 and does not have the support needed to enable reproducible builds. Please install a newer version of tar (you could use the projects buildtools-tarball from our last release or use scripts/install-buildtools).\n" 554 return "Your version of tar is older than 1.28 and does not have the support needed to enable reproducible builds. Please install a newer version of tar (you could use the project's buildtools-tarball from our last release or use scripts/install-buildtools).\n"
537 return None 555 return None
538 556
539# We use git parameters and functionality only found in 1.7.8 or later 557# We use git parameters and functionality only found in 1.7.8 or later
@@ -632,6 +650,7 @@ def check_sanity_version_change(status, d):
632 except ImportError as e: 650 except ImportError as e:
633 status.addresult('Your Python 3 is not a full install. Please install the module %s (see the Getting Started guide for further information).\n' % e.name) 651 status.addresult('Your Python 3 is not a full install. Please install the module %s (see the Getting Started guide for further information).\n' % e.name)
634 652
653 status.addresult(check_gcc_version(d))
635 status.addresult(check_make_version(d)) 654 status.addresult(check_make_version(d))
636 status.addresult(check_patch_version(d)) 655 status.addresult(check_patch_version(d))
637 status.addresult(check_tar_version(d)) 656 status.addresult(check_tar_version(d))