From c0e5370a91c87145d0a8eb753241b04ee3b1928e Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 28 Dec 2023 10:50:39 +0000 Subject: bitbake: lib/bb: Add workaround for libgcc issues with python 3.8 and 3.9 With python 3.8 and 3.9, we see intermittent errors of: libgcc_s.so.1 must be installed for pthread_cancel to work Aborted (core dumped) which seem related to: https://stackoverflow.com/questions/64797838/libgcc-s-so-1-must-be-installed-for-pthread-cancel-to-work https://bugs.ams1.psf.io/issue42888 These tend to occur on debian 11 and ubuntu 20.04. Workaround this by ensuring libgcc is preloaded in all cases. (Bitbake rev: 36959b25c64044dd4bca65bd1bb1243823d51545) Signed-off-by: Richard Purdie Signed-off-by: Steve Sakoman --- bitbake/lib/bb/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bitbake/lib') diff --git a/bitbake/lib/bb/__init__.py b/bitbake/lib/bb/__init__.py index c98e23ce3e..ba8039497f 100644 --- a/bitbake/lib/bb/__init__.py +++ b/bitbake/lib/bb/__init__.py @@ -15,6 +15,13 @@ import sys if sys.version_info < (3, 5, 0): raise RuntimeError("Sorry, python 3.5.0 or later is required for this version of bitbake") +if sys.version_info < (3, 10, 0): + # With python 3.8 and 3.9, we see errors of "libgcc_s.so.1 must be installed for pthread_cancel to work" + # https://stackoverflow.com/questions/64797838/libgcc-s-so-1-must-be-installed-for-pthread-cancel-to-work + # https://bugs.ams1.psf.io/issue42888 + # so ensure libgcc_s is loaded early on + import ctypes + libgcc_s = ctypes.CDLL('libgcc_s.so.1') class BBHandledException(Exception): """ -- cgit v1.2.3-54-g00ecf