Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 204130 Details for
Bug 284957
sys-libs/klibc-1.5.15: savedconfig and extra functionality
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
dev-libs/klibc/klibc-1.5.15.ebuild
klibc-1.5.15.ebuild (text/plain), 9.12 KB, created by
Christopher Friedt
on 2009-09-14 20:02:20 UTC
(
hide
)
Description:
dev-libs/klibc/klibc-1.5.15.ebuild
Filename:
MIME Type:
Creator:
Christopher Friedt
Created:
2009-09-14 20:02:20 UTC
Size:
9.12 KB
patch
obsolete
># 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.ebuild,v 1.1 2009/05/09 22:57:42 robbat2 Exp $ > ># Robin H. Johnson <robbat2@gentoo.org>, 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 savedconfig > >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 ~arm -mips ~ppc ~sparc ~x86" >SLOT="0" >IUSE="debug n32 savedconfig" > >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" > >SAVED_DEFCONFIG_SRC="${PORTAGE_CONFIGROOT}etc/portage/savedconfig/${CATEGORY}/${PF}" > >kernel_asm_arch() { > a="${1:${ARCH}}" > case ${a} in > # Merged arches > x86|amd64) echo x86 ;; > ppc*) echo powerpc ;; > arm*) echo arm ;; > # Non-merged > alphaia64|m68k|mips|sh|sparc*) echo ${1} ;; > *) die "TODO: Update the code for your asm-ARCH symlink" ;; > esac >} > >savedconfig_dst() { > local a="$(kernel_asm_arch ${ARCH})" > echo "${KS}/arch/${a}/configs/savedconfig_defconfig" >} > ># for non-standardized defconfigs (e.g. arm*) >require_savedconfig() { > case ${ARCH} in > arm*) return 0 ;; > *) return 1 ;; > esac >} > >src_unpack() { > # do first to avoid wasting time or resources > if require_savedconfig ; then > if ! use savedconfig ; then > eerror "Your ARCH requires a saved defconfig located at" > eerror "${SAVED_DEFCONFIG_SRC}" > eerror "Please create the file using linux-${OKV}, and then add" > eerror "\"dev-libs/klibc savedconfig\" to " > eerror "${PORTAGE_CONFIGROOT}etc/portage/package.use" > die "USE=\"savedconfig\" is required for ARCH=${ARCH}" > else > if [ ! -f "${SAVED_DEFCONFIG_SRC}" ]; then > eerror "Your savedconfig file does not exist at" > eerror "${SAVED_DEFCONFIG_SRC}" > eerror "Please create the file using linux-${OKV}." > die "${SAVED_DEFCONFIG_SRC}: No such file or directory." > fi > fi > else > if use savedconfig ; then > ewarn "Using a saved defconfig with ARCH=${ARCH} is discouraged and also completely" > ewarn "unsupported. You have been warned." > epause > fi > fi > > 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 > > [[ ${ARCH} =~ arm.* ]] && [[ ${CHOST} =~ .*eabi ]] && > sed -i -e "s/# CONFIG_AEABI is not set/CONFIG_AEABI=y/" \ > defconfig > > for i in dash_readopt losetup klibc_kexecsyscall \ > klibc-1.5.15/wc klibc-1.5.15/modprobe \ > klibc-1.5.15/fstype-sane-vfat-and-jffs2-for-1.5; do > epatch "${FILESDIR}"/oe/${i}.patch || die "" > done > > if use savedconfig ; then > restore_config "$(savedconfig_dst)" || die > fi >} > ># 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 ;; > arm*) echo $(basename $(savedconfig_dst)) ;; > sh*) die "TODO: Your arch is not supported by the klibc ebuild. Please suggest a defconfig in a bug." ;; > *) echo defconfig ;; > esac >} > ># 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 >} > >tc-get-toolchain-prefix() { > echo "${CHOST}-" >} > >src_compile() { > ># ># for both linux and klibc ># > local xopts > tc-is-cross-compiler && \ > xopts="ARCH=${ARCH} CROSS_COMPILE=$(tc-get-toolchain-prefix)" ># ># for linux ># > > # This should be the defconfig corresponding to your userspace! > # NOT your kernel. PPC64-32ul would choose 'ppc' for example. > local defconfig=$(kernel_defconfig ${ARCH}) > > cd "${KS}" > emake ${xopts} ${myopts} ${defconfig} &> /dev/null || \ > die "no defconfig" > emake prepare ${xopts} ${myopts} &> /dev/null || \ > die "make prepare failed" > ># ># for klibc ># > ># unset ABI ARCH # Unset these, because they interfere > unset KBUILD_OUTPUT # we are using a private copy > > cd "${S}" > local myargs="all" > local libdir="$(get_libdir)" > > [[ ! -z "$(tc-get-abi)" ]] && \ > echo "CONFIG_$(tc-get-abi)=y" >> .config > > use debug && myargs="${myargs} V=1" > has test $FEATURES && myargs="${myargs} test" > > emake \ > KLIBCARCH="$(klibc_arch ${ARCH})" \ > KLIBCASMARCH="$(kernel_asm_arch ${ARCH})" \ > INSTALLDIR="/usr/${libdir}/klibc" \ > SHLIBDIR="/${libdir}" \ > libdir="/usr/${libdir}" \ > mandir="/usr/share/man" \ > ${xopts} \ > ${myargs} &> /dev/null || die "Compile failed!" >} > >src_install() { > local myargs > 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 > local xopts > tc-is-cross-compiler && \ > xopts="CROSS_COMPILE=$(tc-get-toolchain-prefix) ARCH=${ARCH}" > ># unset ABI ARCH # Unset these, because they interfere ... really?? > unset KBUILD_OUTPUT # we are using a private copy > > emake \ > EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \ > EXTRA_KLIBCLDFLAGS="-z,noexecstack" \ > INSTALLDIR="/usr/${libdir}/klibc" \ > INSTALLROOT="${D}" \ > KLIBCARCH="$(klibc_arch ${ARCH})" \ > KLIBCASMARCH="$(kernel_asm_arch ${ARCH})" \ > SHLIBDIR="/${libdir}" \ > libdir="/usr/${libdir}" \ > mandir="/usr/share/man" \ > ${myargs} \ > ${xopts} \ > install &> /dev/null || die "Install failed!" > > # 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}" > done > > # Restore now, so we can use the tc- functions > 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-$(kernel_asm_arch ${ARCH}) "${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 >/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 >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 284957
:
204076
|
204078
|
204079
|
204080
|
204084
|
204086
|
204087
|
204089
|
204130
|
204289
|
204291