diff options
author | Martin Schlemmer <azarah@gentoo.org> | 2006-07-08 16:14:01 +0000 |
---|---|---|
committer | Martin Schlemmer <azarah@gentoo.org> | 2006-07-08 16:14:01 +0000 |
commit | 24bd00305592e90aadfb6c349cfb9e8338b42523 (patch) | |
tree | f55364492bda8ca6b344b063c52a4a4c611d90e6 /dev-libs/klibc | |
parent | Updated firmware (diff) | |
download | gentoo-2-24bd00305592e90aadfb6c349cfb9e8338b42523.tar.gz gentoo-2-24bd00305592e90aadfb6c349cfb9e8338b42523.tar.bz2 gentoo-2-24bd00305592e90aadfb6c349cfb9e8338b42523.zip |
Update version. Try to do something about executable stack. Add mips n32
patch again. Disable the stdinc patch as it seems to support
-fno-stack-protector.
(Portage version: 2.1.1_pre2-r6)
Diffstat (limited to 'dev-libs/klibc')
-rw-r--r-- | dev-libs/klibc/ChangeLog | 11 | ||||
-rw-r--r-- | dev-libs/klibc/files/digest-klibc-1.4.9 | 3 | ||||
-rw-r--r-- | dev-libs/klibc/files/klibc-1.4.8-dash-flags.patch | 13 | ||||
-rw-r--r-- | dev-libs/klibc/files/klibc-1.4.9-mips32.patch | 13 | ||||
-rw-r--r-- | dev-libs/klibc/klibc-1.4.9.ebuild | 218 |
5 files changed, 257 insertions, 1 deletions
diff --git a/dev-libs/klibc/ChangeLog b/dev-libs/klibc/ChangeLog index 0778312e54bc..a62cd332dcc6 100644 --- a/dev-libs/klibc/ChangeLog +++ b/dev-libs/klibc/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for dev-libs/klibc # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/klibc/ChangeLog,v 1.25 2006/07/07 13:43:53 azarah Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-libs/klibc/ChangeLog,v 1.26 2006/07/08 16:14:01 azarah Exp $ + +*klibc-1.4.9 (08 Jul 2006) + + 08 Jul 2006; Martin Schlemmer <azarah@gentoo.org> + +files/klibc-1.4.8-dash-flags.patch, +files/klibc-1.4.9-mips32.patch, + +klibc-1.4.9.ebuild: + Update version. Try to do something about executable stack. Add mips n32 + patch again. Disable the stdinc patch as it seems to support + -fno-stack-protector. *klibc-1.4.8 (07 Jul 2006) diff --git a/dev-libs/klibc/files/digest-klibc-1.4.9 b/dev-libs/klibc/files/digest-klibc-1.4.9 new file mode 100644 index 000000000000..d5fc594ba0d9 --- /dev/null +++ b/dev-libs/klibc/files/digest-klibc-1.4.9 @@ -0,0 +1,3 @@ +MD5 e011fcd7ffcc4f07917b1c6b03130d55 klibc-1.4.9.tar.bz2 472957 +RMD160 48ac1b171f2f2b5b7b40b791c70adb446502c95c klibc-1.4.9.tar.bz2 472957 +SHA256 dfde10068f74b7b8d675907bffcb783b5871d35ddc323ee08a7be241bf2ac74f klibc-1.4.9.tar.bz2 472957 diff --git a/dev-libs/klibc/files/klibc-1.4.8-dash-flags.patch b/dev-libs/klibc/files/klibc-1.4.8-dash-flags.patch new file mode 100644 index 000000000000..9f758ddfe917 --- /dev/null +++ b/dev-libs/klibc/files/klibc-1.4.8-dash-flags.patch @@ -0,0 +1,13 @@ +diff --git a/usr/dash/Kbuild b/usr/dash/Kbuild +index 8e5184e..6e743f8 100644 +--- a/usr/dash/Kbuild ++++ b/usr/dash/Kbuild +@@ -18,7 +18,7 @@ DEFAULT_INCLUDES := \ + -I$(srctree)/$(src) -I$(objtree)/$(obj) \ + -include $(srctree)/$(src)/config.h + +-EXTRA_KLIBCCFLAGS := $(DEFS) $(DEFAULT_INCLUDES) $(CPPFLAGS) $(CFLAGS) ++KLIBCCFLAGS += $(DEFS) $(DEFAULT_INCLUDES) $(CPPFLAGS) $(CFLAGS) + HOST_EXTRACFLAGS := $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) + + SRCS := alias.c arith_yylex.c cd.c error.c eval.c exec.c expand.c \ diff --git a/dev-libs/klibc/files/klibc-1.4.9-mips32.patch b/dev-libs/klibc/files/klibc-1.4.9-mips32.patch new file mode 100644 index 000000000000..044cb6d32867 --- /dev/null +++ b/dev-libs/klibc/files/klibc-1.4.9-mips32.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile b/Makefile +index bb018cc..4a66577 100644 +--- a/Makefile ++++ b/Makefile +@@ -24,7 +24,7 @@ export OBJDUMP := $(KLIBCROSS)objdump + + NOSTDINC_FLAGS := -nostdlib -nostdinc -isystem $(shell $(CC) -print-file-name=include) + +-ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/parisc64/parisc/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) ++ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/parisc64/parisc/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/mips64/mips/) + export KLIBCARCH ?= $(ARCH) + export KLIBCARCHDIR := $(shell echo $(KLIBCARCH) | sed -e s/s390x/s390/) + diff --git a/dev-libs/klibc/klibc-1.4.9.ebuild b/dev-libs/klibc/klibc-1.4.9.ebuild new file mode 100644 index 000000000000..5d07d846a514 --- /dev/null +++ b/dev-libs/klibc/klibc-1.4.9.ebuild @@ -0,0 +1,218 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/klibc/klibc-1.4.9.ebuild,v 1.1 2006/07/08 16:14:01 azarah Exp $ + +inherit eutils linux-info multilib + +# Klibc has no PT_GNU_STACK support, so scanning for execstacks is moot +QA_EXECSTACK="*" + +export CTARGET=${CTARGET:-${CHOST}} +if [[ ${CTARGET} == ${CHOST} ]] ; then + if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then + export CTARGET=${CATEGORY/cross-} + fi +fi + +DESCRIPTION="A minimal libc subset for use with initramfs." +HOMEPAGE="http://www.zytor.com/mailman/listinfo/klibc" +SRC_URI="ftp://ftp.kernel.org/pub/linux/libs/klibc/${P}.tar.bz2 + ftp://ftp.kernel.org/pub/linux/libs/klibc/Stable/${P}.tar.bz2 + ftp://ftp.kernel.org/pub/linux/libs/klibc/Testing/${P}.tar.bz2" +LICENSE="|| ( GPL-2 LGPL-2 )" +# Mips patches needs updating ... +KEYWORDS="~amd64 -mips ~ppc ~x86" +IUSE="n32" +RESTRICT="nostrip" + +DEPEND="dev-lang/perl + virtual/linux-sources" +RDEPEND="dev-lang/perl" + +if [[ ${CTARGET} != ${CHOST} ]] ; then + SLOT="${CTARGET}" +else + SLOT="0" +fi + +is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; } + +guess_arch() { + local x + local host=$(echo "${CTARGET%%-*}" | sed -e 's/i.86/i386/' \ + -e 's/sun4u/sparc64/' \ + -e 's/arm.*/arm/' \ + -e 's/sa110/arm/' \ + -e 's/powerpc/ppc/') + + # Sort reverse so that we will get ppc64 before ppc, etc + for x in $(ls -1 "${S}/usr/include/arch/" | sort -r) ; do + if [[ ${host} == "${x}" ]] ; then + echo "${x}" + return 0 + fi + done + + return 1 +} + +pkg_setup() { + # Make sure kernel sources are OK + # (Override for linux-mod eclass) + check_kernel_built +} + +src_unpack() { + unpack ${A} + + if [[ ! -d /usr/${CTARGET} ]] ; then + echo + eerror "It does not look like your cross-compiler is setup properly!" + die "It does not look like your cross-compiler is setup properly!" + fi + + einfo "CTARGET = $CTARGET" + if ! guess_arch &>/dev/null ; then + echo + eerror "Could not guess klibc's ARCH from your CTARGET!" + die "Could not guess klibc's ARCH from your CTARGET!" + fi + + kernel_arch=$(readlink "${KV_OUT_DIR}/include/asm" | sed -e 's:asm-::') + if [[ ${kernel_arch} != $(guess_arch) ]] ; then + echo + eerror "Your kernel sources are not configured for your chosen arch!" + eerror "(KERNEL_ARCH=\"${kernel_arch}\", ARCH=\"$(guess_arch)\")" + die "Your kernel sources are not configured for your chosen arch!" + fi + + cd ${S} + + # Add our linux source tree symlink + ln -snf ${KV_DIR} linux + + # Some reason .config has outdated mtime + touch ${S}/.config + + # We do not want all the nice prelink warnings + # NOTE: for amd64, we might change below to '/usr/$(get_libdir)/klibc', + # but I do not do it right now, as the build system do not support + # the lib64 yet .... + cat > "${S}/70klibc" <<-EOF + PRELINK_PATH_MASK="/usr/lib/klibc" + EOF + + # Export the NOSTDINC_FLAGS to ensure -nostdlib is passed, bug #120678 + # NOTE: Disabling this for now, as klibc have -fno-stack-protector. Will + # enable it again if there is still issues. + #epatch "${FILESDIR}/${PN}"-1.4.7-nostdinc-flags.patch + # Fix not being able to set EXTRA_KLIBCCFLAGS during build + epatch "${FILESDIR}/${PN}"-1.4.8-dash-flags.patch + + # klibc detects mips64 systems as having 64bit userland + # Force them to 32bit userlands instead + if ! use n32; then + epatch "${FILESDIR}/${PN}"-1.4.9-mips32.patch + fi + + # Linker path is awry + # NB: Still needed ??? + #epatch "${FILESDIR}/${PN}"-1.1.16-mips-ldpaths.patch +} + +src_compile() { + local myargs + + [[ ${KV_DIR} != "${KV_OUT_DIR}" ]] && \ + myargs="KLIBCKERNELOBJ='${KV_OUT_DIR}/' KBUILD_SRC='1'" + + if is_cross ; then + einfo "ARCH = \"$(guess_arch)\"" + einfo "CROSS = \"${CTARGET}-\"" + emake ARCH=$(guess_arch) \ + CROSS="${CTARGET}-" \ + EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \ + EXTRA_KLIBCCFLAGS="-Wa,--noexecstack" \ + EXTRA_KLIBCLDFLAGS="-z,noexecstack" \ + libdir="/usr/$(get_libdir)" \ + SHLIBDIR="/$(get_libdir)" \ + mandir="/usr/share/man" \ + INSTALLDIR="/usr/$(get_libdir)/klibc" \ + ${myargs} || die "Compile failed!" + else + env -u ARCH \ + emake \ + EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \ + EXTRA_KLIBCCFLAGS="-Wa,--noexecstack" \ + EXTRA_KLIBCLDFLAGS="-z,noexecstack" \ + libdir="/usr/$(get_libdir)" \ + SHLIBDIR="/$(get_libdir)" \ + mandir="/usr/share/man" \ + INSTALLDIR="/usr/$(get_libdir)/klibc" \ + ${myargs} || die "Compile failed!" + fi +} + +src_install() { + local myargs klibc_prefix + + [[ ${KV_DIR} != "${KV_OUT_DIR}" ]] && \ + myargs="KLIBCKERNELOBJ='${KV_OUT_DIR}/' KBUILD_SRC='1'" + + if is_cross ; then + klibc_prefix=$("${S}/klcc/${CTARGET}-klcc" -print-klibc-prefix) + + make \ + EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \ + EXTRA_KLIBCCFLAGS="-Wa,--noexecstack" \ + EXTRA_KLIBCLDFLAGS="-z,noexecstack" \ + INSTALLROOT=${D} \ + ARCH=$(guess_arch) \ + CROSS="${CTARGET}-" \ + libdir="/usr/$(get_libdir)" \ + SHLIBDIR="/$(get_libdir)" \ + mandir="/usr/share/man" \ + INSTALLDIR="/usr/$(get_libdir)/klibc" \ + ${myargs} \ + install || die "Install failed!" + else + klibc_prefix=$("${S}/klcc/klcc" -print-klibc-prefix) + + env -u ARCH \ + make \ + EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \ + EXTRA_KLIBCCFLAGS="-Wa,--noexecstack" \ + EXTRA_KLIBCLDFLAGS="-z,noexecstack" \ + INSTALLROOT=${D} \ + libdir="/usr/$(get_libdir)" \ + SHLIBDIR="/$(get_libdir)" \ + mandir="/usr/share/man" \ + INSTALLDIR="/usr/$(get_libdir)/klibc" \ + ${myargs} \ + install || die "Install failed!" + fi + + # Hardlinks becoming copies + for x in gunzip zcat ; do + rm -f "${D}/${klibc_prefix}/bin/${x}" + dosym gzip "${klibc_prefix}/bin/${x}" + done + + if ! is_cross ; then + insinto /usr/share/aclocal + doins ${FILESDIR}/klibc.m4 + + doenvd ${S}/70klibc + + dodoc ${S}/README ${S}/usr/klibc/{LICENSE,CAVEATS} + newdoc ${S}/usr/klibc/README README.klibc + newdoc ${S}/usr/klibc/arch/README README.klibc.arch + docinto dash; newdoc ${S}/usr/dash/README.klibc README + docinto gzip; dodoc ${S}/usr/gzip/{COPYING,README} + fi +} + +pkg_postinst() { + # Override for linux-mod eclass + return 0 +} |