From 90573cc105a07e4c81eaee4f2515c87d2aabc0f0 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Wed, 16 Sep 2009 09:01:33 +0000 Subject: Bug #284957: Work for USE=savedconfig in progress. Package-Manager: portage-2.2_rc40/cvs/Linux x86_64 --- dev-libs/klibc/ChangeLog | 8 +- dev-libs/klibc/Manifest | 3 +- dev-libs/klibc/klibc-1.5.15-r1.ebuild | 281 ++++++++++++++++++++++++++++++++++ 3 files changed, 290 insertions(+), 2 deletions(-) create mode 100644 dev-libs/klibc/klibc-1.5.15-r1.ebuild (limited to 'dev-libs/klibc') diff --git a/dev-libs/klibc/ChangeLog b/dev-libs/klibc/ChangeLog index e800faa01b00..5ac1a5865014 100644 --- a/dev-libs/klibc/ChangeLog +++ b/dev-libs/klibc/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for dev-libs/klibc # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/klibc/ChangeLog,v 1.69 2009/09/15 19:41:02 robbat2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-libs/klibc/ChangeLog,v 1.70 2009/09/16 09:01:33 robbat2 Exp $ + +*klibc-1.5.15-r1 (16 Sep 2009) + + 16 Sep 2009; Robin H. Johnson + +klibc-1.5.15-r1.ebuild: + Bug #284957: Work for USE=savedconfig in progress. 15 Sep 2009; Robin H. Johnson klibc-1.5.15.ebuild: Implement basic ARM support, thanks to the mv78100 board from Marvell. diff --git a/dev-libs/klibc/Manifest b/dev-libs/klibc/Manifest index d56b5411b089..d53d93a4b510 100644 --- a/dev-libs/klibc/Manifest +++ b/dev-libs/klibc/Manifest @@ -19,7 +19,8 @@ EBUILD klibc-1.1.ebuild 4163 RMD160 3bdee15ca33572451ff609634cf178ac3019f6e2 SHA EBUILD klibc-1.5.11.ebuild 7057 RMD160 ae7d7d8cec09e9a1b787d2ea25b3501ebacd9d1e SHA1 f9d3f81fad94ba9f9ec6df2a02070f763b5cc314 SHA256 ca9c7f31dd9b9f13c57be6bdf1523cd8c626136d72bdfd5d3cb6550b427af314 EBUILD klibc-1.5.12-r1.ebuild 7750 RMD160 0ff4151f425e84fffdaeb98a75bf7ed1ca6c901e SHA1 29d41fbefbdc8a8f9394db94d0b966c60f33859a SHA256 9a397c65d02ae27e860488d8bbad445ffd360ff28454d4016f4fc24bb8223b57 EBUILD klibc-1.5.12.ebuild 7057 RMD160 847822e71e4669b8cf59eafb7ea89d7581d13bda SHA1 7c22d053ef05019e03f15add166b4acc2b60f1b6 SHA256 09ef34ed8ba11c9f6a84988286ed3190af2d5073d51231da1695283dbbf00f4c +EBUILD klibc-1.5.15-r1.ebuild 8179 RMD160 5b023188cc7e04108894cfdef750a4f35c58c240 SHA1 7945d6c16c58776325f823347690b5ba1721e952 SHA256 b25445be42063558d9a9288d66a7436745cbdbbfc733617897f06bc084199e47 EBUILD klibc-1.5.15.ebuild 8176 RMD160 13fc506f90c140b46dffdef5c451076bf8b8e45a SHA1 838abc09c314511cec149fa745315a0814a418b2 SHA256 5bc08c0708e741d46847ab0726d2442bf99ed6ae5885463e0c90e28f4fdf0926 EBUILD klibc-1.5.8.ebuild 6920 RMD160 de5ba665e0baaa105d386bfd3242ea4036569385 SHA1 dc95c9e02959be2b2700d02f35659c8af140d148 SHA256 13bf15851856be9cf1f9bcdbfd48f8daf98efc72aac25f44de3b7b636e0aaf34 -MISC ChangeLog 11661 RMD160 52f91daff9c461ae8cafc0c3567c8e42248a84ff SHA1 bee90893541270c25e215196db989f78f51bba13 SHA256 cf2e37eb682d26f642b9529a20024dc9372d6a7861645e3433b4938cde696410 +MISC ChangeLog 11827 RMD160 f872002765e72cd8bd3187d97fdcb65f942c95bf SHA1 a35dd84a4300e31f4a438785c1d05b0e57f624ee SHA256 1034798660feb77abd1f167347a6335e627b7e2b97b362ca7a0986dcfa82bc7e MISC metadata.xml 257 RMD160 47ef62fe1bd58dc643105eb0ba428746e5a2e216 SHA1 94998abb1247fbef63eccd27d1544078e7f030bf SHA256 a8371994e2a3b1be202096fba4f9a6a86a85c1be2d5792a258730abe49513e9f diff --git a/dev-libs/klibc/klibc-1.5.15-r1.ebuild b/dev-libs/klibc/klibc-1.5.15-r1.ebuild new file mode 100644 index 000000000000..3d7e827d282d --- /dev/null +++ b/dev-libs/klibc/klibc-1.5.15-r1.ebuild @@ -0,0 +1,281 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/klibc/klibc-1.5.15-r1.ebuild,v 1.1 2009/09/16 09:01:33 robbat2 Exp $ + +# Robin H. Johnson , 12 Nov 2007: +# This still needs major work. +# But it is significently better than the previous version. +# In that it will now build on biarch systems, such as ppc64-32ul. + +# NOTES: +# ====== +# We need to bring in the kernel sources seperately +# Because they have to be configured in a way that differs from the copy in +# /usr/src/. The sys-kernel/linux-headers are too stripped down to use +# unfortunetly. +# This will be able to go away once the klibc author updates his code +# to build again the headers provided by the kernel's 'headers_install' target. + +inherit eutils multilib toolchain-funcs + +DESCRIPTION="A minimal libc subset for use with initramfs." +HOMEPAGE="http://www.zytor.com/mailman/listinfo/klibc" +KV_MAJOR="2" KV_MINOR="6" KV_SUB="26" +PKV_EXTRA="" +if [ -n "${PKV_EXTRA}" ]; then + PKV="${KV_MAJOR}.${KV_MINOR}.$((${KV_SUB}+1))-${PKV_EXTRA}" + PATCH_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/patch-${PKV}.bz2" +fi +OKV="${KV_MAJOR}.${KV_MINOR}.${KV_SUB}" +KERNEL_URI=" + mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2 + mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/testing/linux-${OKV}.tar.bz2" +SRC_URI=" + mirror://kernel/linux/libs/klibc/${P}.tar.bz2 + mirror://kernel/linux/libs/klibc/Testing/${P}.tar.bz2 + ${PATCH_URI} + ${KERNEL_URI}" + +LICENSE="|| ( GPL-2 LGPL-2 )" +KEYWORDS="~amd64 -mips ~ppc ~sparc ~x86 ~arm" +SLOT="0" +IUSE="debug n32" + +DEPEND="dev-lang/perl" +RDEPEND="${DEPEND}" + +KS="${WORKDIR}/linux-${OKV}" + +# Klibc has no PT_GNU_STACK support, so scanning for execstacks is moot +QA_EXECSTACK="*" +# Do not strip +RESTRICT="strip" + +kernel_asm_arch() { + a="${1:${ARCH}}" + case ${a} in + # Merged arches + x86|amd64) echo x86 ;; + ppc*) echo powerpc ;; + # Non-merged + alpha|arm|ia64|m68k|mips|sh|sparc*) echo ${1} ;; + *) die "TODO: Update the code for your asm-ARCH symlink" ;; + esac +} + +# For a given Gentoo ARCH, +# specify the kernel defconfig most relevant +kernel_defconfig() { + a="${1:${ARCH}}" + # most, but not all arches have a sanely named defconfig + case ${a} in + ppc64) echo ppc64_defconfig ;; + ppc) echo pmac32_defconfig ;; + sh*) die "TODO: Your arch is not supported by the klibc ebuild. Please suggest a defconfig in a bug." ;; + *) echo defconfig ;; + esac +} + +src_unpack() { + unpack linux-${OKV}.tar.bz2 ${P}.tar.bz2 + [ -n "${PKV}" ] && EPATCH_OPTS="-d ${KS} -p1" epatch "${DISTDIR}"/patch-${PKV}.bz2 + cd "${S}" + + # Symlink /usr/src/linux to ${S}/linux + ln -snf "${KS}" linux + #ln -snf "/usr" linux + + # Build interp.o with EXTRA_KLIBCAFLAGS (.S source) + epatch "${FILESDIR}"/${PN}-1.4.11-interp-flags.patch + + # Fixes for sparc and ppc + epatch "${FILESDIR}"/${PN}-1.5-sigaction.patch + + # Prevent klibc from prestripping stuff +# epatch "${FILESDIR}"/${P}-nostrip.patch + + # Fix the asm-ppc vs. asm-powerpc issue, bug #196521 + epatch "${FILESDIR}"/${PN}-1.5.11-klibcasmarch.patch + + # Fix usage of -s, bug #201006 + epatch "${FILESDIR}"/klibc-1.5.7-strip-fix-dash-s.patch + + # bug 229525, usr/include/arch/x86_64/sys/io.h has undefined variables + epatch "${FILESDIR}"/${PN}-1.5.11-x86_64-io.h-return.diff +} + +# klibc has it's own ideas of arches +# They reflect userspace strictly. +# This functions maps from a Gentoo ARCH, to an arch that klibc expects +# Look at klibc-${S}/usr/klibc/arch for a list of these arches +klibc_arch() { + a="${1:${ARCH}}" + case ${a} in + amd64) echo x86_64;; + mips) die 'TODO: Use the $ABI' ;; + x86) echo i386;; + *) echo ${a} ;; + esac +} + +src_compile() { + local myargs="all" + local myARCH="${ARCH}" myABI="${ABI}" + # TODO: For cross-compiling + # You should set ARCH and ABI here + CC="$(tc-getCC)" + HOSTCC="$(tc-getBUILD_CC)" + KLIBCARCH="$(klibc_arch ${ARCH})" + KLIBCASMARCH="$(kernel_asm_arch ${ARCH})" + libdir="$(get_libdir)" + # This should be the defconfig corresponding to your userspace! + # NOT your kernel. PPC64-32ul would choose 'ppc' for example. + defconfig=$(kernel_defconfig ${ARCH}) + unset ABI ARCH # Unset these, because they interfere + unset KBUILD_OUTPUT # we are using a private copy + + cd "${KS}" + emake ${defconfig} CC="${CC}" HOSTCC="${HOSTCC}" || die "No defconfig" + if [[ "${KLIBCARCH/arm}" != "${KLIBCARCH}" ]] && \ + [[ "${CHOST/eabi}" != "${CHOST}" ]]; then + # The delete and insert are seperate statements + # so that they are reliably used. + sed -i \ + -e '/CONFIG_AEABI/d' \ + -e '1iCONFIG_AEABI=y' \ + -e '/CONFIG_OABI_COMPAT/d' \ + -e '1iCONFIG_OABI_COMPAT=y' \ + "${KS}"/.config \ + "${S}"/defconfig + fi + emake prepare CC="${CC}" HOSTCC="${HOSTCC}" || die "Failed to prepare kernel sources for header usage" + + cd "${S}" + + use debug && myargs="${myargs} V=1" + has test $FEATURES && myargs="${myargs} test" + + emake \ + EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \ + EXTRA_KLIBCLDFLAGS="-z,noexecstack" \ + HOSTCC="${HOSTCC}" CC="${CC}" \ + INSTALLDIR="/usr/${libdir}/klibc" \ + KLIBCARCH=${KLIBCARCH} \ + KLIBCASMARCH=${KLIBCASMARCH} \ + SHLIBDIR="/${libdir}" \ + libdir="/usr/${libdir}" \ + mandir="/usr/share/man" \ + T="${T}" \ + ${myargs} || die "Compile failed!" + + #SHLIBDIR="/${libdir}" \ + + ARCH="${myARCH}" ABI="${myABI}" +} + +src_install() { + local myargs + local myARCH="${ARCH}" myABI="${ABI}" + # TODO: For cross-compiling + # You should set ARCH and ABI here + CC="$(tc-getCC)" + HOSTCC="$(tc-getBUILD_CC)" + KLIBCARCH="$(klibc_arch ${ARCH})" + KLIBCASMARCH="$(kernel_asm_arch ${ARCH})" + libdir="$(get_libdir)" + # This should be the defconfig corresponding to your userspace! + # NOT your kernel. PPC64-32ul would choose 'ppc' for example. + defconfig=$(kernel_defconfig ${ARCH}) + + use debug && myargs="${myargs} V=1" + + local klibc_prefix + if tc-is-cross-compiler ; then + klibc_prefix=$("${S}/klcc/${KLIBCARCH}-klcc" -print-klibc-prefix) + else + klibc_prefix=$("${S}/klcc/klcc" -print-klibc-prefix) + fi + + unset ABI ARCH # Unset these, because they interfere + unset KBUILD_OUTPUT # we are using a private copy + + emake \ + EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \ + EXTRA_KLIBCLDFLAGS="-z,noexecstack" \ + HOSTCC="${HOSTCC}" CC="${CC}" \ + INSTALLDIR="/usr/${libdir}/klibc" \ + INSTALLROOT="${D}" \ + KLIBCARCH=${KLIBCARCH} \ + KLIBCASMARCH=${KLIBCASMARCH} \ + SHLIBDIR="/${libdir}" \ + libdir="/usr/${libdir}" \ + mandir="/usr/share/man" \ + ${myargs} \ + install || die "Install failed!" + + #SHLIBDIR="/${libdir}" \ + + # klibc doesn't support prelinking, so we need to mask it + cat > "${T}/70klibc" <<-EOF + PRELINK_PATH_MASK="/usr/${libdir}/klibc" + EOF + + doenvd "${T}"/70klibc + + # Fix the permissions (bug #178053) on /usr/${libdir}/klibc/include + # Actually I have no idea, why the includes have those weird-ass permissions + # on a particular system, might be due to inherited permissions from parent + # directory + find "${D}"/usr/${libdir}/klibc/include | xargs chmod o+rX + + # Hardlinks becoming copies + for x in gunzip zcat ; do + rm -f "${D}/${klibc_prefix}/bin/${x}" + dosym gzip "${klibc_prefix}/bin/${x}" + done + + # Restore now, so we can use the tc- functions + ARCH="${myARCH}" ABI="${myABI}" + if ! tc-is-cross-compiler ; then + cd "${S}" + insinto /usr/share/aclocal + doins contrib/klibc.m4 + + dodoc README usr/klibc/CAVEATS usr/klibc/README + newdoc usr/klibc/arch/README README.klibc.arch + docinto dash; newdoc usr/dash/README.klibc README + docinto gzip; dodoc usr/gzip/README + fi + + # Fix up the symlink + # Mainly for merged arches + linkname="${D}/usr/${libdir}/klibc/include/asm" + if [ -L "${linkname}" ] && [ ! -e "${linkname}" ] ; then + ln -snf asm-${KLIBCASMARCH} "${linkname}" + fi +} + +src_test() { + if ! tc-is-cross-compiler ; then + cd "${S}"/usr/klibc/tests + ALL_TESTS="$(ls *.c |sed 's,\.c$,,g')" + BROKEN_TESTS="idtest fcntl fnmatch testrand48" + failed=0 + for t in $ALL_TESTS ; do + if has $t $BROKEN_TESTS ; then + echo "=== $t SKIP" + else + echo -n "=== $t " + ./$t /dev/null + rc=$? + if [ $rc -eq 0 ]; then + echo PASS + else + echo FAIL + failed=1 + fi + fi + done + [ $failed -ne 0 ] && die "Some tests failed." + fi +} -- cgit v1.2.3-65-gdbad