diff options
author | Fabian Groffen <grobian@gentoo.org> | 2005-09-02 08:10:39 +0000 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2005-09-02 08:10:39 +0000 |
commit | 1d1c265e4a1dd7f151babe79bb7fe7955c94e7d6 (patch) | |
tree | a91374138d2daef36d84847a21ded1d4ae897742 /dev-libs/libsigsegv/files | |
parent | Stable on alpha due to security bug #104010 (diff) | |
download | historical-1d1c265e4a1dd7f151babe79bb7fe7955c94e7d6.tar.gz historical-1d1c265e4a1dd7f151babe79bb7fe7955c94e7d6.tar.bz2 historical-1d1c265e4a1dd7f151babe79bb7fe7955c94e7d6.zip |
Fixing up the ebuild and adding a patch that allows compilation on ppc-macos
Package-Manager: portage-2.0.51.22-r2
Diffstat (limited to 'dev-libs/libsigsegv/files')
-rw-r--r-- | dev-libs/libsigsegv/files/libsigsegv-2.2-ppc-macos.patch | 209 |
1 files changed, 209 insertions, 0 deletions
diff --git a/dev-libs/libsigsegv/files/libsigsegv-2.2-ppc-macos.patch b/dev-libs/libsigsegv/files/libsigsegv-2.2-ppc-macos.patch new file mode 100644 index 000000000000..79df2fc162fa --- /dev/null +++ b/dev-libs/libsigsegv/files/libsigsegv-2.2-ppc-macos.patch @@ -0,0 +1,209 @@ +--- libsigsegv-2.2/configure.orig 2005-09-02 09:57:18.000000000 +0200 ++++ libsigsegv-2.2/configure 2005-09-02 09:58:06.000000000 +0200 +@@ -22882,206 +22882,6 @@ + echo "${ECHO_T}$sv_cv_fault_macosdarwin7_ppc" >&6 + + +-if test "$sv_cv_fault_macosdarwin7_ppc" != yes; then +- +- +- +- +- echo "$as_me:$LINENO: checking whether a fault handler according to MacOSX/Darwin5 PowerPC works" >&5 +-echo $ECHO_N "checking whether a fault handler according to MacOSX/Darwin5 PowerPC works... $ECHO_C" >&6 +-if test "${sv_cv_fault_macosdarwin5_ppc+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- +- if test "$cross_compiling" = yes; then +- case "$host" in +- powerpc-*-darwin5*) sv_cv_fault_macosdarwin5_ppc=yes ;; +- *) +- cat >conftest.$ac_ext <<_ACEOF +- +- /* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +-#include <signal.h> +-#include "$srcdir/src/fault-macosdarwin5-powerpc.c" +-void sigsegv_handler (int sig, int code, struct sigcontext *scp) +-{ +- void *fault_address = (void *) (get_fault_addr (scp)); +-} +- +-int +-main () +-{ +-struct sigaction action; +- +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.$ac_objext conftest$ac_exeext +-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" +- || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest$ac_exeext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- sv_cv_fault_macosdarwin5_ppc="guessing no" +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-sv_cv_fault_macosdarwin5_ppc=no +-fi +-rm -f conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +- ;; +- esac +- +-else +- cat >conftest.$ac_ext <<_ACEOF +- +- /* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +-#include <stdlib.h> +-#include <signal.h> +-#if HAVE_SYS_SIGNAL_H +-# include <sys/signal.h> +-#endif +-#include "$srcdir/src/fault-macosdarwin5-powerpc.c" +-#include <sys/types.h> +-#include <sys/mman.h> +-#if HAVE_MMAP_DEVZERO +-# include <fcntl.h> +-# ifndef MAP_FILE +-# define MAP_FILE 0 +-# endif +-#endif +-#ifndef PROT_NONE +-# define PROT_NONE 0 +-#endif +-#if HAVE_MMAP_ANON +-# define zero_fd -1 +-# define map_flags MAP_ANON | MAP_PRIVATE +-#elif HAVE_MMAP_ANONYMOUS +-# define zero_fd -1 +-# define map_flags MAP_ANONYMOUS | MAP_PRIVATE +-#elif HAVE_MMAP_DEVZERO +-static int zero_fd; +-# define map_flags MAP_FILE | MAP_PRIVATE +-#endif +-unsigned long page; +-int handler_called = 0; +-void sigsegv_handler (int sig, int code, struct sigcontext *scp) +-{ +- void *fault_address = (void *) (get_fault_addr (scp)); +- handler_called++; +- if (handler_called == 10) +- exit (4); +- if (fault_address != (void*)(page + 0x678)) +- exit (3); +- if (mprotect ((void *) page, 0x10000, PROT_READ | PROT_WRITE) < 0) +- exit (2); +-} +-void crasher (unsigned long p) +-{ +- *(int *) (p + 0x678) = 42; +-} +-int main () +-{ +- void *p; +- struct sigaction action; +- /* Preparations. */ +-#if !HAVE_MMAP_ANON && !HAVE_MMAP_ANONYMOUS && HAVE_MMAP_DEVZERO +- zero_fd = open ("/dev/zero", O_RDONLY, 0644); +-#endif +- /* Setup some mmaped memory. */ +-#ifdef __hpux +- /* HP-UX 10 mmap() often fails when given a hint. So give the OS complete +- freedom about the address range. */ +- p = mmap ((void *) 0, 0x10000, PROT_READ | PROT_WRITE, map_flags, zero_fd, 0); +-#else +- p = mmap ((void *) 0x12340000, 0x10000, PROT_READ | PROT_WRITE, map_flags, zero_fd, 0); +-#endif +- if (p == (void *)(-1)) +- exit (2); +- page = (unsigned long) p; +- /* Make it read-only. */ +- if (mprotect ((void *) page, 0x10000, PROT_READ) < 0) +- exit (2); +- /* Install the SIGSEGV handler. */ +- sigemptyset(&action.sa_mask); +- +- action.sa_handler = (void (*) (int)) &sigsegv_handler; +- action.sa_flags = 0; +- +- sigaction (SIGSEGV, &action, (struct sigaction *) NULL); +- sigaction (SIGBUS, &action, (struct sigaction *) NULL); +- /* The first write access should invoke the handler and then complete. */ +- crasher (page); +- /* The second write access should not invoke the handler. */ +- crasher (page); +- /* Check that the handler was called only once. */ +- if (handler_called != 1) +- exit (1); +- /* Test passed! */ +- return 0; +-} +-_ACEOF +-rm -f conftest$ac_exeext +-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- sv_cv_fault_macosdarwin5_ppc=yes +-else +- echo "$as_me: program exited with status $ac_status" >&5 +-echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-( exit $ac_status ) +-sv_cv_fault_macosdarwin5_ppc=no +-fi +-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +-fi +- +-fi +-echo "$as_me:$LINENO: result: $sv_cv_fault_macosdarwin5_ppc" >&5 +-echo "${ECHO_T}$sv_cv_fault_macosdarwin5_ppc" >&6 +- +-fi +- +- +- +- +- + echo "$as_me:$LINENO: checking whether a fault handler according to Hurd works" >&5 + echo $ECHO_N "checking whether a fault handler according to Hurd works... $ECHO_C" >&6 + if test "${sv_cv_fault_hurd+set}" = set; then |