diff options
-rw-r--r-- | cmake/os/WindowsCache.cmake | 1 | ||||
-rw-r--r-- | config.h.cmake | 1 | ||||
-rw-r--r-- | configure.cmake | 8 | ||||
-rw-r--r-- | mysys/stacktrace.c | 16 |
4 files changed, 8 insertions, 18 deletions
diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake index a4d46df2af6..742f374e99f 100644 --- a/cmake/os/WindowsCache.cmake +++ b/cmake/os/WindowsCache.cmake @@ -35,7 +35,6 @@ SET(HAVE_BFILL CACHE INTERNAL "") SET(HAVE_BMOVE CACHE INTERNAL "") SET(HAVE_BSD_SIGNALS CACHE INTERNAL "") SET(HAVE_BSEARCH 1 CACHE INTERNAL "") -SET(HAVE_BSS_START CACHE INTERNAL "") SET(HAVE_BZERO CACHE INTERNAL "") SET(HAVE_CHOWN CACHE INTERNAL "") SET(HAVE_CLOCK_GETTIME CACHE INTERNAL "") diff --git a/config.h.cmake b/config.h.cmake index eb3e6228bf7..17e449fbab2 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -312,7 +312,6 @@ /* Symbols we may use */ #cmakedefine HAVE_SYS_ERRLIST 1 /* used by stacktrace functions */ -#cmakedefine HAVE_BSS_START 1 #cmakedefine HAVE_BACKTRACE 1 #cmakedefine HAVE_BACKTRACE_SYMBOLS 1 #cmakedefine HAVE_BACKTRACE_SYMBOLS_FD 1 diff --git a/configure.cmake b/configure.cmake index 8d477abc91b..36655fd4348 100644 --- a/configure.cmake +++ b/configure.cmake @@ -936,14 +936,6 @@ CHECK_CXX_SOURCE_COMPILES(" ENDIF() CHECK_C_SOURCE_COMPILES(" - int main(int argc, char **argv) - { - extern char *__bss_start; - return __bss_start ? 1 : 0; - }" -HAVE_BSS_START) - -CHECK_C_SOURCE_COMPILES(" int main() { extern void __attribute__((weak)) foo(void); diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c index 7daed0df673..b31213b8488 100644 --- a/mysys/stacktrace.c +++ b/mysys/stacktrace.c @@ -34,19 +34,19 @@ #include <execinfo.h> #endif +#ifdef __linux__ #define PTR_SANE(p) ((p) && (char*)(p) >= heap_start && (char*)(p) <= heap_end) - static char *heap_start; - -#ifdef HAVE_BSS_START extern char *__bss_start; -#endif +#else +#define PTR_SANE(p) (p) +#endif /* __linux */ void my_init_stacktrace() { -#ifdef HAVE_BSS_START +#ifdef __linux__ heap_start = (char*) &__bss_start; -#endif +#endif /* __linux__ */ } #ifdef __linux__ @@ -149,15 +149,15 @@ static int safe_print_str(const char *addr, int max_len) int my_safe_print_str(const char* val, int max_len) { +#ifdef __linux__ char *heap_end; -#ifdef __linux__ // Try and make use of /proc filesystem to safely print memory contents. if (!safe_print_str(val, max_len)) return 0; -#endif heap_end= (char*) sbrk(0); +#endif if (!PTR_SANE(val)) { |