diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake index e2f14398fd857..c128fd2ed125c 100644 --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -21,7 +21,6 @@ if (ANDROID OR CYGWIN OR CMAKE_SYSTEM_NAME MATCHES "AIX|DragonFly|FreeBSD|Haiku| set(HAVE_MACH_MACH_H 0) set(HAVE_MALLOC_MALLOC_H 0) set(HAVE_PTHREAD_H 1) - set(HAVE_SYS_AUXV_H 1) set(HAVE_SYS_MMAN_H 1) set(HAVE_SYSEXITS_H 1) set(HAVE_UNISTD_H 1) @@ -53,7 +52,6 @@ else() check_include_file(mach/mach.h HAVE_MACH_MACH_H) check_include_file(malloc/malloc.h HAVE_MALLOC_MALLOC_H) check_include_file(pthread.h HAVE_PTHREAD_H) - check_include_file(sys/auxv.h HAVE_SYS_AUXV_H) check_include_file(sys/mman.h HAVE_SYS_MMAN_H) check_include_file(sysexits.h HAVE_SYSEXITS_H) check_include_file(unistd.h HAVE_UNISTD_H) @@ -321,6 +319,7 @@ check_symbol_exists(getrusage sys/resource.h HAVE_GETRUSAGE) check_symbol_exists(isatty unistd.h HAVE_ISATTY) check_symbol_exists(futimens sys/stat.h HAVE_FUTIMENS) check_symbol_exists(futimes sys/time.h HAVE_FUTIMES) +check_symbol_exists(getauxval sys/auxv.h HAVE_GETAUXVAL) # AddressSanitizer conflicts with lib/Support/Unix/Signals.inc # Avoid sigaltstack on Apple platforms, where backtrace() cannot handle it # (rdar://7089625) and _Unwind_Backtrace is unusable because it cannot unwind diff --git a/llvm/include/llvm/Config/config.h.cmake b/llvm/include/llvm/Config/config.h.cmake index d4f5935b245b7..835201f2a45b0 100644 --- a/llvm/include/llvm/Config/config.h.cmake +++ b/llvm/include/llvm/Config/config.h.cmake @@ -295,6 +295,6 @@ #cmakedefine HAVE_BUILTIN_THREAD_POINTER ${HAVE_BUILTIN_THREAD_POINTER} -#cmakedefine HAVE_SYS_AUXV_H ${HAVE_SYS_AUXV_H} +#cmakedefine HAVE_GETAUXVAL ${HAVE_GETAUXVAL} #endif diff --git a/llvm/lib/Support/Unix/Process.inc b/llvm/lib/Support/Unix/Process.inc index 43509190fccfb..b5c3719f57963 100644 --- a/llvm/lib/Support/Unix/Process.inc +++ b/llvm/lib/Support/Unix/Process.inc @@ -31,7 +31,7 @@ #ifdef HAVE_MALLOC_MALLOC_H #include #endif -#ifdef HAVE_SYS_AUXV_H +#ifdef HAVE_GETAUXVAL #include #endif @@ -66,7 +66,7 @@ Process::Pid Process::getProcessId() { // On Cygwin, getpagesize() returns 64k(AllocationGranularity) and // offset in mmap(3) should be aligned to the AllocationGranularity. Expected Process::getPageSize() { -#if defined(HAVE_SYS_AUXV_H) +#if defined(HAVE_GETAUXVAL) static const int page_size = ::getauxval(AT_PAGESZ); #elif defined(HAVE_GETPAGESIZE) static const int page_size = ::getpagesize();