From 0b75d3ce0bae8240c28c6a8f191f5130548f8475 Mon Sep 17 00:00:00 2001 From: Sam James Date: Mon, 19 Feb 2024 05:02:09 +0000 Subject: toolchain.eclass: rework fixincludes again * Only run fixincludes for >= GCC 13 with --- eclass/toolchain.eclass | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'eclass') diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index 6a4b59972fa3..5de1329347ee 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -140,6 +140,11 @@ GCCMINOR=$(ver_cut 2 ${GCC_PV}) # @DESCRIPTION: # GCC micro version. GCCMICRO=$(ver_cut 3 ${GCC_PV}) +# @ECLASS_VARIABLE: GCC_RUN_FIXINCLUDES +# @INTERNAL +# @DESCRIPTION: +# Controls whether fixincludes should be used. +GCC_RUN_FIXINCLUDES=0 tc_use_major_version_only() { local use_major_version_only=0 @@ -1297,6 +1302,20 @@ toolchain_src_configure() { ) fi + if tc_version_is_at_least 13.1 ; then + # Re-enable fixincludes for >= GCC 13 with older glibc + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107128 + if use elibc_glibc && has_version "= GCC 13 - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107128 - if [[ ${GCCMAJOR} -lt 13 ]] ; then + if [[ ${GCC_RUN_FIXINCLUDES} == 0 ]] ; then # We remove the generated fixincludes, as they can cause things to break # (ncurses, openssl, etc). We do not prevent them from being built, as # in the following commit which we revert: -- cgit v1.2.3-65-gdbad