[compiler-rt] [builtins] Update HAVE_SYSCONF configure check to adapt CMake [NFC] (PR #79847)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 07:20:38 PST 2024


https://github.com/piggynl created https://github.com/llvm/llvm-project/pull/79847

The cleans up the `HAVE_SYSCONF` check in enable_execute_stack.c from 2dbae9c334c4c250f16e105e5579b0c3f2f3fb22 and 40268af91e4a8cb2b7d1a90abc5453223fc54547. Those two commits were made when the CMake build system was not ready yet.

>From a42c0c888060d3063438742b42ebf1a18dd5004e Mon Sep 17 00:00:00 2001
From: ZHU Zijia <piggynl at outlook.com>
Date: Mon, 29 Jan 2024 23:09:35 +0800
Subject: [PATCH] [builtins] Update HAVE_SYSCONF configure check to adapt CMake
 [NFC]

The cleans up the HAVE_SYSCONF check in enable_execute_stack.c from
2dbae9c and 40268af. Those two commits were made when the CMake build
system was not ready yet.
---
 compiler-rt/lib/builtins/enable_execute_stack.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/compiler-rt/lib/builtins/enable_execute_stack.c b/compiler-rt/lib/builtins/enable_execute_stack.c
index e18de4eaebf2a7..53335483a52f77 100644
--- a/compiler-rt/lib/builtins/enable_execute_stack.c
+++ b/compiler-rt/lib/builtins/enable_execute_stack.c
@@ -12,11 +12,6 @@
 #include <sys/mman.h>
 #endif
 
-// #include "config.h"
-// FIXME: CMake - include when cmake system is ready.
-// Remove #define HAVE_SYSCONF 1 line.
-#define HAVE_SYSCONF 1
-
 #ifdef _WIN32
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
@@ -54,7 +49,7 @@ COMPILER_RT_ABI void __enable_execute_stack(void *addr) {
 #error "HAVE_SYSCONF not defined! See enable_execute_stack.c"
 #else
   const uintptr_t pageSize = sysconf(_SC_PAGESIZE);
-#endif // __APPLE__
+#endif
 
   const uintptr_t pageAlignMask = ~(pageSize - 1);
   uintptr_t p = (uintptr_t)addr;



More information about the llvm-commits mailing list