1 |
commit: ea4cbdc9159c0ebbd29d4062bbb314393a8cc32f |
2 |
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jul 12 21:13:47 2019 +0000 |
4 |
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jul 21 13:30:54 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ea4cbdc9 |
7 |
|
8 |
sys-libs/glibc: Fix handling of ${EPREFIX} when building cross-glibc |
9 |
|
10 |
It was duplicating the prefix in the form |
11 |
${EPREFIX}/usr/${CTARGET}/${EPREFIX}. |
12 |
|
13 |
This also fixes the kernel header version check, which was broken for |
14 |
native prefixed builds. |
15 |
|
16 |
Bug: https://bugs.gentoo.org/642604 |
17 |
Closes: https://github.com/gentoo/gentoo/pull/12435 |
18 |
Package-Manager: Portage-2.3.69, Repoman-2.3.13 |
19 |
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org> |
20 |
|
21 |
sys-libs/glibc/glibc-2.29-r2.ebuild | 32 ++++++++++++++++++++++---------- |
22 |
sys-libs/glibc/glibc-9999.ebuild | 32 ++++++++++++++++++++++---------- |
23 |
2 files changed, 44 insertions(+), 20 deletions(-) |
24 |
|
25 |
diff --git a/sys-libs/glibc/glibc-2.29-r2.ebuild b/sys-libs/glibc/glibc-2.29-r2.ebuild |
26 |
index ad6fed1c166..da78a273d19 100644 |
27 |
--- a/sys-libs/glibc/glibc-2.29-r2.ebuild |
28 |
+++ b/sys-libs/glibc/glibc-2.29-r2.ebuild |
29 |
@@ -125,6 +125,18 @@ alt_prefix() { |
30 |
is_crosscompile && echo /usr/${CTARGET} |
31 |
} |
32 |
|
33 |
+# This prefix is applicable to CHOST when building against this |
34 |
+# glibc. It is baked into the library at configure time. |
35 |
+host_eprefix() { |
36 |
+ is_crosscompile || echo "${EPREFIX}" |
37 |
+} |
38 |
+ |
39 |
+# This prefix is applicable to CBUILD when building against this |
40 |
+# glibc. It determines the destination path at install time. |
41 |
+build_eprefix() { |
42 |
+ is_crosscompile && echo "${EPREFIX}" |
43 |
+} |
44 |
+ |
45 |
# We need to be able to set alternative headers for compiling for non-native |
46 |
# platform. Will also become useful for testing kernel-headers without screwing |
47 |
# up the whole system. |
48 |
@@ -134,7 +146,7 @@ alt_headers() { |
49 |
|
50 |
alt_build_headers() { |
51 |
if [[ -z ${ALT_BUILD_HEADERS} ]] ; then |
52 |
- ALT_BUILD_HEADERS="${EPREFIX}$(alt_headers)" |
53 |
+ ALT_BUILD_HEADERS="$(host_eprefix)$(alt_headers)" |
54 |
if tc-is-cross-compiler ; then |
55 |
ALT_BUILD_HEADERS=${SYSROOT}$(alt_headers) |
56 |
if [[ ! -e ${ALT_BUILD_HEADERS}/linux/version.h ]] ; then |
57 |
@@ -578,7 +590,7 @@ eend_KV() { |
58 |
|
59 |
get_kheader_version() { |
60 |
printf '#include <linux/version.h>\nLINUX_VERSION_CODE\n' | \ |
61 |
- $(tc-getCPP ${CTARGET}) -I "${EPREFIX}/$(alt_build_headers)" - | \ |
62 |
+ $(tc-getCPP ${CTARGET}) -I "$(build_eprefix)$(alt_build_headers)" - | \ |
63 |
tail -n 1 |
64 |
} |
65 |
|
66 |
@@ -892,9 +904,9 @@ glibc_do_configure() { |
67 |
$(use_enable profile) |
68 |
$(use_with gd) |
69 |
--with-headers=$(alt_build_headers) |
70 |
- --prefix="${EPREFIX}/usr" |
71 |
- --sysconfdir="${EPREFIX}/etc" |
72 |
- --localstatedir="${EPREFIX}/var" |
73 |
+ --prefix="$(host_eprefix)/usr" |
74 |
+ --sysconfdir="$(host_eprefix)/etc" |
75 |
+ --localstatedir="$(host_eprefix)/var" |
76 |
--libdir='$(prefix)'/$(get_libdir) |
77 |
--mandir='$(prefix)'/share/man |
78 |
--infodir='$(prefix)'/share/info |
79 |
@@ -916,8 +928,8 @@ glibc_do_configure() { |
80 |
|
81 |
# There is no configure option for this and we need to export it |
82 |
# since the glibc build will re-run configure on itself |
83 |
- export libc_cv_rootsbindir="${EPREFIX}/sbin" |
84 |
- export libc_cv_slibdir="${EPREFIX}/$(get_libdir)" |
85 |
+ export libc_cv_rootsbindir="$(host_eprefix)/sbin" |
86 |
+ export libc_cv_slibdir="$(host_eprefix)/$(get_libdir)" |
87 |
|
88 |
# We take care of patching our binutils to use both hash styles, |
89 |
# and many people like to force gnu hash style only, so disable |
90 |
@@ -1046,7 +1058,7 @@ glibc_headers_configure() { |
91 |
--build=${CBUILD_OPT:-${CBUILD}} |
92 |
--host=${CTARGET_OPT:-${CTARGET}} |
93 |
--with-headers=$(alt_build_headers) |
94 |
- --prefix="${EPREFIX}/usr" |
95 |
+ --prefix="$(host_eprefix)/usr" |
96 |
${EXTRA_ECONF} |
97 |
) |
98 |
|
99 |
@@ -1136,7 +1148,7 @@ glibc_do_src_install() { |
100 |
local builddir=$(builddir nptl) |
101 |
cd "${builddir}" |
102 |
|
103 |
- emake install_root="${D}$(alt_prefix)" install || die |
104 |
+ emake install_root="${D}$(build_eprefix)$(alt_prefix)" install || die |
105 |
|
106 |
# This version (2.26) provides some compatibility libraries for the NIS/NIS+ support |
107 |
# which come without headers etc. Only needed for binary packages since the |
108 |
@@ -1320,7 +1332,7 @@ glibc_do_src_install() { |
109 |
glibc_headers_install() { |
110 |
local builddir=$(builddir "headers") |
111 |
cd "${builddir}" |
112 |
- emake install_root="${D}$(alt_prefix)" install-headers |
113 |
+ emake install_root="${D}$(build_eprefix)$(alt_prefix)" install-headers |
114 |
|
115 |
insinto $(alt_headers)/gnu |
116 |
doins "${S}"/include/gnu/stubs.h |
117 |
|
118 |
diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild |
119 |
index 39209741d27..2b0697465d5 100644 |
120 |
--- a/sys-libs/glibc/glibc-9999.ebuild |
121 |
+++ b/sys-libs/glibc/glibc-9999.ebuild |
122 |
@@ -126,6 +126,18 @@ alt_prefix() { |
123 |
is_crosscompile && echo /usr/${CTARGET} |
124 |
} |
125 |
|
126 |
+# This prefix is applicable to CHOST when building against this |
127 |
+# glibc. It is baked into the library at configure time. |
128 |
+host_eprefix() { |
129 |
+ is_crosscompile || echo "${EPREFIX}" |
130 |
+} |
131 |
+ |
132 |
+# This prefix is applicable to CBUILD when building against this |
133 |
+# glibc. It determines the destination path at install time. |
134 |
+build_eprefix() { |
135 |
+ is_crosscompile && echo "${EPREFIX}" |
136 |
+} |
137 |
+ |
138 |
# We need to be able to set alternative headers for compiling for non-native |
139 |
# platform. Will also become useful for testing kernel-headers without screwing |
140 |
# up the whole system. |
141 |
@@ -135,7 +147,7 @@ alt_headers() { |
142 |
|
143 |
alt_build_headers() { |
144 |
if [[ -z ${ALT_BUILD_HEADERS} ]] ; then |
145 |
- ALT_BUILD_HEADERS="${EPREFIX}$(alt_headers)" |
146 |
+ ALT_BUILD_HEADERS="$(host_eprefix)$(alt_headers)" |
147 |
if tc-is-cross-compiler ; then |
148 |
ALT_BUILD_HEADERS=${SYSROOT}$(alt_headers) |
149 |
if [[ ! -e ${ALT_BUILD_HEADERS}/linux/version.h ]] ; then |
150 |
@@ -585,7 +597,7 @@ eend_KV() { |
151 |
|
152 |
get_kheader_version() { |
153 |
printf '#include <linux/version.h>\nLINUX_VERSION_CODE\n' | \ |
154 |
- $(tc-getCPP ${CTARGET}) -I "${EPREFIX}/$(alt_build_headers)" - | \ |
155 |
+ $(tc-getCPP ${CTARGET}) -I "$(build_eprefix)$(alt_build_headers)" - | \ |
156 |
tail -n 1 |
157 |
} |
158 |
|
159 |
@@ -899,9 +911,9 @@ glibc_do_configure() { |
160 |
$(use_enable profile) |
161 |
$(use_with gd) |
162 |
--with-headers=$(alt_build_headers) |
163 |
- --prefix="${EPREFIX}/usr" |
164 |
- --sysconfdir="${EPREFIX}/etc" |
165 |
- --localstatedir="${EPREFIX}/var" |
166 |
+ --prefix="$(host_eprefix)/usr" |
167 |
+ --sysconfdir="$(host_eprefix)/etc" |
168 |
+ --localstatedir="$(host_eprefix)/var" |
169 |
--libdir='$(prefix)'/$(get_libdir) |
170 |
--mandir='$(prefix)'/share/man |
171 |
--infodir='$(prefix)'/share/info |
172 |
@@ -923,8 +935,8 @@ glibc_do_configure() { |
173 |
|
174 |
# There is no configure option for this and we need to export it |
175 |
# since the glibc build will re-run configure on itself |
176 |
- export libc_cv_rootsbindir="${EPREFIX}/sbin" |
177 |
- export libc_cv_slibdir="${EPREFIX}/$(get_libdir)" |
178 |
+ export libc_cv_rootsbindir="$(host_eprefix)/sbin" |
179 |
+ export libc_cv_slibdir="$(host_eprefix)/$(get_libdir)" |
180 |
|
181 |
# We take care of patching our binutils to use both hash styles, |
182 |
# and many people like to force gnu hash style only, so disable |
183 |
@@ -1053,7 +1065,7 @@ glibc_headers_configure() { |
184 |
--build=${CBUILD_OPT:-${CBUILD}} |
185 |
--host=${CTARGET_OPT:-${CTARGET}} |
186 |
--with-headers=$(alt_build_headers) |
187 |
- --prefix="${EPREFIX}/usr" |
188 |
+ --prefix="$(host_eprefix)/usr" |
189 |
${EXTRA_ECONF} |
190 |
) |
191 |
|
192 |
@@ -1143,7 +1155,7 @@ glibc_do_src_install() { |
193 |
local builddir=$(builddir nptl) |
194 |
cd "${builddir}" |
195 |
|
196 |
- emake install_root="${D}$(alt_prefix)" install || die |
197 |
+ emake install_root="${D}$(build_eprefix)$(alt_prefix)" install || die |
198 |
|
199 |
# This version (2.26) provides some compatibility libraries for the NIS/NIS+ support |
200 |
# which come without headers etc. Only needed for binary packages since the |
201 |
@@ -1327,7 +1339,7 @@ glibc_do_src_install() { |
202 |
glibc_headers_install() { |
203 |
local builddir=$(builddir "headers") |
204 |
cd "${builddir}" |
205 |
- emake install_root="${D}$(alt_prefix)" install-headers |
206 |
+ emake install_root="${D}$(build_eprefix)$(alt_prefix)" install-headers |
207 |
|
208 |
insinto $(alt_headers)/gnu |
209 |
doins "${S}"/include/gnu/stubs.h |