Gentoo Archives: gentoo-commits

From: "Andreas K. Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/glibc/
Date: Fri, 19 Apr 2019 00:01:49
Message-Id: 1555632085.4b4f4514202b682d5361da627e6c317f8acc9907.dilfridge@gentoo
1 commit: 4b4f4514202b682d5361da627e6c317f8acc9907
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Thu Apr 18 23:59:29 2019 +0000
4 Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 19 00:01:25 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4b4f4514
7
8 Revert "sys-libs/glibc: Fix headers-only cross-build for riscv"
9
10 Sergei's solution is way better. Tomorrow.
11 This reverts commit 08ac6a89ea72d4cdcb02383410b58e76e69913a4.
12
13 Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
14
15 sys-libs/glibc/glibc-2.29-r2.ebuild | 37 +++++++++++++++++++------------------
16 sys-libs/glibc/glibc-9999.ebuild | 37 +++++++++++++++++++------------------
17 2 files changed, 38 insertions(+), 36 deletions(-)
18
19 diff --git a/sys-libs/glibc/glibc-2.29-r2.ebuild b/sys-libs/glibc/glibc-2.29-r2.ebuild
20 index fe9feab7f75..093ffc207eb 100644
21 --- a/sys-libs/glibc/glibc-2.29-r2.ebuild
22 +++ b/sys-libs/glibc/glibc-2.29-r2.ebuild
23 @@ -1006,6 +1006,25 @@ glibc_headers_configure() {
24 popd >/dev/null
25 fi
26
27 + case ${CTARGET} in
28 + riscv*)
29 + # RISC-V interrogates the compiler to determine which target to
30 + # build. If building the headers then we don't strictly need a
31 + # RISC-V compiler, so the built-in definitions that are provided
32 + # along with all RISC-V compiler might not exist. This causes
33 + # glibc's RISC-V preconfigure script to blow up. Since we're just
34 + # building the headers any value will actually work here, so just
35 + # pick the standard one (rv64g/lp64d) to make the build scripts
36 + # happy for now -- the headers are all the same anyway so it
37 + # doesn't matter.
38 + headers_only_arch_CPPFLAGS+=(
39 + -D__riscv_xlen=64
40 + -D__riscv_flen=64
41 + -D__riscv_float_abi_double=1
42 + -D__riscv_atomic=1
43 + ) ;;
44 + esac
45 +
46 local myconf=()
47 myconf+=(
48 --disable-sanity-checks
49 @@ -1023,24 +1042,6 @@ glibc_headers_configure() {
50 # Nothing is compiled here which would affect the headers for the target.
51 # So forcing CC/CFLAGS is sane.
52 local headers_only_CC=$(tc-getBUILD_CC)
53 -
54 - case ${CTARGET} in
55 - riscv*)
56 - # RISC-V interrogates the compiler to determine which target to
57 - # build. If building the headers then we don't strictly need a
58 - # RISC-V compiler, so the built-in definitions that are provided
59 - # along with all RISC-V compiler might not exist. This causes
60 - # glibc's RISC-V preconfigure script to blow up. Since we're just
61 - # building the headers any value will actually work here, so just
62 - # pick the standard one (rv64g/lp64d) to make the build scripts
63 - # happy for now -- the headers are all the same anyway so it
64 - # doesn't matter.
65 - # It's not sufficient to shove the flags into CPPFLAGS, they need
66 - # to really go *everywhere*.
67 - headers_only_CC="${headers_only_CC} -D__riscv_xlen=64 -D__riscv_flen=64 -D__riscv_float_abi_double=1 -D__riscv_atomic=1"
68 - ;;
69 - esac
70 -
71 local headers_only_CFLAGS="-O1 -pipe"
72 local headers_only_CPPFLAGS="-U_FORTIFY_SOURCE ${headers_only_arch_CPPFLAGS[*]}"
73 local headers_only_LDFLAGS=""
74
75 diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
76 index 20846e05faf..142153734f9 100644
77 --- a/sys-libs/glibc/glibc-9999.ebuild
78 +++ b/sys-libs/glibc/glibc-9999.ebuild
79 @@ -1007,6 +1007,25 @@ glibc_headers_configure() {
80 popd >/dev/null
81 fi
82
83 + case ${CTARGET} in
84 + riscv*)
85 + # RISC-V interrogates the compiler to determine which target to
86 + # build. If building the headers then we don't strictly need a
87 + # RISC-V compiler, so the built-in definitions that are provided
88 + # along with all RISC-V compiler might not exist. This causes
89 + # glibc's RISC-V preconfigure script to blow up. Since we're just
90 + # building the headers any value will actually work here, so just
91 + # pick the standard one (rv64g/lp64d) to make the build scripts
92 + # happy for now -- the headers are all the same anyway so it
93 + # doesn't matter.
94 + headers_only_arch_CPPFLAGS+=(
95 + -D__riscv_xlen=64
96 + -D__riscv_flen=64
97 + -D__riscv_float_abi_double=1
98 + -D__riscv_atomic=1
99 + ) ;;
100 + esac
101 +
102 local myconf=()
103 myconf+=(
104 --disable-sanity-checks
105 @@ -1024,24 +1043,6 @@ glibc_headers_configure() {
106 # Nothing is compiled here which would affect the headers for the target.
107 # So forcing CC/CFLAGS is sane.
108 local headers_only_CC=$(tc-getBUILD_CC)
109 -
110 - case ${CTARGET} in
111 - riscv*)
112 - # RISC-V interrogates the compiler to determine which target to
113 - # build. If building the headers then we don't strictly need a
114 - # RISC-V compiler, so the built-in definitions that are provided
115 - # along with all RISC-V compiler might not exist. This causes
116 - # glibc's RISC-V preconfigure script to blow up. Since we're just
117 - # building the headers any value will actually work here, so just
118 - # pick the standard one (rv64g/lp64d) to make the build scripts
119 - # happy for now -- the headers are all the same anyway so it
120 - # doesn't matter.
121 - # It's not sufficient to shove the flags into CPPFLAGS, they need
122 - # to really go *everywhere*.
123 - headers_only_CC="${headers_only_CC} -D__riscv_xlen=64 -D__riscv_flen=64 -D__riscv_float_abi_double=1 -D__riscv_atomic=1"
124 - ;;
125 - esac
126 -
127 local headers_only_CFLAGS="-O1 -pipe"
128 local headers_only_CPPFLAGS="-U_FORTIFY_SOURCE ${headers_only_arch_CPPFLAGS[*]}"
129 local headers_only_LDFLAGS=""