Gentoo Archives: gentoo-commits

From: Pacho Ramos <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/klibc/
Date: Tue, 06 Jun 2017 11:45:07
Message-Id: 1496749487.6114d8e6b583c16894291087a0ae995a0c2b566a.pacho@gentoo
1 commit: 6114d8e6b583c16894291087a0ae995a0c2b566a
2 Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 6 11:44:22 2017 +0000
4 Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 6 11:44:47 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6114d8e6
7
8 dev-libs/klibc: Drop old
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.2
11
12 dev-libs/klibc/Manifest | 4 -
13 dev-libs/klibc/klibc-1.5.25.ebuild | 265 -------------------------------
14 dev-libs/klibc/klibc-2.0.4.ebuild | 316 -------------------------------------
15 3 files changed, 585 deletions(-)
16
17 diff --git a/dev-libs/klibc/Manifest b/dev-libs/klibc/Manifest
18 index cec70f846d2..b011c20c02a 100644
19 --- a/dev-libs/klibc/Manifest
20 +++ b/dev-libs/klibc/Manifest
21 @@ -1,7 +1,3 @@
22 -DIST klibc-1.5.25.tar.bz2 510064 SHA256 0b910ec0b2a97d4c775ed06e44ad7bca7be150efdf2a77a19253a573e16367d3 SHA512 e550afb319cd995fb9c7fb086bc8ede550e5e4a48856ff5856e2296f691ba643c9fcc314c5e973f4d5b4f33b543ef4bc10d29b389f83e5418ec860a80e7cac45 WHIRLPOOL d986dcdcc95e2c7846d2eda9338519d5d84f50e94f82f1eee0234a17504ae10abaa75b6c89e9cf4c228690c0cc489d4323d98e5e62cde10cf7a04581026309f3
23 DIST klibc-2.0.4.tar.xz 469348 SHA256 7f9a0850586def7cf4faeeb75e5d0f66e613674c524f6e77b0f4d93a26c801cb SHA512 7a01d1744b49f3de64111fefc522b1d63f054199acf671254bc046d6f1d0b6ca68e050c99025bf8303751c2466a5e034677555649ae5909c40997858d393db8d WHIRLPOOL f5dc71b48f118155df512d8ac839b66d361b22ff4e040e49a562722d82f18ac83a8c682bf0b4c59a9b108473f74bebc673d38456cf0ab5b1051071ca3fa9b78e
24 -DIST klibc_2.0.2-1.debian.tar.gz 21305 SHA256 93f4b9be5a3c725a38b7ac137850311e3cf8d8094874006c7dce793d2b71e469 SHA512 9cbcc39396a49bc37ace79eaefad6e704ddc9f30aba1b39f40dd2888dad06eeeb7b9c1a387cee60a95cf5641f50bd7f225cf8209547c75a8bae8af4285152d91 WHIRLPOOL a42e148550a27426e8f38b54cb4f3b1f355759d573ab27c0ecadb0c68d0afd54a5950471628ec4e2e27ac9c8b9d841940d6b0f2c0a873d4feab7af37e7989a52
25 DIST klibc_2.0.4-9.debian.tar.xz 28628 SHA256 069f3496d66bda23bca227acdbf2b5e5b57e57419db619c293b81ed4929aba12 SHA512 0fe9a6642be962fa631919850d7eeed5a87c10682766ee10fe31dec2b19a6179e0067602acb26bdc2aa8ceecfd39b1dc95a76f3b0a9bc813b172c0ffe9f0ff53 WHIRLPOOL 96de652f4b0cea4e2c117f541d820b9e869c05763e408b7bd203d04ae2b70a89939713794e0dda27f253b2662ef03aea62bd669b06de4a2290f807890b1b01e8
26 -DIST linux-2.6.39.tar.bz2 76096559 SHA256 584d17f2a3ee18a9501d7ff36907639e538cfdba4529978b8550c461d45c61f6 SHA512 06cb5aba7c53c68d43afcebbbb9507d8b398b3e994d8a237c66a49374ca569237f074adaa3fccba7f908eab4f51f99bae40656793eab5c2f5ce03cd3a65fa02c WHIRLPOOL 2f2c833ab1d8ddbe3e0b862b71a38d47fd3fc5688ea81cdd818369b09e72fa50481bf84533ddcea992af1130b2ceec10b6ff5eaff393a14ee70639293a555912
27 -DIST linux-3.12.tar.xz 76384600 SHA256 2e120ec7fde19fa51dc6b6cc11c81860a0775defcad5a5bf910ed9a50e845a02 SHA512 4ba5797e0772726d05c9f2eee66dc6dc2a5033c749ef44764c805a83da739ed5d0c6443b76785e38fe1ef74cc7ade787e48144faed0cfcb6f124f05248c700ff WHIRLPOOL a40195f6b53ba3440cf90a44495f6a59670f750851d1518e2bdfe3b949f0e898d1df5d37e271c31c555087026ddb6cc2c9109b22b9639e3222735e6f650a1417
28 DIST linux-4.4.tar.xz 87295988 SHA256 401d7c8fef594999a460d10c72c5a94e9c2e1022f16795ec51746b0d165418b2 SHA512 13c8459933a8b80608e226a1398e3d1848352ace84bcfb7e6a4a33cb230bbe1ab719d4b58e067283df91ce5311be6d2d595fc8c19e2ae6ecc652499415614b3e WHIRLPOOL 02abc203d867404b9934aaa4c1e5b5dcbb0b0021e91a03f3a7e7fd224eed106821d8b4949f32a590536db150e5a88c16fcde88538777a26d0c17900f0257b1bc
29
30 diff --git a/dev-libs/klibc/klibc-1.5.25.ebuild b/dev-libs/klibc/klibc-1.5.25.ebuild
31 deleted file mode 100644
32 index 0a7041be858..00000000000
33 --- a/dev-libs/klibc/klibc-1.5.25.ebuild
34 +++ /dev/null
35 @@ -1,265 +0,0 @@
36 -# Copyright 1999-2014 Gentoo Foundation
37 -# Distributed under the terms of the GNU General Public License v2
38 -
39 -# Robin H. Johnson <robbat2@g.o>, 12 Nov 2007:
40 -# This still needs major work.
41 -# But it is significently better than the previous version.
42 -# In that it will now build on biarch systems, such as ppc64-32ul.
43 -
44 -# NOTES:
45 -# ======
46 -# We need to bring in the kernel sources seperately
47 -# Because they have to be configured in a way that differs from the copy in
48 -# /usr/src/. The sys-kernel/linux-headers are too stripped down to use
49 -# unfortunately.
50 -# This will be able to go away once the klibc author updates his code
51 -# to build again the headers provided by the kernel's 'headers_install' target.
52 -
53 -inherit eutils multilib toolchain-funcs
54 -
55 -DESCRIPTION="A minimal libc subset for use with initramfs"
56 -HOMEPAGE="http://www.zytor.com/mailman/listinfo/klibc"
57 -KV_MAJOR="2" KV_MINOR="6" KV_SUB="39"
58 -PKV_EXTRA=""
59 -if [ -n "${PKV_EXTRA}" ]; then
60 - PKV="${KV_MAJOR}.${KV_MINOR}.$((${KV_SUB}+1))-${PKV_EXTRA}"
61 - PATCH_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/patch-${PKV}.bz2"
62 -fi
63 -OKV="${KV_MAJOR}.${KV_MINOR}.${KV_SUB}"
64 -KERNEL_URI="
65 - mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2
66 - mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/testing/linux-${OKV}.tar.bz2"
67 -SRC_URI="
68 - mirror://kernel/linux/libs/klibc/${PV:0:3}/${P}.tar.bz2
69 - ${PATCH_URI}
70 - ${KERNEL_URI}"
71 -
72 -LICENSE="|| ( GPL-2 LGPL-2 )"
73 -KEYWORDS="~alpha amd64 ~arm ia64 -mips ~ppc ~ppc64 ~sparc x86"
74 -SLOT="0"
75 -IUSE="debug"
76 -
77 -DEPEND="dev-lang/perl"
78 -RDEPEND="${DEPEND}"
79 -
80 -KS="${WORKDIR}/linux-${OKV}"
81 -
82 -# Klibc has no PT_GNU_STACK support, so scanning for execstacks is moot
83 -QA_EXECSTACK="*"
84 -# Do not strip
85 -RESTRICT="strip"
86 -
87 -kernel_asm_arch() {
88 - a="${1:${ARCH}}"
89 - case ${a} in
90 - # Merged arches
91 - x86|amd64) echo x86 ;;
92 - ppc*) echo powerpc ;;
93 - # Non-merged
94 - alpha|arm|ia64|m68k|mips|sh|sparc*) echo ${1} ;;
95 - *) die "TODO: Update the code for your asm-ARCH symlink" ;;
96 - esac
97 -}
98 -
99 -# For a given Gentoo ARCH,
100 -# specify the kernel defconfig most relevant
101 -kernel_defconfig() {
102 - a="${1:${ARCH}}"
103 - # most, but not all arches have a sanely named defconfig
104 - case ${a} in
105 - ppc64) echo ppc64_defconfig ;;
106 - ppc) echo pmac32_defconfig ;;
107 - sh*) die "TODO: Your arch is not supported by the klibc ebuild. Please suggest a defconfig in a bug." ;;
108 - *) echo defconfig ;;
109 - esac
110 -}
111 -
112 -src_unpack() {
113 - unpack linux-${OKV}.tar.bz2 ${P}.tar.bz2
114 - [ -n "${PKV}" ] && EPATCH_OPTS="-d ${KS} -p1" epatch "${DISTDIR}"/patch-${PKV}.bz2
115 - cd "${S}"
116 -
117 - # Symlink /usr/src/linux to ${S}/linux
118 - ln -snf "${KS}" linux
119 - #ln -snf "/usr" linux
120 -
121 - # Build interp.o with EXTRA_KLIBCAFLAGS (.S source)
122 - epatch "${FILESDIR}"/${PN}-1.4.11-interp-flags.patch
123 -
124 - # Fix usage of -s, bug #201006
125 - epatch "${FILESDIR}"/klibc-1.5.7-strip-fix-dash-s.patch
126 -}
127 -
128 -# klibc has it's own ideas of arches
129 -# They reflect userspace strictly.
130 -# This functions maps from a Gentoo ARCH, to an arch that klibc expects
131 -# Look at klibc-${S}/usr/klibc/arch for a list of these arches
132 -klibc_arch() {
133 - a="${1:${ARCH}}"
134 - case ${a} in
135 - amd64) echo x86_64;;
136 - mips) die 'TODO: Use the $ABI' ;;
137 - x86) echo i386;;
138 - *) echo ${a} ;;
139 - esac
140 -}
141 -
142 -src_compile() {
143 - local myargs="all"
144 - local myARCH="${ARCH}" myABI="${ABI}"
145 - # TODO: For cross-compiling
146 - # You should set ARCH and ABI here
147 - CC="$(tc-getCC)"
148 - HOSTCC="$(tc-getBUILD_CC)"
149 - KLIBCARCH="$(klibc_arch ${ARCH})"
150 - KLIBCASMARCH="$(kernel_asm_arch ${ARCH})"
151 - libdir="$(get_libdir)"
152 - # This should be the defconfig corresponding to your userspace!
153 - # NOT your kernel. PPC64-32ul would choose 'ppc' for example.
154 - defconfig=$(kernel_defconfig ${ARCH})
155 - unset ABI ARCH # Unset these, because they interfere
156 - unset KBUILD_OUTPUT # we are using a private copy
157 -
158 - cd "${KS}"
159 - emake ${defconfig} CC="${CC}" HOSTCC="${HOSTCC}" || die "No defconfig"
160 - if [[ "${KLIBCARCH/arm}" != "${KLIBCARCH}" ]] && \
161 - [[ "${CHOST/eabi}" != "${CHOST}" ]]; then
162 - # The delete and insert are seperate statements
163 - # so that they are reliably used.
164 - sed -i \
165 - -e '/CONFIG_AEABI/d' \
166 - -e '1iCONFIG_AEABI=y' \
167 - -e '/CONFIG_OABI_COMPAT/d' \
168 - -e '1iCONFIG_OABI_COMPAT=y' \
169 - "${KS}"/.config \
170 - "${S}"/defconfig
171 - fi
172 - emake prepare CC="${CC}" HOSTCC="${HOSTCC}" || die "Failed to prepare kernel sources for header usage"
173 -
174 - cd "${S}"
175 -
176 - use debug && myargs="${myargs} V=1"
177 - use test && myargs="${myargs} test"
178 -
179 - emake \
180 - EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \
181 - EXTRA_KLIBCLDFLAGS="-z noexecstack" \
182 - HOSTCC="${HOSTCC}" CC="${CC}" \
183 - INSTALLDIR="/usr/${libdir}/klibc" \
184 - KLIBCARCH=${KLIBCARCH} \
185 - KLIBCASMARCH=${KLIBCASMARCH} \
186 - SHLIBDIR="/${libdir}" \
187 - libdir="/usr/${libdir}" \
188 - mandir="/usr/share/man" \
189 - T="${T}" \
190 - ${myargs} || die "Compile failed!"
191 -
192 - #SHLIBDIR="/${libdir}" \
193 -
194 - ARCH="${myARCH}" ABI="${myABI}"
195 -}
196 -
197 -src_install() {
198 - local myargs
199 - local myARCH="${ARCH}" myABI="${ABI}"
200 - # TODO: For cross-compiling
201 - # You should set ARCH and ABI here
202 - CC="$(tc-getCC)"
203 - HOSTCC="$(tc-getBUILD_CC)"
204 - KLIBCARCH="$(klibc_arch ${ARCH})"
205 - KLIBCASMARCH="$(kernel_asm_arch ${ARCH})"
206 - libdir="$(get_libdir)"
207 - # This should be the defconfig corresponding to your userspace!
208 - # NOT your kernel. PPC64-32ul would choose 'ppc' for example.
209 - defconfig=$(kernel_defconfig ${ARCH})
210 -
211 - use debug && myargs="${myargs} V=1"
212 -
213 - local klibc_prefix
214 - if tc-is-cross-compiler ; then
215 - klibc_prefix=$("${S}/klcc/${KLIBCARCH}-klcc" -print-klibc-prefix)
216 - else
217 - klibc_prefix=$("${S}/klcc/klcc" -print-klibc-prefix)
218 - fi
219 -
220 - unset ABI ARCH # Unset these, because they interfere
221 - unset KBUILD_OUTPUT # we are using a private copy
222 -
223 - emake \
224 - EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \
225 - EXTRA_KLIBCLDFLAGS="-z noexecstack" \
226 - HOSTCC="${HOSTCC}" CC="${CC}" \
227 - INSTALLDIR="/usr/${libdir}/klibc" \
228 - INSTALLROOT="${D}" \
229 - KLIBCARCH=${KLIBCARCH} \
230 - KLIBCASMARCH=${KLIBCASMARCH} \
231 - SHLIBDIR="/${libdir}" \
232 - libdir="/usr/${libdir}" \
233 - mandir="/usr/share/man" \
234 - ${myargs} \
235 - install || die "Install failed!"
236 -
237 - #SHLIBDIR="/${libdir}" \
238 -
239 - # klibc doesn't support prelinking, so we need to mask it
240 - cat > "${T}/70klibc" <<-EOF
241 - PRELINK_PATH_MASK="/usr/${libdir}/klibc"
242 - EOF
243 -
244 - doenvd "${T}"/70klibc
245 -
246 - # Fix the permissions (bug #178053) on /usr/${libdir}/klibc/include
247 - # Actually I have no idea, why the includes have those weird-ass permissions
248 - # on a particular system, might be due to inherited permissions from parent
249 - # directory
250 - find "${D}"/usr/${libdir}/klibc/include | xargs chmod o+rX
251 -
252 - # Hardlinks becoming copies
253 - for x in gunzip zcat ; do
254 - rm -f "${D}/${klibc_prefix}/bin/${x}"
255 - dosym gzip "${klibc_prefix}/bin/${x}"
256 - done
257 -
258 - # Restore now, so we can use the tc- functions
259 - ARCH="${myARCH}" ABI="${myABI}"
260 - if ! tc-is-cross-compiler ; then
261 - cd "${S}"
262 - insinto /usr/share/aclocal
263 - doins contrib/klibc.m4
264 -
265 - dodoc README usr/klibc/CAVEATS
266 - docinto gzip; dodoc usr/gzip/README
267 - fi
268 -
269 - # Fix up the symlink
270 - # Mainly for merged arches
271 - linkname="${D}/usr/${libdir}/klibc/include/asm"
272 - if [ -L "${linkname}" ] && [ ! -e "${linkname}" ] ; then
273 - ln -snf asm-${KLIBCASMARCH} "${linkname}"
274 - fi
275 -}
276 -
277 -src_test() {
278 - if ! tc-is-cross-compiler ; then
279 - cd "${S}"/usr/klibc/tests
280 - ALL_TESTS="$(ls *.c |sed 's,\.c$,,g')"
281 - BROKEN_TESTS="fcntl fnmatch testrand48"
282 - failed=0
283 - for t in $ALL_TESTS ; do
284 - if has $t $BROKEN_TESTS ; then
285 - echo "=== $t SKIP"
286 - else
287 - echo -n "=== $t "
288 - ./$t </dev/null >/dev/null
289 - rc=$?
290 - if [ $rc -eq 0 ]; then
291 - echo PASS
292 - else
293 - echo FAIL
294 - failed=1
295 - fi
296 - fi
297 - done
298 - [ $failed -ne 0 ] && die "Some tests failed."
299 - fi
300 -}
301
302 diff --git a/dev-libs/klibc/klibc-2.0.4.ebuild b/dev-libs/klibc/klibc-2.0.4.ebuild
303 deleted file mode 100644
304 index 907298dfb3d..00000000000
305 --- a/dev-libs/klibc/klibc-2.0.4.ebuild
306 +++ /dev/null
307 @@ -1,316 +0,0 @@
308 -# Copyright 1999-2016 Gentoo Foundation
309 -# Distributed under the terms of the GNU General Public License v2
310 -
311 -# Robin H. Johnson <robbat2@g.o>, 12 Nov 2007:
312 -# This still needs major work.
313 -# But it is significently better than the previous version.
314 -# In that it will now build on biarch systems, such as ppc64-32ul.
315 -
316 -# NOTES:
317 -# ======
318 -# We need to bring in the kernel sources seperately
319 -# Because they have to be configured in a way that differs from the copy in
320 -# /usr/src/. The sys-kernel/linux-headers are too stripped down to use
321 -# unfortunately.
322 -# This will be able to go away once the klibc author updates his code
323 -# to build again the headers provided by the kernel's 'headers_install' target.
324 -
325 -EAPI=5
326 -K_TARBALL_SUFFIX="xz"
327 -
328 -inherit eutils multilib toolchain-funcs flag-o-matic
329 -
330 -DESCRIPTION="A minimal libc subset for use with initramfs"
331 -HOMEPAGE="http://www.zytor.com/mailman/listinfo/klibc/ https://www.kernel.org/pub/linux/libs/klibc/"
332 -KV_MAJOR="3" KV_MINOR="x" KV_SUB="12"
333 -PKV_EXTRA=""
334 -if [[ ${PKV_EXTRA} ]]; then
335 - if [[ ${KV_MAJOR} == 2 ]]; then
336 - PKV="${KV_MAJOR}.${KV_MINOR}.$((${KV_SUB}+1))-${PKV_EXTRA}"
337 - else
338 - PKV="${KV_MAJOR}.$((${KV_SUB}+1))-${PKV_EXTRA}"
339 - fi
340 - PATCH_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/patch-${PKV}.${K_TARBALL_SUFFIX}"
341 -fi
342 -if [[ ${KV_MAJOR} == 2 ]]; then
343 - OKV="${KV_MAJOR}.${KV_MINOR}.${KV_SUB}"
344 -else
345 - OKV="${KV_MAJOR}.${KV_SUB}"
346 -fi
347 -KERNEL_URI="
348 - mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.${K_TARBALL_SUFFIX}
349 - mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/testing/linux-${OKV}.tar.${K_TARBALL_SUFFIX}"
350 -DEBIAN_PV=2.0.2
351 -DEBIAN_PR=1
352 -DEBIAN_A="${PN}_${DEBIAN_PV}-${DEBIAN_PR}.debian.tar.gz"
353 -SRC_URI="
354 - mirror://kernel/linux/libs/klibc/${PV:0:3}/${P}.tar.${K_TARBALL_SUFFIX}
355 - mirror://debian/pool/main/k/klibc/${DEBIAN_A}
356 - ${PATCH_URI}
357 - ${KERNEL_URI}"
358 -
359 -LICENSE="|| ( GPL-2 LGPL-2 )"
360 -KEYWORDS="~alpha ~amd64 ~arm ~ia64 -mips ~ppc ~ppc64 ~sparc ~x86"
361 -SLOT="0"
362 -IUSE="debug test custom-cflags"
363 -
364 -DEPEND="dev-lang/perl"
365 -RDEPEND="${DEPEND}"
366 -
367 -KS="${WORKDIR}/linux-${OKV}"
368 -
369 -# Klibc has no PT_GNU_STACK support, so scanning for execstacks is moot
370 -QA_EXECSTACK="*"
371 -# Do not strip
372 -RESTRICT="strip"
373 -
374 -kernel_asm_arch() {
375 - a="${1:${ARCH}}"
376 - case ${a} in
377 - # Merged arches
378 - x86) echo i386 ;; # for build on x86 userspace & 64bit kernel
379 - amd64) echo x86 ;;
380 - ppc*) echo powerpc ;;
381 - # Non-merged
382 - alpha|arm|arm64|ia64|m68k|mips|sh|sparc*) echo ${1} ;;
383 - *) die "TODO: Update the code for your asm-ARCH symlink" ;;
384 - esac
385 -}
386 -
387 -# For a given Gentoo ARCH,
388 -# specify the kernel defconfig most relevant
389 -kernel_defconfig() {
390 - a="${1:${ARCH}}"
391 - # most, but not all arches have a sanely named defconfig
392 - case ${a} in
393 - ppc64) echo ppc64_defconfig ;;
394 - ppc) echo pmac32_defconfig ;;
395 - sh*) die "TODO: Your arch is not supported by the klibc ebuild. Please suggest a defconfig in a bug." ;;
396 - *) echo defconfig ;;
397 - esac
398 -}
399 -
400 -src_unpack() {
401 - unpack linux-${OKV}.tar.${K_TARBALL_SUFFIX} ${P}.tar.${K_TARBALL_SUFFIX} ${DEBIAN_A}
402 -}
403 -
404 -src_prepare() {
405 - [[ ${PKV} ]] && EPATCH_OPTS="-d ${KS} -p1" epatch "${DISTDIR}"/patch-${PKV}.${K_TARBALL_SUFFIX}
406 - cd "${S}"
407 -
408 - # Symlink /usr/src/linux to ${S}/linux
409 - ln -snf "${KS}" linux
410 - #ln -snf "/usr" linux
411 -
412 - # Build interp.o with EXTRA_KLIBCAFLAGS (.S source)
413 - epatch "${FILESDIR}"/${PN}-1.4.11-interp-flags.patch
414 -
415 - # Fix usage of -s, bug #201006
416 - epatch "${FILESDIR}"/klibc-1.5.7-strip-fix-dash-s.patch
417 -
418 - # The inline definition from sys/stat.h does not seem to get used
419 - # So just copy it to make this compile for now
420 - epatch "${FILESDIR}"/klibc-2.0.2-mkfifo.patch
421 -
422 - # Newer kernels have some headers in the uapi dir
423 - epatch "${FILESDIR}"/klibc-2.0.3-kernel-uapi.patch
424 -
425 - # Borrow the debian fixes too
426 - for p in $(<"${S}"/debian/patches/series) ; do
427 - epatch "${S}/debian/patches/${p}"
428 - done
429 -}
430 -
431 -# klibc has it's own ideas of arches
432 -# They reflect userspace strictly.
433 -# This functions maps from a Gentoo ARCH, to an arch that klibc expects
434 -# Look at klibc-${S}/usr/klibc/arch for a list of these arches
435 -klibc_arch() {
436 - a="${1:${ARCH}}"
437 - case ${a} in
438 - amd64) echo x86_64;;
439 - mips) die 'TODO: Use the $ABI' ;;
440 - x86) echo i386;;
441 - *) echo ${a} ;;
442 - esac
443 -}
444 -
445 -src_compile() {
446 - local myargs="all"
447 - local myARCH="${ARCH}" myABI="${ABI}"
448 - # TODO: For cross-compiling
449 - # You should set ARCH and ABI here
450 - CC="$(tc-getCC)"
451 - LD="$(tc-getLD)"
452 - HOSTCC="$(tc-getBUILD_CC)"
453 - HOSTLD="$(tc-getBUILD_LD)"
454 - KLIBCARCH="$(klibc_arch ${ARCH})"
455 - KLIBCASMARCH="$(kernel_asm_arch ${ARCH})"
456 - libdir="$(get_libdir)"
457 - # This should be the defconfig corresponding to your userspace!
458 - # NOT your kernel. PPC64-32ul would choose 'ppc' for example.
459 - defconfig=$(kernel_defconfig ${ARCH})
460 - unset ABI ARCH # Unset these, because they interfere
461 - unset KBUILD_OUTPUT # we are using a private copy
462 -
463 - cd "${KS}"
464 - emake ${defconfig} CC="${CC}" HOSTCC="${HOSTCC}" ARCH="${KLIBCASMARCH}" || die "No defconfig"
465 - if [[ "${KLIBCARCH/arm}" != "${KLIBCARCH}" ]] && \
466 - [[ "${CHOST/eabi}" != "${CHOST}" ]]; then
467 - # The delete and insert are seperate statements
468 - # so that they are reliably used.
469 - sed -i \
470 - -e '/CONFIG_AEABI/d' \
471 - -e '1iCONFIG_AEABI=y' \
472 - -e '/CONFIG_OABI_COMPAT/d' \
473 - -e '1iCONFIG_OABI_COMPAT=y' \
474 - -e '1iCONFIG_ARM_UNWIND=y' \
475 - "${KS}"/.config \
476 - "${S}"/defconfig
477 - fi
478 - emake prepare CC="${CC}" HOSTCC="${HOSTCC}" ARCH="${KLIBCASMARCH}" || die "Failed to prepare kernel sources for header usage"
479 -
480 - cd "${S}"
481 -
482 - use debug && myargs="${myargs} V=1"
483 - use test && myargs="${myargs} test"
484 - append-ldflags -z noexecstack
485 - append-flags -nostdlib
486 -
487 - emake \
488 - EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \
489 - EXTRA_KLIBCLDFLAGS="-z noexecstack" \
490 - HOSTLDFLAGS="-z noexecstack" \
491 - KLIBCOPTFLAGS='-nostdlib' \
492 - HOSTCC="${HOSTCC}" CC="${CC}" \
493 - HOSTLD="${HOSTLD}" LD="${LD}" \
494 - INSTALLDIR="/usr/${libdir}/klibc" \
495 - KLIBCARCH=${KLIBCARCH} \
496 - KLIBCASMARCH=${KLIBCASMARCH} \
497 - SHLIBDIR="/${libdir}" \
498 - libdir="/usr/${libdir}" \
499 - mandir="/usr/share/man" \
500 - T="${T}" \
501 - $(use custom-cflags || echo SKIP_)HOSTCFLAGS="${CFLAGS}" \
502 - $(use custom-cflags || echo SKIP_)HOSTLDFLAGS="${LDFLAGS}" \
503 - $(use custom-cflags || echo SKIP_)KLIBCOPTFLAGS="${CFLAGS}" \
504 - ${myargs} || die "Compile failed!"
505 -
506 - #SHLIBDIR="/${libdir}" \
507 -
508 - ARCH="${myARCH}" ABI="${myABI}"
509 -}
510 -
511 -src_install() {
512 - local myargs
513 - local myARCH="${ARCH}" myABI="${ABI}"
514 - # TODO: For cross-compiling
515 - # You should set ARCH and ABI here
516 - CC="$(tc-getCC)"
517 - HOSTCC="$(tc-getBUILD_CC)"
518 - KLIBCARCH="$(klibc_arch ${ARCH})"
519 - KLIBCASMARCH="$(kernel_asm_arch ${ARCH})"
520 - libdir="$(get_libdir)"
521 - # This should be the defconfig corresponding to your userspace!
522 - # NOT your kernel. PPC64-32ul would choose 'ppc' for example.
523 - defconfig=$(kernel_defconfig ${ARCH})
524 -
525 - use debug && myargs="${myargs} V=1"
526 -
527 - local klibc_prefix
528 - if tc-is-cross-compiler ; then
529 - klibc_prefix=$("${S}/klcc/${KLIBCARCH}-klcc" -print-klibc-prefix)
530 - else
531 - klibc_prefix=$("${S}/klcc/klcc" -print-klibc-prefix)
532 - fi
533 -
534 - unset ABI ARCH # Unset these, because they interfere
535 - unset KBUILD_OUTPUT # we are using a private copy
536 -
537 - emake \
538 - EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \
539 - EXTRA_KLIBCLDFLAGS="-z noexecstack" \
540 - HOSTLDFLAGS="-z noexecstack" \
541 - KLIBCOPTFLAGS='-nostdlib' \
542 - HOSTCC="${HOSTCC}" CC="${CC}" \
543 - HOSTLD="${HOSTLD}" LD="${LD}" \
544 - INSTALLDIR="/usr/${libdir}/klibc" \
545 - INSTALLROOT="${D}" \
546 - KLIBCARCH=${KLIBCARCH} \
547 - KLIBCASMARCH=${KLIBCASMARCH} \
548 - SHLIBDIR="/${libdir}" \
549 - libdir="/usr/${libdir}" \
550 - mandir="/usr/share/man" \
551 - T="${T}" \
552 - $(use custom-cflags || echo SKIP_)HOSTCFLAGS="${CFLAGS}" \
553 - $(use custom-cflags || echo SKIP_)HOSTLDFLAGS="${LDFLAGS}" \
554 - $(use custom-cflags || echo SKIP_)KLIBCOPTFLAGS="${CFLAGS}" \
555 - ${myargs} \
556 - install || die "Install failed!"
557 -
558 - #SHLIBDIR="/${libdir}" \
559 -
560 - # klibc doesn't support prelinking, so we need to mask it
561 - cat > "${T}/70klibc" <<-EOF
562 - PRELINK_PATH_MASK="/usr/${libdir}/klibc"
563 - EOF
564 -
565 - doenvd "${T}"/70klibc
566 -
567 - # Fix the permissions (bug #178053) on /usr/${libdir}/klibc/include
568 - # Actually I have no idea, why the includes have those weird-ass permissions
569 - # on a particular system, might be due to inherited permissions from parent
570 - # directory
571 - find "${D}"/usr/${libdir}/klibc/include | xargs chmod o+rX
572 - find "${D}"/usr/${libdir}/klibc/include -type f \
573 - \( -name '.install' -o -name '..install.cmd' \) -delete || die
574 -
575 - # Hardlinks becoming copies
576 - for x in gunzip zcat ; do
577 - rm -f "${D}/${klibc_prefix}/bin/${x}"
578 - dosym gzip "${klibc_prefix}/bin/${x}"
579 - done
580 -
581 - # Restore now, so we can use the tc- functions
582 - ARCH="${myARCH}" ABI="${myABI}"
583 - if ! tc-is-cross-compiler ; then
584 - cd "${S}"
585 - insinto /usr/share/aclocal
586 - doins contrib/klibc.m4
587 -
588 - dodoc README usr/klibc/CAVEATS
589 - docinto gzip; dodoc usr/gzip/README
590 - fi
591 -
592 - # Fix up the symlink
593 - # Mainly for merged arches
594 - linkname="${D}/usr/${libdir}/klibc/include/asm"
595 - if [ -L "${linkname}" ] && [ ! -e "${linkname}" ] ; then
596 - ln -snf asm-${KLIBCASMARCH} "${linkname}"
597 - fi
598 -}
599 -
600 -src_test() {
601 - if ! tc-is-cross-compiler ; then
602 - cd "${S}"/usr/klibc/tests
603 - ALL_TESTS="$(ls *.c |sed 's,\.c$,,g')"
604 - BROKEN_TESTS="fcntl fnmatch testrand48"
605 - failed=0
606 - for t in $ALL_TESTS ; do
607 - if has $t $BROKEN_TESTS ; then
608 - echo "=== $t SKIP"
609 - else
610 - echo -n "=== $t "
611 - ./$t </dev/null >/dev/null
612 - rc=$?
613 - if [ $rc -eq 0 ]; then
614 - echo PASS
615 - else
616 - echo FAIL
617 - failed=1
618 - fi
619 - fi
620 - done
621 - [ $failed -ne 0 ] && die "Some tests failed."
622 - fi
623 -}