aboutsummaryrefslogtreecommitdiff
path: root/libgcc/enable-execute-stack-mprotect.c
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely.gcc@gmail.com>2012-01-03 21:39:46 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2012-01-03 21:39:46 +0000
commita99ad7372c43e6d7020f5036cfbde89eb121abb9 (patch)
tree4e3f872f3d6d7ae9a5e4ad599ed591b02948efa2 /libgcc/enable-execute-stack-mprotect.c
parente30afafbbf5b4cf462c68c3e9e172c5989c7d85d (diff)
downloadgcc-a99ad7372c43e6d7020f5036cfbde89eb121abb9.zip
gcc-a99ad7372c43e6d7020f5036cfbde89eb121abb9.tar.gz
gcc-a99ad7372c43e6d7020f5036cfbde89eb121abb9.tar.bz2
re PR bootstrap/51006 (bootstrap fails on NetBSD 5.1)
2012-01-02 Jonathan Wakely <jwakely.gcc@gmail.com> PR bootstrap/51006 * enable-execute-stack-mprotect.c (getpagesize): Do not define for NetBSD. From-SVN: r182860
Diffstat (limited to 'libgcc/enable-execute-stack-mprotect.c')
-rw-r--r--libgcc/enable-execute-stack-mprotect.c29
1 files changed, 1 insertions, 28 deletions
diff --git a/libgcc/enable-execute-stack-mprotect.c b/libgcc/enable-execute-stack-mprotect.c
index 1ad77bd..41b2635 100644
--- a/libgcc/enable-execute-stack-mprotect.c
+++ b/libgcc/enable-execute-stack-mprotect.c
@@ -1,5 +1,5 @@
/* Implement __enable_execute_stack using mprotect(2).
- Copyright (C) 2011 Free Software Foundation, Inc.
+ Copyright (C) 2011, 2012 Free Software Foundation, Inc.
This file is part of GCC.
@@ -62,33 +62,6 @@ check_enabling (void)
static int need_enable_exec_stack = 1;
#endif
-#if defined __NetBSD__
-/* Note that we go out of our way to use namespace-non-invasive calls
- here. Unfortunately, there is no libc-internal name for mprotect(). */
-
-#include <sys/sysctl.h>
-
-extern int __sysctl (int *, unsigned int, void *, size_t *, void *, size_t);
-
-static int
-getpagesize (void)
-{
- static int size;
-
- if (size == 0)
- {
- int mib[2];
- size_t len;
-
- mib[0] = CTL_HW;
- mib[1] = HW_PAGESIZE;
- len = sizeof (size);
- (void) __sysctl (mib, 2, &size, &len, NULL, 0);
- }
- return size;
-}
-#endif /* __NetBSD__ */
-
/* Attempt to turn on access permissions for the stack. Unfortunately it
is not possible to make this namespace-clean.*/