commit: 4fd2400c18a36b8aad51328b3731fef55968e4fc Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Sat Aug 20 00:31:21 2022 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Sat Aug 20 00:32:36 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4fd2400c
sys-libs/glibc: restore GCC < 11.2.1_p* AVX512 sanity check It's cheap and it avoids build failures, so why not? Only really affects Tiger Lake or so though. Fixed in newer GCCs anyway. Bug: https://bugs.gentoo.org/823780 Signed-off-by: Sam James <sam <AT> gentoo.org> sys-libs/glibc/glibc-2.35-r8.ebuild | 6 ++++++ sys-libs/glibc/glibc-2.36.ebuild | 6 ++++++ sys-libs/glibc/glibc-9999.ebuild | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/sys-libs/glibc/glibc-2.35-r8.ebuild b/sys-libs/glibc/glibc-2.35-r8.ebuild index c50c5ba3fbca..25a735d93196 100644 --- a/sys-libs/glibc/glibc-2.35-r8.ebuild +++ b/sys-libs/glibc/glibc-2.35-r8.ebuild @@ -326,6 +326,12 @@ setup_target_flags() { fi # For compatibility with older binaries at slight performance cost. use stack-realign && export CFLAGS_x86+=" -mstackrealign" + + # Workaround for bug #823780. + if tc-is-gcc && (($(gcc-major-version) == 11)) && (($(gcc-minor-version) <= 2)) && (($(gcc-micro-version) == 0)) ; then + export CFLAGS_x86="${CFLAGS_x86} -mno-avx512f" + einfo "Auto adding -mno-avx512f to CFLAGS_x86 for buggy GCC version (bug #823780) (ABI=${ABI})" + fi fi ;; mips) diff --git a/sys-libs/glibc/glibc-2.36.ebuild b/sys-libs/glibc/glibc-2.36.ebuild index df09f5c97b9d..dc52203e0fe7 100644 --- a/sys-libs/glibc/glibc-2.36.ebuild +++ b/sys-libs/glibc/glibc-2.36.ebuild @@ -326,6 +326,12 @@ setup_target_flags() { fi # For compatibility with older binaries at slight performance cost. use stack-realign && export CFLAGS_x86+=" -mstackrealign" + + # Workaround for bug #823780. + if tc-is-gcc && (($(gcc-major-version) == 11)) && (($(gcc-minor-version) <= 2)) && (($(gcc-micro-version) == 0)) ; then + export CFLAGS_x86="${CFLAGS_x86} -mno-avx512f" + einfo "Auto adding -mno-avx512f to CFLAGS_x86 for buggy GCC version (bug #823780) (ABI=${ABI})" + fi fi ;; mips) diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild index b35b2febd192..92b54a5a254a 100644 --- a/sys-libs/glibc/glibc-9999.ebuild +++ b/sys-libs/glibc/glibc-9999.ebuild @@ -326,6 +326,12 @@ setup_target_flags() { fi # For compatibility with older binaries at slight performance cost. use stack-realign && export CFLAGS_x86+=" -mstackrealign" + + # Workaround for bug #823780. + if tc-is-gcc && (($(gcc-major-version) == 11)) && (($(gcc-minor-version) <= 2)) && (($(gcc-micro-version) == 0)) ; then + export CFLAGS_x86="${CFLAGS_x86} -mno-avx512f" + einfo "Auto adding -mno-avx512f to CFLAGS_x86 for buggy GCC version (bug #823780) (ABI=${ABI})" + fi fi ;; mips)