From 3088e76c597e068479e82508b1770a7ad0c806b6 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Mon, 19 Nov 2018 08:14:58 -0800 Subject: Export of internal Abseil changes. -- 5278e56bd7d322ecf161eaf29fd7fa3941d7431b by Greg Falcon : internal change PiperOrigin-RevId: 222078614 GitOrigin-RevId: 5278e56bd7d322ecf161eaf29fd7fa3941d7431b Change-Id: I1e86bef2e3733c81148a1a42dccd8182fe3f7fae --- absl/debugging/failure_signal_handler.cc | 4 ++++ absl/debugging/symbolize_elf.inc | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'absl/debugging') diff --git a/absl/debugging/failure_signal_handler.cc b/absl/debugging/failure_signal_handler.cc index 6cecd93f9ba1..c2e56f9d819c 100644 --- a/absl/debugging/failure_signal_handler.cc +++ b/absl/debugging/failure_signal_handler.cc @@ -119,7 +119,11 @@ const char* FailureSignalToString(int signo) { #ifndef _WIN32 static bool SetupAlternateStackOnce() { +#if defined(__wasm__) || defined (__asjms__) + const size_t page_mask = getpagesize() - 1; +#else const size_t page_mask = sysconf(_SC_PAGESIZE) - 1; +#endif size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask; #if defined(ADDRESS_SANITIZER) || defined(MEMORY_SANITIZER) || \ defined(THREAD_SANITIZER) diff --git a/absl/debugging/symbolize_elf.inc b/absl/debugging/symbolize_elf.inc index b31362e6f552..97d767abf11d 100644 --- a/absl/debugging/symbolize_elf.inc +++ b/absl/debugging/symbolize_elf.inc @@ -333,7 +333,11 @@ static std::atomic g_cached_symbolizer; } // namespace static int SymbolizerSize() { +#if defined(__wasm__) || defined(__asmjs__) + int pagesize = getpagesize(); +#else int pagesize = sysconf(_SC_PAGESIZE); +#endif return ((sizeof(Symbolizer) - 1) / pagesize + 1) * pagesize; } -- cgit 1.4.1