1 |
commit: dc0564d9e7675dad5603d5e8cfbf50e0154891b5 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Apr 6 19:13:27 2018 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Apr 6 19:13:38 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc0564d9 |
7 |
|
8 |
sys-libs/glibc: tweak riscv preconfigure mangling |
9 |
|
10 |
Changed 'preconfigure' mangling from using sed to using CPPFLAGS. |
11 |
While at it move the hack closer to ./configure call. |
12 |
|
13 |
Package-Manager: Portage-2.3.28, Repoman-2.3.9 |
14 |
|
15 |
sys-libs/glibc/glibc-2.27-r1.ebuild | 43 ++++++++++++++++++------------------ |
16 |
sys-libs/glibc/glibc-9999.ebuild | 44 +++++++++++++++++++------------------ |
17 |
2 files changed, 45 insertions(+), 42 deletions(-) |
18 |
|
19 |
diff --git a/sys-libs/glibc/glibc-2.27-r1.ebuild b/sys-libs/glibc/glibc-2.27-r1.ebuild |
20 |
index c61cf3e2929..3cc1a137ada 100644 |
21 |
--- a/sys-libs/glibc/glibc-2.27-r1.ebuild |
22 |
+++ b/sys-libs/glibc/glibc-2.27-r1.ebuild |
23 |
@@ -754,26 +754,6 @@ src_prepare() { |
24 |
einfo "Done." |
25 |
fi |
26 |
|
27 |
- if just_headers ; then |
28 |
- if [[ -e sysdeps/riscv/preconfigure ]] ; then |
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 |
- sed -i 's/^ xlen=.*/ xlen=64/g' sysdeps/riscv/preconfigure || die |
39 |
- sed -i 's/^ flen=.*/ flen=64/g' sysdeps/riscv/preconfigure || die |
40 |
- sed -i 's/^ float_abi=.*/ float_abi=double/g' sysdeps/riscv/preconfigure || die |
41 |
- sed -i 's/^ atomic=.*/ atomic=__riscv_atomic/g' sysdeps/riscv/preconfigure || die |
42 |
- sed -i 's/^libc_cv_riscv_float_abi=no/libc_cv_riscv_float_abi=d/g' sysdeps/unix/sysv/linux/riscv/configure.ac || die |
43 |
- sed -i 's/^libc_cv_riscv_float_abi=no/libc_cv_riscv_float_abi=d/g' sysdeps/unix/sysv/linux/riscv/configure || die |
44 |
- fi |
45 |
- fi |
46 |
- |
47 |
default |
48 |
|
49 |
gnuconfig_update |
50 |
@@ -1009,6 +989,8 @@ glibc_headers_configure() { |
51 |
export ${v} |
52 |
done |
53 |
|
54 |
+ local headers_only_arch_CPPFLAGS=() |
55 |
+ |
56 |
# Blow away some random CC settings that screw things up. #550192 |
57 |
if [[ -d ${S}/sysdeps/mips ]]; then |
58 |
pushd "${S}"/sysdeps/mips >/dev/null |
59 |
@@ -1025,6 +1007,25 @@ glibc_headers_configure() { |
60 |
popd >/dev/null |
61 |
fi |
62 |
|
63 |
+ case ${CTARGET} in |
64 |
+ riscv*) |
65 |
+ # RISC-V interrogates the compiler to determine which target to |
66 |
+ # build. If building the headers then we don't strictly need a |
67 |
+ # RISC-V compiler, so the built-in definitions that are provided |
68 |
+ # along with all RISC-V compiler might not exist. This causes |
69 |
+ # glibc's RISC-V preconfigure script to blow up. Since we're just |
70 |
+ # building the headers any value will actually work here, so just |
71 |
+ # pick the standard one (rv64g/lp64d) to make the build scripts |
72 |
+ # happy for now -- the headers are all the same anyway so it |
73 |
+ # doesn't matter. |
74 |
+ headers_only_arch_CPPFLAGS+=( |
75 |
+ -D__riscv_xlen=64 |
76 |
+ -D__riscv_flen=64 |
77 |
+ -D__riscv_float_abi_double=1 |
78 |
+ -D__riscv_atomic=1 |
79 |
+ ) ;; |
80 |
+ esac |
81 |
+ |
82 |
local myconf=() |
83 |
myconf+=( |
84 |
--disable-sanity-checks |
85 |
@@ -1043,7 +1044,7 @@ glibc_headers_configure() { |
86 |
# So forcing CC/CFLAGS is sane. |
87 |
local headers_only_CC=$(tc-getBUILD_CC) |
88 |
local headers_only_CFLAGS="-O1 -pipe" |
89 |
- local headers_only_CPPFLAGS="-U_FORTIFY_SOURCE" |
90 |
+ local headers_only_CPPFLAGS="-U_FORTIFY_SOURCE ${headers_only_arch_CPPFLAGS[*]}" |
91 |
local headers_only_LDFLAGS="" |
92 |
set -- "${S}"/configure "${myconf[@]}" |
93 |
echo \ |
94 |
|
95 |
diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild |
96 |
index 12272c31f35..519bc28c954 100644 |
97 |
--- a/sys-libs/glibc/glibc-9999.ebuild |
98 |
+++ b/sys-libs/glibc/glibc-9999.ebuild |
99 |
@@ -754,26 +754,6 @@ src_prepare() { |
100 |
einfo "Done." |
101 |
fi |
102 |
|
103 |
- if just_headers ; then |
104 |
- if [[ -e sysdeps/riscv/preconfigure ]] ; then |
105 |
- # RISC-V interrogates the compiler to determine which target to |
106 |
- # build. If building the headers then we don't strictly need a |
107 |
- # RISC-V compiler, so the built-in definitions that are provided |
108 |
- # along with all RISC-V compiler might not exist. This causes |
109 |
- # glibc's RISC-V preconfigure script to blow up. Since we're just |
110 |
- # building the headers any value will actually work here, so just |
111 |
- # pick the standard one (rv64g/lp64d) to make the build scripts |
112 |
- # happy for now -- the headers are all the same anyway so it |
113 |
- # doesn't matter. |
114 |
- sed -i 's/^ xlen=.*/ xlen=64/g' sysdeps/riscv/preconfigure || die |
115 |
- sed -i 's/^ flen=.*/ flen=64/g' sysdeps/riscv/preconfigure || die |
116 |
- sed -i 's/^ float_abi=.*/ float_abi=double/g' sysdeps/riscv/preconfigure || die |
117 |
- sed -i 's/^ atomic=.*/ atomic=__riscv_atomic/g' sysdeps/riscv/preconfigure || die |
118 |
- sed -i 's/^libc_cv_riscv_float_abi=no/libc_cv_riscv_float_abi=d/g' sysdeps/unix/sysv/linux/riscv/configure.ac || die |
119 |
- sed -i 's/^libc_cv_riscv_float_abi=no/libc_cv_riscv_float_abi=d/g' sysdeps/unix/sysv/linux/riscv/configure || die |
120 |
- fi |
121 |
- fi |
122 |
- |
123 |
default |
124 |
|
125 |
gnuconfig_update |
126 |
@@ -1009,6 +989,8 @@ glibc_headers_configure() { |
127 |
export ${v} |
128 |
done |
129 |
|
130 |
+ local headers_only_arch_CPPFLAGS=() |
131 |
+ |
132 |
# Blow away some random CC settings that screw things up. #550192 |
133 |
if [[ -d ${S}/sysdeps/mips ]]; then |
134 |
pushd "${S}"/sysdeps/mips >/dev/null |
135 |
@@ -1025,6 +1007,25 @@ glibc_headers_configure() { |
136 |
popd >/dev/null |
137 |
fi |
138 |
|
139 |
+ case ${CTARGET} in |
140 |
+ riscv*) |
141 |
+ # RISC-V interrogates the compiler to determine which target to |
142 |
+ # build. If building the headers then we don't strictly need a |
143 |
+ # RISC-V compiler, so the built-in definitions that are provided |
144 |
+ # along with all RISC-V compiler might not exist. This causes |
145 |
+ # glibc's RISC-V preconfigure script to blow up. Since we're just |
146 |
+ # building the headers any value will actually work here, so just |
147 |
+ # pick the standard one (rv64g/lp64d) to make the build scripts |
148 |
+ # happy for now -- the headers are all the same anyway so it |
149 |
+ # doesn't matter. |
150 |
+ headers_only_arch_CPPFLAGS+=( |
151 |
+ -D__riscv_xlen=64 |
152 |
+ -D__riscv_flen=64 |
153 |
+ -D__riscv_float_abi_double=1 |
154 |
+ -D__riscv_atomic=1 |
155 |
+ ) ;; |
156 |
+ esac |
157 |
+ |
158 |
local myconf=() |
159 |
myconf+=( |
160 |
--disable-sanity-checks |
161 |
@@ -1043,7 +1044,7 @@ glibc_headers_configure() { |
162 |
# So forcing CC/CFLAGS is sane. |
163 |
local headers_only_CC=$(tc-getBUILD_CC) |
164 |
local headers_only_CFLAGS="-O1 -pipe" |
165 |
- local headers_only_CPPFLAGS="-U_FORTIFY_SOURCE" |
166 |
+ local headers_only_CPPFLAGS="-U_FORTIFY_SOURCE ${headers_only_arch_CPPFLAGS[*]}" |
167 |
local headers_only_LDFLAGS="" |
168 |
set -- "${S}"/configure "${myconf[@]}" |
169 |
echo \ |
170 |
@@ -1101,6 +1102,7 @@ src_test() { |
171 |
if just_headers ; then |
172 |
return |
173 |
fi |
174 |
+ |
175 |
# Give tests more time to complete. |
176 |
export TIMEOUTFACTOR=5 |