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: Sun, 27 Jan 2019 11:06:43
Message-Id: 1548587140.25d6028f2bbd8b8e7313a4f307f3115332ebc062.pacho@gentoo
1 commit: 25d6028f2bbd8b8e7313a4f307f3115332ebc062
2 Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 27 11:02:15 2019 +0000
4 Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 27 11:05:40 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25d6028f
7
8 dev-libs/klibc: Drop old
9
10 Package-Manager: Portage-2.3.58, Repoman-2.3.12
11 Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>
12
13 dev-libs/klibc/Manifest | 1 -
14 dev-libs/klibc/klibc-2.0.4-r2.ebuild | 318 -----------------------------------
15 2 files changed, 319 deletions(-)
16
17 diff --git a/dev-libs/klibc/Manifest b/dev-libs/klibc/Manifest
18 index 10df3d3198b..d2bab8e8ae0 100644
19 --- a/dev-libs/klibc/Manifest
20 +++ b/dev-libs/klibc/Manifest
21 @@ -1,4 +1,3 @@
22 DIST klibc-2.0.4.tar.xz 469348 BLAKE2B 5975e3d25f72b70c4cbaa56ea5363417407e8dace1e02e2da0b835bbb2cad56648b0084e5404528206ef3facf4ffd3611e8bd729eadd80b00e30d1a70b3057cf SHA512 7a01d1744b49f3de64111fefc522b1d63f054199acf671254bc046d6f1d0b6ca68e050c99025bf8303751c2466a5e034677555649ae5909c40997858d393db8d
23 DIST klibc_2.0.4-9.debian.tar.xz 28628 BLAKE2B aaad6fafb7372152987eebda5951b9f3de2e33da583e0ea7597f666461977f461303566f9e363e9c96994c7b0eb6213c6a17b2fab72df7460db3cfbc0c2e1cf8 SHA512 0fe9a6642be962fa631919850d7eeed5a87c10682766ee10fe31dec2b19a6179e0067602acb26bdc2aa8ceecfd39b1dc95a76f3b0a9bc813b172c0ffe9f0ff53
24 DIST linux-4.14.tar.xz 100770500 BLAKE2B 85dc4aa953fe65e273a24473d8de98e4f204f97c43be9fc87cf5be01f796f94cfde5c8f9c84619751f1cac51f83ce0b4681fb19c5f2965a72d4a94fe5577846a SHA512 77e43a02d766c3d73b7e25c4aafb2e931d6b16e870510c22cef0cdb05c3acb7952b8908ebad12b10ef982c6efbe286364b1544586e715cf38390e483927904d8
25 -DIST linux-4.4.tar.xz 87295988 BLAKE2B f260f1858994f5d481fd078c86e51bddbc958f7c5d1586f60dced772e1b1107ecf3aae0558c3e6f39c36f7d3aa1e6cd1e5c64ec9d6f2218f47b98413da6466fb SHA512 13c8459933a8b80608e226a1398e3d1848352ace84bcfb7e6a4a33cb230bbe1ab719d4b58e067283df91ce5311be6d2d595fc8c19e2ae6ecc652499415614b3e
26
27 diff --git a/dev-libs/klibc/klibc-2.0.4-r2.ebuild b/dev-libs/klibc/klibc-2.0.4-r2.ebuild
28 deleted file mode 100644
29 index f9435d7ad81..00000000000
30 --- a/dev-libs/klibc/klibc-2.0.4-r2.ebuild
31 +++ /dev/null
32 @@ -1,318 +0,0 @@
33 -# Copyright 1999-2018 Gentoo Foundation
34 -# Distributed under the terms of the GNU General Public License v2
35 -
36 -# Robin H. Johnson <robbat2@g.o>, 12 Nov 2007:
37 -# This still needs major work.
38 -# But it is significently better than the previous version.
39 -# In that it will now build on biarch systems, such as ppc64-32ul.
40 -
41 -# NOTES:
42 -# ======
43 -# We need to bring in the kernel sources seperately
44 -# Because they have to be configured in a way that differs from the copy in
45 -# /usr/src/. The sys-kernel/linux-headers are too stripped down to use
46 -# unfortunately.
47 -# This will be able to go away once the klibc author updates his code
48 -# to build again the headers provided by the kernel's 'headers_install' target.
49 -
50 -EAPI=6
51 -K_TARBALL_SUFFIX="xz"
52 -
53 -inherit eutils toolchain-funcs flag-o-matic
54 -
55 -DESCRIPTION="A minimal libc subset for use with initramfs"
56 -HOMEPAGE="https://www.zytor.com/mailman/listinfo/klibc/ https://www.kernel.org/pub/linux/libs/klibc/"
57 -KV_MAJOR="4" KV_MINOR="x" KV_SUB="4"
58 -PKV_EXTRA=""
59 -if [[ ${PKV_EXTRA} ]]; then
60 - if [[ ${KV_MAJOR} == 2 ]]; then
61 - PKV="${KV_MAJOR}.${KV_MINOR}.$((${KV_SUB}+1))-${PKV_EXTRA}"
62 - else
63 - PKV="${KV_MAJOR}.$((${KV_SUB}+1))-${PKV_EXTRA}"
64 - fi
65 - PATCH_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/patch-${PKV}.${K_TARBALL_SUFFIX}"
66 -fi
67 -if [[ ${KV_MAJOR} == 2 ]]; then
68 - OKV="${KV_MAJOR}.${KV_MINOR}.${KV_SUB}"
69 -else
70 - OKV="${KV_MAJOR}.${KV_SUB}"
71 -fi
72 -KERNEL_URI="
73 - mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.${K_TARBALL_SUFFIX}
74 - mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/testing/linux-${OKV}.tar.${K_TARBALL_SUFFIX}"
75 -DEBIAN_PV=2.0.4
76 -DEBIAN_PR=9
77 -DEBIAN_A="${PN}_${DEBIAN_PV}-${DEBIAN_PR}.debian.tar.xz"
78 -SRC_URI="
79 - mirror://kernel/linux/libs/klibc/${PV:0:3}/${P}.tar.${K_TARBALL_SUFFIX}
80 - mirror://debian/pool/main/k/klibc/${DEBIAN_A}
81 - ${PATCH_URI}
82 - ${KERNEL_URI}"
83 -
84 -LICENSE="|| ( GPL-2 LGPL-2 )"
85 -KEYWORDS="~alpha amd64 ~arm ia64 -mips ~ppc ~ppc64 ~sparc x86"
86 -SLOT="0"
87 -IUSE="debug test custom-cflags"
88 -
89 -RDEPEND="dev-lang/perl"
90 -DEPEND="${RDEPEND}
91 - sys-devel/bc"
92 -
93 -KS="${WORKDIR}/linux-${OKV}"
94 -
95 -# Klibc has no PT_GNU_STACK support, so scanning for execstacks is moot
96 -QA_EXECSTACK="*"
97 -# Do not strip
98 -RESTRICT="strip"
99 -
100 -kernel_asm_arch() {
101 - a="${1:${ARCH}}"
102 - case ${a} in
103 - # Merged arches
104 - x86) echo i386 ;; # for build on x86 userspace & 64bit kernel
105 - amd64) echo x86 ;;
106 - ppc*) echo powerpc ;;
107 - # Non-merged
108 - alpha|arm|arm64|ia64|m68k|mips|sh|sparc*) echo ${1} ;;
109 - *) die "TODO: Update the code for your asm-ARCH symlink" ;;
110 - esac
111 -}
112 -
113 -# For a given Gentoo ARCH,
114 -# specify the kernel defconfig most relevant
115 -kernel_defconfig() {
116 - a="${1:${ARCH}}"
117 - # most, but not all arches have a sanely named defconfig
118 - case ${a} in
119 - ppc64) echo ppc64_defconfig ;;
120 - ppc) echo pmac32_defconfig ;;
121 - sh*) die "TODO: Your arch is not supported by the klibc ebuild. Please suggest a defconfig in a bug." ;;
122 - *) echo defconfig ;;
123 - esac
124 -}
125 -
126 -src_unpack() {
127 - unpack linux-${OKV}.tar.${K_TARBALL_SUFFIX} ${P}.tar.${K_TARBALL_SUFFIX} ${DEBIAN_A}
128 -}
129 -
130 -PATCHES=(
131 - # Build interp.o with EXTRA_KLIBCAFLAGS (.S source)
132 - "${FILESDIR}"/${PN}-1.4.11-interp-flags.patch
133 - # Fix usage of -s, bug #201006
134 - "${FILESDIR}"/klibc-1.5.7-strip-fix-dash-s.patch
135 - # The inline definition from sys/stat.h does not seem to get used
136 - # So just copy it to make this compile for now
137 - "${FILESDIR}"/klibc-2.0.2-mkfifo.patch
138 - # Newer kernels have some headers in the uapi dir
139 - "${FILESDIR}"/klibc-2.0.3-kernel-uapi.patch
140 -)
141 -
142 -src_prepare() {
143 - [[ ${PKV} ]] && eapply "${DISTDIR}"/patch-${PKV}.${K_TARBALL_SUFFIX}
144 -
145 - # Symlink /usr/src/linux to ${S}/linux
146 - ln -snf "${KS}" linux
147 - #ln -snf "/usr" linux
148 -
149 - # Borrow the debian fixes too
150 - for p in $(<"${WORKDIR}"/debian/patches/series) ; do
151 - PATCHES+=( "${WORKDIR}/debian/patches/${p}" )
152 - done
153 -
154 - default
155 -}
156 -
157 -# klibc has it's own ideas of arches
158 -# They reflect userspace strictly.
159 -# This functions maps from a Gentoo ARCH, to an arch that klibc expects
160 -# Look at klibc-${S}/usr/klibc/arch for a list of these arches
161 -klibc_arch() {
162 - a="${1:${ARCH}}"
163 - case ${a} in
164 - amd64) echo x86_64;;
165 - mips) die 'TODO: Use the $ABI' ;;
166 - x86) echo i386;;
167 - *) echo ${a} ;;
168 - esac
169 -}
170 -
171 -src_compile() {
172 - local myargs="all"
173 - local myARCH="${ARCH}" myABI="${ABI}"
174 - # TODO: For cross-compiling
175 - # You should set ARCH and ABI here
176 - CC="$(tc-getCC)"
177 - LD="$(tc-getLD)"
178 - HOSTCC="$(tc-getBUILD_CC)"
179 - HOSTLD="$(tc-getBUILD_LD)"
180 - KLIBCARCH="$(klibc_arch ${ARCH})"
181 - KLIBCASMARCH="$(kernel_asm_arch ${ARCH})"
182 - libdir="$(get_libdir)"
183 - # This should be the defconfig corresponding to your userspace!
184 - # NOT your kernel. PPC64-32ul would choose 'ppc' for example.
185 - defconfig=$(kernel_defconfig ${ARCH})
186 - unset ABI ARCH # Unset these, because they interfere
187 - unset KBUILD_OUTPUT # we are using a private copy
188 -
189 - cd "${KS}"
190 - emake ${defconfig} CC="${CC}" HOSTCC="${HOSTCC}" ARCH="${KLIBCASMARCH}" || die "No defconfig"
191 - if [[ "${KLIBCARCH/arm}" != "${KLIBCARCH}" ]] && \
192 - [[ "${CHOST/eabi}" != "${CHOST}" ]]; then
193 - # The delete and insert are seperate statements
194 - # so that they are reliably used.
195 - sed -i \
196 - -e '/CONFIG_AEABI/d' \
197 - -e '1iCONFIG_AEABI=y' \
198 - -e '/CONFIG_OABI_COMPAT/d' \
199 - -e '1iCONFIG_OABI_COMPAT=y' \
200 - -e '1iCONFIG_ARM_UNWIND=y' \
201 - "${KS}"/.config \
202 - "${S}"/defconfig
203 - fi
204 - emake prepare CC="${CC}" HOSTCC="${HOSTCC}" ARCH="${KLIBCASMARCH}" || die "Failed to prepare kernel sources for header usage"
205 -
206 - cd "${S}"
207 -
208 - use debug && myargs="${myargs} V=1"
209 - use test && myargs="${myargs} test"
210 - append-ldflags -z noexecstack
211 - append-flags -nostdlib
212 -
213 - emake \
214 - EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \
215 - EXTRA_KLIBCLDFLAGS="-z noexecstack" \
216 - HOSTLDFLAGS="-z noexecstack" \
217 - KLIBCOPTFLAGS='-nostdlib' \
218 - HOSTCC="${HOSTCC}" CC="${CC}" \
219 - HOSTLD="${HOSTLD}" LD="${LD}" \
220 - INSTALLDIR="/usr/${libdir}/klibc" \
221 - KLIBCARCH=${KLIBCARCH} \
222 - KLIBCASMARCH=${KLIBCASMARCH} \
223 - SHLIBDIR="/${libdir}" \
224 - libdir="/usr/${libdir}" \
225 - mandir="/usr/share/man" \
226 - T="${T}" \
227 - $(use custom-cflags || echo SKIP_)HOSTCFLAGS="${CFLAGS}" \
228 - $(use custom-cflags || echo SKIP_)HOSTLDFLAGS="${LDFLAGS}" \
229 - $(use custom-cflags || echo SKIP_)KLIBCOPTFLAGS="${CFLAGS}" \
230 - ${myargs} || die "Compile failed!"
231 -
232 - #SHLIBDIR="/${libdir}" \
233 -
234 - ARCH="${myARCH}" ABI="${myABI}"
235 -}
236 -
237 -src_install() {
238 - local myargs
239 - local myARCH="${ARCH}" myABI="${ABI}"
240 - # TODO: For cross-compiling
241 - # You should set ARCH and ABI here
242 - CC="$(tc-getCC)"
243 - HOSTCC="$(tc-getBUILD_CC)"
244 - KLIBCARCH="$(klibc_arch ${ARCH})"
245 - KLIBCASMARCH="$(kernel_asm_arch ${ARCH})"
246 - libdir="$(get_libdir)"
247 - # This should be the defconfig corresponding to your userspace!
248 - # NOT your kernel. PPC64-32ul would choose 'ppc' for example.
249 - defconfig=$(kernel_defconfig ${ARCH})
250 -
251 - use debug && myargs="${myargs} V=1"
252 -
253 - local klibc_prefix
254 - if tc-is-cross-compiler ; then
255 - klibc_prefix=$("${S}/klcc/${KLIBCARCH}-klcc" -print-klibc-prefix)
256 - else
257 - klibc_prefix=$("${S}/klcc/klcc" -print-klibc-prefix)
258 - fi
259 -
260 - unset ABI ARCH # Unset these, because they interfere
261 - unset KBUILD_OUTPUT # we are using a private copy
262 -
263 - emake \
264 - EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \
265 - EXTRA_KLIBCLDFLAGS="-z noexecstack" \
266 - HOSTLDFLAGS="-z noexecstack" \
267 - KLIBCOPTFLAGS='-nostdlib' \
268 - HOSTCC="${HOSTCC}" CC="${CC}" \
269 - HOSTLD="${HOSTLD}" LD="${LD}" \
270 - INSTALLDIR="/usr/${libdir}/klibc" \
271 - INSTALLROOT="${D}" \
272 - KLIBCARCH=${KLIBCARCH} \
273 - KLIBCASMARCH=${KLIBCASMARCH} \
274 - SHLIBDIR="/${libdir}" \
275 - libdir="/usr/${libdir}" \
276 - mandir="/usr/share/man" \
277 - T="${T}" \
278 - $(use custom-cflags || echo SKIP_)HOSTCFLAGS="${CFLAGS}" \
279 - $(use custom-cflags || echo SKIP_)HOSTLDFLAGS="${LDFLAGS}" \
280 - $(use custom-cflags || echo SKIP_)KLIBCOPTFLAGS="${CFLAGS}" \
281 - ${myargs} \
282 - install || die "Install failed!"
283 -
284 - #SHLIBDIR="/${libdir}" \
285 -
286 - # klibc doesn't support prelinking, so we need to mask it
287 - cat > "${T}/70klibc" <<-EOF
288 - PRELINK_PATH_MASK="/usr/${libdir}/klibc"
289 - EOF
290 -
291 - doenvd "${T}"/70klibc
292 -
293 - # Fix the permissions (bug #178053) on /usr/${libdir}/klibc/include
294 - # Actually I have no idea, why the includes have those weird-ass permissions
295 - # on a particular system, might be due to inherited permissions from parent
296 - # directory
297 - # NOTE: This totally violates sandbox <asturm@g.o>
298 - # find "${D}"/usr/${libdir}/klibc/include | xargs chmod o+rX
299 - find "${D}"/usr/${libdir}/klibc/include -type f \
300 - \( -name '.install' -o -name '..install.cmd' \) -delete || die
301 -
302 - # Hardlinks becoming copies
303 - for x in gunzip zcat ; do
304 - rm -f "${D}/${klibc_prefix}/bin/${x}"
305 - dosym gzip "${klibc_prefix}/bin/${x}"
306 - done
307 -
308 - # Restore now, so we can use the tc- functions
309 - ARCH="${myARCH}" ABI="${myABI}"
310 - if ! tc-is-cross-compiler ; then
311 - cd "${S}"
312 - insinto /usr/share/aclocal
313 - doins contrib/klibc.m4
314 -
315 - dodoc README usr/klibc/CAVEATS
316 - docinto gzip; dodoc usr/gzip/README
317 - fi
318 -
319 - # Fix up the symlink
320 - # Mainly for merged arches
321 - linkname="${D}/usr/${libdir}/klibc/include/asm"
322 - if [ -L "${linkname}" ] && [ ! -e "${linkname}" ] ; then
323 - ln -snf asm-${KLIBCASMARCH} "${linkname}"
324 - fi
325 -}
326 -
327 -src_test() {
328 - if ! tc-is-cross-compiler ; then
329 - cd "${S}"/usr/klibc/tests
330 - ALL_TESTS="$(ls *.c |sed 's,\.c$,,g')"
331 - BROKEN_TESTS="fcntl fnmatch testrand48"
332 - failed=0
333 - for t in $ALL_TESTS ; do
334 - if has $t $BROKEN_TESTS ; then
335 - echo "=== $t SKIP"
336 - else
337 - echo -n "=== $t "
338 - ./$t </dev/null >/dev/null
339 - rc=$?
340 - if [ $rc -eq 0 ]; then
341 - echo PASS
342 - else
343 - echo FAIL
344 - failed=1
345 - fi
346 - fi
347 - done
348 - [ $failed -ne 0 ] && die "Some tests failed."
349 - fi
350 -}