]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
sanity: Add sanity test for 'bad' gcc installs on ubuntu 24.04
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 8 Jul 2025 21:34:02 +0000 (22:34 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 9 Jul 2025 07:47:59 +0000 (08:47 +0100)
Installing emacs on Ubuntu 24.04 pulls in emacs-gtk which leads to libgcc-14-dev
despite gcc being 13. This breaks libcxx-native and compiler-rt-native builds.
We've tried various ways of addressing this buit they don't work. Instead, detect
this situation and tell the user to either install or remove a package.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-global/sanity.bbclass

index 1044ed9cc691371d4abfe11b0415e6b321b75ff4..d875a022db03f102584deea97aea106d92d570fa 100644 (file)
@@ -672,6 +672,8 @@ def check_sanity_sstate_dir_change(sstate_dir, data):
     return testmsg
 
 def check_sanity_version_change(status, d):
+    import glob
+
     # Sanity checks to be done when SANITY_VERSION or NATIVELSBSTRING changes
     # In other words, these tests run once in a given build directory and then 
     # never again until the sanity version or host distribution id/version changes.
@@ -703,6 +705,11 @@ def check_sanity_version_change(status, d):
     if not check_app_exists('g++', d):
         missing = missing + "C++ Compiler (g++),"
 
+    # installing emacs on Ubuntu 24.04 pulls in emacs-gtk -> libgcc-14-dev despite gcc being 13
+    # this breaks libcxx-native and compiler-rt-native builds so tell the user to fix things
+    if glob.glob("/usr/lib/gcc/*/14/libgcc_s.so") and not glob.glob("/usr/lib/gcc/*/14/libstdc++.so"):
+        status.addresult('libgcc-14-dev is installed and not libstdc++-14-dev which will break clang native compiles. Please remove one or install the other.')
+
     required_utilities = d.getVar('SANITY_REQUIRED_UTILITIES')
 
     for util in required_utilities.split():