summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/enable_execute_stack.c
diff options
context:
space:
mode:
authorEdward O'Callaghan <eocallaghan@auroraux.org>2009-08-10 00:56:46 +0000
committerEdward O'Callaghan <eocallaghan@auroraux.org>2009-08-10 00:56:46 +0000
commit2dbae9c334c4c250f16e105e5579b0c3f2f3fb22 (patch)
tree38ee86496da4e8430a196fdc7dbe497eaa1caa5d /compiler-rt/lib/enable_execute_stack.c
parentaea9dfc1671d0e3f57223ad522cdc4c8e3182c53 (diff)
downloadbcm5719-llvm-2dbae9c334c4c250f16e105e5579b0c3f2f3fb22.tar.gz
bcm5719-llvm-2dbae9c334c4c250f16e105e5579b0c3f2f3fb22.zip
Fix a FIXME for configure check for HAVE_SYSCONF.
llvm-svn: 78545
Diffstat (limited to 'compiler-rt/lib/enable_execute_stack.c')
-rw-r--r--compiler-rt/lib/enable_execute_stack.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/compiler-rt/lib/enable_execute_stack.c b/compiler-rt/lib/enable_execute_stack.c
index 6f17c9b9528..07c1645ce76 100644
--- a/compiler-rt/lib/enable_execute_stack.c
+++ b/compiler-rt/lib/enable_execute_stack.c
@@ -10,9 +10,14 @@
#include <stdint.h>
#include <sys/mman.h>
+
+/* #include "config.h"
+ * FIXME: CMake - include when cmake system is ready.
+ */
+
#ifndef __APPLE__
#include <unistd.h>
-#endif
+#endif /* __APPLE__ */
/*
@@ -25,13 +30,16 @@
void __enable_execute_stack(void* addr)
{
+
#if __APPLE__
/* On Darwin, pagesize is always 4096 bytes */
const uintptr_t pageSize = 4096;
+#elif !defined(HAVE_SYSCONF)
+#error "HAVE_SYSCONF not defined! See enable_execute_stack.c"
#else
- /* FIXME: We should have a configure check for this. */
const uintptr_t pageSize = sysconf(_SC_PAGESIZE);
-#endif
+#endif /* __APPLE__ */
+
const uintptr_t pageAlignMask = ~(pageSize-1);
uintptr_t p = (uintptr_t)addr;
unsigned char* startPage = (unsigned char*)(p & pageAlignMask);
OpenPOWER on IntegriCloud