summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schlemmer <azarah@gentoo.org>2005-08-26 21:16:25 +0000
committerMartin Schlemmer <azarah@gentoo.org>2005-08-26 21:16:25 +0000
commit87445f7d671913d8b747ca6fbb8a24731640a96c (patch)
treea6b96819087d05a64fa9770c39a0a81cfd3336bd /dev-libs/klibc
parentstable on ia64 (diff)
downloadgentoo-2-87445f7d671913d8b747ca6fbb8a24731640a96c.tar.gz
gentoo-2-87445f7d671913d8b747ca6fbb8a24731640a96c.tar.bz2
gentoo-2-87445f7d671913d8b747ca6fbb8a24731640a96c.zip
Enable building on hardened systems, bug #103437.
(Portage version: 2.0.51.22-r2)
Diffstat (limited to 'dev-libs/klibc')
-rw-r--r--dev-libs/klibc/ChangeLog8
-rw-r--r--dev-libs/klibc/Manifest13
-rw-r--r--dev-libs/klibc/files/digest-klibc-1.0.14-r11
-rw-r--r--dev-libs/klibc/files/klibc-1.0.14-nostdlib.patch12
-rw-r--r--dev-libs/klibc/klibc-1.0.14-r1.ebuild156
5 files changed, 179 insertions, 11 deletions
diff --git a/dev-libs/klibc/ChangeLog b/dev-libs/klibc/ChangeLog
index a626fe45b591..e3cc81b5da84 100644
--- a/dev-libs/klibc/ChangeLog
+++ b/dev-libs/klibc/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for dev-libs/klibc
# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/klibc/ChangeLog,v 1.9 2005/06/29 07:08:47 dholm Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/klibc/ChangeLog,v 1.10 2005/08/26 21:16:25 azarah Exp $
+
+*klibc-1.0.14-r1 (26 Aug 2005)
+
+ 26 Aug 2005; Martin Schlemmer <azarah@gentoo.org>
+ +files/klibc-1.0.14-nostdlib.patch, +klibc-1.0.14-r1.ebuild:
+ Enable building on hardened systems, bug #103437.
29 Jun 2005; David Holm <dholm@gentoo.org> klibc-1.0.14.ebuild:
Added to ~ppc.
diff --git a/dev-libs/klibc/Manifest b/dev-libs/klibc/Manifest
index c060733852cd..b3b3c3e6b576 100644
--- a/dev-libs/klibc/Manifest
+++ b/dev-libs/klibc/Manifest
@@ -1,6 +1,4 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
+MD5 d387f0f30d82ac21387316c34083fcd8 klibc-1.0.14-r1.ebuild 4119
MD5 300321e4e9125b68cfc58017ec3949fd klibc-1.0.ebuild 3289
MD5 e054f1020f728f17ff8cf5fc3cef0ed3 klibc-1.0.3.ebuild 3939
MD5 4ff19cc7970bfe6510b42bde782fbaa4 ChangeLog 1618
@@ -11,12 +9,7 @@ MD5 d839dab2895dd0e607d19436928be939 files/digest-klibc-1.0.8 64
MD5 626ed5b2981bf97e3b37743bb3b4cc08 files/digest-klibc-1.0.3 64
MD5 e70edb40913b7ad07638a7202f773b6f files/klibc-1.0-makeklcc-empty-args.patch 807
MD5 790a9f0a9a74e6eac6c6c1dbde2a94b6 files/klibc.m4 3619
+MD5 4b098438d57b0f7ad9f16d534fb98eb4 files/klibc-1.0.14-nostdlib.patch 460
+MD5 5f74818fe6743d6f26cd199480a6d4ea files/digest-klibc-1.0.14-r1 65
MD5 d995810231e49d3aee9101cebc8a6a17 files/digest-klibc-1.0 62
MD5 5f74818fe6743d6f26cd199480a6d4ea files/digest-klibc-1.0.14 65
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.2 (GNU/Linux)
-
-iD8DBQFC8yF71ZcsMnZjRyIRAmR5AJ9rEGyF5+NEklupL6aSXPdXZRJbyQCgr9G9
-T7SSyQm/49IhO1OGge9N3iE=
-=NuLO
------END PGP SIGNATURE-----
diff --git a/dev-libs/klibc/files/digest-klibc-1.0.14-r1 b/dev-libs/klibc/files/digest-klibc-1.0.14-r1
new file mode 100644
index 000000000000..cb0361a61c23
--- /dev/null
+++ b/dev-libs/klibc/files/digest-klibc-1.0.14-r1
@@ -0,0 +1 @@
+MD5 882492395506ffb5f4cdbfca11eeb3d6 klibc-1.0.14.tar.bz2 443250
diff --git a/dev-libs/klibc/files/klibc-1.0.14-nostdlib.patch b/dev-libs/klibc/files/klibc-1.0.14-nostdlib.patch
new file mode 100644
index 000000000000..99068a4b6c4e
--- /dev/null
+++ b/dev-libs/klibc/files/klibc-1.0.14-nostdlib.patch
@@ -0,0 +1,12 @@
+diff --git a/MCONFIG b/MCONFIG
+--- a/MCONFIG
++++ b/MCONFIG
+@@ -42,7 +42,7 @@ INCLUDE = -I$(SRCROOT)/include/arch/$(AR
+ -I$(SRCROOT)/include/bits$(BITSIZE) \
+ -I$(SRCROOT)/include \
+ -I$(KRNLOBJ)/include -I$(KRNLOBJ)/include2 -I$(KRNLSRC)/include
+-REQFLAGS = $(ARCHREQFLAGS) $(KLIBCVER) -nostdinc -iwithprefix include \
++REQFLAGS = $(ARCHREQFLAGS) $(KLIBCVER) -nostdlib -nostdinc -iwithprefix include \
+ $(INCLUDE)
+ LDFLAGS =
+ AR = $(CROSS)ar
diff --git a/dev-libs/klibc/klibc-1.0.14-r1.ebuild b/dev-libs/klibc/klibc-1.0.14-r1.ebuild
new file mode 100644
index 000000000000..d1480bb3c34a
--- /dev/null
+++ b/dev-libs/klibc/klibc-1.0.14-r1.ebuild
@@ -0,0 +1,156 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/klibc/klibc-1.0.14-r1.ebuild,v 1.1 2005/08/26 21:16:25 azarah Exp $
+
+inherit eutils linux-mod
+
+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 )"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+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}/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
+
+ 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}
+
+ # Enable building on hardened systems, bug #103437
+ epatch ${FILESDIR}/${P}-nostdlib.patch
+
+ # Add our linux source tree symlink
+ ln -snf ${KV_DIR} linux
+
+ # set the build directory
+ echo "KRNLOBJ = ${KV_OUT_DIR}" >> MCONFIG
+
+ # 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
+}
+
+src_compile() {
+ if is_cross ; then
+ einfo "ARCH = \"$(guess_arch)\""
+ einfo "CROSS = \"${CTARGET}-\""
+ emake ARCH=$(guess_arch) \
+ CROSS="${CTARGET}-" || die "Compile failed!"
+ else
+ env -u ARCH \
+ emake || die "Compile failed!"
+ fi
+}
+
+src_install() {
+ local klibc_prefix
+
+ if is_cross ; then
+ make INSTALLROOT=${D} \
+ ARCH=$(guess_arch) \
+ CROSS="${CTARGET}-" \
+ install || die "Install failed!"
+
+ klibc_prefix=$("${S}/${CTARGET}-klcc" -print-klibc-bindir)
+ else
+ env -u ARCH \
+ make INSTALLROOT=${D} install || die "Install failed!"
+
+ klibc_prefix=$("${S}/klcc" -print-klibc-bindir)
+ fi
+
+ # Hardlinks becoming copies
+ dosym gzip "${klibc_prefix}/gunzip"
+ dosym gzip "${klibc_prefix}/zcat"
+
+ if ! is_cross ; then
+ insinto /usr/share/aclocal
+ doins ${FILESDIR}/klibc.m4
+
+ doenvd ${S}/70klibc
+
+ dodoc ${S}/README ${S}/klibc/{LICENSE,CAVEATS}
+ newdoc ${S}/klibc/README README.klibc
+ newdoc ${S}/klibc/arch/README README.klibc.arch
+ docinto ash; newdoc ${S}/ash/README.klibc README
+ docinto gzip; dodoc ${S}/gzip/{COPYING,README}
+ docinto ipconfig; dodoc ${S}/ipconfig/README
+ docinto kinit; dodoc ${S}/kinit/README
+ fi
+}
+
+pkg_postinst() {
+ # Override for linux-mod eclass
+ return 0
+}