mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
Add a configure-time check for the existence of sigaltstack. It seems that some
systems provide a <signal.h> that doesn't declare it. llvm-svn: 270278
This commit is contained in:
parent
d86d870067
commit
74e8540951
@ -157,6 +157,9 @@ if( HAVE_SETJMP_H )
|
||||
check_symbol_exists(siglongjmp setjmp.h HAVE_SIGLONGJMP)
|
||||
check_symbol_exists(sigsetjmp setjmp.h HAVE_SIGSETJMP)
|
||||
endif()
|
||||
if( HAVE_SIGNAL_H )
|
||||
check_symbol_exists(sigaltstack signal.h HAVE_SIGALTSTACK)
|
||||
endif()
|
||||
if( HAVE_SYS_UIO_H )
|
||||
check_symbol_exists(writev sys/uio.h HAVE_WRITEV)
|
||||
endif()
|
||||
|
@ -248,6 +248,9 @@
|
||||
/* Define if you have the shl_load function. */
|
||||
#undef HAVE_SHL_LOAD
|
||||
|
||||
/* Define to 1 if you have the `sigaltstack' function. */
|
||||
#cmakedefine HAVE_SIGALTSTACK ${HAVE_SIGALTSTACK}
|
||||
|
||||
/* Define to 1 if you have the `siglongjmp' function. */
|
||||
#cmakedefine HAVE_SIGLONGJMP ${HAVE_SIGLONGJMP}
|
||||
|
||||
|
@ -28,8 +28,6 @@
|
||||
# include <execinfo.h> // For backtrace().
|
||||
#endif
|
||||
#if HAVE_SIGNAL_H
|
||||
// FIXME: We unconditionally use symbols from this header below. Do we really
|
||||
// need a configure-time check for a POSIX-mandated header in lib/Support/Unix?
|
||||
#include <signal.h>
|
||||
#endif
|
||||
#if HAVE_SYS_STAT_H
|
||||
@ -119,6 +117,7 @@ static void RegisterHandler(int Signal) {
|
||||
++NumRegisteredSignals;
|
||||
}
|
||||
|
||||
#if defined(HAVE_SIGALTSTACK)
|
||||
// Hold onto the old alternate signal stack so that it's not reported as a leak.
|
||||
// We don't make any attempt to remove our alt signal stack if we remove our
|
||||
// signal handlers; that can't be done reliably if someone else is also trying
|
||||
@ -143,6 +142,9 @@ static void CreateSigAltStack() {
|
||||
if (sigaltstack(&AltStack, &OldAltStack) != 0)
|
||||
free(AltStack.ss_sp);
|
||||
}
|
||||
#else
|
||||
static void CreateSigAltStack() {}
|
||||
#endif
|
||||
|
||||
static void RegisterHandlers() {
|
||||
// We need to dereference the signals mutex during handler registration so
|
||||
|
Loading…
x
Reference in New Issue
Block a user