diff options
author | Christian Heim <phreak@gentoo.org> | 2006-08-26 16:48:52 +0000 |
---|---|---|
committer | Christian Heim <phreak@gentoo.org> | 2006-08-26 16:48:52 +0000 |
commit | e1dd2da055327c98d6df456372f9f420519c2b45 (patch) | |
tree | 6bf94cc077d1552cdf697f58ed439c501e5a6c27 /dev-libs | |
parent | Updating the use legacy (diff) | |
download | overlay-e1dd2da055327c98d6df456372f9f420519c2b45.tar.gz overlay-e1dd2da055327c98d6df456372f9f420519c2b45.tar.bz2 overlay-e1dd2da055327c98d6df456372f9f420519c2b45.zip |
Updated dietlibc-0.28 ebuild for stable
svn path=/; revision=30
Diffstat (limited to 'dev-libs')
-rw-r--r-- | dev-libs/dietlibc/Manifest | 32 | ||||
-rw-r--r-- | dev-libs/dietlibc/dietlibc-0.28-r1.ebuild | 59 | ||||
-rw-r--r-- | dev-libs/dietlibc/files/0.24-dirent-prototype.patch | 14 | ||||
-rw-r--r-- | dev-libs/dietlibc/files/dietlibc-0.26-ssp.patch | 54 | ||||
-rw-r--r-- | dev-libs/dietlibc/files/dietlibc-0.28-Makefile.patch | 28 | ||||
-rw-r--r-- | dev-libs/dietlibc/files/dietlibc-sparc64-makefile.patch | 11 | ||||
-rw-r--r-- | dev-libs/dietlibc/files/digest-dietlibc-0.28-r1 | 3 | ||||
-rw-r--r-- | dev-libs/dietlibc/files/gcc-33-r3.patch | 16 | ||||
-rw-r--r-- | dev-libs/dietlibc/files/ssp.c | 129 |
9 files changed, 346 insertions, 0 deletions
diff --git a/dev-libs/dietlibc/Manifest b/dev-libs/dietlibc/Manifest new file mode 100644 index 0000000..f32b84e --- /dev/null +++ b/dev-libs/dietlibc/Manifest @@ -0,0 +1,32 @@ +AUX 0.24-dirent-prototype.patch 668 RMD160 c86dd2b8860952d5f850acea204359aa48bd3ebc SHA1 08f416adc9e9727183905bd5ca1e8352122d4593 SHA256 b8ceebd840995c757098e57d3e71ec17266d02e62badc717d7e4afa95e00deb5 +MD5 2d0f660abd258d75417ef8abd8ab5eb7 files/0.24-dirent-prototype.patch 668 +RMD160 c86dd2b8860952d5f850acea204359aa48bd3ebc files/0.24-dirent-prototype.patch 668 +SHA256 b8ceebd840995c757098e57d3e71ec17266d02e62badc717d7e4afa95e00deb5 files/0.24-dirent-prototype.patch 668 +AUX dietlibc-0.26-ssp.patch 1632 RMD160 59f3ca58604b643f3e777f3484183e3a9469c990 SHA1 c25125a3ac737b88c9f26db2ed6aeeb347ac9048 SHA256 e7327c2b4f0872f27257d6960250adce01b330f3ae7fdab8ce30eab981cf69f1 +MD5 9022467ec4210d62330f0eb1d8c93394 files/dietlibc-0.26-ssp.patch 1632 +RMD160 59f3ca58604b643f3e777f3484183e3a9469c990 files/dietlibc-0.26-ssp.patch 1632 +SHA256 e7327c2b4f0872f27257d6960250adce01b330f3ae7fdab8ce30eab981cf69f1 files/dietlibc-0.26-ssp.patch 1632 +AUX dietlibc-0.28-Makefile.patch 529 RMD160 4b66ccd46900965111fbaa0f7712fa61d921bdcb SHA1 b81202d1aaa9b93640adc1307598adb719440c2a SHA256 4307ae87429c4d431d0770532b4a7e96e209e2247baa884a7bb90cfc306a647d +MD5 e326170b86e838c08e64d75b8d6d0f67 files/dietlibc-0.28-Makefile.patch 529 +RMD160 4b66ccd46900965111fbaa0f7712fa61d921bdcb files/dietlibc-0.28-Makefile.patch 529 +SHA256 4307ae87429c4d431d0770532b4a7e96e209e2247baa884a7bb90cfc306a647d files/dietlibc-0.28-Makefile.patch 529 +AUX dietlibc-sparc64-makefile.patch 499 RMD160 a7f21fcc3a96646fed11cf19e09683d35bc4ad83 SHA1 8c619b218f6e9e1834d377bc7be4b18b9cee456b SHA256 59d73b59df80ec83758b5bf6ffeb7cefd1359705e128cc2392f1b1603e2c3074 +MD5 8c25662fd30d966f24ec20ef491075a6 files/dietlibc-sparc64-makefile.patch 499 +RMD160 a7f21fcc3a96646fed11cf19e09683d35bc4ad83 files/dietlibc-sparc64-makefile.patch 499 +SHA256 59d73b59df80ec83758b5bf6ffeb7cefd1359705e128cc2392f1b1603e2c3074 files/dietlibc-sparc64-makefile.patch 499 +AUX gcc-33-r3.patch 451 RMD160 a0576ea89a560174f11004814001f0782ec9a1a4 SHA1 2d7f06e3a660afe5b70af58000f0f86ad25dcdc6 SHA256 3deaf13c0d56375c8f6002b349214178386f4441664540cde2c07a5a09498396 +MD5 ee309afd4c5bd953a5133fb3383124de files/gcc-33-r3.patch 451 +RMD160 a0576ea89a560174f11004814001f0782ec9a1a4 files/gcc-33-r3.patch 451 +SHA256 3deaf13c0d56375c8f6002b349214178386f4441664540cde2c07a5a09498396 files/gcc-33-r3.patch 451 +AUX ssp.c 3065 RMD160 4d1f9aeb0d7d63978b717b7487dfbf17b9fd046a SHA1 ce38c67dc73f304f0036513b484436b83fb4c7f8 SHA256 a35ab2cd397c28d850667d99ca39eab1c521c141c9bb4826fb9c91310406d52c +MD5 65a68ed33fd14d52b23a2fe28e06dfc9 files/ssp.c 3065 +RMD160 4d1f9aeb0d7d63978b717b7487dfbf17b9fd046a files/ssp.c 3065 +SHA256 a35ab2cd397c28d850667d99ca39eab1c521c141c9bb4826fb9c91310406d52c files/ssp.c 3065 +DIST dietlibc-0.28.tar.bz2 560540 RMD160 242cbcd5b7e7f341713f587598cddc9d6ee39f59 SHA1 ac67fca8e57f495e9834dfc77f3e3df227488774 SHA256 2b5cba7bad7ef6a4c0e83303c78cbf426e1fe01a5a69aeae801d714d6fdc002c +EBUILD dietlibc-0.28-r1.ebuild 1617 RMD160 11ecc46791822e0d1f97d6c478e4023be99513b0 SHA1 4ad5e680efb9a873fe0c94c4f43b32cb062cd45b SHA256 db6bd5a071b86fbbebad163fbf73a4b87c777b612212887b12d9466a06271f32 +MD5 0d6789d217cc86b998639b6c08e0fcfe dietlibc-0.28-r1.ebuild 1617 +RMD160 11ecc46791822e0d1f97d6c478e4023be99513b0 dietlibc-0.28-r1.ebuild 1617 +SHA256 db6bd5a071b86fbbebad163fbf73a4b87c777b612212887b12d9466a06271f32 dietlibc-0.28-r1.ebuild 1617 +MD5 90ac396d9ba3f6f7bb4f6b04ab2221e3 files/digest-dietlibc-0.28-r1 244 +RMD160 2a19556861e654340f9185478ea607b86ad04e8c files/digest-dietlibc-0.28-r1 244 +SHA256 6ec1db8d4f38e9f0f31e143bbf5ca22eb82fba0426d80774e90d10004d63cba4 files/digest-dietlibc-0.28-r1 244 diff --git a/dev-libs/dietlibc/dietlibc-0.28-r1.ebuild b/dev-libs/dietlibc/dietlibc-0.28-r1.ebuild new file mode 100644 index 0000000..095763d --- /dev/null +++ b/dev-libs/dietlibc/dietlibc-0.28-r1.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/dietlibc/dietlibc-0.28.ebuild,v 1.10 2006/01/07 08:23:28 phreak Exp $ + +inherit eutils flag-o-matic + +DESCRIPTION="A minimal libc" +HOMEPAGE="http://www.fefe.de/dietlibc/" +SRC_URI="mirror://kernel/linux/libs/${PN}/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 ~arm hppa ~mips ppc ppc64 sparc x86" +IUSE="debug pie" + +DEPEND="" + +pkg_setup() { + use hppa && strip-unsupported-flags + if use pie ; then + einfo "Appending -fPIE to CFLAGS" + append-flags -fPIE + else + einfo "Adding -fno-pie to CFLAGS" + append-flags -fno-pie + fi +} + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}"/0.24-dirent-prototype.patch + epatch "${FILESDIR}"/gcc-33-r3.patch + epatch "${FILESDIR}"/dietlibc-sparc64-makefile.patch #45601 + + # Ok so let's make dietlibc ssp aware (Aug 7 2004) -solar + cp "${FILESDIR}"/ssp.c "${S}"/lib/ || die "Failed to copy ssp.c into lib for compile" + epatch "${FILESDIR}"/dietlibc-0.26-ssp.patch + + replace-sparc64-flags #45716 + + # Fix for not available gcc option on hppa (20 Jul 2005) KillerFox + epatch "${FILESDIR}"/dietlibc-0.28-Makefile.patch +} + +src_compile() { + local make_opt="" + use debug && make_opt="DEBUG=1" + emake CFLAGS="${CFLAGS}" ${make_opt} || die "emake failed" +} + +src_install() { + make install DESTDIR="${D}" || die "make install failed" + dobin "${D}"/usr/diet/bin/* || die "dobin" + doman "${D}"/usr/diet/man/*/* || die "doman" + rm -r "${D}"/usr/diet/{man,bin} + dodoc AUTHOR BUGS CAVEAT CHANGES README THANKS TODO PORTING +} diff --git a/dev-libs/dietlibc/files/0.24-dirent-prototype.patch b/dev-libs/dietlibc/files/0.24-dirent-prototype.patch new file mode 100644 index 0000000..0beeb36 --- /dev/null +++ b/dev-libs/dietlibc/files/0.24-dirent-prototype.patch @@ -0,0 +1,14 @@ +diff -Nru dietlibc-0.23.orig/include/dirent.h dietlibc-0.23/include/dirent.h +--- dietlibc-0.23.orig/include/dirent.h 2003-08-19 12:22:52.000000000 -0400 ++++ dietlibc-0.23/include/dirent.h 2003-09-12 20:40:03.000000000 -0400 +@@ -37,8 +37,8 @@ + struct dirent *readdir (DIR *__dirp) __THROW; + struct dirent64 *readdir64 (DIR *__dirp) __THROW; + void rewinddir (DIR *__dirp) __THROW; +-void seekdir (DIR *__dirp, long int __pos) __THROW; +-long int telldir (DIR *__dirp) __THROW; ++void seekdir (DIR *__dirp, off_t __pos) __THROW; ++off_t telldir (DIR *__dirp) __THROW; + + int scandir(const char *dir, struct dirent ***namelist, + int (*selection)(const struct dirent *), diff --git a/dev-libs/dietlibc/files/dietlibc-0.26-ssp.patch b/dev-libs/dietlibc/files/dietlibc-0.26-ssp.patch new file mode 100644 index 0000000..98b2be1 --- /dev/null +++ b/dev-libs/dietlibc/files/dietlibc-0.26-ssp.patch @@ -0,0 +1,54 @@ +diff -Nrup dietlibc-0.26.orig/i386/start.S dietlibc-0.26/i386/start.S +--- dietlibc-0.26.orig/i386/start.S 2003-04-17 09:55:39.000000000 -0400 ++++ dietlibc-0.26/i386/start.S 2004-08-07 18:50:52.000000000 -0400 +@@ -50,7 +50,9 @@ _start: + PUT_VAR %edi, __vsyscall, %edx + 1: + #endif +- ++#ifdef __dietlibc__ ++ call __guard_setup ++#endif + #ifdef WANT_DYNAMIC + call _dyn_start + #else +diff -Nrup dietlibc-0.26.orig/sparc/start.S dietlibc-0.26/sparc/start.S +--- dietlibc-0.26.orig/sparc/start.S 2003-08-22 08:16:23.000000000 -0400 ++++ dietlibc-0.26/sparc/start.S 2004-08-07 18:55:26.000000000 -0400 +@@ -29,6 +29,9 @@ _start: + be NULL. */ + + /* Let libc do the rest of the initialization, and call main. */ ++#if 0 /* FIXME: __dietlibc__ */ ++ call __guard_setup ++#endif + #ifdef WANT_DYNAMIC + call dyn_start + #else +diff -Nrup dietlibc-0.26.orig/sparc64/start.S dietlibc-0.26/sparc64/start.S +--- dietlibc-0.26.orig/sparc64/start.S 2003-08-22 08:16:23.000000000 -0400 ++++ dietlibc-0.26/sparc64/start.S 2004-08-07 18:55:36.000000000 -0400 +@@ -29,6 +29,9 @@ _start: + be NULL. */ + + /* Let libc do the rest of the initialization, and call main. */ ++#if 0 /* FIXME: __dietlibc__ */ ++ call __guard_setup ++#endif + #ifdef WANT_DYNAMIC + call dyn_start + #else +diff -Nrup dietlibc-0.26.orig/x86_64/start.S dietlibc-0.26/x86_64/start.S +--- dietlibc-0.26.orig/x86_64/start.S 2003-02-05 09:29:19.000000000 -0500 ++++ dietlibc-0.26/x86_64/start.S 2004-08-07 18:52:39.000000000 -0400 +@@ -35,6 +35,10 @@ _start: + popq %rdi + #endif + ++#if 0 /* FIXME: __dietlibc__ */ ++ call __guard_setup ++#endif ++ + #ifdef WANT_DYNAMIC + call _dyn_start + #else diff --git a/dev-libs/dietlibc/files/dietlibc-0.28-Makefile.patch b/dev-libs/dietlibc/files/dietlibc-0.28-Makefile.patch new file mode 100644 index 0000000..7a0eb00 --- /dev/null +++ b/dev-libs/dietlibc/files/dietlibc-0.28-Makefile.patch @@ -0,0 +1,28 @@ +--- Makefile ++++ Makefile +@@ -1,5 +1,5 @@ + INSTALL=install +-prefix?=/opt/diet ++prefix=/usr/diet + # Set the following to install to a different root + #DESTDIR=/tmp/fefix + # Use "make DEBUG=1" to compile a debug version. +@@ -95,7 +95,6 @@ + + profiling: $(OBJDIR)/libgmon.a $(OBJDIR)/pstart.o + +-CFLAGS=-pipe -nostdinc + CROSS= + + CC=gcc +@@ -126,10 +125,6 @@ + + LIBMATHOBJ=$(patsubst %,$(OBJDIR)/%,$(LIBMATH)) + +-ifeq ($(CFLAGS),-pipe -nostdinc) +-CFLAGS+=-O -fomit-frame-pointer +-endif +- + ifneq ($(DEBUG),) + CFLAGS = -g + COMMENT = : diff --git a/dev-libs/dietlibc/files/dietlibc-sparc64-makefile.patch b/dev-libs/dietlibc/files/dietlibc-sparc64-makefile.patch new file mode 100644 index 0000000..d720152 --- /dev/null +++ b/dev-libs/dietlibc/files/dietlibc-sparc64-makefile.patch @@ -0,0 +1,11 @@ +--- Makefile.orig 2004-03-25 08:24:20.420425000 -0700 ++++ Makefile 2004-03-25 08:27:02.730425000 -0700 +@@ -8,7 +8,7 @@ + BINDIR=${prefix}/bin + MAN1DIR=${prefix}/man/man1 + +-MYARCH:=$(shell uname -m | sed -e 's/i[4-9]86/i386/' -e 's/armv[3-6][lb]/arm/') ++MYARCH:=$(shell uname -m | sed -e 's/i[4-9]86/i386/' -e 's/armv[3-6][lb]/arm/' -e 's/sparc64/sparc/') + + # This extra-ugly cruft is here so make will not run uname and sed each + # time it looks at $(OBJDIR). This alone sped up running make when diff --git a/dev-libs/dietlibc/files/digest-dietlibc-0.28-r1 b/dev-libs/dietlibc/files/digest-dietlibc-0.28-r1 new file mode 100644 index 0000000..5c48c58 --- /dev/null +++ b/dev-libs/dietlibc/files/digest-dietlibc-0.28-r1 @@ -0,0 +1,3 @@ +MD5 5be8e221a438817f83f73d09ce655883 dietlibc-0.28.tar.bz2 560540 +RMD160 242cbcd5b7e7f341713f587598cddc9d6ee39f59 dietlibc-0.28.tar.bz2 560540 +SHA256 2b5cba7bad7ef6a4c0e83303c78cbf426e1fe01a5a69aeae801d714d6fdc002c dietlibc-0.28.tar.bz2 560540 diff --git a/dev-libs/dietlibc/files/gcc-33-r3.patch b/dev-libs/dietlibc/files/gcc-33-r3.patch new file mode 100644 index 0000000..1ccc1d4 --- /dev/null +++ b/dev-libs/dietlibc/files/gcc-33-r3.patch @@ -0,0 +1,16 @@ +--- diet.c ++++ diet.c +@@ -26,8 +26,13 @@ + + static const char* Os[] = { + "i386","-Os","-mpreferred-stack-boundary=2", ++#if __GNUC__ >= 3 ++ "-falign-functions=1","-falign-jumps=1", ++ "-falign-loops=1","-fomit-frame-pointer",0, ++#else + "-malign-functions=1","-malign-jumps=1", + "-malign-loops=1","-fomit-frame-pointer",0, ++#endif + "x86_64","-Os","-fno-omit-frame-pointer",0, + "sparc","-Os","-mcpu=supersparc",0, + "sparc64","-Os","-m64",0, diff --git a/dev-libs/dietlibc/files/ssp.c b/dev-libs/dietlibc/files/ssp.c new file mode 100644 index 0000000..18d16fe --- /dev/null +++ b/dev-libs/dietlibc/files/ssp.c @@ -0,0 +1,129 @@ +/* + * Distributed under the terms of the GNU General Public License v2 + * $Header: /var/cvsroot/gentoo-x86/dev-libs/dietlibc/files/ssp.c,v 1.2 2004/12/05 19:25:40 solar Exp $ + * + * This is a modified version of Hiroaki Etoh's stack smashing routines + * implemented for glibc. + * + * The following people have contributed input to this code. + * Ned Ludd - <solar[@]gentoo.org> + * Alexander Gabert - <pappy[@]gentoo.org> + * The PaX Team - <pageexec[@]freemail.hu> + * Peter S. Mazinger - <ps.m[@]gmx.net> + * Yoann Vandoorselaere - <yoann[@]prelude-ids.org> + * Robert Connolly - <robert[@]linuxfromscratch.org> + * Cory Visi <cory@visi.name> + * + */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <stdio.h> +#include <string.h> +#include <fcntl.h> +#include <unistd.h> +#include <signal.h> +#include <sys/types.h> +#include <sys/socket.h> +#include <sys/un.h> +#include <sys/time.h> + +#ifdef __PROPOLICE_BLOCK_SEGV__ +#define SSP_SIGTYPE SIGSEGV +#elif __PROPOLICE_BLOCK_KILL__ +#define SSP_SIGTYPE SIGKILL +#else +#define SSP_SIGTYPE SIGABRT +#endif + +unsigned long __guard = 0UL; + +void +__guard_setup (void) +{ + size_t size; + if (__guard != 0UL) + return; + +#ifndef __SSP_QUICK_CANARY__ + /* + * Attempt to open kernel pseudo random device if one exists before + * opening urandom to avoid system entropy depletion. + */ + { + int fd; +#ifdef HAVE_DEV_ERANDOM + if ((fd = open ("/dev/erandom", O_RDONLY)) == (-1)) +#endif + fd = open ("/dev/urandom", O_RDONLY); + if (fd != (-1)) + { + size = read (fd, (char *) &__guard, sizeof (__guard)); + close (fd); + if (size == sizeof (__guard)) + return; + } + } +#endif + + /* If sysctl was unsuccessful, use the "terminator canary". */ + __guard = 0xFF0A0D00UL; + + { + /* Everything failed? Or we are using a weakened model of the + * terminator canary */ + struct timeval tv; + + gettimeofday (&tv, NULL); + __guard ^= tv.tv_usec ^ tv.tv_sec; + } +} + +void +__stack_smash_handler (char func[], int damaged) +{ + struct sigaction sa; + const char message[] = ": stack smashing attack in function "; + int bufsz, len; + char buf[512]; + static char *__progname = "dietapp"; + + sigset_t mask; + sigfillset (&mask); + + sigdelset (&mask, SSP_SIGTYPE); /* Block all signal handlers */ + sigprocmask (SIG_BLOCK, &mask, NULL); /* except SIGABRT */ + + bufsz = sizeof (buf); + strcpy (buf, "<2>"); + len = 3; + + strncat (buf, __progname, sizeof (buf) - 4); + len = strlen (buf); + + if (bufsz > len) + { + strncat (buf, message, bufsz - len - 1); + len = strlen (buf); + } + if (bufsz > len) + { + strncat (buf, func, bufsz - len - 1); + len = strlen (buf); + } + + /* print error message */ + write (STDERR_FILENO, buf + 3, len - 3); + write (STDERR_FILENO, "()\n", 3); + + /* Make sure the default handler is associated with the our signal handler */ + memset (&sa, 0, sizeof (struct sigaction)); + sigfillset (&sa.sa_mask); /* Block all signals */ + sa.sa_flags = 0; + sa.sa_handler = SIG_DFL; + sigaction (SSP_SIGTYPE, &sa, NULL); + (void) kill (getpid (), SSP_SIGTYPE); + _exit (127); +} |