Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/glibc/
Date: Sun, 25 Sep 2022 01:21:18
Message-Id: 1664068742.8e62898af68131da0430c09cd99955d3eef1567c.sam@gentoo
1 commit: 8e62898af68131da0430c09cd99955d3eef1567c
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 9 14:23:43 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 25 01:19:02 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e62898a
7
8 sys-libs/glibc: avoid gcc-major-version failure
9
10 I ended up getting a weird failure (which I can't reproduce any longer,
11 but it maeks sense still I think):
12 ```
13 x86_64-pc-linux-gnu-gcc -m64 -pipe -march=native -fdiagnostics-color=always -ggdb3 -O2 -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-z,pack-relative-relocs -fuse-ld=bfd -Wl,-O1 -Wl,--as-needed -pipe -march=native -fdiagnostics-color=always -ggdb3 -O2 -m32 -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-z,pack-relative-relocs -fuse-ld=bfd -Wl,-O1 -Wl,--as-needed glibc-test.c -o glibc-test
14 /var/tmp/portage/sys-libs/glibc-2.36-r1/temp/environment: line 3892: ((: #define == 11: syntax error: operand expected (error token is "#define == 11")
15 * Running do_src_configure for ABI x86
16 * ABI: x86
17 * CBUILD: x86_64-pc-linux-gnu
18 ```
19
20 It's because tc-getCPP can't handle at least a large amount of CFLAGS
21 (seems to handle some okay though). Strip them all out and just use
22 barebones CC when calling gcc-major-version and friends, then restor
23 after.
24
25 Signed-off-by: Sam James <sam <AT> gentoo.org>
26 Closes: https://github.com/gentoo/gentoo/pull/27418
27 Signed-off-by: Sam James <sam <AT> gentoo.org>
28
29 sys-libs/glibc/glibc-2.36-r3.ebuild | 4 ++++
30 sys-libs/glibc/glibc-9999.ebuild | 7 +++++--
31 2 files changed, 9 insertions(+), 2 deletions(-)
32
33 diff --git a/sys-libs/glibc/glibc-2.36-r3.ebuild b/sys-libs/glibc/glibc-2.36-r3.ebuild
34 index 012d6984dd74..7d7069dadec8 100644
35 --- a/sys-libs/glibc/glibc-2.36-r3.ebuild
36 +++ b/sys-libs/glibc/glibc-2.36-r3.ebuild
37 @@ -336,10 +336,14 @@ setup_target_flags() {
38 use stack-realign && export CFLAGS_x86+=" -mstackrealign"
39
40 # Workaround for bug #823780.
41 + # Need to save/restore CC because earlier on, we stuff it full of CFLAGS, and tc-getCPP doesn't like that.
42 + CC_mangled=${CC}
43 + CC=${glibc__GLIBC_CC}
44 if tc-is-gcc && (($(gcc-major-version) == 11)) && (($(gcc-minor-version) <= 2)) && (($(gcc-micro-version) == 0)) ; then
45 export CFLAGS_x86="${CFLAGS_x86} -mno-avx512f"
46 einfo "Auto adding -mno-avx512f to CFLAGS_x86 for buggy GCC version (bug #823780) (ABI=${ABI})"
47 fi
48 + CC=${CC_mangled}
49 fi
50 ;;
51 mips)
52
53 diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
54 index 8456c2a16fe4..68bafd8c3c33 100644
55 --- a/sys-libs/glibc/glibc-9999.ebuild
56 +++ b/sys-libs/glibc/glibc-9999.ebuild
57 @@ -26,8 +26,7 @@ PATCH_DEV=dilfridge
58 if [[ ${PV} == 9999* ]]; then
59 inherit git-r3
60 else
61 - #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
62 - KEYWORDS=""
63 + #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
64 SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
65 SRC_URI+=" https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz"
66 fi
67 @@ -337,10 +336,14 @@ setup_target_flags() {
68 use stack-realign && export CFLAGS_x86+=" -mstackrealign"
69
70 # Workaround for bug #823780.
71 + # Need to save/restore CC because earlier on, we stuff it full of CFLAGS, and tc-getCPP doesn't like that.
72 + CC_mangled=${CC}
73 + CC=${glibc__GLIBC_CC}
74 if tc-is-gcc && (($(gcc-major-version) == 11)) && (($(gcc-minor-version) <= 2)) && (($(gcc-micro-version) == 0)) ; then
75 export CFLAGS_x86="${CFLAGS_x86} -mno-avx512f"
76 einfo "Auto adding -mno-avx512f to CFLAGS_x86 for buggy GCC version (bug #823780) (ABI=${ABI})"
77 fi
78 + CC=${CC_mangled}
79 fi
80 ;;
81 mips)