summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2006-04-30 03:27:40 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2006-04-30 03:27:40 +0000
commitdf4dd8e517ffac6396f487f221373c68ba6675df (patch)
tree3eff2d75f45620076fd4d4834dab2f6810737bad /sys-freebsd/freebsd-lib
parenttextrels fix introduced (diff)
downloadgentoo-2-df4dd8e517ffac6396f487f221373c68ba6675df.tar.gz
gentoo-2-df4dd8e517ffac6396f487f221373c68ba6675df.tar.bz2
gentoo-2-df4dd8e517ffac6396f487f221373c68ba6675df.zip
Commit the first try patch for ssp, thanks to solar.
(Portage version: 2.1_pre10)
Diffstat (limited to 'sys-freebsd/freebsd-lib')
-rw-r--r--sys-freebsd/freebsd-lib/ChangeLog6
-rw-r--r--sys-freebsd/freebsd-lib/files/freebsd-lib-6.0-ssp.patch51
-rw-r--r--sys-freebsd/freebsd-lib/freebsd-lib-6.0-r2.ebuild8
3 files changed, 63 insertions, 2 deletions
diff --git a/sys-freebsd/freebsd-lib/ChangeLog b/sys-freebsd/freebsd-lib/ChangeLog
index 5f340c531058..bd7089b94566 100644
--- a/sys-freebsd/freebsd-lib/ChangeLog
+++ b/sys-freebsd/freebsd-lib/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-freebsd/freebsd-lib
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/ChangeLog,v 1.10 2006/04/27 16:22:13 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/ChangeLog,v 1.11 2006/04/30 03:27:40 flameeyes Exp $
+
+ 30 Apr 2006; Diego Pettenò <flameeyes@gentoo.org>
+ +files/freebsd-lib-6.0-ssp.patch, freebsd-lib-6.0-r2.ebuild:
+ Commit the first try patch for ssp, thanks to solar.
27 Apr 2006; Diego Pettenò <flameeyes@gentoo.org>
freebsd-lib-6.0-r2.ebuild:
diff --git a/sys-freebsd/freebsd-lib/files/freebsd-lib-6.0-ssp.patch b/sys-freebsd/freebsd-lib/files/freebsd-lib-6.0-ssp.patch
new file mode 100644
index 000000000000..98e07710f123
--- /dev/null
+++ b/sys-freebsd/freebsd-lib/files/freebsd-lib-6.0-ssp.patch
@@ -0,0 +1,51 @@
+Index: fbsd-6/lib/libc/sys/Makefile.inc
+===================================================================
+--- fbsd-6.orig/lib/libc/sys/Makefile.inc
++++ fbsd-6/lib/libc/sys/Makefile.inc
+@@ -18,7 +18,7 @@
+ .endif
+
+ # Sources common to both syscall interfaces:
+-SRCS+= ftruncate.c lseek.c mmap.c pread.c pwrite.c truncate.c __error.c
++SRCS+= ftruncate.c lseek.c mmap.c pread.c pwrite.c truncate.c __error.c ssp.c
+
+ # Add machine dependent asm sources:
+ SRCS+=${MDASM}
+Index: fbsd-6/lib/libc/sys/ssp.c
+===================================================================
+--- /dev/null
++++ fbsd-6/lib/libc/sys/ssp.c
+@@ -0,0 +1,13 @@
++#include <stdlib.h>
++#include <sys/param.h>
++#include <sys/sysctl.h>
++
++unsigned long __guard = 0UL;
++void __guard_setup(void) __attribute__ ((constructor));
++void __stack_smash_handler(char func[], int damaged __attribute__ ((unused)));
++void __guard_setup(void) { if (__guard != 0UL) return; __guard = 0xFF0A0D00UL; }
++
++void __stack_smash_handler(char func[], int damaged) {
++ _exit(127);
++}
++
+Index: fbsd-6/lib/csu/i386-elf/crt1.c
+===================================================================
+--- fbsd-6.orig/lib/csu/i386-elf/crt1.c
++++ fbsd-6/lib/csu/i386-elf/crt1.c
+@@ -44,6 +44,7 @@ extern void _fini(void);
+ extern void _init(void);
+ extern int main(int, char **, char **);
+ extern void _start(char *, ...);
++extern void __guard_setup(void);
+
+ #ifdef GCRT
+ extern void _mcleanup(void);
+@@ -106,6 +107,7 @@ _start(char *ap, ...)
+ monstartup(&eprol, &etext);
+ #endif
+ _init();
++ __guard_setup();
+ exit( main(argc, argv, env) );
+ }
+
diff --git a/sys-freebsd/freebsd-lib/freebsd-lib-6.0-r2.ebuild b/sys-freebsd/freebsd-lib/freebsd-lib-6.0-r2.ebuild
index 5f1c6de2bc61..518ff3e1e27b 100644
--- a/sys-freebsd/freebsd-lib/freebsd-lib-6.0-r2.ebuild
+++ b/sys-freebsd/freebsd-lib/freebsd-lib-6.0-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/freebsd-lib-6.0-r2.ebuild,v 1.4 2006/04/27 16:22:13 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/freebsd-lib-6.0-r2.ebuild,v 1.5 2006/04/30 03:27:40 flameeyes Exp $
inherit bsdmk freebsd flag-o-matic toolchain-funcs
@@ -67,6 +67,8 @@ pkg_setup() {
mymakeopts="${mymakeopts} MACHINE=$(tc-arch-kernel ${CTARGET})"
mymakeopts="${mymakeopts} MACHINE_ARCH=$(tc-arch-kernel ${CTARGET})"
fi
+
+ einfo "Using mymakeopts: ${mymakeopts}"
}
PATCHES="${FILESDIR}/${PN}-bsdxml.patch
@@ -107,6 +109,9 @@ src_unpack() {
[[ -n $(install --version 2> /dev/null | grep GNU) ]] && \
sed -i -e 's:${INSTALL} -C:${INSTALL}:' "${WORKDIR}/include/Makefile"
+
+ sed -i -e 's:-o/dev/stdout:-t:' ${S}/libc/net/Makefile.inc
+ use ssp && epatch "${FILESDIR}/${PN}-${RV}-ssp.patch"
}
src_compile() {
@@ -141,6 +146,7 @@ src_compile() {
cd "${S}/msun"
$(freebsd_get_bmake) ${mymakeopts} || die "make libc failed"
else
+ append-flags -fno-stack-protector # Don't use ssp until properly fixed
cd "${S}"
freebsd_src_compile
fi