diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8420fff4c..e810adeea1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: fail-fast: false matrix: include: - # toolchain per runner-image availability: + # toolchain per runner-image availability: # ubuntu 22.04 # GCC: 9-12 # clang: 11-15 @@ -136,14 +136,12 @@ jobs: - name: Linux (GCC + musl + libunwind) os: ubuntu-latest container: ghcr.io/getsentry/sentry-native-alpine:3.21 - CMAKE_DEFINES: -DSENTRY_LIBUNWIND_SHARED=OFF CC: gcc CXX: g++ SYSTEM_PYTHON: 1 - name: Linux (clang + musl + libunwind) os: ubuntu-latest container: ghcr.io/getsentry/sentry-native-alpine:3.21 - CMAKE_DEFINES: -DSENTRY_LIBUNWIND_SHARED=OFF CC: clang CXX: clang++ SYSTEM_PYTHON: 1 @@ -151,6 +149,10 @@ jobs: os: macos-14 ERROR_ON_WARNINGS: 1 SYSTEM_VERSION_COMPAT: 0 + - name: macOS 26 (xcode llvm) + os: macos-26 + ERROR_ON_WARNINGS: 1 + SYSTEM_VERSION_COMPAT: 0 - name: macOS 14 (xcode llvm + universal) os: macos-14 ERROR_ON_WARNINGS: 1 @@ -163,6 +165,11 @@ jobs: ERROR_ON_WARNINGS: 1 SYSTEM_VERSION_COMPAT: 0 RUN_ANALYZER: asan,llvm-cov + - name: macOS 26 (arm64e + PAC test) + os: macos-26 + ERROR_ON_WARNINGS: 1 + SYSTEM_VERSION_COMPAT: 0 + CMAKE_DEFINES: -DCMAKE_OSX_ARCHITECTURES=arm64e - name: Windows (old VS, 32-bit) os: windows-2022 TEST_X86: 1 @@ -222,6 +229,12 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + + - name: Debug runner architecture + if: ${{ runner.os == 'macOS' }} + run: | + echo "Runner arch: $(uname -m)" + - uses: actions/setup-python@v5 with: python-version: ${{ !env['SYSTEM_PYTHON'] && '3.12' || '' }} @@ -268,13 +281,13 @@ jobs: run: | sudo dpkg --add-architecture i386 sudo apt update - sudo apt install cmake "${CC}-multilib" "${CXX}-multilib" zlib1g-dev:i386 libssl-dev:i386 libcurl4-openssl-dev:i386 + sudo apt install cmake "${CC}-multilib" "${CXX}-multilib" zlib1g-dev:i386 libssl-dev:i386 libcurl4-openssl-dev:i386 liblzma-dev:i386 - name: Installing Alpine Linux Dependencies if: ${{ contains(matrix.container, 'alpine') }} run: | apk update - apk add curl-dev libunwind-dev libunwind-static xz-dev + apk add curl-dev xz-dev # install manually until available by default (also for future .NET updates) - name: Install .NET 10 SDK for ARM64 runners if: ${{ runner.os == 'Linux' && runner.arch == 'ARM64' && !matrix.container }} @@ -285,11 +298,6 @@ jobs: echo "$HOME/.dotnet" >> $GITHUB_PATH echo "DOTNET_ROOT=$HOME/.dotnet" >> $GITHUB_ENV - # https://github.com/actions/runner-images/issues/9491 - - name: Decrease vm.mmap_rnd_bit to prevent ASLR ASAN issues - if: ${{ runner.os == 'Linux' && contains(env['RUN_ANALYZER'], 'asan') }} - run: sudo sysctl vm.mmap_rnd_bits=28 - - name: Installing CodeChecker if: ${{ contains(env['RUN_ANALYZER'], 'code-checker') }} run: sudo snap install codechecker --classic diff --git a/CHANGELOG.md b/CHANGELOG.md index 29508206cf..0dd66bc072 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,14 +2,28 @@ ## Unreleased +**Breaking**: + +- inproc: since we split `inproc` into signal-handler/UEF part and a separate handler thread, `before_send` and `on_crash` could be called from other threads than the one that crashed. While this was never part of the contract, if your code relies on this, it will no longer work. ([#1446](https://github.com/getsentry/sentry-native/pull/1446)) + **Features**: - Add new offline caching options to persist envelopes locally: `sentry_options_set_cache_keep`, `sentry_options_set_cache_max_items`, `sentry_options_set_cache_max_size`, and `sentry_options_set_cache_max_age`. ([#1490](https://github.com/getsentry/sentry-native/pull/1490), [#1493](https://github.com/getsentry/sentry-native/pull/1493)) +- Add support for `abort()` in the `inproc` backend on Windows. ([#1446](https://github.com/getsentry/sentry-native/pull/1446)) **Fixes**: - Remove spurious decref in `sentry_capture_user_feedback()` ([#1510](https://github.com/getsentry/sentry-native/pull/1510)) - Prevent double-decref of event in envelope add functions ([#1511](https://github.com/getsentry/sentry-native/pull/1511)) +- Make the signal-handler synchronization fully atomic to fix rare race scenarios. ([#1446](https://github.com/getsentry/sentry-native/pull/1446)) +- Reintroduce an FP-based stack-walker for macOS that can start from a user context. This also makes `inproc` backend functional again on macOS 13+. ([#1446](https://github.com/getsentry/sentry-native/pull/1446)) +- Split the `inproc` signal handler (and UEF on Windows) into a safe handler part and an "unsafe" handler thread. This minimizes exposure to undefined behavior inside the signal handler. ([#1446](https://github.com/getsentry/sentry-native/pull/1446)) +- Use a signal-safe address formatter instead of `snprintf()`. ([#1446](https://github.com/getsentry/sentry-native/pull/1446)) + +**Internal**: + +- Introduce PAC tests for `arm64e` on macOS. ([#1446](https://github.com/getsentry/sentry-native/pull/1446)) +- For Linux, the SDK now has a vendored "nognu" `libunwind` as the default stack walker and links it statically, but with PIC enabled so it can be used in PIE executables. ([#1446](https://github.com/getsentry/sentry-native/pull/1446)) ## 0.12.6 @@ -51,6 +65,7 @@ - Add logs flush on `sentry_flush()`. ([#1434](https://github.com/getsentry/sentry-native/pull/1434)) - Add global attributes API. These are added to all `sentry_log_X` calls. ([#1450](https://github.com/getsentry/sentry-native/pull/1450)) + ## 0.12.1 **Fixes**: diff --git a/CMakeLists.txt b/CMakeLists.txt index 50beda3338..cf37de08f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,16 +143,8 @@ if(LINUX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE") set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -m32 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE") set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS OFF) + set(CMAKE_SYSTEM_PROCESSOR "i686") endif() - - execute_process( - COMMAND ${CMAKE_C_COMPILER} -dumpmachine - OUTPUT_VARIABLE TARGET_TRIPLET - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - if(TARGET_TRIPLET MATCHES "musl") - set(MUSL TRUE) - endif() endif() # CMAKE_POSITION_INDEPENDENT_CODE must be set BEFORE adding any libraries (including subprojects) @@ -266,9 +258,12 @@ endif() if(ANDROID) set(SENTRY_WITH_LIBUNWINDSTACK TRUE) -elseif(MUSL) +elseif(LINUX) set(SENTRY_WITH_LIBUNWIND TRUE) +elseif(APPLE) + set(SENTRY_WITH_LIBUNWIND_MAC TRUE) elseif(NOT WIN32 AND NOT PROSPERO) + # this should never be true, but we keep it as fallback set(SENTRY_WITH_LIBBACKTRACE TRUE) endif() @@ -620,19 +615,15 @@ endif() if(SENTRY_WITH_LIBUNWIND) if(LINUX) - option(SENTRY_LIBUNWIND_SHARED "Link to shared libunwind" ${SENTRY_BUILD_SHARED_LIBS}) - find_path(LIBUNWIND_INCLUDE_DIR libunwind.h PATH_SUFFIXES libunwind REQUIRED) - if(SENTRY_LIBUNWIND_SHARED) - find_library(LIBUNWIND_LIBRARIES unwind REQUIRED) - else() - find_library(LIBUNWIND_LIBRARIES libunwind.a REQUIRED) - find_library(LZMA_LIBRARY lzma) - if(LZMA_LIBRARY) - list(APPEND LIBUNWIND_LIBRARIES ${LZMA_LIBRARY}) - endif() + # Use vendored libunwind + add_subdirectory(vendor/libunwind) + target_link_libraries(sentry PRIVATE unwind) + if(NOT SENTRY_BUILD_SHARED_LIBS) + sentry_install(TARGETS unwind EXPORT sentry + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ) endif() - target_include_directories(sentry PRIVATE ${LIBUNWIND_INCLUDE_DIR}) - target_link_libraries(sentry PRIVATE ${LIBUNWIND_LIBRARIES}) endif() endif() @@ -685,6 +676,15 @@ if(SENTRY_BACKEND_CRASHPAD) $ $ ) + + # ignore #include_next warning being a GCC extension via pedantic + if (LINUX) + target_include_directories(sentry + SYSTEM PRIVATE + external/crashpad/compat/linux + ) + endif() + install(EXPORT crashpad_export NAMESPACE sentry_crashpad:: FILE sentry_crashpad-targets.cmake DESTINATION "${CMAKE_INSTALL_CMAKEDIR}" ) @@ -824,11 +824,17 @@ if(SENTRY_BUILD_EXAMPLES) set_target_properties(sentry_example PROPERTIES FOLDER ${SENTRY_FOLDER}) endif() + if(CMAKE_GENERATOR STREQUAL "Xcode") + set(SENTRY_FIXTURE_OUTPUT_DIR "$/..") + else() + set(SENTRY_FIXTURE_OUTPUT_DIR "$") + endif() + add_custom_command(TARGET sentry_example POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/minidump.dmp" "$/minidump.dmp") + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/minidump.dmp" "${SENTRY_FIXTURE_OUTPUT_DIR}/minidump.dmp") add_custom_command(TARGET sentry_example POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/view-hierarchy.json" "$/view-hierarchy.json") + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/view-hierarchy.json" "${SENTRY_FIXTURE_OUTPUT_DIR}/view-hierarchy.json") endif() # Limit the exported symbols when sentry is built as a shared library to those with a "sentry_" prefix: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d701458280..3ab0c889f2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,7 +12,7 @@ Building and testing `sentry-native` currently requires the following tools: - **CMake** and a supported C/C++ compiler, to actually build the code. - **python** and **pytest**, to run integration tests. - **clang-format** and **black**, to format the C/C++ and python code respectively. -- **curl** and **zlib** libraries (e.g. on Ubuntu: libcurl4-openssl-dev, libz-dev) +- **curl** and **zlib** libraries (e.g. on Ubuntu: `libcurl4-openssl-dev`, `libz-dev`) `pytest`, `clang-format` and `black` are installed as virtualenv dependencies automatically. @@ -235,4 +235,4 @@ applied in order not to have to fight boring concurrency bugs: * if you nest them (directly or via callees), the `options` lock **must always be acquired before** the `scope` lock * never early-return or jump (via `goto` or `return`) from within a `SENTRY_WITH_*` block: doing so skips the corresponding release or cleanup * in particular, since `options` are readonly after `sentry_init()` the lock is only acquired to increment the refcount for the duration of `SENTRY_WITH_OPTIONS` - * however, `SENTRY_WITH_SCOPE` (and variants) always hold the lock for the entirety of their lexical scope \ No newline at end of file + * however, `SENTRY_WITH_SCOPE` (and variants) always hold the lock for the entirety of their lexical scope diff --git a/README.md b/README.md index 0522200c40..c0d0dbcb47 100644 --- a/README.md +++ b/README.md @@ -301,27 +301,26 @@ using `cmake -D BUILD_SHARED_LIBS=OFF ..`. ### Support Matrix -| Feature | Windows | macOS | Linux | Android | iOS | -|------------|---------|-------|-------|---------|-------| -| Transports | | | | | | -| - curl | | ☑ | ☑ | (✓)*** | | -| - winhttp | ☑ | | | | | -| - none | ✓ | ✓ | ✓ | ☑ | ☑ | -| | | | | | | -| Backends | | | | | | -| - crashpad | ☑ | ☑ | ☑ | | | -| - breakpad | ✓ | ✓ | ✓ | (✓)** | (✓)** | -| - inproc | ✓ | (✓)* | ✓ | ☑ | | -| - none | ✓ | ✓ | ✓ | ✓ | | +| Feature | Windows | macOS | Linux | Android | iOS | +|------------|---------|-------|-------|---------|------| +| Transports | | | | | | +| - curl | | ☑ | ☑ | (✓)** | | +| - winhttp | ☑ | | | | | +| - none | ✓ | ✓ | ✓ | ☑ | ☑ | +| | | | | | | +| Backends | | | | | | +| - crashpad | ☑ | ☑ | ☑ | | | +| - breakpad | ✓ | ✓ | ✓ | (✓)* | (✓)* | +| - inproc | ✓ | ✓ | ✓ | ☑ | | +| - none | ✓ | ✓ | ✓ | ✓ | | Legend: - ☑ default - ✓ supported - (✓) supported with limitations -- `*`: `inproc` has not produced valid stack traces on macOS since version 13 ("Ventura"). Tracking: https://github.com/getsentry/sentry-native/issues/906 -- `**`: `breakpad` on Android and iOS builds and should work according to upstream but is untested. -- `***`: `curl` as a transport works on Android but isn't used in any supported configuration to reduce the size of our artifacts. +- `*`: `breakpad` on Android and iOS builds and should work according to upstream but is untested. +- `**`: `curl` as a transport works on Android but isn't used in any supported configuration to reduce the size of our artifacts. In addition to platform support, the "Advanced Usage" section of the SDK docs now [describes the tradeoffs](https://docs.sentry.io/platforms/native/advanced-usage/backend-tradeoffs/) involved in choosing a suitable backend for a particular use case. diff --git a/examples/example.c b/examples/example.c index 3627e0e537..a7cc36c647 100644 --- a/examples/example.c +++ b/examples/example.c @@ -843,6 +843,10 @@ main(int argc, char **argv) assert(0); } if (has_arg(argc, argv, "abort")) { +#ifdef _WIN32 + // Suppress the Windows abort dialog that would block CI + _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT); +#endif abort(); } #ifdef SENTRY_PLATFORM_UNIX diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 4ccb3dd9ac..74e7c83c5b 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -144,16 +144,16 @@ if(LINUX OR ANDROID) if(HAVE_GETCONTEXT) target_compile_definitions(breakpad_client PRIVATE HAVE_GETCONTEXT) else() - # Enable ASM for getcontext once, only if not already enabled - get_property(_langs GLOBAL PROPERTY ENABLED_LANGUAGES) - if(NOT "ASM" IN_LIST _langs) - include(CheckLanguage) - check_language(ASM) - if(NOT CMAKE_ASM_COMPILER) - message(FATAL_ERROR "ASM required for breakpad's Linux context code, but no assembler found.") - endif() - enable_language(ASM) + # Enable ASM for getcontext - must be called in this directory scope + # even if ASM is already globally enabled (e.g. by vendored libunwind), + # because CMake rule variables like CMAKE_ASM_COMPILE_OBJECT are + # directory-scoped. + include(CheckLanguage) + check_language(ASM) + if(NOT CMAKE_ASM_COMPILER) + message(FATAL_ERROR "ASM required for breakpad's Linux context code, but no assembler found.") endif() + enable_language(ASM) target_sources(breakpad_client PRIVATE ${BREAKPAD_SOURCES_COMMON_LINUX_GETCONTEXT}) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3b874a887b..538df87fa8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -159,6 +159,9 @@ elseif(SENTRY_BACKEND_NONE) endif() # unwinder +sentry_target_sources_cwd(sentry + unwinder/sentry_unwinder.h +) if(SENTRY_WITH_LIBBACKTRACE) target_compile_definitions(sentry PRIVATE SENTRY_WITH_UNWINDER_LIBBACKTRACE) sentry_target_sources_cwd(sentry @@ -173,6 +176,13 @@ if(SENTRY_WITH_LIBUNWIND) ) endif() +if(SENTRY_WITH_LIBUNWIND_MAC) + target_compile_definitions(sentry PRIVATE SENTRY_WITH_UNWINDER_LIBUNWIND_MAC) + sentry_target_sources_cwd(sentry + unwinder/sentry_unwinder_libunwind_mac.c + ) +endif() + if(SENTRY_WITH_LIBUNWINDSTACK) target_compile_definitions(sentry PRIVATE SENTRY_WITH_UNWINDER_LIBUNWINDSTACK) sentry_target_sources_cwd(sentry diff --git a/src/backends/sentry_backend_breakpad.cpp b/src/backends/sentry_backend_breakpad.cpp index 4d515b3816..f723680f5d 100644 --- a/src/backends/sentry_backend_breakpad.cpp +++ b/src/backends/sentry_backend_breakpad.cpp @@ -101,7 +101,7 @@ breakpad_backend_callback(const google_breakpad::MinidumpDescriptor &descriptor, #ifndef SENTRY_PLATFORM_WINDOWS sentry__page_allocator_enable(); - sentry__enter_signal_handler(); + (void)!sentry__enter_signal_handler(); #endif sentry_path_t *dump_path = nullptr; @@ -266,22 +266,22 @@ breakpad_backend_startup( && defined(SENTRY_THREAD_STACK_GUARANTEE_AUTO_INIT) sentry__set_default_thread_stack_guarantee(); # endif - backend->data = new google_breakpad::ExceptionHandler( + backend->data = new (std::nothrow) google_breakpad::ExceptionHandler( current_run_folder->path_w, nullptr, breakpad_backend_callback, nullptr, google_breakpad::ExceptionHandler::HANDLER_EXCEPTION); #elif defined(SENTRY_PLATFORM_MACOS) // If process is being debugged and there are breakpoints set it will cause // task_set_exception_ports to crash the whole process and debugger - backend->data = new google_breakpad::ExceptionHandler( - current_run_folder->path, nullptr, breakpad_backend_callback, nullptr, - !IsDebuggerActive(), nullptr); + backend->data = new (std::nothrow) + google_breakpad::ExceptionHandler(current_run_folder->path, nullptr, + breakpad_backend_callback, nullptr, !IsDebuggerActive(), nullptr); #elif defined(SENTRY_PLATFORM_IOS) - backend->data - = new google_breakpad::ExceptionHandler(current_run_folder->path, - nullptr, breakpad_backend_callback, nullptr, true, nullptr); + backend->data = new (std::nothrow) + google_breakpad::ExceptionHandler(current_run_folder->path, nullptr, + breakpad_backend_callback, nullptr, true, nullptr); #else google_breakpad::MinidumpDescriptor descriptor(current_run_folder->path); - backend->data = new google_breakpad::ExceptionHandler( + backend->data = new (std::nothrow) google_breakpad::ExceptionHandler( descriptor, nullptr, breakpad_backend_callback, nullptr, true, -1); #endif return backend->data == nullptr; diff --git a/src/backends/sentry_backend_crashpad.cpp b/src/backends/sentry_backend_crashpad.cpp index 95c60740d9..9815bdb420 100644 --- a/src/backends/sentry_backend_crashpad.cpp +++ b/src/backends/sentry_backend_crashpad.cpp @@ -34,8 +34,7 @@ extern "C" { #if defined(__GNUC__) # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-parameter" -# pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" -# pragma GCC diagnostic ignored "-Wfour-char-constants" +# pragma GCC diagnostic ignored "-Wmultichar" #elif defined(_MSC_VER) # pragma warning(push) # pragma warning(disable : 4100) // unreferenced formal parameter @@ -312,14 +311,14 @@ flush_scope_from_handler( # ifdef SENTRY_PLATFORM_WINDOWS static bool -sentry__crashpad_handler(EXCEPTION_POINTERS *ExceptionInfo) +crashpad_handler(EXCEPTION_POINTERS *ExceptionInfo) { # else static bool -sentry__crashpad_handler(int signum, siginfo_t *info, ucontext_t *user_context) +crashpad_handler(int signum, siginfo_t *info, ucontext_t *user_context) { sentry__page_allocator_enable(); - sentry__enter_signal_handler(); + (void)!sentry__enter_signal_handler(); # endif // Disable logging during crash handling if the option is set SENTRY_WITH_OPTIONS (options) { @@ -712,7 +711,7 @@ crashpad_backend_startup( // `sentry_init` will persist the upload flag. data->db = crashpad::CrashReportDatabase::Initialize(database).release(); process_completed_reports(data, options); - data->client = new crashpad::CrashpadClient; + data->client = new (std::nothrow) crashpad::CrashpadClient; char *minidump_url = sentry__dsn_get_minidump_url(options->dsn, options->user_agent); if (minidump_url) { @@ -754,8 +753,7 @@ crashpad_backend_startup( } #if defined(SENTRY_PLATFORM_LINUX) || defined(SENTRY_PLATFORM_WINDOWS) - crashpad::CrashpadClient::SetFirstChanceExceptionHandler( - &sentry__crashpad_handler); + crashpad::CrashpadClient::SetFirstChanceExceptionHandler(&crashpad_handler); #endif #ifdef SENTRY_PLATFORM_LINUX // Crashpad was recently changed to register its own signal stack, which for @@ -766,7 +764,7 @@ crashpad_backend_startup( if (g_signal_stack.ss_sp) { g_signal_stack.ss_size = SIGNAL_STACK_SIZE; g_signal_stack.ss_flags = 0; - sigaltstack(&g_signal_stack, 0); + sigaltstack(&g_signal_stack, nullptr); } #endif @@ -805,9 +803,9 @@ crashpad_backend_shutdown(sentry_backend_t *backend) #ifdef SENTRY_PLATFORM_LINUX g_signal_stack.ss_flags = SS_DISABLE; - sigaltstack(&g_signal_stack, 0); + sigaltstack(&g_signal_stack, nullptr); sentry_free(g_signal_stack.ss_sp); - g_signal_stack.ss_sp = NULL; + g_signal_stack.ss_sp = nullptr; #endif } @@ -857,7 +855,7 @@ crashpad_backend_free(sentry_backend_t *backend) sentry__path_free(data->breadcrumb1_path); sentry__path_free(data->breadcrumb2_path); sentry__path_free(data->external_report_path); - sentry_free(data); + delete data; } static void @@ -1049,12 +1047,11 @@ sentry__backend_new(void) } memset(backend, 0, sizeof(sentry_backend_t)); - auto *data = SENTRY_MAKE(crashpad_state_t); + auto *data = new (std::nothrow) crashpad_state_t {}; if (!data) { sentry_free(backend); return nullptr; } - memset(data, 0, sizeof(crashpad_state_t)); data->scope_flush = false; data->crashed = false; diff --git a/src/backends/sentry_backend_inproc.c b/src/backends/sentry_backend_inproc.c index 76c73c1756..ecc76fff8b 100644 --- a/src/backends/sentry_backend_inproc.c +++ b/src/backends/sentry_backend_inproc.c @@ -4,6 +4,7 @@ #include "sentry_alloc.h" #include "sentry_backend.h" #include "sentry_core.h" +#include "sentry_cpu_relax.h" #include "sentry_database.h" #include "sentry_envelope.h" #include "sentry_logger.h" @@ -12,6 +13,7 @@ #include "sentry_options.h" #if defined(SENTRY_PLATFORM_WINDOWS) # include "sentry_os.h" +# include #endif #include "sentry_scope.h" #include "sentry_screenshot.h" @@ -19,13 +21,192 @@ #include "sentry_transport.h" #include "sentry_unix_pageallocator.h" #include "transports/sentry_disk_transport.h" +#include +#include #include -#define SIGNAL_DEF(Sig, Desc) { Sig, #Sig, Desc } +/** + * Signal/async-safe logging macro for use in signal handlers or other + * contexts where stdio and malloc are unsafe. Only supports static strings. + */ +#ifdef SENTRY_PLATFORM_UNIX +# include +# define SENTRY_SIGNAL_SAFE_LOG(msg) \ + do { \ + static const char _msg[] = "[sentry] " msg "\n"; \ + (void)!write(STDERR_FILENO, _msg, sizeof(_msg) - 1); \ + } while (0) +#elif defined(SENTRY_PLATFORM_WINDOWS) +# define SENTRY_SIGNAL_SAFE_LOG(msg) \ + do { \ + static const char _msg[] = "[sentry] " msg "\n"; \ + OutputDebugStringA(_msg); \ + HANDLE _stderr = GetStdHandle(STD_ERROR_HANDLE); \ + if (_stderr && _stderr != INVALID_HANDLE_VALUE) { \ + DWORD _written; \ + WriteFile(_stderr, _msg, (DWORD)(sizeof(_msg) - 1), &_written, \ + NULL); \ + } \ + } while (0) +#endif + +/** + * Inproc Backend Introduction + * + * As the name suggests the inproc backend runs the crash handling entirely + * inside the process and thus is the right choice for platforms that + * are limited in process creation/spawning/cloning (or even deploying a + * separate release artifact like with `crashpad`). It is also very lightweight + * in terms of toolchain dependencies because it does not require a C++ standard + * library. + * + * It targets UNIX and Windows (effectively supporting all target platforms of + * the Native SDK) and uses POSIX signal handling on UNIX and unhandled + * exception filters (UEF) on Windows. Whenever a signal handler is mentioned + * in the code or comments, one can replace that with UEF on Windows. + * + * In its current implementation it only gathers the crash context for the + * crashed thread and does not attempt to stop any other threads. While this + * can be considered a downside for some users, it allows additional handlers + * to process the crashed process again, which the other backends currently + * can't guarantee to work. Additional crash signals coming from other threads + * will be blocked indefinitely until previous handler takes over. + * + * The inproc backend splits the handler into two parts: + * - a signal handler/unhandled exception filter that severely limits what we + * can do, focusing on response to the OS mechanism and almost zero policy. + * - a separate handler thread that does most of the typical sentry error + * handling and policy implementation, with a bit more freedom. + * + * Only if the handler thread has crashed or is otherwise unavailable, will we + * execute the unsafe part inside the signal-handler itself, as a last chance + * fallback for report creation. The signal-handler part should not use any + * synchronization or signal-unsafe function from `libc` (see function-level + * comment), even access to options is ideally done before during + * initialization. If access to option or scope (or any other global context) + * is required this should happen in the handler thread. + * + * The handler thread is started during backend initialization and will be + * triggered by the signal handler via a POSIX pipe on which the handler thread + * blocks from the start (similarly on Windows, which uses a Semaphore). While + * the handler thread handles a crash, the signal handler (or UEF) blocks itself + * on an ACK pipe/semaphore. Once the handler thread is done processing the + * crash, it will unblock the signal handler which resets the synchronization + * during crash handling and invokes the handler chain. + * + * The most important functions and their meaning: + * + * - `handle_signal`/`handle_exception`: top-level entry points called directly + * from the operating system. They pack sentry_ucontext_t and call... + * - `process_ucontext`: the actual signal-handler/UEF, primarily manages the + * interaction with the OS and other handlers and calls... + * - `dispatch_ucontext`: this is the place that decides on where to run the + * sentry error event creation and that does the synchronization with... + * - `handler_thread_main`: implements the handler thread loop, blocks until + * unblocked by the signal handler and finally calls... + * - `process_ucontext_deferred`: the implementation of sentry specific + * handler policy leading to crash event construction, it defers to... + * - `make_signal_event`: that is purely about making a crash event object and + * filling the context data + * + * The `on_crash` and `before_send` hook usually run on the handler thread + * during `process_ucontext_deferred` but users cannot rely on any particular + * thread to call their callbacks. However, they can be sure that the crashed + * thread won't progress during the execution of their callback code. + * + * Note on unwinders: + * + * The backend relies on an unwinder that can backtrace from a user context. + * This is important because the unwinder usually runs in the context of the + * handler thread, where a direct backtrace makes no longer any sense (even if + * it was signal safe). We do not dispatch to the handler thread for targets + * that still use `libbacktrace`, and instead run the unsafe part directly in + * the signal handler. This is primarily to not break these target, but in + * general the `libbacktrace`-based unwinder should be considered deprecated. + * + * Notes on signal handling in other runtimes: + * + * The .net runtimes currently rely on signal handling to deliver managed + * exceptions caused from the generated native code. Due to the initialization + * order the inproc backend will receive those signals which it should not + * process. On setups like these it offers a handler strategy that chains the + * previous signal handler first, allowing the .net runtime handler to either + * immediately jump back into runtime code or reset IP/SP so that the returning + * signal handler continues from the managed exception rather than the crashed + * instruction. + * + * The Android runtime (ART) otoh, while also relying heavily on signal handling + * to communicate between generated code and the garbage collector entirely + * shields the signals from us (via `libsigchain` special handler ordering) and + * only forwards signals that are not relevant to runtime. However, it relies on + * each thread having a specific sigaltstack setup, which can lead to crashes if + * overridden. For this reason, we do not set the sigaltstack of any thread if + * one was already configured even if the size is smaller than we'd want. Since + * most of the handler runs in a separate thread the size limitation of any pre- + * configured `sigaltstack` is not a problem to our more complex handler code. + */ +#define SIGNAL_DEF(Sig, Desc) { Sig, #Sig, Desc } #define MAX_FRAMES 128 +// the data exchange between the signal handler and the handler thread +typedef struct sentry_inproc_handler_state_s { + sentry_ucontext_t uctx; +#ifdef SENTRY_PLATFORM_UNIX + siginfo_t siginfo_storage; + ucontext_t user_context_storage; +#endif + const struct signal_slot *sig_slot; +} sentry_inproc_handler_state_t; + +// "data" struct containing options to prevent mutex access in signal handler +typedef struct sentry_inproc_backend_config_s { + bool enable_logging_when_crashed; + sentry_handler_strategy_t handler_strategy; +} sentry_inproc_backend_config_t; + +// global instance for data-exchange between signal handler and handler thread +static sentry_inproc_handler_state_t g_handler_state; +// global instance for backend configuration state +static sentry_inproc_backend_config_t g_backend_config; + +// handler thread state and synchronization variables +static sentry_threadid_t g_handler_thread; +// true once the handler thread starts waiting +static volatile long g_handler_thread_ready = 0; +// shutdown loop invariant +static volatile long g_handler_should_exit = 0; +// signal handler tells handler thread to start working +static volatile long g_handler_has_work = 0; +// State machine for crash handling coordination across threads: +// IDLE (0): No crash being handled, ready to accept +// HANDLING (1): A crash is being processed by another thread +// DONE (2): Crash handling complete, signal handlers reset +// +// Threads that crash while state is HANDLING will spin until state becomes +// DONE, then return from their signal handler. Since our signal handlers are +// unregistered before transitioning to DONE, re-executing the crashing +// instruction will invoke the default/previous handler (terminating the +// process) rather than re-entering our handler. +#define CRASH_STATE_IDLE 0 +#define CRASH_STATE_HANDLING 1 +#define CRASH_STATE_DONE 2 +static volatile long g_crash_handling_state = CRASH_STATE_IDLE; + +// trigger/schedule primitives that block the other side until this side is done +#ifdef SENTRY_PLATFORM_UNIX +static int g_handler_pipe[2] = { -1, -1 }; +static int g_handler_ack_pipe[2] = { -1, -1 }; +#elif defined(SENTRY_PLATFORM_WINDOWS) +static HANDLE g_handler_semaphore = NULL; +static HANDLE g_handler_ack_semaphore = NULL; +#endif + +static int start_handler_thread(void); +static void stop_handler_thread(void); + #ifdef SENTRY_PLATFORM_UNIX +# include struct signal_slot { int signum; const char *signame; @@ -49,6 +230,50 @@ static const struct signal_slot SIGNAL_DEFINITIONS[SIGNAL_COUNT] = { static void handle_signal(int signum, siginfo_t *info, void *user_context); +/** + * Sets up an alternate signal stack for the current thread if one isn't + * already configured. The allocated stack is stored in `out_stack` so it + * can be freed later via `teardown_sigaltstack()`. + */ +static void +setup_sigaltstack(stack_t *out_stack) +{ + memset(out_stack, 0, sizeof(*out_stack)); + + stack_t old_sig_stack; + int ret = sigaltstack(NULL, &old_sig_stack); + if (ret == 0 && old_sig_stack.ss_flags == SS_DISABLE) { + SENTRY_DEBUGF("installing signal stack (size: %d)", SIGNAL_STACK_SIZE); + out_stack->ss_sp = sentry_malloc(SIGNAL_STACK_SIZE); + if (!out_stack->ss_sp) { + SENTRY_WARN("failed to allocate signal stack"); + return; + } + out_stack->ss_size = SIGNAL_STACK_SIZE; + out_stack->ss_flags = 0; + sigaltstack(out_stack, 0); + } else if (ret == 0) { + SENTRY_DEBUGF("using existing signal stack (size: %d, flags: %d)", + old_sig_stack.ss_size, old_sig_stack.ss_flags); + } else if (ret == -1) { + SENTRY_WARNF("failed to query signal stack: %s", strerror(errno)); + } +} + +/** + * Tears down a signal stack previously set up via `setup_sigaltstack()`. + */ +static void +teardown_sigaltstack(stack_t *sig_stack) +{ + if (sig_stack->ss_sp) { + sig_stack->ss_flags = SS_DISABLE; + sigaltstack(sig_stack, 0); + sentry_free(sig_stack->ss_sp); + sig_stack->ss_sp = NULL; + } +} + static void reset_signal_handlers(void) { @@ -78,8 +303,28 @@ invoke_signal_handler(int signum, siginfo_t *info, void *user_context) static int startup_inproc_backend( - sentry_backend_t *UNUSED(backend), const sentry_options_t *UNUSED(options)) + sentry_backend_t *backend, const sentry_options_t *options) { +# ifdef SENTRY_WITH_UNWINDER_LIBBACKTRACE + SENTRY_WARN("Using `backtrace()` for stack traces together with the inproc " + "backend is signal-unsafe. This is a fallback configuration."); +# endif + // get option state so we don't need to sync read during signal handling + g_backend_config.enable_logging_when_crashed + = options ? options->enable_logging_when_crashed : true; + g_backend_config.handler_strategy = +# if defined(SENTRY_PLATFORM_LINUX) + options ? sentry_options_get_handler_strategy(options) : +# endif + SENTRY_HANDLER_STRATEGY_DEFAULT; + if (backend) { + backend->data = &g_backend_config; + } + + if (start_handler_thread() != 0) { + return 1; + } + // save the old signal handlers memset(g_previous_handlers, 0, sizeof(g_previous_handlers)); for (size_t i = 0; i < SIGNAL_COUNT; ++i) { @@ -90,29 +335,16 @@ startup_inproc_backend( } } - // set up an alternate signal stack if noone defined one before - stack_t old_sig_stack; - int ret = sigaltstack(NULL, &old_sig_stack); - if (ret == 0 && old_sig_stack.ss_flags == SS_DISABLE) { - SENTRY_DEBUGF("installing signal stack (size: %d)", SIGNAL_STACK_SIZE); - g_signal_stack.ss_sp = sentry_malloc(SIGNAL_STACK_SIZE); - if (!g_signal_stack.ss_sp) { - return 1; - } - g_signal_stack.ss_size = SIGNAL_STACK_SIZE; - g_signal_stack.ss_flags = 0; - sigaltstack(&g_signal_stack, 0); - } else if (ret == 0) { - SENTRY_DEBUGF("using existing signal stack (size: %d, flags: %d)", - old_sig_stack.ss_size, old_sig_stack.ss_flags); - } else if (ret == -1) { - SENTRY_WARNF("Failed to query signal stack size: %s", strerror(errno)); - } + setup_sigaltstack(&g_signal_stack); // install our own signal handler sigemptyset(&g_sigaction.sa_mask); g_sigaction.sa_sigaction = handle_signal; - g_sigaction.sa_flags = SA_SIGINFO | SA_ONSTACK; + // SA_NODEFER allows the signal to be delivered while the handler is + // running. This is needed for recursive crash detection to work - + // without it, a crash during crash handling would block the signal + // and leave the process in an undefined state. + g_sigaction.sa_flags = SA_SIGINFO | SA_ONSTACK | SA_NODEFER; for (size_t i = 0; i < SIGNAL_COUNT; ++i) { sigaction(SIGNAL_DEFINITIONS[i].signum, &g_sigaction, NULL); } @@ -120,15 +352,19 @@ startup_inproc_backend( } static void -shutdown_inproc_backend(sentry_backend_t *UNUSED(backend)) +shutdown_inproc_backend(sentry_backend_t *backend) { - if (g_signal_stack.ss_sp) { - g_signal_stack.ss_flags = SS_DISABLE; - sigaltstack(&g_signal_stack, 0); - sentry_free(g_signal_stack.ss_sp); - g_signal_stack.ss_sp = NULL; - } + stop_handler_thread(); + + teardown_sigaltstack(&g_signal_stack); reset_signal_handlers(); + + if (backend) { + backend->data = NULL; + } + + // allow tests or orderly shutdown to re-arm the backend once unregistered + sentry__atomic_store(&g_crash_handling_state, CRASH_STATE_IDLE); } #elif defined(SENTRY_PLATFORM_WINDOWS) @@ -139,7 +375,7 @@ struct signal_slot { const char *sigdesc; }; -# define SIGNAL_COUNT 20 +# define SIGNAL_COUNT 21 static LPTOP_LEVEL_EXCEPTION_FILTER g_previous_handler = NULL; @@ -163,32 +399,104 @@ static const struct signal_slot SIGNAL_DEFINITIONS[SIGNAL_COUNT] = { SIGNAL_DEF(EXCEPTION_NONCONTINUABLE_EXCEPTION, "NonContinuableException"), SIGNAL_DEF(EXCEPTION_PRIV_INSTRUCTION, "PrivilgedInstruction"), SIGNAL_DEF(EXCEPTION_SINGLE_STEP, "SingleStep"), - SIGNAL_DEF(EXCEPTION_STACK_OVERFLOW, "StackOverflow") + SIGNAL_DEF(EXCEPTION_STACK_OVERFLOW, "StackOverflow"), + SIGNAL_DEF(STATUS_FATAL_APP_EXIT, "FatalAppExit"), }; static LONG WINAPI handle_exception(EXCEPTION_POINTERS *); +// SIGABRT handling on Windows: abort() calls the signal handler but doesn't +// go through the unhandled exception filter. We register a SIGABRT handler +// that captures context and calls into our exception handler. +static void (*g_previous_sigabrt_handler)(int) = NULL; + +static void +handle_sigabrt(int signum) +{ + (void)signum; + + // Capture the current CPU context + CONTEXT context; + RtlCaptureContext(&context); + + // Create a synthetic exception record for abort + EXCEPTION_RECORD record; + memset(&record, 0, sizeof(record)); + record.ExceptionCode = STATUS_FATAL_APP_EXIT; + record.ExceptionFlags = EXCEPTION_NONCONTINUABLE; +# if defined(_M_AMD64) + record.ExceptionAddress = (PVOID)context.Rip; +# elif defined(_M_IX86) + record.ExceptionAddress = (PVOID)context.Eip; +# elif defined(_M_ARM64) + record.ExceptionAddress = (PVOID)context.Pc; +# endif + + EXCEPTION_POINTERS exception_pointers; + exception_pointers.ContextRecord = &context; + exception_pointers.ExceptionRecord = &record; + + handle_exception(&exception_pointers); + + // If we get here, call the previous handler or terminate + if (g_previous_sigabrt_handler && g_previous_sigabrt_handler != SIG_DFL + && g_previous_sigabrt_handler != SIG_IGN) { + g_previous_sigabrt_handler(signum); + } + + // Terminate the process - abort() must not return + TerminateProcess(GetCurrentProcess(), 3); +} + static int startup_inproc_backend( - sentry_backend_t *UNUSED(backend), const sentry_options_t *UNUSED(options)) + sentry_backend_t *backend, const sentry_options_t *options) { + g_backend_config.enable_logging_when_crashed + = options ? options->enable_logging_when_crashed : true; + g_backend_config.handler_strategy = SENTRY_HANDLER_STRATEGY_DEFAULT; + if (backend) { + backend->data = &g_backend_config; + } + # if !defined(SENTRY_BUILD_SHARED) \ && defined(SENTRY_THREAD_STACK_GUARANTEE_AUTO_INIT) sentry__set_default_thread_stack_guarantee(); # endif + if (start_handler_thread() != 0) { + return 1; + } g_previous_handler = SetUnhandledExceptionFilter(&handle_exception); SetErrorMode(SEM_FAILCRITICALERRORS); + + // Register SIGABRT handler - abort() doesn't go through the UEF + g_previous_sigabrt_handler = signal(SIGABRT, handle_sigabrt); + return 0; } static void -shutdown_inproc_backend(sentry_backend_t *UNUSED(backend)) +shutdown_inproc_backend(sentry_backend_t *backend) { + stop_handler_thread(); + LPTOP_LEVEL_EXCEPTION_FILTER current_handler = SetUnhandledExceptionFilter(g_previous_handler); if (current_handler != &handle_exception) { SetUnhandledExceptionFilter(current_handler); } + + // Restore previous SIGABRT handler (unconditionally, since SIG_DFL is + // typically NULL on MSVC and a conditional check would skip restoration) + signal(SIGABRT, g_previous_sigabrt_handler); + g_previous_sigabrt_handler = NULL; + + if (backend) { + backend->data = NULL; + } + + // the inproc handler is now unregistered; re-arm the guard for future use + sentry__atomic_store(&g_crash_handling_state, CRASH_STATE_IDLE); } #endif @@ -365,10 +673,25 @@ registers_from_uctx(const sentry_ucontext_t *uctx) SET_REG("x26", __x[26]); SET_REG("x27", __x[27]); SET_REG("x28", __x[28]); +# if defined(__arm64e__) + sentry_value_set_by_key(registers, "fp", + sentry__value_new_addr( + (uint64_t)__darwin_arm_thread_state64_get_fp(*thread_state))); + sentry_value_set_by_key(registers, "lr", + sentry__value_new_addr( + (uint64_t)__darwin_arm_thread_state64_get_lr(*thread_state))); + sentry_value_set_by_key(registers, "sp", + sentry__value_new_addr( + (uint64_t)__darwin_arm_thread_state64_get_sp(*thread_state))); + sentry_value_set_by_key(registers, "pc", + sentry__value_new_addr( + (uint64_t)__darwin_arm_thread_state64_get_pc(*thread_state))); +# else SET_REG("fp", __fp); SET_REG("lr", __lr); SET_REG("sp", __sp); SET_REG("pc", __pc); +# endif # elif defined(__arm__) @@ -555,10 +878,11 @@ make_signal_event(const struct signal_slot *sig_slot, if (sig_slot) { sentry_value_set_by_key( signal_meta, "name", sentry_value_new_string(sig_slot->signame)); - // at least on windows, the signum is a true u32 which we can't - // otherwise represent. - sentry_value_set_by_key(signal_meta, "number", - sentry_value_new_double((double)sig_slot->signum)); + // relay interprets the signal number as an i64: + // https://github.com/getsentry/relay/blob/e96e4b037cfddaa7b0fb97a0909d100dde034f8e/relay-event-schema/src/protocol/mechanism.rs#L52-L53 + // This covers the signal number ranges of all supported platforms. + sentry_value_set_by_key( + signal_meta, "number", sentry_value_new_int64(sig_slot->signum)); } sentry_value_set_by_key(mechanism_meta, "signal", signal_meta); sentry_value_set_by_key( @@ -603,114 +927,74 @@ make_signal_event(const struct signal_slot *sig_slot, return event; } -static void -handle_ucontext(const sentry_ucontext_t *uctx) +/** + * This is the signal-unsafe part of the inproc handler. Everything that + * requires stdio, time-formatting/-capture or serialization must happen here. + * + * Although we can use signal-unsafe functions here, this should still be + * written with care. Don't rely on thread synchronization or the system + * allocator since the program is in a crashed state. At least one thread no + * longer progresses and memory can be corrupted. + */ + +// Test hook for triggering crashes at specific points in the handler. +// Set via sentry__set_test_crash_callback() during testing. +#ifdef SENTRY_UNITTEST +typedef void (*sentry_test_crash_callback_t)(const char *location); +static sentry_test_crash_callback_t g_test_crash_callback = NULL; + +void +sentry__set_test_crash_callback(sentry_test_crash_callback_t callback) { - // Disable logging during crash handling if the option is set - SENTRY_WITH_OPTIONS (options) { - if (!options->enable_logging_when_crashed) { - sentry__logger_disable(); - } - } - - SENTRY_INFO("entering signal handler"); - - sentry_handler_strategy_t strategy = SENTRY_HANDLER_STRATEGY_DEFAULT; -#ifdef SENTRY_PLATFORM_UNIX - // inform the sentry_sync system that we're in a signal handler. This will - // make mutexes spin on a spinlock instead as it's no longer safe to use a - // pthread mutex. - sentry__enter_signal_handler(); -#endif - - SENTRY_WITH_OPTIONS (options) { -#ifdef SENTRY_PLATFORM_LINUX - // On Linux (and thus Android) CLR/Mono converts signals provoked by - // AOT/JIT-generated native code into managed code exceptions. In these - // cases, we shouldn't react to the signal at all and let their handler - // discontinue the signal chain by invoking the runtime handler before - // we process the signal. - strategy = sentry_options_get_handler_strategy(options); - if (strategy == SENTRY_HANDLER_STRATEGY_CHAIN_AT_START) { - SENTRY_DEBUG("defer to runtime signal handler at start"); - // there is a good chance that we won't return from the previous - // handler and that would mean we couldn't enter this handler with - // the next signal coming in if we didn't "leave" here. - sentry__leave_signal_handler(); - if (!options->enable_logging_when_crashed) { - sentry__logger_enable(); - } - - uintptr_t ip = get_instruction_pointer(uctx); - uintptr_t sp = get_stack_pointer(uctx); - - // invoke the previous handler (typically the CLR/Mono - // signal-to-managed-exception handler) - invoke_signal_handler( - uctx->signum, uctx->siginfo, (void *)uctx->user_context); - - // If the execution returns here in AOT mode, and the instruction - // or stack pointer were changed, it means CLR/Mono converted the - // signal into a managed exception and transferred execution to a - // managed exception handler. - // https://github.com/dotnet/runtime/blob/6d96e28597e7da0d790d495ba834cc4908e442cd/src/mono/mono/mini/exceptions-arm64.c#L538 - if (ip != get_instruction_pointer(uctx) - || sp != get_stack_pointer(uctx)) { - SENTRY_DEBUG("runtime converted the signal to a managed " - "exception, we do not handle the signal"); - return; - } - - // let's re-enter because it means this was an actual native crash - if (!options->enable_logging_when_crashed) { - sentry__logger_disable(); - } - sentry__enter_signal_handler(); - SENTRY_DEBUG( - "return from runtime signal handler, we handle the signal"); - } -#endif + g_test_crash_callback = callback; +} - const struct signal_slot *sig_slot = NULL; - for (int i = 0; i < SIGNAL_COUNT; ++i) { -#ifdef SENTRY_PLATFORM_UNIX - if (SIGNAL_DEFINITIONS[i].signum == uctx->signum) { -#elif defined SENTRY_PLATFORM_WINDOWS - if (SIGNAL_DEFINITIONS[i].signum - == uctx->exception_ptrs.ExceptionRecord->ExceptionCode) { +# define TEST_CRASH_POINT(location) \ + do { \ + if (g_test_crash_callback) { \ + g_test_crash_callback(location); \ + } \ + } while (0) #else -# error Unsupported platform +# define TEST_CRASH_POINT(location) ((void)0) #endif - sig_slot = &SIGNAL_DEFINITIONS[i]; - } - } -#ifdef SENTRY_PLATFORM_UNIX - // use a signal-safe allocator before we tear down. - sentry__page_allocator_enable(); -#endif +static void +process_ucontext_deferred(const sentry_ucontext_t *uctx, + const struct signal_slot *sig_slot, bool skip_hooks) +{ + SENTRY_INFO("entering signal handler"); + TEST_CRASH_POINT("after_enter"); + SENTRY_WITH_OPTIONS (options) { + sentry_handler_strategy_t strategy = +#if defined(SENTRY_PLATFORM_LINUX) + options ? sentry_options_get_handler_strategy(options) : +#endif + SENTRY_HANDLER_STRATEGY_DEFAULT; sentry_value_t event = make_signal_event(sig_slot, uctx, strategy); bool should_handle = true; sentry__write_crash_marker(options); - if (options->on_crash_func) { + if (options->on_crash_func && !skip_hooks) { SENTRY_DEBUG("invoking `on_crash` hook"); event = options->on_crash_func(uctx, event, options->on_crash_data); should_handle = !sentry_value_is_null(event); + } else if (skip_hooks && options->on_crash_func) { + SENTRY_DEBUG("skipping `on_crash` hook due to recursive crash"); } - // Flush logs and metrics in a crash-safe manner before crash handling + // Flush logs in a crash-safe manner before crash handling if (options->enable_logs) { sentry__logs_flush_crash_safe(); } if (options->enable_metrics) { sentry__metrics_flush_crash_safe(); } - + TEST_CRASH_POINT("before_capture"); if (should_handle) { - sentry_envelope_t *envelope = sentry__prepare_event( - options, event, NULL, !options->on_crash_func, NULL); + sentry_envelope_t *envelope = sentry__prepare_event(options, event, + NULL, !options->on_crash_func && !skip_hooks, NULL); // TODO(tracing): Revisit when investigating transaction flushing // during hard crashes. @@ -743,21 +1027,586 @@ handle_ucontext(const sentry_ucontext_t *uctx) // after capturing the crash event, dump all the envelopes to disk sentry__transport_dump_queue(options->transport, options->run); + + // Use signal-safe logging here since this may run in signal handler + // context (fallback path) where stdio functions are not safe. + SENTRY_SIGNAL_SAFE_LOG("crash has been captured"); } +} + +SENTRY_THREAD_FN +handler_thread_main(void *UNUSED(data)) +{ +#ifdef SENTRY_PLATFORM_UNIX + // Set up an alternate signal stack for the handler thread + stack_t handler_thread_stack; + setup_sigaltstack(&handler_thread_stack); +#endif + + sentry__atomic_store(&g_handler_thread_ready, 1); + + for (;;) { +#ifdef SENTRY_PLATFORM_UNIX + char command = 0; + ssize_t rv = read(g_handler_pipe[0], &command, 1); + if (rv == -1 && errno == EINTR) { + continue; + } + if (rv <= 0) { + if (sentry__atomic_fetch(&g_handler_should_exit)) { + break; + } + continue; + } +#elif defined(SENTRY_PLATFORM_WINDOWS) + DWORD wait_result = WaitForSingleObject(g_handler_semaphore, INFINITE); + if (wait_result != WAIT_OBJECT_0) { + continue; + } +#endif - SENTRY_INFO("crash has been captured"); + if (!sentry__atomic_fetch(&g_handler_has_work)) { + if (sentry__atomic_fetch(&g_handler_should_exit)) { + break; + } + continue; + } + process_ucontext_deferred( + &g_handler_state.uctx, g_handler_state.sig_slot, false); + sentry__atomic_store(&g_handler_has_work, 0); #ifdef SENTRY_PLATFORM_UNIX + if (g_handler_ack_pipe[1] >= 0) { + char c = 1; + do { + rv = write(g_handler_ack_pipe[1], &c, 1); + } while (rv == -1 && errno == EINTR); + if (rv != 1) { + SENTRY_SIGNAL_SAFE_LOG("WARN failed to write handler ack"); + close(g_handler_ack_pipe[1]); + g_handler_ack_pipe[1] = -1; + sentry__atomic_store(&g_handler_should_exit, 1); + break; + } + } +#elif defined(SENTRY_PLATFORM_WINDOWS) + if (g_handler_ack_semaphore) { + ReleaseSemaphore(g_handler_ack_semaphore, 1, NULL); + } +#endif + + if (sentry__atomic_fetch(&g_handler_should_exit)) { + break; + } + } + +#ifdef SENTRY_PLATFORM_UNIX + teardown_sigaltstack(&handler_thread_stack); +#endif + +#ifdef SENTRY_PLATFORM_WINDOWS + return 0; +#else + return NULL; +#endif +} + +static int +start_handler_thread(void) +{ + if (sentry__atomic_fetch(&g_handler_thread_ready)) { + return 0; + } + + sentry__thread_init(&g_handler_thread); + sentry__atomic_store(&g_handler_should_exit, 0); + sentry__atomic_store(&g_handler_has_work, 0); + +#ifdef SENTRY_PLATFORM_UNIX + if (pipe(g_handler_pipe) != 0) { + SENTRY_WARNF("failed to create handler pipe: %s", strerror(errno)); + return 1; + } + if (pipe(g_handler_ack_pipe) != 0) { + SENTRY_WARNF("failed to create handler ack pipe: %s", strerror(errno)); + close(g_handler_pipe[0]); + close(g_handler_pipe[1]); + g_handler_pipe[0] = -1; + g_handler_pipe[1] = -1; + return 1; + } +#elif defined(SENTRY_PLATFORM_WINDOWS) + g_handler_semaphore = CreateSemaphoreW(NULL, 0, LONG_MAX, NULL); + if (!g_handler_semaphore) { + SENTRY_WARN("failed to create handler semaphore"); + return 1; + } + g_handler_ack_semaphore = CreateSemaphoreW(NULL, 0, LONG_MAX, NULL); + if (!g_handler_ack_semaphore) { + SENTRY_WARN("failed to create handler ack semaphore"); + CloseHandle(g_handler_semaphore); + g_handler_semaphore = NULL; + return 1; + } +#endif + + if (sentry__thread_spawn(&g_handler_thread, handler_thread_main, NULL) + != 0) { + SENTRY_WARN("failed to spawn handler thread"); +#ifdef SENTRY_PLATFORM_UNIX + close(g_handler_pipe[0]); + close(g_handler_pipe[1]); + g_handler_pipe[0] = -1; + g_handler_pipe[1] = -1; + close(g_handler_ack_pipe[0]); + close(g_handler_ack_pipe[1]); + g_handler_ack_pipe[0] = -1; + g_handler_ack_pipe[1] = -1; +#elif defined(SENTRY_PLATFORM_WINDOWS) + CloseHandle(g_handler_semaphore); + g_handler_semaphore = NULL; + CloseHandle(g_handler_ack_semaphore); + g_handler_ack_semaphore = NULL; +#endif + return 1; + } + + // Wait for handler thread to be ready before returning. Use a time-based + // timeout (5 seconds) with periodic sleeps to ensure we give the handler + // thread enough time even on slow systems (e.g., Android emulators). + const int timeout_ms = 5000; + const int sleep_interval_ms = 10; + int elapsed_ms = 0; + while (!sentry__atomic_fetch(&g_handler_thread_ready) + && elapsed_ms < timeout_ms) { +#ifdef SENTRY_PLATFORM_WINDOWS + Sleep(sleep_interval_ms); +#else + usleep(sleep_interval_ms * 1000); +#endif + elapsed_ms += sleep_interval_ms; + } + + if (!sentry__atomic_fetch(&g_handler_thread_ready)) { + SENTRY_WARN("handler thread failed to start in time"); + // Thread was spawned but didn't become ready. Signal it to exit, + // join it, and clean up all resources. + sentry__atomic_store(&g_handler_should_exit, 1); +#ifdef SENTRY_PLATFORM_UNIX + // Close the write end of the pipe to unblock any pending read() + // in the handler thread, causing it to see EOF and exit. + if (g_handler_pipe[1] >= 0) { + close(g_handler_pipe[1]); + g_handler_pipe[1] = -1; + } +#elif defined(SENTRY_PLATFORM_WINDOWS) + if (g_handler_semaphore) { + ReleaseSemaphore(g_handler_semaphore, 1, NULL); + } +#endif + sentry__thread_join(g_handler_thread); + sentry__thread_free(&g_handler_thread); + + // The thread may have set g_handler_thread_ready before exiting; + // ensure it's cleared so we don't appear "started". + sentry__atomic_store(&g_handler_thread_ready, 0); + + // Clean up remaining resources +#ifdef SENTRY_PLATFORM_UNIX + if (g_handler_pipe[0] >= 0) { + close(g_handler_pipe[0]); + g_handler_pipe[0] = -1; + } + if (g_handler_ack_pipe[0] >= 0) { + close(g_handler_ack_pipe[0]); + g_handler_ack_pipe[0] = -1; + } + if (g_handler_ack_pipe[1] >= 0) { + close(g_handler_ack_pipe[1]); + g_handler_ack_pipe[1] = -1; + } +#elif defined(SENTRY_PLATFORM_WINDOWS) + if (g_handler_semaphore) { + CloseHandle(g_handler_semaphore); + g_handler_semaphore = NULL; + } + if (g_handler_ack_semaphore) { + CloseHandle(g_handler_ack_semaphore); + g_handler_ack_semaphore = NULL; + } +#endif + return 1; + } + + return 0; +} + +static void +stop_handler_thread(void) +{ + if (!sentry__atomic_fetch(&g_handler_thread_ready)) { + return; + } + + sentry__atomic_store(&g_handler_should_exit, 1); + +#ifdef SENTRY_PLATFORM_UNIX + if (g_handler_pipe[1] >= 0) { + char c = 0; + ssize_t rv; + do { + rv = write(g_handler_pipe[1], &c, 1); + } while (rv == -1 && errno == EINTR); + } +#elif defined(SENTRY_PLATFORM_WINDOWS) + if (g_handler_semaphore) { + ReleaseSemaphore(g_handler_semaphore, 1, NULL); + } +#endif + + sentry__thread_join(g_handler_thread); + sentry__thread_free(&g_handler_thread); + +#ifdef SENTRY_PLATFORM_UNIX + if (g_handler_pipe[0] >= 0) { + close(g_handler_pipe[0]); + g_handler_pipe[0] = -1; + } + if (g_handler_pipe[1] >= 0) { + close(g_handler_pipe[1]); + g_handler_pipe[1] = -1; + } + if (g_handler_ack_pipe[0] >= 0) { + close(g_handler_ack_pipe[0]); + g_handler_ack_pipe[0] = -1; + } + if (g_handler_ack_pipe[1] >= 0) { + close(g_handler_ack_pipe[1]); + g_handler_ack_pipe[1] = -1; + } +#elif defined(SENTRY_PLATFORM_WINDOWS) + if (g_handler_semaphore) { + CloseHandle(g_handler_semaphore); + g_handler_semaphore = NULL; + } + if (g_handler_ack_semaphore) { + CloseHandle(g_handler_ack_semaphore); + g_handler_ack_semaphore = NULL; + } +#endif + + sentry__atomic_store(&g_handler_thread_ready, 0); + sentry__atomic_store(&g_handler_should_exit, 0); +} + +static bool +has_handler_thread_crashed(void) +{ + const sentry_threadid_t current_thread = sentry__current_thread(); + if (sentry__atomic_fetch(&g_handler_thread_ready) + && sentry__threadid_equal(current_thread, g_handler_thread)) { +#ifdef SENTRY_PLATFORM_UNIX + SENTRY_SIGNAL_SAFE_LOG( + "FATAL crash in handler thread, falling back to previous handler"); +#else + SENTRY_SIGNAL_SAFE_LOG( + "FATAL crash in handler thread, UEF continues search"); +#endif + return true; + } + return false; +} + +static void +dispatch_ucontext(const sentry_ucontext_t *uctx, + const struct signal_slot *sig_slot, int handler_depth) +{ + // skip_hooks when re-entering (depth >= 2) to avoid crashing in the same + // hook again, but still try to capture the crash + bool skip_hooks = handler_depth >= 2; + +#ifdef SENTRY_WITH_UNWINDER_LIBBACKTRACE + // For targets that still use `backtrace()` as the sole unwinder we must + // run the signal-unsafe part in the signal handler like we did before. + // Disable stdio-based logging - not safe in signal handler context. + sentry__logger_disable(); + process_ucontext_deferred(uctx, sig_slot, skip_hooks); + return; +#else + if (has_handler_thread_crashed()) { + // Disable stdio-based logging since we're now in signal handler context + // where stdio functions are not safe. + sentry__logger_disable(); + + // directly execute unsafe part in signal handler as a last chance to + // report an error when the handler thread has crashed. + // Always skip hooks here since the first attempt (from handler thread) + // already failed, likely due to a crashing hook. + process_ucontext_deferred(uctx, sig_slot, true); + return; + } + + // Try to become the crash handler. Only one thread can transition + // IDLE -> HANDLING; others will spin until DONE. + if (!sentry__atomic_compare_swap( + &g_crash_handling_state, CRASH_STATE_IDLE, CRASH_STATE_HANDLING)) { + // Another thread is already handling a crash. We need to release the + // signal handler lock before spinning, otherwise the winning thread + // won't be able to re-enter after the handler thread ACKs. +# ifdef SENTRY_PLATFORM_UNIX + sentry__leave_signal_handler(); +# endif + // Spin until they're done. Once state becomes DONE, our signal handlers + // are unregistered, so returning from this handler will re-execute the + // crash instruction and hit the default/previous handler. + while (sentry__atomic_fetch(&g_crash_handling_state) + == CRASH_STATE_HANDLING) { + sentry__cpu_relax(); + } + // State is now DONE: just return and let the signal propagate + return; + } + + // We are the first handler. Check if handler thread is available. + if (!sentry__atomic_fetch(&g_handler_thread_ready)) { + // Disable stdio-based logging - not safe in signal handler context. + sentry__logger_disable(); + process_ucontext_deferred(uctx, sig_slot, skip_hooks); + return; + } + + g_handler_state.uctx = *uctx; + g_handler_state.sig_slot = sig_slot; + +# ifdef SENTRY_PLATFORM_UNIX + if (uctx->siginfo) { + memcpy(&g_handler_state.siginfo_storage, uctx->siginfo, + sizeof(g_handler_state.siginfo_storage)); + g_handler_state.uctx.siginfo = &g_handler_state.siginfo_storage; + } else { + g_handler_state.uctx.siginfo = NULL; + } + + if (uctx->user_context) { + memcpy(&g_handler_state.user_context_storage, uctx->user_context, + sizeof(g_handler_state.user_context_storage)); + g_handler_state.uctx.user_context + = &g_handler_state.user_context_storage; + } else { + g_handler_state.uctx.user_context = NULL; + } + + // we leave the handler + sentry__leave_signal_handler(); +# endif + + sentry__atomic_store(&g_handler_has_work, 1); + + // signal the handler thread to start working + bool handler_signaled = false; +# ifdef SENTRY_PLATFORM_UNIX + if (g_handler_pipe[1] >= 0) { + char c = 1; + ssize_t rv; + do { + rv = write(g_handler_pipe[1], &c, 1); + } while (rv == -1 && errno == EINTR); + + if (rv == 1) { + handler_signaled = true; + } else { + // Write failed (EPIPE, etc.) - handler thread may be dead + SENTRY_SIGNAL_SAFE_LOG( + "WARN failed to signal handler thread, processing in-handler"); + } + } + + if (!handler_signaled) { + // Fall back to in-handler processing + int depth = sentry__enter_signal_handler(); + if (depth >= 3) { + // Multiple recursive crashes - bail out + return; + } + // Disable stdio-based logging - not safe in signal handler context. + sentry__logger_disable(); + // Use skip_hooks from the original handler_depth rather than the + // fresh depth: the lock was released above, so depth here is + // always 1, which would incorrectly re-run hooks on a recursive + // crash where the pipe also fails. + process_ucontext_deferred(uctx, sig_slot, skip_hooks); + return; + } +# elif defined(SENTRY_PLATFORM_WINDOWS) + if (g_handler_semaphore) { + if (ReleaseSemaphore(g_handler_semaphore, 1, NULL)) { + handler_signaled = true; + } else { + SENTRY_SIGNAL_SAFE_LOG( + "WARN failed to signal handler thread, processing in-handler"); + } + } + + if (!handler_signaled) { + // Fall back to in-handler processing + // Disable stdio-based logging - not safe in signal handler context. + sentry__logger_disable(); + process_ucontext_deferred(uctx, sig_slot, skip_hooks); + return; + } +# endif + + // wait until the handler has done its work +# ifdef SENTRY_PLATFORM_UNIX + if (g_handler_ack_pipe[0] >= 0) { + char c = 0; + ssize_t rv; + do { + rv = read(g_handler_ack_pipe[0], &c, 1); + } while (rv == -1 && errno == EINTR); + } +# elif defined(SENTRY_PLATFORM_WINDOWS) + if (g_handler_ack_semaphore) { + WaitForSingleObject(g_handler_ack_semaphore, INFINITE); + } +# endif + +# ifdef SENTRY_PLATFORM_UNIX + // Re-acquire signal handler lock after handler thread finished. + (void)!sentry__enter_signal_handler(); +# endif + +#endif +} + +/** + * This is the signal-safe part of the inproc handler. Everything in here should + * not defer to more than the set of functions listed in: + * https://www.man7.org/linux/man-pages/man7/signal-safety.7.html + * Since this function runs as an UnhandledExceptionFilter on Windows, the rules + * are less strict, but similar in nature. + * + * That means: + * - no heap allocations except for sentry_malloc() (page allocator enabled!!!) + * - no stdio or any kind of libc string formatting + * - no logging (at least not with the printf-based default logger) + * - no thread synchronization (SENTRY_WITH_OPTIONS will terminate with a log) + * - in particular, don't access sentry interfaces that could request + * access to options or the scope, those should go to the handler thread + * - sentry_value_* and sentry_malloc are generally fine, because we use a safe + * allocator, but keep in mind that some constructors create timestampy and + * similar stringy and thus formatted values (and those are forbidden here). + * + * If you are unsure about a particular function on a given target platform + * please consult the signal-safety man page. + * + * Another decision marker of whether code should go in here: do you must run + * on the preempted crashed thread? Do you need to run before anything else? + */ +static void +process_ucontext(const sentry_ucontext_t *uctx) +{ +#ifdef SENTRY_PLATFORM_LINUX + if (g_backend_config.handler_strategy + == SENTRY_HANDLER_STRATEGY_CHAIN_AT_START + && uctx->signum != SIGABRT) { + // SIGABRT is excluded: CLR/Mono never uses it for managed exception + // translation. Chaining SIGABRT to a SIG_DFL previous handler calls + // raise(SIGABRT), and with SA_NODEFER our handler re-enters + // immediately causing an infinite loop. + // + // On Linux (and thus Android) CLR/Mono converts signals provoked by + // AOT/JIT-generated native code into managed code exceptions. In these + // cases, we shouldn't react to the signal at all and let their handler + // discontinue the signal chain by invoking the runtime handler before + // we process the signal. + uintptr_t ip = get_instruction_pointer(uctx); + uintptr_t sp = get_stack_pointer(uctx); + + // invoke the previous handler (typically the CLR/Mono + // signal-to-managed-exception handler) + invoke_signal_handler( + uctx->signum, uctx->siginfo, (void *)uctx->user_context); + + // If the execution returns here in AOT mode, and the instruction + // or stack pointer were changed, it means CLR/Mono converted the + // signal into a managed exception and transferred execution to a + // managed exception handler. + // https://github.com/dotnet/runtime/blob/6d96e28597e7da0d790d495ba834cc4908e442cd/src/mono/mono/mini/exceptions-arm64.c#L538 + if (ip != get_instruction_pointer(uctx) + || sp != get_stack_pointer(uctx)) { + return; + } + + // return from runtime handler; continue processing the crash on the + // signal thread until the worker takes over + } +#endif + +#ifdef SENTRY_PLATFORM_UNIX + int handler_depth = sentry__enter_signal_handler(); + if (handler_depth >= 3) { + // Multiple recursive crashes - bail out completely to avoid loops + SENTRY_SIGNAL_SAFE_LOG( + "multiple recursive crashes detected, bailing out"); + goto cleanup; + } +#endif + + if (!g_backend_config.enable_logging_when_crashed) { + sentry__logger_disable(); + } + + const struct signal_slot *sig_slot = NULL; + for (int i = 0; i < SIGNAL_COUNT; ++i) { +#ifdef SENTRY_PLATFORM_UNIX + if (SIGNAL_DEFINITIONS[i].signum == uctx->signum) { +#elif defined SENTRY_PLATFORM_WINDOWS + if (SIGNAL_DEFINITIONS[i].signum + == uctx->exception_ptrs.ExceptionRecord->ExceptionCode) { +#else +# error Unsupported platform +#endif + sig_slot = &SIGNAL_DEFINITIONS[i]; + } + } + +#ifdef SENTRY_PLATFORM_UNIX + // use a signal-safe allocator before we tear down. + sentry__page_allocator_enable(); +#endif + + // invoke the handler thread for signal unsafe actions +#ifdef SENTRY_PLATFORM_UNIX + dispatch_ucontext(uctx, sig_slot, handler_depth); +#else + dispatch_ucontext(uctx, sig_slot, 1); +#endif + +#ifdef SENTRY_PLATFORM_UNIX +cleanup: // reset signal handlers and invoke the original ones. This will then tear // down the process. In theory someone might have some other handler here // which recovers the process but this will cause a memory leak going // forward as we're not restoring the page allocator. reset_signal_handlers(); + + // Signal to any other threads spinning in dispatch_ucontext that we're + // done. They can now return from their signal handlers. Since our handlers + // are unregistered, re-executing their crash will hit the default handler. + sentry__atomic_store(&g_crash_handling_state, CRASH_STATE_DONE); + sentry__leave_signal_handler(); - if (strategy != SENTRY_HANDLER_STRATEGY_CHAIN_AT_START) { + if (g_backend_config.handler_strategy + != SENTRY_HANDLER_STRATEGY_CHAIN_AT_START) { invoke_signal_handler( uctx->signum, uctx->siginfo, (void *)uctx->user_context); } +#elif defined(SENTRY_PLATFORM_WINDOWS) + // Signal to any other threads spinning in dispatch_ucontext that we're + // done. They can now return EXCEPTION_CONTINUE_SEARCH from their UEF, + // allowing the exception to propagate and terminate the process. + sentry__atomic_store(&g_crash_handling_state, CRASH_STATE_DONE); #endif } @@ -769,7 +1618,7 @@ handle_signal(int signum, siginfo_t *info, void *user_context) uctx.signum = signum; uctx.siginfo = info; uctx.user_context = (ucontext_t *)user_context; - handle_ucontext(&uctx); + process_ucontext(&uctx); } #elif defined SENTRY_PLATFORM_WINDOWS static LONG WINAPI @@ -781,10 +1630,9 @@ handle_exception(EXCEPTION_POINTERS *ExceptionInfo) return EXCEPTION_CONTINUE_SEARCH; } - sentry_ucontext_t uctx; - memset(&uctx, 0, sizeof(uctx)); + sentry_ucontext_t uctx = { 0 }; uctx.exception_ptrs = *ExceptionInfo; - handle_ucontext(&uctx); + process_ucontext(&uctx); return EXCEPTION_CONTINUE_SEARCH; } #endif @@ -792,7 +1640,7 @@ handle_exception(EXCEPTION_POINTERS *ExceptionInfo) static void handle_except(sentry_backend_t *UNUSED(backend), const sentry_ucontext_t *uctx) { - handle_ucontext(uctx); + process_ucontext(uctx); } sentry_backend_t * diff --git a/src/modulefinder/sentry_modulefinder_apple.c b/src/modulefinder/sentry_modulefinder_apple.c index 26ef5088e0..b7c8d72666 100644 --- a/src/modulefinder/sentry_modulefinder_apple.c +++ b/src/modulefinder/sentry_modulefinder_apple.c @@ -106,7 +106,8 @@ remove_image(const struct mach_header *mh, intptr_t UNUSED(vmaddr_slide)) } char ref_addr[32]; - snprintf(ref_addr, sizeof(ref_addr), "0x%llx", (long long)info.dli_fbase); + sentry__addr_to_string( + ref_addr, sizeof(ref_addr), (uint64_t)info.dli_fbase); sentry_value_t new_modules = sentry_value_new_list(); for (size_t i = 0; i < sentry_value_get_length(g_modules); i++) { diff --git a/src/sentry_string.c b/src/sentry_string.c index 5952888dd4..6a4351a13f 100644 --- a/src/sentry_string.c +++ b/src/sentry_string.c @@ -7,6 +7,45 @@ # include #endif +// "0x" + 16 nibbles + NUL +#define SENTRY_ADDR_MIN_BUFFER_SIZE 19 +/** + * We collect hex digits into a small stack scratch buffer (in reverse order) + * and then copy them forward. This avoids reverse-writing into the destination + * and keeps the code simple. + */ +void +sentry__addr_to_string(char *buf, size_t buf_len, uint64_t addr) +{ + static const char hex[] = "0123456789abcdef"; + + if (!buf || buf_len < SENTRY_ADDR_MIN_BUFFER_SIZE) { + return; + } + + size_t buf_idx = 0; + buf[buf_idx++] = '0'; + buf[buf_idx++] = 'x'; + + // fill a reverse buffer from each nibble + char rev[2 * sizeof(uint64_t)]; + size_t rev_idx = 0; + if (addr == 0) { + rev[rev_idx++] = '0'; + } else { + while (addr && rev_idx < sizeof(rev)) { + rev[rev_idx++] = hex[addr & 0xF]; + addr >>= 4; + } + } + + // read rev into buf from its end + while (rev_idx && buf_idx + 1 < buf_len) { + buf[buf_idx++] = rev[--rev_idx]; + } + buf[buf_idx] = '\0'; +} + #define INITIAL_BUFFER_SIZE 128 void diff --git a/src/sentry_string.h b/src/sentry_string.h index 710924e7f9..99caba3305 100644 --- a/src/sentry_string.h +++ b/src/sentry_string.h @@ -204,6 +204,14 @@ sentry__uint64_to_string(uint64_t val) return sentry__string_clone(buf); } +/** + * Formats an address as "0x" + lowercase hex into a caller-provided buffer. + * This is a replacement for `snprintf` in signal handlers: + * - signal-safe: uses no stdio, malloc, locks, or thread-local state. + * - reentrant: only stack locals; no writable globals. + */ +void sentry__addr_to_string(char *buf, size_t buf_len, uint64_t addr); + #ifdef SENTRY_PLATFORM_WINDOWS /** * Create a utf-8 string from a Wide String. diff --git a/src/sentry_sync.c b/src/sentry_sync.c index 7766a69709..d370f49238 100644 --- a/src/sentry_sync.c +++ b/src/sentry_sync.c @@ -505,34 +505,78 @@ sentry__bgworker_get_thread_name(sentry_bgworker_t *bgw) #if defined(SENTRY_PLATFORM_UNIX) || defined(SENTRY_PLATFORM_NX) # include "sentry_cpu_relax.h" +# include -static sig_atomic_t g_in_signal_handler = 0; static sentry_threadid_t g_signal_handling_thread = { 0 }; +static sig_atomic_t g_in_signal_handler __attribute__((aligned(64))) = 0; bool sentry__block_for_signal_handler(void) { - while (__sync_fetch_and_add(&g_in_signal_handler, 0)) { - if (sentry__threadid_equal( - sentry__current_thread(), g_signal_handling_thread)) { + for (;;) { + // if there is no signal handler active, we don't need to block + // we can spin cheaply, but for the return we must acquire + if (!__atomic_load_n(&g_in_signal_handler, __ATOMIC_RELAXED)) { + if (__atomic_load_n(&g_in_signal_handler, __ATOMIC_ACQUIRE) == 0) { + return true; + } + } + + // if we are on the signal handler thread we can also leave + if (sentry__threadid_equal(sentry__current_thread(), + __atomic_load_n(&g_signal_handling_thread, __ATOMIC_ACQUIRE))) { return false; } + + // otherwise, we spin sentry__cpu_relax(); } - return true; } -void +// Tracks recursive entry depth for the signal handling thread. +// 0 = not in handler, 1 = first entry, 2 = re-entry (skip hooks), 3+ = bail out +static volatile sig_atomic_t g_signal_handler_depth = 0; + +int sentry__enter_signal_handler(void) { - sentry__block_for_signal_handler(); - g_signal_handling_thread = sentry__current_thread(); - __sync_fetch_and_or(&g_in_signal_handler, 1); + for (;;) { + // entering a signal handler while another runs, should block us + // unless we are the signal handling thread (recursive crash) + while (__atomic_load_n(&g_in_signal_handler, __ATOMIC_RELAXED)) { + if (sentry__threadid_equal(sentry__current_thread(), + __atomic_load_n( + &g_signal_handling_thread, __ATOMIC_ACQUIRE))) { + // same thread re-entering via recursive crash + int depth = __atomic_add_fetch( + &g_signal_handler_depth, 1, __ATOMIC_ACQ_REL); + return depth; + } + sentry__cpu_relax(); + } + + // atomically try to take ownership + if (__atomic_exchange_n(&g_in_signal_handler, 1, __ATOMIC_ACQ_REL) + == 0) { + // once we have, publish the handling thread too + sentry_threadid_t me = sentry__current_thread(); + __atomic_store_n(&g_signal_handling_thread, me, __ATOMIC_RELEASE); + __atomic_store_n(&g_signal_handler_depth, 1, __ATOMIC_RELEASE); + return 1; // first entry + } + + // otherwise we've been raced, spin + } } void sentry__leave_signal_handler(void) { - __sync_fetch_and_and(&g_in_signal_handler, 0); + // reset handling thread + __atomic_store_n( + &g_signal_handling_thread, (sentry_threadid_t) { 0 }, __ATOMIC_RELAXED); + + // reset handler flag + __atomic_store_n(&g_in_signal_handler, 0, __ATOMIC_RELEASE); } #endif diff --git a/src/sentry_sync.h b/src/sentry_sync.h index 5516443b99..6505dce59a 100644 --- a/src/sentry_sync.h +++ b/src/sentry_sync.h @@ -207,6 +207,18 @@ typedef CONDITION_VARIABLE sentry_cond_t; # define sentry__cond_wait(CondVar, Lock) \ sentry__cond_wait_timeout(CondVar, Lock, INFINITE) +static inline sentry_threadid_t +sentry__current_thread(void) +{ + return GetCurrentThread(); +} + +static inline int +sentry__threadid_equal(sentry_threadid_t a, sentry_threadid_t b) +{ + return GetThreadId(a) == GetThreadId(b); +} + #else # include # include @@ -225,7 +237,13 @@ typedef CONDITION_VARIABLE sentry_cond_t; us crash under concurrent modifications. The mutexes we're likely going to hit are the options and scope lock. */ bool sentry__block_for_signal_handler(void); -void sentry__enter_signal_handler(void); +/** + * Enter signal handler context. Returns the recursion depth: + * 1 = first entry, normal processing + * 2 = re-entry (crash during handling), skip hooks but try to capture + * 3+ = multiple re-entries, bail out to previous handler + */ +int sentry__enter_signal_handler(void); void sentry__leave_signal_handler(void); typedef pthread_t sentry_threadid_t; diff --git a/src/sentry_unix_pageallocator.c b/src/sentry_unix_pageallocator.c index 0226c9b09f..7c0e4ec40e 100644 --- a/src/sentry_unix_pageallocator.c +++ b/src/sentry_unix_pageallocator.c @@ -33,20 +33,26 @@ static sentry_spinlock_t g_lock = SENTRY__SPINLOCK_INIT; bool sentry__page_allocator_enabled(void) { - return !!g_alloc; + return __atomic_load_n(&g_alloc, __ATOMIC_ACQUIRE) != NULL; } void sentry__page_allocator_enable(void) { + if (sentry__page_allocator_enabled()) { + return; + } sentry__spinlock_lock(&g_lock); - if (!g_alloc) { - g_alloc = &g_page_allocator_backing; - g_alloc->page_size = getpagesize(); - g_alloc->last_page = NULL; - g_alloc->current_page = NULL; - g_alloc->page_offset = 0; - g_alloc->pages_allocated = 0; + if (__atomic_load_n(&g_alloc, __ATOMIC_RELAXED) == NULL) { + struct page_allocator_s *p = &g_page_allocator_backing; + + p->page_size = getpagesize(); + p->last_page = NULL; + p->current_page = NULL; + p->page_offset = 0; + p->pages_allocated = 0; + + __atomic_store_n(&g_alloc, p, __ATOMIC_RELEASE); } sentry__spinlock_unlock(&g_lock); } diff --git a/src/sentry_unix_spinlock.h b/src/sentry_unix_spinlock.h index 575f86d676..b0b9f2b46d 100644 --- a/src/sentry_unix_spinlock.h +++ b/src/sentry_unix_spinlock.h @@ -14,9 +14,15 @@ typedef volatile sig_atomic_t sentry_spinlock_t; #define SENTRY__SPINLOCK_INIT 0 #define sentry__spinlock_lock(spinlock_ref) \ - while (!__sync_bool_compare_and_swap(spinlock_ref, 0, 1)) { \ - sentry__cpu_relax(); \ + for (;;) { \ + while (__atomic_load_n(spinlock_ref, __ATOMIC_RELAXED)) { \ + sentry__cpu_relax(); \ + } \ + if (__atomic_exchange_n(spinlock_ref, 1, __ATOMIC_ACQUIRE) == 0) { \ + break; \ + } \ } -#define sentry__spinlock_unlock(spinlock_ref) (*spinlock_ref = 0) +#define sentry__spinlock_unlock(spinlock_ref) \ + (__atomic_store_n(spinlock_ref, 0, __ATOMIC_RELEASE)) #endif diff --git a/src/sentry_value.c b/src/sentry_value.c index 4381879824..978251e3b6 100644 --- a/src/sentry_value.c +++ b/src/sentry_value.c @@ -1281,12 +1281,7 @@ sentry_value_t sentry__value_new_addr(uint64_t addr) { char buf[32]; - size_t written = (size_t)snprintf( - buf, sizeof(buf), "0x%llx", (unsigned long long)addr); - if (written >= sizeof(buf)) { - return sentry_value_new_null(); - } - buf[written] = '\0'; + sentry__addr_to_string(buf, sizeof(buf), addr); return sentry_value_new_string(buf); } diff --git a/src/unwinder/sentry_unwinder.c b/src/unwinder/sentry_unwinder.c index 19affe8fed..09664d0156 100644 --- a/src/unwinder/sentry_unwinder.c +++ b/src/unwinder/sentry_unwinder.c @@ -16,6 +16,7 @@ DEFINE_UNWINDER(libunwindstack); DEFINE_UNWINDER(libbacktrace); DEFINE_UNWINDER(dbghelp); DEFINE_UNWINDER(libunwind); +DEFINE_UNWINDER(libunwind_mac); DEFINE_UNWINDER(psunwind); static size_t @@ -34,6 +35,9 @@ unwind_stack( #ifdef SENTRY_WITH_UNWINDER_LIBUNWIND TRY_UNWINDER(libunwind); #endif +#ifdef SENTRY_WITH_UNWINDER_LIBUNWIND_MAC + TRY_UNWINDER(libunwind_mac); +#endif #ifdef SENTRY_WITH_UNWINDER_PS TRY_UNWINDER(psunwind); #endif diff --git a/src/unwinder/sentry_unwinder.h b/src/unwinder/sentry_unwinder.h new file mode 100644 index 0000000000..889d20ca18 --- /dev/null +++ b/src/unwinder/sentry_unwinder.h @@ -0,0 +1,8 @@ +#ifndef SENTRY_UNWINDER_H_INCLUDED +#define SENTRY_UNWINDER_H_INCLUDED + +typedef struct { + uintptr_t lo, hi; +} mem_range_t; + +#endif // SENTRY_UNWINDER_H_INCLUDED diff --git a/src/unwinder/sentry_unwinder_libbacktrace.c b/src/unwinder/sentry_unwinder_libbacktrace.c index dd671a9587..fbfb0f895e 100644 --- a/src/unwinder/sentry_unwinder_libbacktrace.c +++ b/src/unwinder/sentry_unwinder_libbacktrace.c @@ -2,7 +2,7 @@ // XXX: Make into a CMake check // XXX: IBM i PASE offers libbacktrace in libutil, but not available in AIX -#if defined(SENTRY_PLATFORM_DARWIN) || defined(__GLIBC__) || defined(__PASE__) +#if defined(__GLIBC__) || defined(__PASE__) # define HAS_EXECINFO_H #endif @@ -14,15 +14,7 @@ size_t sentry__unwind_stack_libbacktrace( void *addr, const sentry_ucontext_t *uctx, void **ptrs, size_t max_frames) { - if (addr) { -#if defined(SENTRY_PLATFORM_MACOS) && defined(MAC_OS_X_VERSION_10_14) \ - && __has_builtin(__builtin_available) - if (__builtin_available(macOS 10.14, *)) { - return (size_t)backtrace_from_fp(addr, ptrs, (int)max_frames); - } -#endif - return 0; - } else if (uctx) { + if (addr || uctx) { return 0; } #ifdef HAS_EXECINFO_H diff --git a/src/unwinder/sentry_unwinder_libunwind.c b/src/unwinder/sentry_unwinder_libunwind.c index 844558dd72..9c0c95d7b0 100644 --- a/src/unwinder/sentry_unwinder_libunwind.c +++ b/src/unwinder/sentry_unwinder_libunwind.c @@ -1,7 +1,40 @@ #include "sentry_boot.h" #include "sentry_logger.h" +#include "sentry_unwinder.h" #define UNW_LOCAL_ONLY #include +#include + +/** + * Looks up the memory range for a given pointer in /proc/self/maps. + * `range` is an output parameter. Returns `true` if a range was found. + * Note: it is safe to use this function as long as we are running in a healthy + * thread or in the handler thread. The function is unsafe for a signal handler. + */ +static bool +find_mem_range(uintptr_t ptr, mem_range_t *range) +{ + bool found = false; + FILE *fp = fopen("/proc/self/maps", "r"); + if (!fp) { + return found; + } + char line[512]; + while (fgets(line, sizeof line, fp)) { + unsigned long lo, hi; + if (sscanf(line, "%lx-%lx", &lo, &hi) == 2) { + // our bounds are [lo, hi) + if (ptr >= lo && ptr < hi) { + range->lo = (uintptr_t)lo; + range->hi = (uintptr_t)hi; + found = true; + break; + } + } + } + fclose(fp); + return found; +} size_t sentry__unwind_stack_libunwind( @@ -12,6 +45,7 @@ sentry__unwind_stack_libunwind( } unw_cursor_t cursor; + unw_context_t uc; if (uctx) { int ret = unw_init_local2(&cursor, (unw_context_t *)uctx->user_context, UNW_INIT_SIGNAL_FRAME); @@ -20,8 +54,16 @@ sentry__unwind_stack_libunwind( return 0; } } else { - unw_context_t uc; +#ifdef __clang__ +// This pragma is required to build with Werror on ARM64 Ubuntu +# pragma clang diagnostic push +# pragma clang diagnostic ignored \ + "-Wgnu-statement-expression-from-macro-expansion" +#endif int ret = unw_getcontext(&uc); +#ifdef __clang__ +# pragma clang diagnostic pop +#endif if (ret != 0) { SENTRY_WARN("Failed to retrieve context with libunwind"); return 0; @@ -34,14 +76,46 @@ sentry__unwind_stack_libunwind( } } - size_t frame_idx = 0; - while (unw_step(&cursor) > 0 && frame_idx < max_frames - 1) { - unw_word_t ip = 0; - unw_get_reg(&cursor, UNW_REG_IP, &ip); - ptrs[frame_idx] = (void *)ip; - unw_word_t sp = 0; - unw_get_reg(&cursor, UNW_REG_SP, &sp); - frame_idx++; + size_t n = 0; + // get the first frame and stack pointer + unw_word_t ip = 0; + if (unw_get_reg(&cursor, UNW_REG_IP, &ip) < 0) { + return n; + } + if (n < max_frames) { + ptrs[n++] = (void *)ip; + } + unw_word_t sp = 0; + (void)unw_get_reg(&cursor, UNW_REG_SP, &sp); + + // ensure we have a valid stack pointer otherwise we only send the top frame + mem_range_t stack = { 0, 0 }; + if (uctx && !find_mem_range((uintptr_t)sp, &stack)) { + SENTRY_WARNF("unwinder: SP (%p) is in unmapped memory likely due to " + "stack overflow", + (void *)sp); + return n; + } + + // walk the callers + unw_word_t prev_ip = ip; + unw_word_t prev_sp = sp; + while (n < max_frames && unw_step(&cursor) > 0) { + // stop the walk if we fail to read IP + if (unw_get_reg(&cursor, UNW_REG_IP, &ip) < 0) { + break; + } + // SP is optional for progress + (void)unw_get_reg(&cursor, UNW_REG_SP, &sp); + + // stop the walk if there is _no_ progress + if (ip == prev_ip && sp == prev_sp) { + break; + } + + prev_ip = ip; + prev_sp = sp; + ptrs[n++] = (void *)ip; } - return frame_idx + 1; + return n; } diff --git a/src/unwinder/sentry_unwinder_libunwind_mac.c b/src/unwinder/sentry_unwinder_libunwind_mac.c new file mode 100644 index 0000000000..39bd1a4c64 --- /dev/null +++ b/src/unwinder/sentry_unwinder_libunwind_mac.c @@ -0,0 +1,241 @@ +#include "sentry_boot.h" +#include "sentry_logger.h" +#include "sentry_unwinder.h" +#include + +#if defined(SENTRY_PLATFORM_MACOS) +# include +# include +#endif + +// On arm64(e), return addresses may have Pointer Authentication Code (PAC) bits +// set in the upper bits. These must be stripped before symbolization. +// The mask 0x7fffffffffff keeps the lower 47 bits which is the actual address. +// See: +// https://developer.apple.com/documentation/security/preparing_your_app_to_work_with_pointer_authentication +#if defined(__arm64__) +# define STRIP_PAC(addr) ((addr) & 0x7fffffffffffull) +#else +# define STRIP_PAC(addr) (addr) +#endif + +#if defined(SENTRY_PLATFORM_MACOS) +// Basic pointer validation to make sure we stay inside mapped memory. +static bool +is_readable_ptr(uintptr_t p, size_t size) +{ + if (!p) { + return false; + } + + mach_vm_address_t address = (mach_vm_address_t)p; + mach_vm_size_t region_size = 0; + vm_region_basic_info_data_64_t info; + mach_msg_type_number_t count = VM_REGION_BASIC_INFO_COUNT_64; + mach_port_t object = MACH_PORT_NULL; + + kern_return_t kr = mach_vm_region(mach_task_self(), &address, ®ion_size, + VM_REGION_BASIC_INFO_64, (vm_region_info_t)&info, &count, &object); + if (object != MACH_PORT_NULL) { + mach_port_deallocate(mach_task_self(), object); + } + if (kr != KERN_SUCCESS) { + return false; + } + + if (!(info.protection & VM_PROT_READ)) { + return false; + } + + mem_range_t vm_region + = { (uintptr_t)address, (uintptr_t)address + (uintptr_t)region_size }; + if (vm_region.hi < vm_region.lo) { + return false; + } + + uintptr_t end = p + (uintptr_t)size; + if (end < p) { + return false; + } + + return p >= vm_region.lo && end <= vm_region.hi; +} +#endif + +static bool +valid_ptr(uintptr_t p) +{ + if (!p || (p % sizeof(uintptr_t)) != 0) { + return false; + } + +#if defined(SENTRY_PLATFORM_MACOS) + return is_readable_ptr(p, sizeof(uintptr_t) * 2); +#else + return true; +#endif +} + +/** + * This does the same frame-pointer walk for arm64 and x86_64, with the only + * difference being which registers value is used as frame-pointer (fp vs rbp) + */ +static void +fp_walk(uintptr_t fp, size_t *n, void **ptrs, size_t max_frames) +{ + while (*n < max_frames) { + if (!valid_ptr(fp)) { + break; + } + + // arm64 frame record layout: [prev_fp, saved_lr] at fp and fp+8 + // x86_64 frame record layout: [prev_rbp, saved_retaddr] at bp and bp+8 + const uintptr_t *record = (uintptr_t *)fp; + const uintptr_t next_fp = record[0]; + uintptr_t ret_addr = record[1]; + if (!valid_ptr(next_fp) || !ret_addr) { + break; + } + + ret_addr = STRIP_PAC(ret_addr); + ptrs[(*n)++] = (void *)(ret_addr - 1); + if (next_fp <= fp) { + break; // prevent loops + } + fp = next_fp; + } +} + +static size_t +fp_walk_from_uctx(const sentry_ucontext_t *uctx, void **ptrs, size_t max_frames) +{ + size_t n = 0; + struct __darwin_mcontext64 *mctx = uctx->user_context->uc_mcontext; +#if defined(__arm64__) + uintptr_t pc, fp, lr; + +# if defined(__arm64e__) + // arm64e uses opaque accessors that handle PAC authentication + pc = __darwin_arm_thread_state64_get_pc(mctx->__ss); + fp = __darwin_arm_thread_state64_get_fp(mctx->__ss); + lr = __darwin_arm_thread_state64_get_lr(mctx->__ss); +# else + // arm64 can access members directly, strip PAC defensively + pc = STRIP_PAC((uintptr_t)mctx->__ss.__pc); + fp = (uintptr_t)mctx->__ss.__fp; + lr = STRIP_PAC((uintptr_t)mctx->__ss.__lr); +# endif + + // top frame: crash PC points to the faulting instruction, no adjustment + if (pc && n < max_frames) { + ptrs[n++] = (void *)pc; + } + + // Emit LR as the next frame (return address, so adjust -1). + if (lr && n < max_frames) { + ptrs[n++] = (void *)(lr - 1); + } + + // Determine where to start the frame pointer walk: + // If LR matches the saved LR in the current frame record, + // the crashing function has a frame and hasn't made sub-calls since its + // prologue + // -> walking from fp would produce a duplicate. + // -> Skip to the caller's frame pointer. + // + // When they differ, + // either the function has no frame record (fp belongs to the caller, and LR + // is the only reference to the caller frame) + // or + // it sub-calls (LR is a stale return within the crashing function). + // + // In both cases, walking from fp captures the correct remaining frames. + if (valid_ptr(fp)) { + const uintptr_t *record = (uintptr_t *)fp; + uintptr_t saved_lr = STRIP_PAC(record[1]); + if (lr == saved_lr) { + fp_walk(record[0], &n, ptrs, max_frames); + } else { + fp_walk(fp, &n, ptrs, max_frames); + } + } +#elif defined(__x86_64__) + uintptr_t ip = (uintptr_t)mctx->__ss.__rip; + uintptr_t bp = (uintptr_t)mctx->__ss.__rbp; + + // top frame: no adjustment + if (ip && n < max_frames) { + ptrs[n++] = (void *)ip; + } + + fp_walk(bp, &n, ptrs, max_frames); +#else +# error "Unsupported CPU architecture for macOS stackwalker" +#endif + return n; +} + +size_t +sentry__unwind_stack_libunwind_mac( + void *addr, const sentry_ucontext_t *uctx, void **ptrs, size_t max_frames) +{ + if (addr) { + size_t n = 0; + fp_walk((uintptr_t)addr, &n, ptrs, max_frames); + return n; + } + + if (uctx) { + return fp_walk_from_uctx(uctx, ptrs, max_frames); + } + + // fall back on the system `libunwind` for stack-traces "from call-site" + unw_context_t uc; + int ret = unw_getcontext(&uc); + if (ret != 0) { + SENTRY_WARN("Failed to retrieve context with libunwind"); + return 0; + } + + unw_cursor_t cursor; + ret = unw_init_local(&cursor, &uc); + if (ret != 0) { + SENTRY_WARN("Failed to initialize libunwind with local context"); + return 0; + } + size_t n = 0; + // get the first frame + if (n < max_frames) { + unw_word_t ip = 0; + if (unw_get_reg(&cursor, UNW_REG_IP, &ip) >= 0) { + ip = STRIP_PAC(ip); + ptrs[n++] = (void *)ip; + } else { + return 0; + } + } + // walk the callers + unw_word_t prev_ip = n > 0 ? (uintptr_t)ptrs[0] : 0; + unw_word_t prev_sp = 0; + (void)unw_get_reg(&cursor, UNW_REG_SP, &prev_sp); + while (n < max_frames && unw_step(&cursor) > 0) { + unw_word_t ip = 0, sp = 0; + // stop the walk if we fail to read IP + if (unw_get_reg(&cursor, UNW_REG_IP, &ip) < 0) { + break; + } + // SP is optional for progress + (void)unw_get_reg(&cursor, UNW_REG_SP, &sp); + + // stop the walk if there is _no_ progress + if (ip == prev_ip && sp == prev_sp) { + break; + } + ip = STRIP_PAC(ip); + prev_ip = ip; + prev_sp = sp; + ptrs[n++] = (void *)ip; + } + + return n; +} diff --git a/tests/assertions.py b/tests/assertions.py index 34ff463481..f746382657 100644 --- a/tests/assertions.py +++ b/tests/assertions.py @@ -127,11 +127,11 @@ def assert_event_meta( match = VERSION_RE.match(version) version = match.group(1) build = match.group(2) + expected_os_context = {"name": "Linux", "version": version} + if build: + expected_os_context["build"] = build - assert_matches( - event["contexts"]["os"], - {"name": "Linux", "version": version, "build": build}, - ) + assert_matches(event["contexts"]["os"], expected_os_context) assert "distribution_name" in event["contexts"]["os"] assert "distribution_version" in event["contexts"]["os"] elif sys.platform == "darwin": @@ -170,6 +170,16 @@ def assert_event_meta( ) +def is_valid_hex(s): + if not s.lower().startswith("0x"): + return False + try: + int(s, 0) + return True + except ValueError: + return False + + def assert_stacktrace( envelope, inside_exception=False, check_size=True, check_package=False ): @@ -181,7 +191,7 @@ def assert_stacktrace( if check_size: assert len(frames) > 0 - assert all(frame["instruction_addr"].startswith("0x") for frame in frames) + assert all(is_valid_hex(frame["instruction_addr"]) for frame in frames) assert any( frame.get("function") is not None and frame.get("package") is not None for frame in frames diff --git a/tests/build_config.py b/tests/build_config.py new file mode 100644 index 0000000000..654450a8fa --- /dev/null +++ b/tests/build_config.py @@ -0,0 +1,179 @@ +""" +Build configuration utilities for sentry-native tests. + +This module provides shared logic for reading environment variables and +preparing CMake build parameters, used by both cmake.py (for building +example, library and backend artifacts) and individual tests that need +to build additional executables (like the inproc stress test) but still +need to align with the core artifacts. + +This should make it much easier to add additional integration tests that +we no longer want to bloat example.c with. +""" + +import os +import shutil +import sys +from pathlib import Path + + +def get_android_config(): + """ + Returns Android toolchain CMake options if ANDROID_API and ANDROID_NDK + environment variables are set. + """ + if not (os.environ.get("ANDROID_API") and os.environ.get("ANDROID_NDK")): + return {} + + toolchain = "{}/ndk/{}/build/cmake/android.toolchain.cmake".format( + os.environ["ANDROID_HOME"], os.environ["ANDROID_NDK"] + ) + return { + "CMAKE_TOOLCHAIN_FILE": toolchain, + "ANDROID_ABI": os.environ.get("ANDROID_ARCH") or "x86", + "ANDROID_NATIVE_API_LEVEL": os.environ["ANDROID_API"], + } + + +def get_platform_cmake_args(): + """ + Returns a list of CMake command-line arguments based on platform and + environment configuration. + + This handles: + - 32-bit builds (TEST_X86) + - ASAN/TSAN sanitizers (RUN_ANALYZER) + - Additional CMAKE_DEFINES from environment + """ + args = [] + + if sys.platform == "win32" and os.environ.get("TEST_X86"): + args.append("-AWin32") + elif sys.platform == "linux" and os.environ.get("TEST_X86"): + args.append("-DSENTRY_BUILD_FORCE32=ON") + + if "asan" in os.environ.get("RUN_ANALYZER", ""): + args.append("-DWITH_ASAN_OPTION=ON") + + if "tsan" in os.environ.get("RUN_ANALYZER", ""): + args.append("-DWITH_TSAN_OPTION=ON") + + if "CMAKE_DEFINES" in os.environ: + args.extend(os.environ.get("CMAKE_DEFINES").split()) + + return args + + +def get_cflags(extra_cflags=None): + """ + Returns compiler flags (CFLAGS/CXXFLAGS) for the build. + + This handles: + - ERROR_ON_WARNINGS -> -Werror + - MSVC parallel builds and warnings as errors + - GCC analyzer + + Args: + extra_cflags: Additional flags to include + """ + cflags = list(extra_cflags) if extra_cflags else [] + + if os.environ.get("ERROR_ON_WARNINGS"): + cflags.append("-Werror") + + if sys.platform == "win32" and not os.environ.get("TEST_MINGW"): + cpus = os.cpu_count() + cflags.append("/WX /MP{}".format(cpus)) + + if "gcc" in os.environ.get("RUN_ANALYZER", ""): + cflags.append("-fanalyzer") + + return cflags + + +def get_tsan_env(): + """ + Returns TSAN_OPTIONS environment variable value if TSAN is enabled. + + Returns None if TSAN is not enabled. + """ + if "tsan" not in os.environ.get("RUN_ANALYZER", ""): + return None + + module_dir = Path(__file__).resolve().parent + tsan_options = { + "verbosity": 2, + "detect_deadlocks": 1, + "second_deadlock_stack": 1, + "suppressions": module_dir / "tsan.supp", + } + return ":".join(f"{key}={value}" for key, value in tsan_options.items()) + + +def get_test_executable_cmake_args(sentry_lib_dir, sentry_include_dir): + """ + Returns CMake arguments for building a test executable that links against + libsentry, with all necessary platform/sanitizer flags. + + Args: + sentry_lib_dir: Path to directory containing libsentry + sentry_include_dir: Path to sentry include directory + """ + args = [ + f"-DSENTRY_LIB_DIR={sentry_lib_dir}", + f"-DSENTRY_INCLUDE_DIR={sentry_include_dir}", + ] + + android_config = get_android_config() + for key, value in android_config.items(): + args.append(f"-D{key}={value}") + + args.extend(get_platform_cmake_args()) + + return args + + +def get_test_executable_cflags(): + """ + Returns CFLAGS for building test executables. + + This is a subset of the flags used for libsentry, focusing on: + - Sanitizer instrumentation (required for linking with sanitized libsentry) + - 32-bit builds + """ + cflags = [] + + if sys.platform == "linux" and os.environ.get("TEST_X86"): + cflags.append("-m32") + + if "asan" in os.environ.get("RUN_ANALYZER", ""): + cflags.append("-fsanitize=address") + + if "tsan" in os.environ.get("RUN_ANALYZER", ""): + cflags.append("-fsanitize=thread") + + if "llvm-cov" in os.environ.get("RUN_ANALYZER", ""): + cflags.extend(["-fprofile-instr-generate", "-fcoverage-mapping"]) + + return cflags + + +def get_test_executable_env(): + """ + Returns environment variables for running/building test executables. + """ + env = dict(os.environ) + + tsan_opts = get_tsan_env() + if tsan_opts: + env["TSAN_OPTIONS"] = tsan_opts + + cflags = get_test_executable_cflags() + if cflags: + existing_cflags = env.get("CFLAGS", "") + existing_cxxflags = env.get("CXXFLAGS", "") + flags_str = " ".join(cflags) + env["CFLAGS"] = f"{existing_cflags} {flags_str}".strip() + env["CXXFLAGS"] = f"{existing_cxxflags} {flags_str}".strip() + + return env diff --git a/tests/cmake.py b/tests/cmake.py index d49d0243f4..09e25eb725 100644 --- a/tests/cmake.py +++ b/tests/cmake.py @@ -8,6 +8,13 @@ import pytest +from .build_config import ( + get_android_config, + get_platform_cmake_args, + get_cflags, + get_tsan_env, +) + class CMake: def __init__(self, factory): @@ -122,18 +129,8 @@ def cmake(cwd, targets, options=None, cflags=None): "CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE": cwd, } ) - if os.environ.get("ANDROID_API") and os.environ.get("ANDROID_NDK"): - # See: https://developer.android.com/ndk/guides/cmake - toolchain = "{}/ndk/{}/build/cmake/android.toolchain.cmake".format( - os.environ["ANDROID_HOME"], os.environ["ANDROID_NDK"] - ) - options.update( - { - "CMAKE_TOOLCHAIN_FILE": toolchain, - "ANDROID_ABI": os.environ.get("ANDROID_ARCH") or "x86", - "ANDROID_NATIVE_API_LEVEL": os.environ["ANDROID_API"], - } - ) + + options.update(get_android_config()) source_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) @@ -154,77 +151,20 @@ def cmake(cwd, targets, options=None, cflags=None): config_cmd = cmake.copy() if os.environ.get("VS_GENERATOR_TOOLSET") == "ClangCL": - config_cmd.append("-G Visual Studio 17 2022") - config_cmd.append("-A x64") - config_cmd.append("-T ClangCL") + configure_clang_cl(config_cmd) for key, value in options.items(): config_cmd.append("-D{}={}".format(key, value)) - if sys.platform == "win32" and os.environ.get("TEST_X86"): - config_cmd.append("-AWin32") - elif sys.platform == "linux" and os.environ.get("TEST_X86"): - config_cmd.append("-DSENTRY_BUILD_FORCE32=ON") - if "asan" in os.environ.get("RUN_ANALYZER", ""): - config_cmd.append("-DWITH_ASAN_OPTION=ON") - if "tsan" in os.environ.get("RUN_ANALYZER", ""): - module_dir = Path(__file__).resolve().parent - tsan_options = { - "verbosity": 2, - "detect_deadlocks": 1, - "second_deadlock_stack": 1, - "suppressions": module_dir / "tsan.supp", - } - os.environ["TSAN_OPTIONS"] = ":".join( - f"{key}={value}" for key, value in tsan_options.items() - ) - config_cmd.append("-DWITH_TSAN_OPTION=ON") - - # we have to set `-Werror` for this cmake invocation only, otherwise - # completely unrelated things will break - if os.environ.get("ERROR_ON_WARNINGS"): - cflags.append("-Werror") - if sys.platform == "win32" and not os.environ.get("TEST_MINGW"): - # MP = object level parallelism, WX = warnings as errors - cpus = os.cpu_count() - cflags.append("/WX /MP{}".format(cpus)) - if "gcc" in os.environ.get("RUN_ANALYZER", ""): - cflags.append("-fanalyzer") + + config_cmd.extend(get_platform_cmake_args()) + + tsan_opts = get_tsan_env() + if tsan_opts: + os.environ["TSAN_OPTIONS"] = tsan_opts + + cflags.extend(get_cflags()) if "llvm-cov" in os.environ.get("RUN_ANALYZER", ""): - if False and os.environ.get("VS_GENERATOR_TOOLSET") == "ClangCL": - # for clang-cl in CI we have to use `--coverage` rather than `fprofile-instr-generate` and provide an - # architecture-specific profiling library for it work: - # TODO: This currently doesn't work due to https://gitlab.kitware.com/cmake/cmake/-/issues/24025 - # The issue describes a behavior where generated object-name is specified via `/fo` using a target - # directory, rather than a file-name (this is CMake behavior). While the `clang-cl` suggest that this - # is supported the flag produces `.gcda` and `.gcno` files, which have no relation with the object- - # file and which leads to failure to accumulate coverage data. - # This would have to be fixed in clang-cl: https://github.com/llvm/llvm-project/issues/87304 - # Let's leave this in here for posterity, it would be great to get coverage analysis on Windows. - flags = "--coverage" - profile_lib = "clang_rt.profile-x86_64.lib" - config_cmd.append(f"-DCMAKE_EXE_LINKER_FLAGS='{profile_lib}'") - config_cmd.append(f"-DCMAKE_SHARED_LINKER_FLAGS='{profile_lib}'") - config_cmd.append(f"-DCMAKE_MODULE_LINKER_FLAGS='{profile_lib}'") - else: - flags = "-fprofile-instr-generate -fcoverage-mapping" - config_cmd.append("-DCMAKE_C_FLAGS='{}'".format(flags)) - - # Since we overwrite `CXXFLAGS` below, we must add the experimental library here for the GHA runner that builds - # sentry-native with LLVM clang for macOS (to run ASAN on macOS) rather than the version coming with XCode. - # TODO: remove this if the GHA runner image for macOS ever updates beyond llvm15. - if ( - sys.platform == "darwin" - and os.environ.get("CC", "") == "clang" - and shutil.which("clang") == "/usr/local/opt/llvm@15/bin/clang" - ): - flags = ( - flags - + " -L/usr/local/opt/llvm@15/lib/c++ -fexperimental-library -Wno-unused-command-line-argument" - ) - - config_cmd.append("-DCMAKE_CXX_FLAGS='{}'".format(flags)) - if "CMAKE_DEFINES" in os.environ: - config_cmd.extend(os.environ.get("CMAKE_DEFINES").split()) + configure_llvm_cov(config_cmd) env = dict(os.environ) env["CFLAGS"] = env["CXXFLAGS"] = " ".join(cflags) @@ -232,9 +172,18 @@ def cmake(cwd, targets, options=None, cflags=None): print("\n{} > {}".format(cwd, " ".join(config_cmd)), flush=True) try: - subprocess.run(config_cmd, cwd=cwd, env=env, check=True) - except subprocess.CalledProcessError: - raise pytest.fail.Exception("cmake configure failed") from None + result = subprocess.run( + config_cmd, cwd=cwd, env=env, check=True, capture_output=True, text=True + ) + sys.stdout.write(result.stdout) + sys.stderr.write(result.stderr or "") + except subprocess.CalledProcessError as e: + if "Could NOT find ZLIB" in e.stderr: + pytest.skip("ZLIB not found") + else: + sys.stdout.write(e.stdout) + sys.stderr.write(e.stderr or "") + raise pytest.fail.Exception("cmake configure failed") from None # CodeChecker invocations and options are documented here: # https://github.com/Ericsson/codechecker/blob/master/docs/analyzer/user_guide.md @@ -317,3 +266,45 @@ def cmake(cwd, targets, options=None, cflags=None): cwd=cwd, check=True, ) + + +def configure_clang_cl(config_cmd: list[str]): + config_cmd.append("-G Visual Studio 17 2022") + config_cmd.append("-A x64") + config_cmd.append("-T ClangCL") + + +def configure_llvm_cov(config_cmd: list[str]): + if False and os.environ.get("VS_GENERATOR_TOOLSET") == "ClangCL": + # for clang-cl in CI we have to use `--coverage` rather than `fprofile-instr-generate` and provide an + # architecture-specific profiling library for it work: + # TODO: This currently doesn't work due to https://gitlab.kitware.com/cmake/cmake/-/issues/24025 + # The issue describes a behavior where generated object-name is specified via `/fo` using a target + # directory, rather than a file-name (this is CMake behavior). While the `clang-cl` suggest that this + # is supported the flag produces `.gcda` and `.gcno` files, which have no relation with the object- + # file and which leads to failure to accumulate coverage data. + # This would have to be fixed in clang-cl: https://github.com/llvm/llvm-project/issues/87304 + # Let's leave this in here for posterity, it would be great to get coverage analysis on Windows. + flags = "--coverage" + profile_lib = "clang_rt.profile-x86_64.lib" + config_cmd.append(f"-DCMAKE_EXE_LINKER_FLAGS='{profile_lib}'") + config_cmd.append(f"-DCMAKE_SHARED_LINKER_FLAGS='{profile_lib}'") + config_cmd.append(f"-DCMAKE_MODULE_LINKER_FLAGS='{profile_lib}'") + else: + flags = "-fprofile-instr-generate -fcoverage-mapping" + config_cmd.append("-DCMAKE_C_FLAGS='{}'".format(flags)) + + # Since we overwrite `CXXFLAGS` below, we must add the experimental library here for the GHA runner that builds + # sentry-native with LLVM clang for macOS (to run ASAN on macOS) rather than the version coming with XCode. + # TODO: remove this if the GHA runner image for macOS ever updates beyond llvm15. + if ( + sys.platform == "darwin" + and os.environ.get("CC", "") == "clang" + and shutil.which("clang") == "/usr/local/opt/llvm@15/bin/clang" + ): + flags = ( + flags + + " -L/usr/local/opt/llvm@15/lib/c++ -fexperimental-library -Wno-unused-command-line-argument" + ) + + config_cmd.append("-DCMAKE_CXX_FLAGS='{}'".format(flags)) diff --git a/tests/conditions.py b/tests/conditions.py index 5af7757fbd..ebfdf82c3f 100644 --- a/tests/conditions.py +++ b/tests/conditions.py @@ -8,6 +8,7 @@ is_tsan = "tsan" in os.environ.get("RUN_ANALYZER", "") is_kcov = "kcov" in os.environ.get("RUN_ANALYZER", "") is_valgrind = "valgrind" in os.environ.get("RUN_ANALYZER", "") +is_arm64e = "CMAKE_OSX_ARCHITECTURES=arm64e" in os.environ.get("CMAKE_DEFINES", "") has_http = not is_android and not (sys.platform == "linux" and is_x86) # breakpad does not work correctly when using kcov or valgrind @@ -22,6 +23,8 @@ # however running it from an `adb shell` does not work correctly :-( and not is_android and not (is_asan and sys.platform == "darwin") + # breakpad accesses thread state registers directly, which doesn't work on arm64e + and not (is_arm64e and sys.platform == "darwin") ) # crashpad requires http, needs porting to AIX, and doesn’t work with kcov/valgrind/tsan either has_crashpad = ( diff --git a/tests/fixtures/inproc_stress/CMakeLists.txt b/tests/fixtures/inproc_stress/CMakeLists.txt new file mode 100644 index 0000000000..2b664ce153 --- /dev/null +++ b/tests/fixtures/inproc_stress/CMakeLists.txt @@ -0,0 +1,52 @@ +cmake_minimum_required(VERSION 3.10) +project(inproc_stress_test C) + +# SENTRY_LIB_DIR and SENTRY_INCLUDE_DIR are passed from the pytest + +# Options that match the main sentry-native build +option(SENTRY_BUILD_FORCE32 "Force a 32bit compile on a 64bit host" OFF) +option(WITH_ASAN_OPTION "Build with address sanitizer" OFF) +option(WITH_TSAN_OPTION "Build with thread sanitizer" OFF) + +# Use CMake's thread finding mechanism (handles Android correctly) +set(THREADS_PREFER_PTHREAD_FLAG ON) +find_package(Threads REQUIRED) + +add_executable(inproc_stress_test + main.c + concurrent_crash.c +) + +target_include_directories(inproc_stress_test PRIVATE ${SENTRY_INCLUDE_DIR}) +target_link_directories(inproc_stress_test PRIVATE ${SENTRY_LIB_DIR}) +target_link_libraries(inproc_stress_test PRIVATE sentry Threads::Threads) + +set_target_properties(inproc_stress_test PROPERTIES + BUILD_RPATH "${SENTRY_LIB_DIR}" + # Ensure the executable is placed directly in the build directory on all platforms + # (Visual Studio generators normally use Debug/Release subdirectories) + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" + RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}" + RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}" + RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}" + RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_BINARY_DIR}" +) + +if(NOT MSVC) + target_compile_options(inproc_stress_test PRIVATE -O0 -g) + + if(SENTRY_BUILD_FORCE32) + target_compile_options(inproc_stress_test PRIVATE -m32) + target_link_options(inproc_stress_test PRIVATE -m32) + endif() + + if(WITH_ASAN_OPTION) + target_compile_options(inproc_stress_test PRIVATE -fsanitize=address) + target_link_options(inproc_stress_test PRIVATE -fsanitize=address) + endif() + + if(WITH_TSAN_OPTION) + target_compile_options(inproc_stress_test PRIVATE -fsanitize=thread) + target_link_options(inproc_stress_test PRIVATE -fsanitize=thread) + endif() +endif() diff --git a/tests/fixtures/inproc_stress/concurrent_crash.c b/tests/fixtures/inproc_stress/concurrent_crash.c new file mode 100644 index 0000000000..ebf621b3da --- /dev/null +++ b/tests/fixtures/inproc_stress/concurrent_crash.c @@ -0,0 +1,152 @@ +/** + * Test fixture for stressing the inproc backend with concurrent crashes. + * + * This test spawns multiple threads that all crash concurrently to expose + * race conditions in the signal handler / handler thread synchronization. + */ + +#include +#include +#include + +#ifndef _WIN32 +# include +# include +# define sleep_ms(ms) usleep((ms) * 1000) +#else +# define WIN32_LEAN_AND_MEAN +# include +# define sleep_ms(ms) Sleep(ms) +#endif + +#define CRASH_THREADS 20 + +static void *invalid_mem = (void *)1; + +// Barrier for synchronizing threads +#ifndef _WIN32 +static volatile int g_barrier = 0; +static volatile int g_ready_count = 0; +#else +static volatile LONG g_barrier = 0; +static volatile LONG g_ready_count = 0; +#endif + +#if defined(__GNUC__) || defined(__clang__) +__attribute__((noinline)) +#elif defined(_MSC_VER) +__declspec(noinline) +#endif +void +do_crash(void) +{ + memset((char *)invalid_mem, 1, 100); +} + +static void +wait_at_barrier(void) +{ +#ifndef _WIN32 + __atomic_add_fetch(&g_ready_count, 1, __ATOMIC_SEQ_CST); + while (__atomic_load_n(&g_barrier, __ATOMIC_SEQ_CST) == 0) { + // spin + } +#else + InterlockedIncrement(&g_ready_count); + while (InterlockedCompareExchange(&g_barrier, 1, 1) == 0) { + // spin + } +#endif +} + +static void +release_barrier(void) +{ +#ifndef _WIN32 + __atomic_store_n(&g_barrier, 1, __ATOMIC_SEQ_CST); +#else + InterlockedExchange(&g_barrier, 1); +#endif +} + +static int +all_threads_ready(void) +{ +#ifndef _WIN32 + return __atomic_load_n(&g_ready_count, __ATOMIC_SEQ_CST) == CRASH_THREADS; +#else + return InterlockedCompareExchange( + &g_ready_count, CRASH_THREADS, CRASH_THREADS) + == CRASH_THREADS; +#endif +} + +#ifndef _WIN32 +static void * +crash_thread(void *param) +{ + (void)param; + wait_at_barrier(); + do_crash(); + return NULL; +} + +void +run_concurrent_crash(void) +{ + pthread_t threads[CRASH_THREADS]; + + for (int i = 0; i < CRASH_THREADS; i++) { + if (pthread_create(&threads[i], NULL, crash_thread, NULL) != 0) { + fprintf(stderr, "Failed to create thread %d\n", i); + exit(1); + } + } + + while (!all_threads_ready()) { + sleep_ms(1); + } + sleep_ms(10); + + release_barrier(); + + for (int i = 0; i < CRASH_THREADS; i++) { + pthread_join(threads[i], NULL); + } +} +#else +static DWORD WINAPI +crash_thread(LPVOID param) +{ + (void)param; + wait_at_barrier(); + do_crash(); + return 0; +} + +void +run_concurrent_crash(void) +{ + HANDLE threads[CRASH_THREADS]; + + for (int i = 0; i < CRASH_THREADS; i++) { + threads[i] = CreateThread(NULL, 0, crash_thread, NULL, 0, NULL); + if (!threads[i]) { + fprintf(stderr, "Failed to create thread %d\n", i); + exit(1); + } + } + + while (!all_threads_ready()) { + sleep_ms(1); + } + sleep_ms(10); + + release_barrier(); + + WaitForMultipleObjects(CRASH_THREADS, threads, TRUE, 5000); + for (int i = 0; i < CRASH_THREADS; i++) { + CloseHandle(threads[i]); + } +} +#endif diff --git a/tests/fixtures/inproc_stress/main.c b/tests/fixtures/inproc_stress/main.c new file mode 100644 index 0000000000..9be0c62b98 --- /dev/null +++ b/tests/fixtures/inproc_stress/main.c @@ -0,0 +1,502 @@ +/** + * Main test driver for inproc backend stress tests. + * + * Usage: + * ./inproc_stress_test concurrent-crash + * ./inproc_stress_test handler-thread-crash + * ./inproc_stress_test simple-crash + * ./inproc_stress_test pipe-failure + */ + +#ifdef _WIN32 +# define WIN32_LEAN_AND_MEAN +# include +#endif + +#include "sentry.h" +#include +#include +#include +#include + +#ifndef _WIN32 +# include +# include +#endif + +// From concurrent_crash.c +extern void run_concurrent_crash(void); + +static void *invalid_mem = (void *)1; + +// Prevent inlining and optimization to ensure predictable frame records. +#if defined(__clang__) +# define NOINLINE __attribute__((noinline, optnone)) +#elif defined(__GNUC__) +# define NOINLINE __attribute__((noinline, optimize("O0"))) +#else +# define NOINLINE __attribute__((noinline)) +#endif + +// Stack trace test functions (used on macOS because that uses a handwritten stack-walker, can compile on Linux/Unix). +// The naming convention encodes the expected call chain so the Python test +// can verify frames by function name. +// +// Scenario 1: crash in function with frame record, no sub-calls since prologue +// stacktest_A_calls_B_no_subcalls -> stacktest_B_crash_no_subcalls +// +// Scenario 2: crash in function with frame record, made sub-calls before crash +// stacktest_A_calls_B_with_subcalls -> stacktest_B_crash_after_subcall +// (B calls stacktest_C_helper which returns, then B crashes) +// +// Scenario 3: crash in function without a frame record +// stacktest_A_calls_B_no_frame_record -> stacktest_B_crash_no_frame_record +#ifdef __APPLE__ + +static volatile int g_side_effect = 0; + +// Has a frame record (explicit prologue) but makes no calls, so LR still +// holds the return address from the caller's bl, matching [FP+8]. +# if defined(__aarch64__) +__attribute__((naked, noinline)) static void +stacktest_B_crash_no_subcalls(void) +{ + __asm__ volatile( + "stp x29, x30, [sp, #-16]!\n\t" // prologue: save fp, lr + "mov x29, sp\n\t" // set up frame pointer + "mov x8, #1\n\t" + "str wzr, [x8]\n\t" // store to address 0x1 -> SIGSEGV + ); +} +# elif defined(__x86_64__) +__attribute__((naked, noinline)) static void +stacktest_B_crash_no_subcalls(void) +{ + __asm__ volatile( + "pushq %%rbp\n\t" // prologue: save bp + "movq %%rsp, %%rbp\n\t" // set up frame pointer + "movl $0, 0x1\n\t" // store to address 0x1 -> SIGSEGV + ::: "memory" + ); +} +# endif + +NOINLINE static void +stacktest_A_calls_B_no_subcalls(void) +{ + fprintf(stderr, "stacktest_A_calls_B_no_subcalls\n"); + fflush(stderr); + stacktest_B_crash_no_subcalls(); +} + +NOINLINE static void +stacktest_C_helper(void) +{ + // A function that returns normally, just to modify LR in the caller + g_side_effect = 42; +} + +NOINLINE static void +stacktest_B_crash_after_subcall(void) +{ + fprintf(stderr, "stacktest_B_crash_after_subcall\n"); + fflush(stderr); + // Call a helper (modifies LR), then crash without another call + stacktest_C_helper(); + *(volatile int *)invalid_mem = 0xdead; +} + +NOINLINE static void +stacktest_A_calls_B_with_subcalls(void) +{ + fprintf(stderr, "stacktest_A_calls_B_with_subcalls\n"); + fflush(stderr); + stacktest_B_crash_after_subcall(); +} + +// This function must not have a frame record. We use __attribute__((naked)) +// to suppress the prologue/epilogue entirely, and write the crashing store +// in assembly. This ensures FP still points to the caller's frame. +# if defined(__aarch64__) +__attribute__((naked, noinline)) static void +stacktest_B_crash_no_frame_record(void) +{ + __asm__ volatile( + "mov x8, #1\n\t" + "str wzr, [x8]\n\t" // store to address 0x1 -> SIGSEGV + ); +} +# elif defined(__x86_64__) +__attribute__((naked, noinline)) static void +stacktest_B_crash_no_frame_record(void) +{ + __asm__ volatile( + "movl $0, 0x1\n\t" // store to address 0x1 -> SIGSEGV + ); +} +# endif + +NOINLINE static void +stacktest_A_calls_B_no_frame_record(void) +{ + fprintf(stderr, "stacktest_A_calls_B_no_frame_record\n"); + fflush(stderr); + stacktest_B_crash_no_frame_record(); +} + +#endif /* __APPLE__ */ + +// on_crash callback that crashes via SIGSEGV: simulates buggy user code +static sentry_value_t +crashing_on_crash_callback( + const sentry_ucontext_t *uctx, sentry_value_t event, void *closure) +{ + (void)uctx; + (void)event; + (void)closure; + + fprintf(stderr, "on_crash callback about to crash\n"); + fflush(stderr); + + memset((char *)invalid_mem, 1, 100); + + return event; +} + +// on_crash callback that crashes via abort(): tests signal mask reset behavior +static sentry_value_t +aborting_on_crash_callback( + const sentry_ucontext_t *uctx, sentry_value_t event, void *closure) +{ + (void)uctx; + (void)event; + (void)closure; + + fprintf(stderr, "on_crash callback about to abort\n"); + fflush(stderr); + + abort(); + + return event; +} + +static void +print_envelope(sentry_envelope_t *envelope, void *unused_state) +{ + (void)unused_state; + size_t size_out = 0; + char *s = sentry_envelope_serialize(envelope, &size_out); + printf("%s", s); + fflush(stdout); + sentry_free(s); + sentry_envelope_free(envelope); +} + +// Use wide-char paths on Windows, narrow paths elsewhere +#if defined(_WIN32) && defined(_MSC_VER) +# define PATH_TYPE const wchar_t * +# define SET_DATABASE_PATH sentry_options_set_database_pathw +# define DEFAULT_DATABASE_PATH L".sentry-native" +#else +# define PATH_TYPE const char * +# define SET_DATABASE_PATH sentry_options_set_database_path +# define DEFAULT_DATABASE_PATH ".sentry-native" +#endif + +static int +setup_sentry(PATH_TYPE database_path) +{ + sentry_options_t *options = sentry_options_new(); + SET_DATABASE_PATH(options, database_path); + sentry_options_set_auto_session_tracking(options, false); + sentry_options_set_dsn(options, "https://public@sentry.invalid/1"); + sentry_options_set_debug(options, 1); + sentry_options_set_symbolize_stacktraces(options, 1); + sentry_options_set_transport(options, sentry_transport_new(print_envelope)); + + if (sentry_init(options) != 0) { + fprintf(stderr, "Failed to initialize sentry\n"); + return 1; + } + return 0; +} + +static int +test_concurrent_crash(PATH_TYPE database_path) +{ + if (setup_sentry(database_path) != 0) { + return 1; + } + + sentry_set_tag("test", "concurrent-crash"); + + fprintf(stderr, "Starting concurrent crash test\n"); + fflush(stderr); + + run_concurrent_crash(); + + // Should not reach this + fprintf(stderr, "ERROR: Threads returned without crashing\n"); + sentry_close(); + return 1; +} + +static void +trigger_crash(void) +{ + memset((char *)invalid_mem, 1, 100); +} + +static int +setup_sentry_with_crashing_on_crash(PATH_TYPE database_path) +{ + sentry_options_t *options = sentry_options_new(); + SET_DATABASE_PATH(options, database_path); + sentry_options_set_auto_session_tracking(options, false); + sentry_options_set_dsn(options, "https://public@sentry.invalid/1"); + sentry_options_set_debug(options, 1); + sentry_options_set_transport(options, sentry_transport_new(print_envelope)); + + // Set the crashing on_crash callback + sentry_options_set_on_crash(options, crashing_on_crash_callback, NULL); + + if (sentry_init(options) != 0) { + fprintf(stderr, "Failed to initialize sentry\n"); + return 1; + } + return 0; +} + +static int +setup_sentry_with_aborting_on_crash(PATH_TYPE database_path) +{ + sentry_options_t *options = sentry_options_new(); + SET_DATABASE_PATH(options, database_path); + sentry_options_set_auto_session_tracking(options, false); + sentry_options_set_dsn(options, "https://public@sentry.invalid/1"); + sentry_options_set_debug(options, 1); + sentry_options_set_transport(options, sentry_transport_new(print_envelope)); + + sentry_options_set_on_crash(options, aborting_on_crash_callback, NULL); + + if (sentry_init(options) != 0) { + fprintf(stderr, "Failed to initialize sentry\n"); + return 1; + } + return 0; +} + +static int +test_handler_thread_crash(PATH_TYPE database_path) +{ + if (setup_sentry_with_crashing_on_crash(database_path) != 0) { + return 1; + } + + sentry_set_tag("test", "handler-thread-crash"); + + fprintf(stderr, "Starting handler thread crash test\n"); + fflush(stderr); + + // This will crash, trigger the handler thread, which will call + // on_crash callback, which will crash the handler thread. + // The fallback should then process in the signal handler. + trigger_crash(); + + fprintf(stderr, "ERROR: Should have crashed\n"); + sentry_close(); + return 1; +} + +static int +test_handler_abort_crash(PATH_TYPE database_path) +{ +#ifdef _WIN32 + // Suppress the Windows abort dialog that would block CI + _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT); +#endif + + if (setup_sentry_with_aborting_on_crash(database_path) != 0) { + return 1; + } + + sentry_set_tag("test", "handler-abort-crash"); + + fprintf(stderr, "Starting handler abort crash test\n"); + fflush(stderr); + + // This will crash, trigger the handler thread, which will call + // on_crash callback, which will call abort(). abort() resets the + // signal mask, so this tests a different code path. + trigger_crash(); + + fprintf(stderr, "ERROR: Should have crashed\n"); + sentry_close(); + return 1; +} + +#ifdef __APPLE__ +static int +test_stack_no_subcalls(PATH_TYPE database_path) +{ + if (setup_sentry(database_path) != 0) { + return 1; + } + sentry_set_tag("test", "stack-no-subcalls"); + fprintf(stderr, "Starting stack-no-subcalls test\n"); + fflush(stderr); + stacktest_A_calls_B_no_subcalls(); + fprintf(stderr, "ERROR: Should have crashed\n"); + sentry_close(); + return 1; +} + +static int +test_stack_with_subcalls(PATH_TYPE database_path) +{ + if (setup_sentry(database_path) != 0) { + return 1; + } + sentry_set_tag("test", "stack-with-subcalls"); + fprintf(stderr, "Starting stack-with-subcalls test\n"); + fflush(stderr); + stacktest_A_calls_B_with_subcalls(); + fprintf(stderr, "ERROR: Should have crashed\n"); + sentry_close(); + return 1; +} + +static int +test_stack_no_frame_record(PATH_TYPE database_path) +{ + if (setup_sentry(database_path) != 0) { + return 1; + } + sentry_set_tag("test", "stack-no-frame-record"); + fprintf(stderr, "Starting stack-no-frame-record test\n"); + fflush(stderr); + stacktest_A_calls_B_no_frame_record(); + fprintf(stderr, "ERROR: Should have crashed\n"); + sentry_close(); + return 1; +} +#endif /* __APPLE__ */ + +static int +test_simple_crash(PATH_TYPE database_path) +{ + if (setup_sentry(database_path) != 0) { + return 1; + } + + sentry_set_tag("test", "simple-crash"); + + fprintf(stderr, "Starting simple crash test\n"); + fflush(stderr); + + trigger_crash(); + + fprintf(stderr, "ERROR: Should have crashed\n"); + sentry_close(); + return 1; +} + +#if defined(_WIN32) && defined(_MSC_VER) +int +wmain(int argc, wchar_t *argv[]) +{ + if (argc < 2) { + fwprintf(stderr, L"Usage: %ls [database-path]\n", argv[0]); + fwprintf(stderr, L"Tests:\n"); + fwprintf(stderr, + L" concurrent-crash - Multiple threads crash " + L"simultaneously\n"); + fwprintf(stderr, + L" simple-crash - Single thread crash (baseline)\n"); + fwprintf(stderr, + L" handler-thread-crash - Handler thread crashes in on_crash " + L"(SIGSEGV)\n"); + fwprintf(stderr, + L" handler-abort-crash - Handler thread crashes in on_crash " + L"(abort)\n"); + return 1; + } + + const wchar_t *test_name = argv[1]; + const wchar_t *database_path + = argc > 2 ? argv[2] : DEFAULT_DATABASE_PATH; + + if (wcscmp(test_name, L"concurrent-crash") == 0) { + return test_concurrent_crash(database_path); + } + if (wcscmp(test_name, L"simple-crash") == 0) { + return test_simple_crash(database_path); + } + if (wcscmp(test_name, L"handler-thread-crash") == 0) { + return test_handler_thread_crash(database_path); + } + if (wcscmp(test_name, L"handler-abort-crash") == 0) { + return test_handler_abort_crash(database_path); + } + fwprintf(stderr, L"Unknown test: %ls\n", test_name); + return 1; +} +#else +int +main(int argc, char *argv[]) +{ + if (argc < 2) { + fprintf(stderr, "Usage: %s [database-path]\n", argv[0]); + fprintf(stderr, "Tests:\n"); + fprintf(stderr, + " concurrent-crash - Multiple threads crash " + "simultaneously\n"); + fprintf(stderr, + " simple-crash - Single thread crash (baseline)\n"); + fprintf(stderr, + " handler-thread-crash - Handler thread crashes in on_crash " + "(SIGSEGV)\n"); + fprintf(stderr, + " handler-abort-crash - Handler thread crashes in on_crash " + "(abort)\n"); +#ifdef __APPLE__ + fprintf(stderr, + " stack-no-subcalls - Stack trace: no sub-calls\n"); + fprintf(stderr, + " stack-with-subcalls - Stack trace: with sub-calls\n"); + fprintf(stderr, + " stack-no-frame-record - Stack trace: no frame record\n"); +#endif + return 1; + } + + const char *test_name = argv[1]; + const char *database_path = argc > 2 ? argv[2] : DEFAULT_DATABASE_PATH; + + if (strcmp(test_name, "concurrent-crash") == 0) { + return test_concurrent_crash(database_path); + } + if (strcmp(test_name, "simple-crash") == 0) { + return test_simple_crash(database_path); + } + if (strcmp(test_name, "handler-thread-crash") == 0) { + return test_handler_thread_crash(database_path); + } + if (strcmp(test_name, "handler-abort-crash") == 0) { + return test_handler_abort_crash(database_path); + } +#ifdef __APPLE__ + if (strcmp(test_name, "stack-no-subcalls") == 0) { + return test_stack_no_subcalls(database_path); + } + if (strcmp(test_name, "stack-with-subcalls") == 0) { + return test_stack_with_subcalls(database_path); + } + if (strcmp(test_name, "stack-no-frame-record") == 0) { + return test_stack_no_frame_record(database_path); + } +#endif + fprintf(stderr, "Unknown test: %s\n", test_name); + return 1; +} +#endif diff --git a/tests/test_dotnet_signals.py b/tests/test_dotnet_signals.py index 9d7fe07c96..7c4e2a70dd 100644 --- a/tests/test_dotnet_signals.py +++ b/tests/test_dotnet_signals.py @@ -65,6 +65,9 @@ def run_dotnet_native_crash(tmp_path): reason="dotnet signal handling is currently only supported on 64-bit Linux without sanitizers", ) def test_dotnet_signals_inproc(cmake): + if shutil.which("dotnet") is None: + pytest.skip("dotnet is not installed") + try: # build native client library with inproc and the example for crash dumping tmp_path = cmake( @@ -166,6 +169,9 @@ def run_aot_native_crash(tmp_path): reason="dotnet AOT signal handling is currently only supported on 64-bit Linux without sanitizers", ) def test_aot_signals_inproc(cmake): + if shutil.which("dotnet") is None: + pytest.skip("dotnet is not installed") + try: # build native client library with inproc and the example for crash dumping tmp_path = cmake( diff --git a/tests/test_inproc_stress.py b/tests/test_inproc_stress.py new file mode 100644 index 0000000000..e9b6d4ee7a --- /dev/null +++ b/tests/test_inproc_stress.py @@ -0,0 +1,510 @@ +import os +import pathlib +import platform +import shutil +import subprocess +import sys +import time + +import pytest +from flaky import flaky + +from . import Envelope +from .assertions import assert_inproc_crash +from .build_config import get_test_executable_cmake_args, get_test_executable_env + +fixture_path = pathlib.Path("tests/fixtures/inproc_stress") + +ANDROID_TMP = "/data/local/tmp" + + +def is_android(): + return bool(os.environ.get("ANDROID_API")) + + +def adb(*args): + """Run an adb command.""" + return subprocess.run( + ["{}/platform-tools/adb".format(os.environ["ANDROID_HOME"]), *args], + check=True, + capture_output=True, + ) + + +def compile_test_program(tmp_path): + build_dir = tmp_path / "inproc_stress_build" + build_dir.mkdir(exist_ok=True) + + source_dir = pathlib.Path(__file__).parent.parent.resolve() + include_dir = source_dir / "include" + + cmake_args = get_test_executable_cmake_args(tmp_path, include_dir) + cmake_args.append(str(fixture_path.resolve())) + + env = get_test_executable_env() + + subprocess.run( + ["cmake"] + cmake_args, + check=True, + cwd=build_dir, + env=env, + ) + + subprocess.run( + ["cmake", "--build", ".", "--parallel"], + check=True, + cwd=build_dir, + env=env, + ) + + exe_name = ( + "inproc_stress_test.exe" if sys.platform == "win32" else "inproc_stress_test" + ) + exe_path = build_dir / exe_name + + # Push executable to Android device + if is_android(): + adb("push", str(exe_path), ANDROID_TMP) + + return exe_path + + +def run_stress_test(tmp_path, test_executable, test_name, database_path=None): + if is_android(): + return run_stress_test_android(test_executable, test_name, database_path) + + if database_path is None: + database_path = tmp_path / ".sentry-native" + + env = os.environ.copy() + if sys.platform != "win32": + env["LD_LIBRARY_PATH"] = str(tmp_path) + ":" + env.get("LD_LIBRARY_PATH", "") + + proc = subprocess.Popen( + [str(test_executable), test_name, str(database_path)], + cwd=tmp_path, + env=env, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + encoding="utf-8", + errors="replace", + ) + + stdout, stderr = proc.communicate(timeout=30) + return proc.returncode, stdout, stderr + + +def run_stress_test_android(test_executable, test_name, database_path): + """Run the stress test on Android via adb shell.""" + exe_name = test_executable.name + remote_db_path = f"{ANDROID_TMP}/{database_path.name}" + + # Clear logcat before running so we limit the capture as close to this run as possible + subprocess.run( + ["{}/platform-tools/adb".format(os.environ["ANDROID_HOME"]), "logcat", "-c"], + check=False, + ) + + # Run on device - we need to capture both stdout and stderr, and the return code + # Android shell doesn't separate stdout/stderr well, so we redirect stderr to stdout + # and parse the return code from the output (same approach as tests/__init__.py) + result = subprocess.run( + [ + "{}/platform-tools/adb".format(os.environ["ANDROID_HOME"]), + "shell", + f"cd {ANDROID_TMP} && LD_LIBRARY_PATH=. ./{exe_name} {test_name} {remote_db_path} 2>&1; echo ret:$?", + ], + capture_output=True, + text=True, + ) + + output = result.stdout + ret_marker = output.rfind("ret:") + if ret_marker != -1: + returncode = int(output[ret_marker + 4 :].strip()) + output = output[:ret_marker] + else: + returncode = result.returncode + + # Give the system a moment to flush logcat buffers after the crash + time.sleep(0.5) + + # Capture logcat to get our logs + logcat_result = subprocess.run( + [ + "{}/platform-tools/adb".format(os.environ["ANDROID_HOME"]), + "logcat", + "-d", + "-s", + "sentry-native:*", + ], + capture_output=True, + text=True, + ) + logcat_output = logcat_result.stdout + + # Pull the database directory back from the device + # adb pull creates a subdirectory, so we pull to the parent + if database_path.exists(): + shutil.rmtree(database_path) + + # Pull the remote database to local path (pulls to parent, creates database_path) + try: + adb("pull", f"{remote_db_path}/", str(database_path.parent)) + except subprocess.CalledProcessError: + # Database might not exist if crash wasn't captured + pass + + # Clean up remote database for next run + subprocess.run( + [ + "{}/platform-tools/adb".format(os.environ["ANDROID_HOME"]), + "shell", + f"rm -rf {remote_db_path}", + ], + check=False, + ) + + # Combine shell output with logcat output for assertion checks + combined_output = output + "\n" + logcat_output + return returncode, combined_output, combined_output + + +def assert_single_crash_envelope(database_path): + run_dirs = list(database_path.glob("*.run")) + assert len(run_dirs) == 1, f"Expected 1 .run directory, found {len(run_dirs)}" + + run_dir = run_dirs[0] + envelopes = list(run_dir.glob("*.envelope")) + assert ( + len(envelopes) == 1 + ), f"Expected 1 envelope, found {len(envelopes)}: {envelopes}" + + return envelopes[0] + + +def assert_crash_marker(database_path): + assert (database_path / "last_crash").exists(), "Crash marker file missing" + + +def test_inproc_simple_crash(cmake): + tmp_path = cmake( + ["sentry"], + {"SENTRY_BACKEND": "inproc", "SENTRY_TRANSPORT": "none"}, + ) + + test_exe = compile_test_program(tmp_path) + database_path = tmp_path / ".sentry-native" + + try: + returncode, stdout, stderr = run_stress_test( + tmp_path, test_exe, "simple-crash", database_path + ) + + assert returncode != 0, f"Process should have crashed. stderr:\n{stderr}" + + assert ( + "crash has been captured" in stderr + ), f"Crash not captured. stderr:\n{stderr}" + + assert_crash_marker(database_path) + envelope_path = assert_single_crash_envelope(database_path) + + with open(envelope_path, "rb") as f: + envelope = Envelope.deserialize(f.read()) + assert_inproc_crash(envelope) + + event = envelope.get_event() + assert event is not None, "Event missing from envelope" + assert "exception" in event, "Exception missing from event" + + finally: + shutil.rmtree(database_path, ignore_errors=True) + + +def test_inproc_concurrent_crash(cmake): + """ + Stress test: multiple threads crash simultaneously. + + This test verifies that: + 1. Only ONE crash envelope is generated (not one per thread) + 2. The envelope is not corrupted by concurrent access + 3. The process terminates cleanly after handling the first crash + """ + tmp_path = cmake( + ["sentry"], + {"SENTRY_BACKEND": "inproc", "SENTRY_TRANSPORT": "none"}, + ) + + test_exe = compile_test_program(tmp_path) + database_path = tmp_path / ".sentry-native" + + try: + returncode, stdout, stderr = run_stress_test( + tmp_path, test_exe, "concurrent-crash", database_path + ) + + assert returncode != 0, f"Process should have crashed. stderr:\n{stderr}" + assert ( + "crash has been captured" in stderr + ), f"Crash not captured. stderr:\n{stderr}" + + assert_crash_marker(database_path) + envelope_path = assert_single_crash_envelope(database_path) + + with open(envelope_path, "rb") as f: + content = f.read() + envelope = Envelope.deserialize(content) + + assert_inproc_crash(envelope) + + event = envelope.get_event() + assert event is not None, "Event missing from envelope" + assert "exception" in event, "Exception missing from event" + + exc = event["exception"]["values"][0] + assert "type" in exc, "Exception type missing" + assert "stacktrace" in exc, "Stacktrace missing from exception" + + finally: + shutil.rmtree(database_path, ignore_errors=True) + + +def test_inproc_handler_thread_crash(cmake): + """ + Test fallback when handler thread crashes via SIGSEGV. + + This test verifies that when the on_crash callback crashes (which runs + on the handler thread), the signal handler detects this and falls back + to processing the crash directly in the signal handler context. + """ + tmp_path = cmake( + ["sentry"], + {"SENTRY_BACKEND": "inproc", "SENTRY_TRANSPORT": "none"}, + ) + + test_exe = compile_test_program(tmp_path) + database_path = tmp_path / ".sentry-native" + + try: + returncode, stdout, stderr = run_stress_test( + tmp_path, test_exe, "handler-thread-crash", database_path + ) + + assert returncode != 0, f"Process should have crashed. stderr:\n{stderr}" + + assert ( + "on_crash callback about to crash" in stderr + ), f"on_crash callback didn't run. stderr:\n{stderr}" + + assert ( + "FATAL crash in handler thread" in stderr + ), f"Handler thread crash not detected. stderr:\n{stderr}" + + assert ( + "crash has been captured" in stderr + ), f"Crash not captured via fallback. stderr:\n{stderr}" + + assert_crash_marker(database_path) + envelope_path = assert_single_crash_envelope(database_path) + with open(envelope_path, "rb") as f: + envelope = Envelope.deserialize(f.read()) + assert_inproc_crash(envelope) + + finally: + shutil.rmtree(database_path, ignore_errors=True) + + +def test_inproc_handler_abort_crash(cmake): + """ + Test behavior when handler thread crashes via abort(). + + When abort() is called from the on_crash callback (running on the handler + thread), we detect this is a handler thread crash and fall back to + processing in the signal handler context (with hooks skipped to avoid + calling the crashing hook again). + + The crash marker should exist (written before on_crash callback), and + an envelope should be written for the abort crash. + """ + tmp_path = cmake( + ["sentry"], + {"SENTRY_BACKEND": "inproc", "SENTRY_TRANSPORT": "none"}, + ) + + test_exe = compile_test_program(tmp_path) + database_path = tmp_path / ".sentry-native" + + try: + returncode, stdout, stderr = run_stress_test( + tmp_path, test_exe, "handler-abort-crash", database_path + ) + + assert returncode != 0, f"Process should have crashed. stderr:\n{stderr}" + + assert ( + "on_crash callback about to abort" in stderr + ), f"on_crash callback didn't run. stderr:\n{stderr}" + + assert ( + "FATAL crash in handler thread" in stderr + ), f"Handler thread crash not detected. stderr:\n{stderr}" + + # The abort crash should be captured via the fallback path + assert ( + "crash has been captured" in stderr + ), f"Crash should have been captured. stderr:\n{stderr}" + + # Crash marker should exist (written before on_crash callback) + assert_crash_marker(database_path) + + # An envelope should be written for the abort crash + run_dirs = list(database_path.glob("*.run")) + assert len(run_dirs) == 1, f"Expected 1 run dir, found: {run_dirs}" + envelopes = list(run_dirs[0].glob("*.envelope")) + assert ( + len(envelopes) == 1 + ), f"Expected 1 envelope after abort(), found: {envelopes}" + + finally: + shutil.rmtree(database_path, ignore_errors=True) + + +@pytest.mark.skipif( + sys.platform != "darwin" or is_android(), + reason="Stack trace tests are macOS-only", +) +@pytest.mark.parametrize( + "test_name,expected_functions,expect_no_duplicates", + [ + ( + "stack-no-subcalls", + [ + "stacktest_B_crash_no_subcalls", + "stacktest_A_calls_B_no_subcalls", + ], + True, + ), + ( + "stack-with-subcalls", + [ + "stacktest_B_crash_after_subcall", + "stacktest_A_calls_B_with_subcalls", + ], + # LR holds a stale return into the crashing function (from the + # last bl before the crash). We accept this spurious extra frame + # because skipping LR would lose a real frame in the + # no-frame-record case, which we can't distinguish at walk time. + False, + ), + pytest.param( + "stack-no-frame-record", + [ + "stacktest_B_crash_no_frame_record", + "stacktest_A_calls_B_no_frame_record", + ], + True, + marks=pytest.mark.skipif( + platform.machine() not in ("arm64", "aarch64"), + reason="no-frame-record recovery requires LR (arm64 only)", + ), + ), + ], + ids=["no-subcalls", "with-subcalls", "no-frame-record"], +) +def test_inproc_stack_trace(cmake, test_name, expected_functions, expect_no_duplicates): + """ + Test that the fp-based unwinder produces correct stack traces on macOS. + + Verifies: + - No duplicate frames where avoidable (arm64 LR vs saved LR dedup) + - No missing frames (functions without frame records need LR) + - Expected function names appear in the correct order + """ + tmp_path = cmake( + ["sentry"], + {"SENTRY_BACKEND": "inproc", "SENTRY_TRANSPORT": "none"}, + ) + + test_exe = compile_test_program(tmp_path) + database_path = tmp_path / ".sentry-native" + + try: + returncode, stdout, stderr = run_stress_test( + tmp_path, test_exe, test_name, database_path + ) + + assert returncode != 0, f"Process should have crashed. stderr:\n{stderr}" + assert ( + "crash has been captured" in stderr + ), f"Crash not captured. stderr:\n{stderr}" + + envelope_path = assert_single_crash_envelope(database_path) + with open(envelope_path, "rb") as f: + envelope = Envelope.deserialize(f.read()) + + event = envelope.get_event() + assert event is not None, "Event missing from envelope" + assert "exception" in event, "Exception missing from event" + + exc = event["exception"]["values"][0] + assert "stacktrace" in exc, "Stacktrace missing from exception" + + frames = exc["stacktrace"]["frames"] + # Sentry convention: frames are bottom-to-top, so reverse for + # top-to-bottom (crash frame first) + func_names = [f.get("function", "") for f in reversed(frames)] + + # Check no consecutive duplicate function names (where expected) + if expect_no_duplicates: + for i in range(len(func_names) - 1): + assert func_names[i] != func_names[i + 1] or not func_names[i], ( + f"Duplicate consecutive frame: {func_names[i]} at positions" + f" {i} and {i+1}.\nAll frames: {func_names}" + ) + + # Check expected functions appear in order + search_start = 0 + for expected in expected_functions: + found = False + for i in range(search_start, len(func_names)): + if expected in (func_names[i] or ""): + found = True + search_start = i + 1 + break + assert found, ( + f"Expected function '{expected}' not found (after position" + f" {search_start}) in stack trace.\nAll frames: {func_names}" + ) + + finally: + shutil.rmtree(database_path, ignore_errors=True) + + +@pytest.mark.parametrize("iteration", range(5)) +def test_inproc_concurrent_crash_repeated(cmake, iteration): + tmp_path = cmake( + ["sentry"], + {"SENTRY_BACKEND": "inproc", "SENTRY_TRANSPORT": "none"}, + ) + + test_exe = compile_test_program(tmp_path) + database_path = tmp_path / f".sentry-native-{iteration}" + + try: + returncode, stdout, stderr = run_stress_test( + tmp_path, test_exe, "concurrent-crash", database_path + ) + + assert returncode != 0, f"Iteration {iteration}: Process should have crashed" + assert ( + "crash has been captured" in stderr + ), f"Crash not captured. stderr:\n{stderr}" + + envelope_path = assert_single_crash_envelope(database_path) + with open(envelope_path, "rb") as f: + envelope = Envelope.deserialize(f.read()) + assert_inproc_crash(envelope) + + finally: + shutil.rmtree(database_path, ignore_errors=True) diff --git a/tests/test_integration_stdout.py b/tests/test_integration_stdout.py index fdded435ab..ecbdac1a5c 100644 --- a/tests/test_integration_stdout.py +++ b/tests/test_integration_stdout.py @@ -185,6 +185,24 @@ def test_inproc_crash_stdout(cmake): assert_inproc_crash(envelope) +def test_inproc_abort_stdout(cmake): + """Test that a normal abort() call is captured by inproc backend. + + This verifies that our SIGABRT handling changes (which bail out early + for abort() on the handler thread or during recursion) don't break + normal abort() capture from user code. + """ + tmp_path, output = run_stdout_for("inproc", cmake, ["attachment", "abort"]) + + envelope = Envelope.deserialize(output) + + assert_crash_timestamp(has_files, tmp_path) + assert_meta(envelope, integration="inproc") + assert_breadcrumb(envelope) + assert_attachment(envelope) + assert_inproc_crash(envelope) + + def test_inproc_crash_stdout_before_send(cmake): tmp_path, output = run_crash_stdout_for("inproc", cmake, ["before-send"]) @@ -240,7 +258,7 @@ def test_inproc_crash_stdout_before_send_and_on_crash(cmake): ) def test_inproc_stack_overflow_stdout(cmake, build_args): tmp_path, output = run_stdout_for( - "inproc", cmake, ["attachment", "stack-overflow"], build_args + "inproc", cmake, ["log", "attachment", "stack-overflow"], build_args ) envelope = Envelope.deserialize(output) diff --git a/tests/test_unit.py b/tests/test_unit.py index 7ce28d04fd..c38fffb911 100644 --- a/tests/test_unit.py +++ b/tests/test_unit.py @@ -17,7 +17,11 @@ def test_unit(cmake, unittest): @pytest.mark.skipif(not has_http, reason="tests need http transport") def test_unit_transport(cmake, unittest): - if unittest in ["custom_logger", "logger_enable_disable_functionality"]: + if unittest in [ + "custom_logger", + "logger_enable_disable_functionality", + "logger_level", + ]: pytest.skip("excluded from transport test-suite") cwd = cmake( diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index 444f54b0b2..359ec43f94 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -47,6 +47,7 @@ add_executable(sentry_test_unit test_scope.c test_session.c test_slice.c + test_string.c test_symbolizer.c test_sync.c test_tracing.c diff --git a/tests/unit/test_process.c b/tests/unit/test_process.c index baeff7b201..8fed7546e8 100644 --- a/tests/unit/test_process.c +++ b/tests/unit/test_process.c @@ -24,6 +24,20 @@ SENTRY_TEST(process_invalid) sentry__path_free(nul); } +#ifndef SENTRY_PLATFORM_WINDOWS +void +find_cp_path(char *buf, size_t buf_len) +{ + FILE *fp = popen("command -v cp 2>/dev/null", "r"); + if (fp && fgets(buf, buf_len, fp)) { + buf[strcspn(buf, "\n")] = 0; // strip newline + } + if (fp) { + pclose(fp); + } +} +#endif + SENTRY_TEST(process_spawn) { #if defined(SENTRY_PLATFORM_WINDOWS) || defined(SENTRY_PLATFORM_MACOS) \ @@ -46,8 +60,10 @@ SENTRY_TEST(process_spawn) sentry__process_spawn(cmd, "/C", "copy", exe->path, dst->path, NULL); sentry__path_free(cmd); # else - // /bin/cp - sentry_path_t *cp = sentry__path_from_str("/bin/cp"); + char cp_path[512] = "/bin/cp"; + find_cp_path(cp_path, sizeof(cp_path)); + // cp + sentry_path_t *cp = sentry__path_from_str(cp_path); TEST_ASSERT(!!cp); sentry__process_spawn(cp, exe->path, dst->path, NULL); sentry__path_free(cp); diff --git a/tests/unit/test_string.c b/tests/unit/test_string.c new file mode 100644 index 0000000000..3170849069 --- /dev/null +++ b/tests/unit/test_string.c @@ -0,0 +1,30 @@ +#include "sentry_random.h" +#include "sentry_string.h" +#include "sentry_testsupport.h" + +void +assert_addr_value_equals_format(uint64_t addr) +{ + char our_buf[32]; + char stdio_buf[32]; + sentry__addr_to_string(our_buf, sizeof(our_buf), addr); + snprintf(stdio_buf, sizeof(stdio_buf), "0x%" PRIx64, addr); + TEST_CHECK_STRING_EQUAL(our_buf, stdio_buf); +} + +SENTRY_TEST(string_address_format) +{ + assert_addr_value_equals_format(0); + assert_addr_value_equals_format(0xf000000000000000); + assert_addr_value_equals_format(0x000000000000000f); + assert_addr_value_equals_format(0x0000ffff0000ffff); + assert_addr_value_equals_format(0x0000ffffffff0000); + assert_addr_value_equals_format(0xf0f0f0f0f0f0f0f0); + assert_addr_value_equals_format(0x0f0f0f0f0f0f0f0f); + uint64_t rnd; + for (int i = 0; i < 1000000; ++i) { + TEST_ASSERT(!sentry__getrandom(&rnd, sizeof(rnd))); + assert_addr_value_equals_format(rnd); + } + assert_addr_value_equals_format(0xffffffffffffffff); +} diff --git a/tests/unit/test_symbolizer.c b/tests/unit/test_symbolizer.c index 436eb4c46c..292b14d965 100644 --- a/tests/unit/test_symbolizer.c +++ b/tests/unit/test_symbolizer.c @@ -1,6 +1,16 @@ #include "sentry_symbolizer.h" #include "sentry_testsupport.h" +// On arm64e, function pointers have PAC (Pointer Authentication Code) bits +// that must be stripped for comparison with addresses from dladdr(). +#if defined(__arm64e__) +# include +# define STRIP_PAC_FROM_FPTR(fptr) \ + ptrauth_strip(fptr, ptrauth_key_function_pointer) +#else +# define STRIP_PAC_FROM_FPTR(fptr) (fptr) +#endif + TEST_VISIBLE void test_function(void) { @@ -22,8 +32,9 @@ asserter(const sentry_frame_info_t *info, void *data) TEST_CHECK( info->instruction_addr == ((char *)*(void **)&test_function) + 1); #else - TEST_CHECK(info->symbol_addr == &test_function); - TEST_CHECK(info->instruction_addr == ((char *)(void *)&test_function) + 1); + void *expected_addr = STRIP_PAC_FROM_FPTR((void *)&test_function); + TEST_CHECK(info->symbol_addr == expected_addr); + TEST_CHECK(info->instruction_addr == ((char *)expected_addr) + 1); #endif *called += 1; } @@ -39,7 +50,8 @@ SENTRY_TEST(symbolizer) sentry__symbolize( ((char *)*(void **)&test_function) + 1, asserter, &called); #else - sentry__symbolize(((char *)(void *)&test_function) + 1, asserter, &called); + void *func_addr = STRIP_PAC_FROM_FPTR((void *)&test_function); + sentry__symbolize(((char *)func_addr) + 1, asserter, &called); #endif TEST_CHECK_INT_EQUAL(called, 1); } diff --git a/tests/unit/test_unwinder.c b/tests/unit/test_unwinder.c index 70568b94dc..2dfb201c40 100644 --- a/tests/unit/test_unwinder.c +++ b/tests/unit/test_unwinder.c @@ -2,6 +2,16 @@ #include "sentry_symbolizer.h" #include "sentry_testsupport.h" +// On arm64e, function pointers have PAC (Pointer Authentication Code) bits +// that must be stripped for comparison with addresses from dladdr(). +#if defined(__arm64e__) +# include +# define STRIP_PAC_FROM_FPTR(fptr) \ + ptrauth_strip(fptr, ptrauth_key_function_pointer) +#else +# define STRIP_PAC_FROM_FPTR(fptr) (fptr) +#endif + #define MAX_FRAMES 128 TEST_VISIBLE size_t @@ -29,7 +39,7 @@ find_frame(const sentry_frame_info_t *info, void *data) // XXX: Should apply on _CALL_ELF == 1 when on PowerPC i.e. Linux *(void **)&invoke_unwinder; #else - &invoke_unwinder; + STRIP_PAC_FROM_FPTR((void *)&invoke_unwinder); #endif if (info->symbol_addr == unwinder_address) { *found_frame += 1; diff --git a/tests/unit/tests.inc b/tests/unit/tests.inc index 0a5cb2e9d5..6686e78d26 100644 --- a/tests/unit/tests.inc +++ b/tests/unit/tests.inc @@ -190,6 +190,7 @@ XX(span_tagging_n) XX(spans_on_scope) XX(stack_guarantee) XX(stack_guarantee_auto_init) +XX(string_address_format) XX(symbolizer) XX(task_queue) XX(thread_without_name_still_valid) diff --git a/tests/valgrind.txt b/tests/valgrind.txt index 92b756580a..aaf7a10b5b 100644 --- a/tests/valgrind.txt +++ b/tests/valgrind.txt @@ -37,3 +37,11 @@ fun:sentry__bgworker_start fun:test_sentry_task_queue } +{ + # writes of uninit buffers with padding or foreign-stack pointers lead to false-positive during stack unwinding + libunwind writes buffers we do not manage + Memcheck:Param + write(buf) + ... + obj:*/libunwind.so* +} \ No newline at end of file diff --git a/vendor/libunwind/AUTHORS b/vendor/libunwind/AUTHORS new file mode 100644 index 0000000000..719eee5c85 --- /dev/null +++ b/vendor/libunwind/AUTHORS @@ -0,0 +1 @@ +David Mosberger diff --git a/vendor/libunwind/CMakeLists.txt b/vendor/libunwind/CMakeLists.txt new file mode 100644 index 0000000000..ffec94be47 --- /dev/null +++ b/vendor/libunwind/CMakeLists.txt @@ -0,0 +1,278 @@ +# CMakeLists.txt for vendored libunwind (Linux only, x86_64 and aarch64) +# This builds only the local unwinding library (libunwind.a equivalent) + +# Vendored libunwind - built as a subdirectory of the main project. +# Enable ASM for the .S sources without a nested project() call. +include(CheckLanguage) +check_language(ASM) +if(NOT CMAKE_ASM_COMPILER) + message(FATAL_ERROR "ASM required for vendored libunwind's context code, but no assembler found.") +endif() +enable_language(ASM) + +set(LIBUNWIND_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src") +set(LIBUNWIND_INC "${CMAKE_CURRENT_SOURCE_DIR}/include") + +# Detect architecture +if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64|amd64") + set(UNWIND_ARCH "x86_64") + set(UNWIND_ELF "elf64") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|arm64") + set(UNWIND_ARCH "aarch64") + set(UNWIND_ELF "elf64") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i[3-6]86|x86") + set(UNWIND_ARCH "x86") + set(UNWIND_ELF "elf32") +else() + message(FATAL_ERROR "Unsupported architecture for vendored libunwind: ${CMAKE_SYSTEM_PROCESSOR}") +endif() + +# Common sources (libunwind_la_SOURCES_common + os sources for Linux) +set(UNWIND_COMMON_SOURCES + ${LIBUNWIND_SRC}/os-linux.c + ${LIBUNWIND_SRC}/dl-iterate-phdr.c + ${LIBUNWIND_SRC}/mi/init.c + ${LIBUNWIND_SRC}/mi/flush_cache.c + ${LIBUNWIND_SRC}/mi/mempool.c + ${LIBUNWIND_SRC}/mi/strerror.c +) + +# Local sources (libunwind_la_SOURCES_local_nounwind + os_local) +set(UNWIND_LOCAL_SOURCES + # os_linux_local (CXX exceptions support - _ReadULEB/_ReadSLEB) + ${LIBUNWIND_SRC}/mi/_ReadULEB.c + ${LIBUNWIND_SRC}/mi/_ReadSLEB.c + # local nounwind + ${LIBUNWIND_SRC}/mi/backtrace.c + ${LIBUNWIND_SRC}/mi/dyn-cancel.c + ${LIBUNWIND_SRC}/mi/dyn-info-list.c + ${LIBUNWIND_SRC}/mi/dyn-register.c + ${LIBUNWIND_SRC}/mi/Laddress_validator.c + ${LIBUNWIND_SRC}/mi/Ldestroy_addr_space.c + ${LIBUNWIND_SRC}/mi/Ldyn-extract.c + ${LIBUNWIND_SRC}/mi/Lfind_dynamic_proc_info.c + ${LIBUNWIND_SRC}/mi/Lget_accessors.c + ${LIBUNWIND_SRC}/mi/Lget_fpreg.c + ${LIBUNWIND_SRC}/mi/Lset_fpreg.c + ${LIBUNWIND_SRC}/mi/Lget_proc_info_by_ip.c + ${LIBUNWIND_SRC}/mi/Lget_proc_name.c + ${LIBUNWIND_SRC}/mi/Lget_reg.c + ${LIBUNWIND_SRC}/mi/Lis_plt_entry.c + ${LIBUNWIND_SRC}/mi/Lput_dynamic_unwind_info.c + ${LIBUNWIND_SRC}/mi/Lset_cache_size.c + ${LIBUNWIND_SRC}/mi/Lset_caching_policy.c + ${LIBUNWIND_SRC}/mi/Lset_iterate_phdr_function.c + ${LIBUNWIND_SRC}/mi/Lset_reg.c + ${LIBUNWIND_SRC}/mi/Lget_elf_filename.c + # local unwind (CXX exception support) + ${LIBUNWIND_SRC}/unwind/Backtrace.c + ${LIBUNWIND_SRC}/unwind/DeleteException.c + ${LIBUNWIND_SRC}/unwind/FindEnclosingFunction.c + ${LIBUNWIND_SRC}/unwind/ForcedUnwind.c + ${LIBUNWIND_SRC}/unwind/GetBSP.c + ${LIBUNWIND_SRC}/unwind/GetCFA.c + ${LIBUNWIND_SRC}/unwind/GetDataRelBase.c + ${LIBUNWIND_SRC}/unwind/GetGR.c + ${LIBUNWIND_SRC}/unwind/GetIP.c + ${LIBUNWIND_SRC}/unwind/GetIPInfo.c + ${LIBUNWIND_SRC}/unwind/GetLanguageSpecificData.c + ${LIBUNWIND_SRC}/unwind/GetRegionStart.c + ${LIBUNWIND_SRC}/unwind/GetTextRelBase.c + ${LIBUNWIND_SRC}/unwind/RaiseException.c + ${LIBUNWIND_SRC}/unwind/Resume.c + ${LIBUNWIND_SRC}/unwind/Resume_or_Rethrow.c + ${LIBUNWIND_SRC}/unwind/SetGR.c + ${LIBUNWIND_SRC}/unwind/SetIP.c +) + +# DWARF sources (local) +set(UNWIND_DWARF_LOCAL_SOURCES + ${LIBUNWIND_SRC}/dwarf/global.c + ${LIBUNWIND_SRC}/dwarf/Lexpr.c + ${LIBUNWIND_SRC}/dwarf/Lfde.c + ${LIBUNWIND_SRC}/dwarf/Lfind_proc_info-lsb.c + ${LIBUNWIND_SRC}/dwarf/Lfind_unwind_table.c + ${LIBUNWIND_SRC}/dwarf/Lget_proc_info_in_range.c + ${LIBUNWIND_SRC}/dwarf/Lparser.c + ${LIBUNWIND_SRC}/dwarf/Lpe.c +) + +# ELF sources +set(UNWIND_ELF_SOURCES + ${LIBUNWIND_SRC}/${UNWIND_ELF}.c +) + +# Architecture-specific sources +if(UNWIND_ARCH STREQUAL "x86_64") + set(UNWIND_ARCH_SOURCES + # common + ${LIBUNWIND_SRC}/x86_64/is_fpreg.c + ${LIBUNWIND_SRC}/x86_64/regname.c + # os_local (Linux) + ${LIBUNWIND_SRC}/x86_64/Los-linux.c + # arch-specific local + ${LIBUNWIND_SRC}/x86_64/getcontext.S + ${LIBUNWIND_SRC}/x86_64/Lapply_reg_state.c + ${LIBUNWIND_SRC}/x86_64/Lcreate_addr_space.c + ${LIBUNWIND_SRC}/x86_64/Lget_proc_info.c + ${LIBUNWIND_SRC}/x86_64/Lget_save_loc.c + ${LIBUNWIND_SRC}/x86_64/Lglobal.c + ${LIBUNWIND_SRC}/x86_64/Linit.c + ${LIBUNWIND_SRC}/x86_64/Linit_local.c + ${LIBUNWIND_SRC}/x86_64/Linit_remote.c + ${LIBUNWIND_SRC}/x86_64/Lregs.c + ${LIBUNWIND_SRC}/x86_64/Lreg_states_iterate.c + ${LIBUNWIND_SRC}/x86_64/Lresume.c + ${LIBUNWIND_SRC}/x86_64/Lstash_frame.c + ${LIBUNWIND_SRC}/x86_64/Lstep.c + ${LIBUNWIND_SRC}/x86_64/Ltrace.c + ${LIBUNWIND_SRC}/x86_64/setcontext.S + ) +elseif(UNWIND_ARCH STREQUAL "aarch64") + set(UNWIND_ARCH_SOURCES + # common + ${LIBUNWIND_SRC}/aarch64/is_fpreg.c + ${LIBUNWIND_SRC}/aarch64/regname.c + # os_local (Linux) + ${LIBUNWIND_SRC}/aarch64/Los-linux.c + # arch-specific local + ${LIBUNWIND_SRC}/aarch64/getcontext.S + ${LIBUNWIND_SRC}/aarch64/Lapply_reg_state.c + ${LIBUNWIND_SRC}/aarch64/Lcreate_addr_space.c + ${LIBUNWIND_SRC}/aarch64/Lget_proc_info.c + ${LIBUNWIND_SRC}/aarch64/Lget_save_loc.c + ${LIBUNWIND_SRC}/aarch64/Lglobal.c + ${LIBUNWIND_SRC}/aarch64/Linit.c + ${LIBUNWIND_SRC}/aarch64/Linit_local.c + ${LIBUNWIND_SRC}/aarch64/Linit_remote.c + ${LIBUNWIND_SRC}/aarch64/Lis_signal_frame.c + ${LIBUNWIND_SRC}/aarch64/Lregs.c + ${LIBUNWIND_SRC}/aarch64/Lreg_states_iterate.c + ${LIBUNWIND_SRC}/aarch64/Lresume.c + ${LIBUNWIND_SRC}/aarch64/Lstash_frame.c + ${LIBUNWIND_SRC}/aarch64/Lstep.c + ${LIBUNWIND_SRC}/aarch64/Ltrace.c + ${LIBUNWIND_SRC}/aarch64/Lstrip_ptrauth_insn_mask.c + ) +elseif(UNWIND_ARCH STREQUAL "x86") + set(UNWIND_ARCH_SOURCES + # common + ${LIBUNWIND_SRC}/x86/is_fpreg.c + ${LIBUNWIND_SRC}/x86/regname.c + # os_local (Linux) + ${LIBUNWIND_SRC}/x86/Los-linux.c + ${LIBUNWIND_SRC}/x86/getcontext-linux.S + # arch-specific local + ${LIBUNWIND_SRC}/x86/Lapply_reg_state.c + ${LIBUNWIND_SRC}/x86/Lcreate_addr_space.c + ${LIBUNWIND_SRC}/x86/Lget_proc_info.c + ${LIBUNWIND_SRC}/x86/Lget_save_loc.c + ${LIBUNWIND_SRC}/x86/Lglobal.c + ${LIBUNWIND_SRC}/x86/Linit.c + ${LIBUNWIND_SRC}/x86/Linit_local.c + ${LIBUNWIND_SRC}/x86/Linit_remote.c + ${LIBUNWIND_SRC}/x86/Lregs.c + ${LIBUNWIND_SRC}/x86/Lreg_states_iterate.c + ${LIBUNWIND_SRC}/x86/Lresume.c + ${LIBUNWIND_SRC}/x86/Lstep.c + ) +endif() + +add_library(unwind STATIC + ${UNWIND_COMMON_SOURCES} + ${UNWIND_LOCAL_SOURCES} + ${UNWIND_DWARF_LOCAL_SOURCES} + ${UNWIND_ELF_SOURCES} + ${UNWIND_ARCH_SOURCES} +) + +# Generate config.h +include(CheckIncludeFile) +include(CheckSymbolExists) +include(CheckStructHasMember) +include(CheckFunctionExists) + +check_include_file("asm/ptrace.h" HAVE_ASM_PTRACE_H) +check_include_file("byteswap.h" HAVE_BYTESWAP_H) +check_include_file("elf.h" HAVE_ELF_H) +check_include_file("endian.h" HAVE_ENDIAN_H) +check_include_file("execinfo.h" HAVE_EXECINFO_H) +check_include_file("link.h" HAVE_LINK_H) +check_include_file("signal.h" HAVE_SIGNAL_H) +check_include_file("sys/ptrace.h" HAVE_SYS_PTRACE_H) +check_include_file("sys/syscall.h" HAVE_SYS_SYSCALL_H) +check_include_file("sys/types.h" HAVE_SYS_TYPES_H) +check_include_file("sys/stat.h" HAVE_SYS_STAT_H) +check_include_file("sys/param.h" HAVE_SYS_PARAM_H) +check_include_file("sys/procfs.h" HAVE_SYS_PROCFS_H) +check_function_exists(dl_iterate_phdr HAVE_DL_ITERATE_PHDR) +check_function_exists(mincore HAVE_MINCORE) +check_function_exists(pipe2 HAVE_PIPE2) +check_function_exists(sigaltstack HAVE_SIGALTSTACK) + +check_struct_has_member("struct dl_phdr_info" dlpi_subs "link.h" HAVE_STRUCT_DL_PHDR_INFO_DLPI_SUBS) + +# Check for PTRACE declarations +include(CheckCSourceCompiles) +foreach(_ptrace_sym PTRACE_CONT PTRACE_POKEDATA PTRACE_POKEUSER PTRACE_SETREGSET PTRACE_SINGLESTEP PTRACE_SYSCALL PTRACE_TRACEME) + check_c_source_compiles(" + #include + int main() { int x = ${_ptrace_sym}; return x; } + " HAVE_DECL_${_ptrace_sym}_VAL) + if(HAVE_DECL_${_ptrace_sym}_VAL) + set(HAVE_DECL_${_ptrace_sym} 1) + else() + set(HAVE_DECL_${_ptrace_sym} 0) + endif() +endforeach() + +# Configure config.h +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.h.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/include/config.h" +) + +# Configure libunwind-common.h +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/libunwind-common.h.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/include/libunwind-common.h" +) + +target_include_directories(unwind + PRIVATE + ${CMAKE_CURRENT_BINARY_DIR}/include + ${LIBUNWIND_INC} + ${LIBUNWIND_SRC} + PUBLIC + $ + $ +) + +# tdep symlinks/includes - libunwind uses tdep- as tdep +if(UNWIND_ARCH STREQUAL "x86_64") + target_include_directories(unwind PRIVATE ${LIBUNWIND_INC}/tdep-x86_64) + target_compile_definitions(unwind PRIVATE UNW_TARGET_X86_64=1) +elseif(UNWIND_ARCH STREQUAL "aarch64") + target_include_directories(unwind PRIVATE ${LIBUNWIND_INC}/tdep-aarch64) + target_compile_definitions(unwind PRIVATE UNW_TARGET_AARCH64=1) +elseif(UNWIND_ARCH STREQUAL "x86") + target_include_directories(unwind PRIVATE ${LIBUNWIND_INC}/tdep-x86) + target_compile_definitions(unwind PRIVATE UNW_TARGET_X86=1) +endif() + +target_compile_definitions(unwind PRIVATE + HAVE_CONFIG_H + _GNU_SOURCE +) + +set_target_properties(unwind PROPERTIES + C_STANDARD 99 + POSITION_INDEPENDENT_CODE ON +) + +# Suppress warnings in vendored code +if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") + target_compile_options(unwind PRIVATE -w) +endif() + +target_link_libraries(unwind PRIVATE ${CMAKE_DL_LIBS} pthread) diff --git a/vendor/libunwind/COPYING b/vendor/libunwind/COPYING new file mode 100644 index 0000000000..41e7d8a6fd --- /dev/null +++ b/vendor/libunwind/COPYING @@ -0,0 +1,20 @@ +Copyright (c) 2002 Hewlett-Packard Co. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/libunwind/ChangeLog b/vendor/libunwind/ChangeLog new file mode 100644 index 0000000000..8713adc8ef --- /dev/null +++ b/vendor/libunwind/ChangeLog @@ -0,0 +1,7 @@ +*********************************************************** + +Discontinued. See git log instead at + + https://github.com/libunwind/libunwind/commits/master + +*********************************************************** diff --git a/vendor/libunwind/INSTALL b/vendor/libunwind/INSTALL new file mode 100644 index 0000000000..e82fd21de2 --- /dev/null +++ b/vendor/libunwind/INSTALL @@ -0,0 +1,368 @@ +Installation Instructions +************************* + + Copyright (C) 1994-1996, 1999-2002, 2004-2017, 2020-2021 Free +Software Foundation, Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell command './configure && make && make install' +should configure, build, and install this package. The following +more-detailed instructions are generic; see the 'README' file for +instructions specific to this package. Some packages provide this +'INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The 'configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a 'Makefile' in each directory of the package. +It may also create one or more '.h' files containing system-dependent +definitions. Finally, it creates a shell script 'config.status' that +you can run in the future to recreate the current configuration, and a +file 'config.log' containing compiler output (useful mainly for +debugging 'configure'). + + It can also use an optional file (typically called 'config.cache' and +enabled with '--cache-file=config.cache' or simply '-C') that saves the +results of its tests to speed up reconfiguring. Caching is disabled by +default to prevent problems with accidental use of stale cache files. + + If you need to do unusual things to compile the package, please try +to figure out how 'configure' could check whether to do them, and mail +diffs or instructions to the address given in the 'README' so they can +be considered for the next release. If you are using the cache, and at +some point 'config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file 'configure.ac' (or 'configure.in') is used to create +'configure' by a program called 'autoconf'. You need 'configure.ac' if +you want to change it or regenerate 'configure' using a newer version of +'autoconf'. + + The simplest way to compile this package is: + + 1. 'cd' to the directory containing the package's source code and type + './configure' to configure the package for your system. + + Running 'configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type 'make' to compile the package. + + 3. Optionally, type 'make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type 'make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the 'make install' phase executed with root + privileges. + + 5. Optionally, type 'make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior 'make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing 'make clean'. To also remove the + files that 'configure' created (so you can compile the package for + a different kind of computer), type 'make distclean'. There is + also a 'make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type 'make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide 'make + distcheck', which can by used by developers to test that all other + targets like 'make install' and 'make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the 'configure' script does not know about. Run './configure --help' +for details on some of the pertinent environment variables. + + You can give 'configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here is +an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU 'make'. 'cd' to the +directory where you want the object files and executables to go and run +the 'configure' script. 'configure' automatically checks for the source +code in the directory that 'configure' is in and in '..'. This is known +as a "VPATH" build. + + With a non-GNU 'make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use 'make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple '-arch' options to the +compiler but only a single '-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the 'lipo' tool if you have problems. + +Installation Names +================== + + By default, 'make install' installs the package's commands under +'/usr/local/bin', include files under '/usr/local/include', etc. You +can specify an installation prefix other than '/usr/local' by giving +'configure' the option '--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option '--exec-prefix=PREFIX' to 'configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like '--bindir=DIR' to specify different values for particular +kinds of files. Run 'configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the default +for these options is expressed in terms of '${prefix}', so that +specifying just '--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to 'configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +'make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, 'make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +'${prefix}'. Any directories that were specified during 'configure', +but not in terms of '${prefix}', must each be overridden at install time +for the entire installation to be relocated. The approach of makefile +variable overrides for each directory variable is required by the GNU +Coding Standards, and ideally causes no recompilation. However, some +platforms have known limitations with the semantics of shared libraries +that end up requiring recompilation when using this method, particularly +noticeable in packages that use GNU Libtool. + + The second method involves providing the 'DESTDIR' variable. For +example, 'make install DESTDIR=/alternate/directory' will prepend +'/alternate/directory' before all installation names. The approach of +'DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of '${prefix}' +at 'configure' time. + +Optional Features +================= + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving 'configure' the +option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. + + Some packages pay attention to '--enable-FEATURE' options to +'configure', where FEATURE indicates an optional part of the package. +They may also pay attention to '--with-PACKAGE' options, where PACKAGE +is something like 'gnu-as' or 'x' (for the X Window System). The +'README' should mention any '--enable-' and '--with-' options that the +package recognizes. + + For packages that use the X Window System, 'configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the 'configure' options '--x-includes=DIR' and +'--x-libraries=DIR' to specify their locations. + + Some packages offer the ability to configure how verbose the +execution of 'make' will be. For these packages, running './configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with 'make V=1'; while running './configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with 'make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC +is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + HP-UX 'make' updates targets which have the same timestamps as their +prerequisites, which makes it generally unusable when shipped generated +files such as 'configure' are involved. Use GNU 'make' instead. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its '' header file. The option '-nodtk' can be used as a +workaround. If GNU CC is not installed, it is therefore recommended to +try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put '/usr/ucb' early in your 'PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in '/usr/bin'. So, if you need '/usr/ucb' +in your 'PATH', put it _after_ '/usr/bin'. + + On Haiku, software installed for all users goes in '/boot/common', +not '/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features 'configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, 'configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +'--build=TYPE' option. TYPE can either be a short name for the system +type, such as 'sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file 'config.sub' for the possible values of each field. If +'config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option '--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with '--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for 'configure' scripts to share, +you can create a site shell script called 'config.site' that gives +default values for variables like 'CC', 'cache_file', and 'prefix'. +'configure' looks for 'PREFIX/share/config.site' if it exists, then +'PREFIX/etc/config.site' if it exists. Or, you can set the +'CONFIG_SITE' environment variable to the location of the site script. +A warning: not all 'configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to 'configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the 'configure' command line, using 'VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified 'gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an +Autoconf limitation. Until the limitation is lifted, you can use this +workaround: + + CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash + +'configure' Invocation +====================== + + 'configure' recognizes the following options to control how it +operates. + +'--help' +'-h' + Print a summary of all of the options to 'configure', and exit. + +'--help=short' +'--help=recursive' + Print a summary of the options unique to this package's + 'configure', and exit. The 'short' variant lists options used only + in the top level, while the 'recursive' variant lists options also + present in any nested packages. + +'--version' +'-V' + Print the version of Autoconf used to generate the 'configure' + script, and exit. + +'--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally 'config.cache'. FILE defaults to '/dev/null' to + disable caching. + +'--config-cache' +'-C' + Alias for '--cache-file=config.cache'. + +'--quiet' +'--silent' +'-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to '/dev/null' (any error + messages will still be shown). + +'--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + 'configure' can determine that directory automatically. + +'--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: for + more details, including other options available for fine-tuning the + installation locations. + +'--no-create' +'-n' + Run the configure checks, but stop before creating any output + files. + +'configure' also accepts some other, not widely useful, options. Run +'configure --help' for more details. diff --git a/vendor/libunwind/Makefile.am b/vendor/libunwind/Makefile.am new file mode 100644 index 0000000000..0ce5128af4 --- /dev/null +++ b/vendor/libunwind/Makefile.am @@ -0,0 +1,123 @@ +ACLOCAL_AMFLAGS = -I m4 +include_HEADERS = include/libunwind-dynamic.h + +if BUILD_PTRACE +include_HEADERS += include/libunwind-ptrace.h +endif BUILD_PTRACE + +if BUILD_COREDUMP +include_HEADERS += include/libunwind-coredump.h +endif BUILD_COREDUMP +if BUILD_NTO +include_HEADERS += include/libunwind-nto.h +endif BUILD_NTO +if ARCH_AARCH64 +include_HEADERS += include/libunwind-aarch64.h +endif +if ARCH_ARM +include_HEADERS += include/libunwind-arm.h +endif +if ARCH_IA64 +include_HEADERS += include/libunwind-ia64.h +endif +if ARCH_HPPA +include_HEADERS += include/libunwind-hppa.h +endif +if ARCH_MIPS +include_HEADERS += include/libunwind-mips.h +endif +if ARCH_X86 +include_HEADERS += include/libunwind-x86.h +endif +if ARCH_X86_64 +include_HEADERS += include/libunwind-x86_64.h +endif +if ARCH_PPC32 +include_HEADERS += include/libunwind-ppc32.h +endif +if ARCH_PPC64 +include_HEADERS += include/libunwind-ppc64.h +endif +if ARCH_SH +include_HEADERS += include/libunwind-sh.h +endif +if ARCH_S390X +include_HEADERS += include/libunwind-s390x.h +endif +if ARCH_RISCV +include_HEADERS += include/libunwind-riscv.h +endif +if ARCH_LOONGARCH64 +include_HEADERS += include/libunwind-loongarch64.h +endif + +if !REMOTE_ONLY +include_HEADERS += include/libunwind.h +if BUILD_UNWIND_HEADER +include_HEADERS += include/unwind.h +endif +endif + +nodist_include_HEADERS = include/libunwind-common.h + +SUBDIRS = src + +if CONFIG_TESTS +SUBDIRS += tests +endif + +if CONFIG_DOCS +SUBDIRS += doc +endif + +noinst_HEADERS = include/dwarf.h include/dwarf_i.h include/dwarf-eh.h \ + include/compiler.h include/libunwind_i.h include/mempool.h \ + include/remote.h \ + include/tdep-aarch64/dwarf-config.h \ + include/tdep-aarch64/jmpbuf.h \ + include/tdep-aarch64/libunwind_i.h \ + include/tdep-arm/dwarf-config.h include/tdep-arm/ex_tables.h \ + include/tdep-arm/jmpbuf.h include/tdep-arm/libunwind_i.h \ + include/tdep-ia64/jmpbuf.h include/tdep-ia64/rse.h \ + include/tdep-ia64/libunwind_i.h include/tdep-ia64/script.h \ + include/tdep-hppa/libunwind_i.h \ + include/tdep-hppa/jmpbuf.h include/tdep-hppa/dwarf-config.h \ + include/tdep-mips/libunwind_i.h \ + include/tdep-mips/jmpbuf.h include/tdep-mips/dwarf-config.h \ + include/tdep-x86/libunwind_i.h \ + include/tdep-x86/jmpbuf.h include/tdep-x86/dwarf-config.h \ + include/tdep-x86_64/libunwind_i.h \ + include/tdep-x86_64/jmpbuf.h include/tdep-x86_64/dwarf-config.h \ + include/tdep-ppc32/dwarf-config.h \ + include/tdep-ppc32/jmpbuf.h include/tdep-ppc32/libunwind_i.h \ + include/tdep-ppc64/dwarf-config.h \ + include/tdep-ppc64/jmpbuf.h include/tdep-ppc64/libunwind_i.h \ + include/tdep-sh/dwarf-config.h \ + include/tdep-sh/jmpbuf.h include/tdep-sh/libunwind_i.h \ + include/tdep-s390x/dwarf-config.h \ + include/tdep-s390x/jmpbuf.h include/tdep-s390x/libunwind_i.h \ + include/tdep-riscv/dwarf-config.h \ + include/tdep-riscv/jmpbuf.h include/tdep-riscv/libunwind_i.h \ + include/tdep-loongarch64/dwarf-config.h \ + include/tdep-loongarch64/jmpbuf.h \ + include/tdep-loongarch64/libunwind_i.h \ + include/tdep/libunwind_i.h \ + include/tdep/jmpbuf.h include/tdep/dwarf-config.h + +EXTRA_DIST = include/libunwind-common.h.in + +MAINTAINERCLEANFILES = \ + Makefile.in \ + INSTALL \ + aclocal.m4 \ + configure \ + config/compile \ + config/config.guess \ + config/config.sub \ + config/depcomp \ + config/install-sh \ + config/ltmain.sh \ + config/missing \ + include/config.h.in \ + include/config.h.in~ + diff --git a/vendor/libunwind/Makefile.in b/vendor/libunwind/Makefile.in new file mode 100644 index 0000000000..2f2d790143 --- /dev/null +++ b/vendor/libunwind/Makefile.in @@ -0,0 +1,1050 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +@BUILD_PTRACE_TRUE@am__append_1 = include/libunwind-ptrace.h +@BUILD_COREDUMP_TRUE@am__append_2 = include/libunwind-coredump.h +@BUILD_NTO_TRUE@am__append_3 = include/libunwind-nto.h +@ARCH_AARCH64_TRUE@am__append_4 = include/libunwind-aarch64.h +@ARCH_ARM_TRUE@am__append_5 = include/libunwind-arm.h +@ARCH_IA64_TRUE@am__append_6 = include/libunwind-ia64.h +@ARCH_HPPA_TRUE@am__append_7 = include/libunwind-hppa.h +@ARCH_MIPS_TRUE@am__append_8 = include/libunwind-mips.h +@ARCH_X86_TRUE@am__append_9 = include/libunwind-x86.h +@ARCH_X86_64_TRUE@am__append_10 = include/libunwind-x86_64.h +@ARCH_PPC32_TRUE@am__append_11 = include/libunwind-ppc32.h +@ARCH_PPC64_TRUE@am__append_12 = include/libunwind-ppc64.h +@ARCH_SH_TRUE@am__append_13 = include/libunwind-sh.h +@ARCH_S390X_TRUE@am__append_14 = include/libunwind-s390x.h +@ARCH_RISCV_TRUE@am__append_15 = include/libunwind-riscv.h +@ARCH_LOONGARCH64_TRUE@am__append_16 = include/libunwind-loongarch64.h +@REMOTE_ONLY_FALSE@am__append_17 = include/libunwind.h +@BUILD_UNWIND_HEADER_TRUE@@REMOTE_ONLY_FALSE@am__append_18 = include/unwind.h +@CONFIG_TESTS_TRUE@am__append_19 = tests +@CONFIG_DOCS_TRUE@am__append_20 = doc +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__include_HEADERS_DIST) \ + $(noinst_HEADERS) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/config.h +CONFIG_CLEAN_FILES = include/libunwind-common.h include/libunwind.h \ + include/tdep/libunwind_i.h src/unwind/libunwind.pc \ + src/coredump/libunwind-coredump.pc \ + src/ptrace/libunwind-ptrace.pc src/setjmp/libunwind-setjmp.pc +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__include_HEADERS_DIST = include/libunwind-dynamic.h \ + include/libunwind-ptrace.h include/libunwind-coredump.h \ + include/libunwind-nto.h include/libunwind-aarch64.h \ + include/libunwind-arm.h include/libunwind-ia64.h \ + include/libunwind-hppa.h include/libunwind-mips.h \ + include/libunwind-x86.h include/libunwind-x86_64.h \ + include/libunwind-ppc32.h include/libunwind-ppc64.h \ + include/libunwind-sh.h include/libunwind-s390x.h \ + include/libunwind-riscv.h include/libunwind-loongarch64.h \ + include/libunwind.h include/unwind.h +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)" +HEADERS = $(include_HEADERS) $(nodist_include_HEADERS) \ + $(noinst_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir distdir-am dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +DIST_SUBDIRS = src tests doc +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/ar-lib \ + $(top_srcdir)/config/compile $(top_srcdir)/config/config.guess \ + $(top_srcdir)/config/config.sub \ + $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ + $(top_srcdir)/config/missing $(top_srcdir)/include/config.h.in \ + $(top_srcdir)/include/libunwind-common.h.in \ + $(top_srcdir)/include/libunwind.h.in \ + $(top_srcdir)/include/tdep/libunwind_i.h.in \ + $(top_srcdir)/src/coredump/libunwind-coredump.pc.in \ + $(top_srcdir)/src/ptrace/libunwind-ptrace.pc.in \ + $(top_srcdir)/src/setjmp/libunwind-setjmp.pc.in \ + $(top_srcdir)/src/unwind/libunwind.pc.in AUTHORS COPYING \ + ChangeLog INSTALL NEWS README TODO config/ar-lib \ + config/compile config/config.guess config/config.sub \ + config/install-sh config/ltmain.sh config/missing +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +ARCH = @ARCH@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BACKTRACELIB = @BACKTRACELIB@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLIB = @DLLIB@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LATEX2MAN = @LATEX2MAN@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_NOSTARTFILES = @LDFLAGS_NOSTARTFILES@ +LDFLAGS_STATIC_LIBCXA = @LDFLAGS_STATIC_LIBCXA@ +LIBLZMA = @LIBLZMA@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBZ = @LIBZ@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_EXTRA = @PKG_EXTRA@ +PKG_MAINTAINER = @PKG_MAINTAINER@ +PKG_MAJOR = @PKG_MAJOR@ +PKG_MINOR = @PKG_MINOR@ +PTHREADS_LIB = @PTHREADS_LIB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UNW_CRT_LDFLAGS = @UNW_CRT_LDFLAGS@ +UNW_CRT_LIBADD = @UNW_CRT_LIBADD@ +UNW_TESTDRIVER = @UNW_TESTDRIVER@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +arch = @arch@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_arch = @build_arch@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +enable_cxx_exceptions = @enable_cxx_exceptions@ +enable_debug_frame = @enable_debug_frame@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +ACLOCAL_AMFLAGS = -I m4 +include_HEADERS = include/libunwind-dynamic.h $(am__append_1) \ + $(am__append_2) $(am__append_3) $(am__append_4) \ + $(am__append_5) $(am__append_6) $(am__append_7) \ + $(am__append_8) $(am__append_9) $(am__append_10) \ + $(am__append_11) $(am__append_12) $(am__append_13) \ + $(am__append_14) $(am__append_15) $(am__append_16) \ + $(am__append_17) $(am__append_18) +nodist_include_HEADERS = include/libunwind-common.h +SUBDIRS = src $(am__append_19) $(am__append_20) +noinst_HEADERS = include/dwarf.h include/dwarf_i.h include/dwarf-eh.h \ + include/compiler.h include/libunwind_i.h include/mempool.h \ + include/remote.h \ + include/tdep-aarch64/dwarf-config.h \ + include/tdep-aarch64/jmpbuf.h \ + include/tdep-aarch64/libunwind_i.h \ + include/tdep-arm/dwarf-config.h include/tdep-arm/ex_tables.h \ + include/tdep-arm/jmpbuf.h include/tdep-arm/libunwind_i.h \ + include/tdep-ia64/jmpbuf.h include/tdep-ia64/rse.h \ + include/tdep-ia64/libunwind_i.h include/tdep-ia64/script.h \ + include/tdep-hppa/libunwind_i.h \ + include/tdep-hppa/jmpbuf.h include/tdep-hppa/dwarf-config.h \ + include/tdep-mips/libunwind_i.h \ + include/tdep-mips/jmpbuf.h include/tdep-mips/dwarf-config.h \ + include/tdep-x86/libunwind_i.h \ + include/tdep-x86/jmpbuf.h include/tdep-x86/dwarf-config.h \ + include/tdep-x86_64/libunwind_i.h \ + include/tdep-x86_64/jmpbuf.h include/tdep-x86_64/dwarf-config.h \ + include/tdep-ppc32/dwarf-config.h \ + include/tdep-ppc32/jmpbuf.h include/tdep-ppc32/libunwind_i.h \ + include/tdep-ppc64/dwarf-config.h \ + include/tdep-ppc64/jmpbuf.h include/tdep-ppc64/libunwind_i.h \ + include/tdep-sh/dwarf-config.h \ + include/tdep-sh/jmpbuf.h include/tdep-sh/libunwind_i.h \ + include/tdep-s390x/dwarf-config.h \ + include/tdep-s390x/jmpbuf.h include/tdep-s390x/libunwind_i.h \ + include/tdep-riscv/dwarf-config.h \ + include/tdep-riscv/jmpbuf.h include/tdep-riscv/libunwind_i.h \ + include/tdep-loongarch64/dwarf-config.h \ + include/tdep-loongarch64/jmpbuf.h \ + include/tdep-loongarch64/libunwind_i.h \ + include/tdep/libunwind_i.h \ + include/tdep/jmpbuf.h include/tdep/dwarf-config.h + +EXTRA_DIST = include/libunwind-common.h.in +MAINTAINERCLEANFILES = \ + Makefile.in \ + INSTALL \ + aclocal.m4 \ + configure \ + config/compile \ + config/config.guess \ + config/config.sub \ + config/depcomp \ + config/install-sh \ + config/ltmain.sh \ + config/missing \ + include/config.h.in \ + include/config.h.in~ + +all: all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +include/config.h: include/stamp-h1 + @test -f $@ || rm -f include/stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) include/stamp-h1 + +include/stamp-h1: $(top_srcdir)/include/config.h.in $(top_builddir)/config.status + @rm -f include/stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status include/config.h +$(top_srcdir)/include/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f include/stamp-h1 + touch $@ + +distclean-hdr: + -rm -f include/config.h include/stamp-h1 +include/libunwind-common.h: $(top_builddir)/config.status $(top_srcdir)/include/libunwind-common.h.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +include/libunwind.h: $(top_builddir)/config.status $(top_srcdir)/include/libunwind.h.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +include/tdep/libunwind_i.h: $(top_builddir)/config.status $(top_srcdir)/include/tdep/libunwind_i.h.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +src/unwind/libunwind.pc: $(top_builddir)/config.status $(top_srcdir)/src/unwind/libunwind.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +src/coredump/libunwind-coredump.pc: $(top_builddir)/config.status $(top_srcdir)/src/coredump/libunwind-coredump.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +src/ptrace/libunwind-ptrace.pc: $(top_builddir)/config.status $(top_srcdir)/src/ptrace/libunwind-ptrace.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +src/setjmp/libunwind-setjmp.pc: $(top_builddir)/config.status $(top_srcdir)/src/setjmp/libunwind-setjmp.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt +install-includeHEADERS: $(include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ + done + +uninstall-includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) +install-nodist_includeHEADERS: $(nodist_include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ + done + +uninstall-nodist_includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile $(HEADERS) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-includeHEADERS install-nodist_includeHEADERS + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-includeHEADERS uninstall-nodist_includeHEADERS + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + clean-libtool cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ + dist-xz dist-zip dist-zstd distcheck distclean \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-includeHEADERS install-info install-info-am \ + install-man install-nodist_includeHEADERS install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-includeHEADERS \ + uninstall-nodist_includeHEADERS + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/vendor/libunwind/NEWS b/vendor/libunwind/NEWS new file mode 100644 index 0000000000..adf449ed7f --- /dev/null +++ b/vendor/libunwind/NEWS @@ -0,0 +1,247 @@ +-*-Mode: outline-*- + +* News for v1.3: + +** Iteration of unwind register states support + Doug Moore +** Freebsd/Armv6 support + Konstantin Belousov +** Many, many dwarf bugfixes +** Mips remote unwind support +** aarch64 ptrace support + +* News for v1.2: + +** aarch64 port +** dwarf parsing improvements +** Fast stacktraces for aarch64 & arm +** tilegx port +** powerpc64 port + +* News for v1.1: + +** coredump unwind support +** New arch: SuperH +** Improved support for PowerPC, ARM +** Lots of cleanups, perf tweaks +** pkg-config support + +* News for v1.0: + +** Fast unwind (rbp, rsp, rip only) on x86_64 with a fallback to + slow code path (Lassi Tuura) +** Improved local and remote unwinding on ARM (Ken Werner) +** Testing, stability and many fixes on x86 (Paul Pluzhnikov) +** FreeBSD port and clean separation of OS specific bits + (Konstantin Belousov) +** Thanks for all the bug reports, contributions and testing! + +* News for v0.99: + +** Greatly improved x86-64 support thanks to Arun Sharma. +** Support for PPC64 added by Jose Flavio Aguilar Paulino. + +* News for v0.98.6: + +** Fix address-leak triggered by invalid byte-order. Fixed by Andreas Schwab. +** On ia64, get_static_proc_name() no longer uses a weak reference to + _Uelf64_get_proc_name(), since that was causing problems with archive + libraries and no longer served any apparent purpose. Fixed by + Curt Wohlgemuth. + +* News for v0.98.5: + +** Fix a typo in the man-page of unw_create_addr_space(). +** Fix an off-by-1 bug in the handling of the dynamic ALIAS directive + for ia64. Reported by Todd L. Miller. +** Fix a bug in libunwind-ptrace which could cause crash due to extraneous + munmap() calls. + +* News for v0.98.4: + +** Fix a typo in _ReadSLEB.c which caused hangs when throwing exceptions + from Intel ICC-compiled programs. Reported by Tommy Hoffner. + +* News for v0.98.3: + +** Make it possible to link against libunwind-ia64.a only (i.e., without + requiring libunwind.a as well). This keeps apps which need only + remote unwinding cleaner, since they logically have no dependency + on libunwind.a. +** Dont link against libatomic_ops for now. Due to a packaging bug on + Debian, linking against this library causes libunwind.so to get + a dependency on libatomic_ops.so, which is not at all what we want. + Fortunately, we don't have to link against that library on x86 or + ia64 since the library is strictly needed only for platforms with + poor atomic operation support. Once the libatomic_ops package is fixed, + we can re-enable linking against libatomic_ops. + +* News for v0.98.2: + +** Fixed bug which caused _UPT_get_dyn_info_list_addr() to sometimes fail + needlessly. Found by Todd L. Miller. + +** When using GCC to build libunwind on ia64, libunwind.so had an + unresolved reference to __divdi3. This is undesirable since it + creates an implicit dependency on libgcc. This problem has been + fixed in the 0.98.2 release by explicitly linking against libgcc.a + when building libunwind. + +* News for v0.98.1: + +** Fixed a bug which caused "make install" to install libunwind-common.h.in + instead of libunwind-common.h. +** Fixed a bug in the ia64 {sig,}longjmp() which showed on + SuSE Linux 9 because it's using a newer compiler & the EPC-based system + call stubs. +** Fixed incorrect offsets in tests/ia64-test-nat-asm.S. + Warning: you'll need a GNU assembler dated later than 21-Sep-2004 to + get this file translated correctly. With an old assembler, "make check" + will get lots of failures when running Gia64-test-nat or Lia64-test-nat! +** Convert tests/bt into a full-blown test-case. It's designed to + trigger a (rarely-encountered) bug in the GNU assembler on ia64. + The assembler has been fixed and once the libraries (libc etc) + have been rebuilt, this test will pass. +** Added test-case tests/run-ptrace-misc which, on ia64, triggers a bug in + current GCC (including v3.4.2) which causes bad unwind info. + +* News for v0.98: + +** Update libunwind to be compliant with the updated/expanded + ia64 unwind specification by HJ Lu [1]. This is needed for + GCC 3.4 compatibility. + + [1] http://www.kernel.org/pub/linux/devel/gcc/unwind/ + +** Initial support for x86-64 has been added courtesy of Max Asbock. + Along with this came a bunch of DWARF2 unwinder fixes. + +** A new routine unw_strerror() has been added courtesy of + Thomas Hallgren. + +** Including now defines 4 macros that can be used + to determine the version number of libunwind. Specifically, + UNW_VERSION_MAJOR, UNW_VERSION_MINOR, UNW_VERSION, and + UNW_VERSION_CODE are defined by the header now. + +** Bug fixes +*** Fix a memory-leak in _UPT_get_dyn_info_list_addr() courtesy of Ed Connell. +*** Fix a crash in libunwind-ptrace courtesy of Mark Young. +*** Fix a bug in ia64-version of unw_init_remote() which prevented + it from working correctly for the local address space. Reported by + Troy Heber. +*** Many other small and not so small fixes. + +* News for v0.97: + +** unw_get_proc_name() may now be called from signal-handler. + +** The ptrace-helper routines are now declared in libunwind-ptrace.h. + Applications which use ptrace-based unwinding should include + to get the _UPT_*() routines declared. + +** libunwind has been split into a "local-only" and a "generic" versions. + The former is optimized for local unwinding (within a process) and + is called libunwind.so (shared version) or libunwind.a (archive + version). The generic version is not limited to unwinding within a + process and is called libunwind-generic.so (shared version) + libunwind-generic.a (archive version). Similarly, the ptrace() + support has been separated out into a convenience library called + libunwind-ptrace.a. For the most part, backwards-compatibility + is retained. However, when building an application which uses + libunwind, it may be necessary to change the linker command-line + as shown in the table below: + + Application which does: Before v0.97: With v0.97: + ----------------------- ------------- ----------- + local unwinding only: -lunwind -lunwind + remote unwinding: -lunwind -lunwind-generic + cross unwinding: -lunwind-PLAT -lunwind-PLAT + ptrace-based unwinding: -lunwind -lunwind-ptrace -lunwind-generic + + The motivation for this splitting is to keep libunwind.so as minimal + as possible. This library will eventually be loaded by most (if not + all) executables and hence it is important to ensure that it can + be loaded as quickly as possible. + +** unw_getcontext() tuned on IA-64. + + The unw_getcontext() routine used to be provided by (GNU) libc + (getcontext()). This caused unnecessary overhead (e.g., an + unnecessary system-call to sigprocmask()). The new + unw_getcontext() only does the work really needed for libunwind and + hence performs much better. However, this change implies that + programs linked against libunwind v0.97 won't be + backwards-compatible with earlier versions (there would be an + unresolved symbol for _Uia64_getcontext()). + +** Fix NaT-bit handling on IA-64. + + New test-cases have been added to test the handling of the NaT bit + (and floating-point NaT values) and all discovered/known bugs have + been fixed. + +** Initial DWARF-based unwinder for x86. + + There is a beginning for a DWARF-based unwinder for x86. Work for + x86-64-support based on this DWARF unwinder is currently underway + at IBM and it is expected that this support will be merged into the + official tree soon. + + +* News for v0.96: + +** _Unwind_*() routines defined by the C++ ABI are now included in + libunwind. + + +* News for v0.95: + +** Bigger, better, faster, or so the theory goes. + + +* News for v0.93: + +** More bug-fixes & improved HP-UX support. + + +* News for v0.92: + +** Bug-fix release. IA-64 unwinder can now be built with Intel compiler (ECC). + + +* News for v0.91: + +** Lots of documentation updates +** Some portability fixes. + + +* News for v0.9: + +** The libunwind API is mostly feature-complete at this point (hence the + version jump from v0.2 to v0.9). + + +* News for v0.2: + +** Automated configuration/build with autoconf and automake. +** Added support for building libunwind as a shared library. +** Added support for remote unwinding. +** Added support for cross-building. +** Added two new routines to the API: + - unw_is_fpreg() + - unw_get_save_loc() +** Added multi-architecture supports (lets a single application use + the unwind libraries for multiple target architectures; this is useful, + e.g., useful for building a debugger that can support multiple targets + such as x86, ia64, etc.) + + +* News for v0.1: + +** Added support for exception handling. + + +* News for v0.0: + +** It's a brand new package. diff --git a/vendor/libunwind/README b/vendor/libunwind/README new file mode 100644 index 0000000000..62b0cdc84c --- /dev/null +++ b/vendor/libunwind/README @@ -0,0 +1,204 @@ +# libunwind + +[![CI - Unix](https://github.com/libunwind/libunwind/actions/workflows/CI-unix.yml/badge.svg)](https://github.com/libunwind/libunwind/actions/workflows/CI-unix.yml) +[![CI - Windows](https://github.com/libunwind/libunwind/actions/workflows/CI-win.yml/badge.svg)](https://github.com/libunwind/libunwind/actions/workflows/CI-win.yml) + +This library supports several architecture/operating-system combinations: + +| System | Architecture | Status | +| :------ | :----------- | :----- | +| Linux | x86-64 | ✓ | +| Linux | x86 | ✓ | +| Linux | ARM | ✓ | +| Linux | AArch64 | ✓ | +| Linux | PPC32 | ✓ | +| Linux | PPC64 | ✓ | +| Linux | SuperH | ✓ | +| Linux | IA-64 | ✓ | +| Linux | PARISC | Works well, but C library missing unwind-info | +| Linux | MIPS | ✓ | +| Linux | RISC-V | 64-bit only | +| Linux | LoongArch | 64-bit only | +| HP-UX | IA-64 | Mostly works, but known to have serious limitations | +| FreeBSD | x86-64 | ✓ | +| FreeBSD | x86 | ✓ | +| FreeBSD | AArch64 | ✓ | +| FreeBSD | PPC32 | ✓ | +| FreeBSD | PPC64 | ✓ | +| QNX | Aarch64 | ✓ | +| QNX | x86-64 | ✓ | +| Solaris | x86-64 | ✓ | + +## Libc Requirements + +libunwind depends on getcontext(), setcontext() functions which are missing +from C libraries like musl-libc because they are considered to be "obsolescent" +API by POSIX document. The following table tries to track current status of +such dependencies + + - r, requires + - p, provides its own implementation + - empty, no requirement + +| Architecture | getcontext | setcontext | +|--------------|------------|------------| +| aarch64 | p | | +| arm | p | | +| hppa | p | p | +| ia64 | p | r | +| loongarch | p | | +| mips | p | | +| ppc32 | r | | +| ppc64 | r | r | +| riscv | p | p | +| s390x | p | p | +| sh | r | | +| x86 | p | r | +| x86_64 | p | p | + +## General Build Instructions + +In general, this library can be built and installed with the following +commands: + + $ autoreconf -i # Needed only for building from git. Depends on libtool. + $ ./configure --prefix=PREFIX + $ make + $ make install + +where `PREFIX` is the installation prefix. By default, a prefix of +`/usr/local` is used, such that `libunwind.a` is installed in +`/usr/local/lib` and `unwind.h` is installed in `/usr/local/include`. For +testing, you may want to use a prefix of `/usr/local` instead. + + +### Building with Intel compiler + +#### Version 8 and later + +Starting with version 8, the preferred name for the IA-64 Intel +compiler is `icc` (same name as on x86). Thus, the configure-line +should look like this: + + $ ./configure CC=icc CFLAGS="-g -O3 -ip" CXX=icc CCAS=gcc CCASFLAGS=-g \ + LDFLAGS="-L$PWD/src/.libs" + + +### Building on HP-UX + +For the time being, libunwind must be built with GCC on HP-UX. + +libunwind should be configured and installed on HP-UX like this: + + $ ./configure CFLAGS="-g -O2 -mlp64" CXXFLAGS="-g -O2 -mlp64" + +Caveat: Unwinding of 32-bit (ILP32) binaries is not supported at the moment. + +### Building for PowerPC64 / Linux + +For building for power64 you should use: + + $ ./configure CFLAGS="-g -O2 -m64" CXXFLAGS="-g -O2 -m64" + +If your power support altivec registers: + + $ ./configure CFLAGS="-g -O2 -m64 -maltivec" CXXFLAGS="-g -O2 -m64 -maltivec" + +To check if your processor has support for vector registers (altivec): + + cat /proc/cpuinfo | grep altivec + +and should have something like this: + + cpu : PPC970, altivec supported + +If libunwind seems to not work (backtracing failing), try to compile +it with `-O0`, without optimizations. There are some compiler problems +depending on the version of your gcc. + +### Building on FreeBSD + +General building instructions apply. To build and execute several tests +on older versions of FreeBSD, you need libexecinfo library available in +ports as devel/libexecinfo. This port has been removed as of 2017 and is +indeed no longer needed. + +## Regression Testing + +After building the library, you can run a set of regression tests with: + + $ make check + +### Expected results on x86 Linux + +The following tests are expected to fail on x86 Linux: + +* `test-ptrace` + +### Expected results on x86-64 Linux + +The following tests are expected to fail on x86-64 Linux: + +* `run-ptrace-misc` (see + and ) + +### Expected results on PARISC Linux + +The following tests are expected to fail on x86-64 Linux: + +* `Gtest-bt` (backtrace truncated at `kill()` due to lack of unwind-info) +* `Ltest-bt` (likewise) +* `Gtest-resume-sig` (`Gresume.c:my_rt_sigreturn()` is wrong somehow) +* `Ltest-resume-sig` (likewise) +* `Gtest-init` (likewise) +* `Ltest-init` (likewise) +* `Gtest-dyn1` (no dynamic unwind info support yet) +* `Ltest-dyn1` (no dynamic unwind info support yet) +* `test-setjmp` (`longjmp()` not implemented yet) +* `run-check-namespace` (toolchain doesn't support `HIDDEN` yet) + +### Expected results on HP-UX + +`make check` is currently unsupported for HP-UX. You can try to run +it, but most tests will fail (and some may fail to terminate). The +only test programs that are known to work at this time are: + +* `tests/bt` +* `tests/Gperf-simple` +* `tests/test-proc-info` +* `tests/test-static-link` +* `tests/Gtest-init` +* `tests/Ltest-init` +* `tests/Gtest-resume-sig` +* `tests/Ltest-resume-sig` + +### Expected results on PPC64 Linux + +`make check` should run with no more than 10 out of 24 tests failed. + +### Expected results on Solaris x86-64 + +`make check` is passing 27 out of 33 tests. The following six tests are consistently +failing: + +* `Gtest-concurrent` +* `Ltest-concurrent` +* `Ltest-init-local-signal` +* `Lrs-race` +* `test-setjmp` +* `x64-unwind-badjmp-signal-frame` + +## Performance Testing + +This distribution includes a few simple performance tests which give +some idea of the basic cost of various libunwind operations. After +building the library, you can run these tests with the following +commands: + + $ cd tests + $ make perf + +## Contacting the Developers + +Please raise issues and pull requests through the GitHub repository: +. diff --git a/vendor/libunwind/TODO b/vendor/libunwind/TODO new file mode 100644 index 0000000000..8b2e0262b0 --- /dev/null +++ b/vendor/libunwind/TODO @@ -0,0 +1,97 @@ +- Update the libunwind man page for the new/fixed cache-flushing behavior. + Effectively, that unw_flush_cache() doesn't have to be called by + applications except for extraordinary circumstances (e.g., if application + implements its own runtime loader). +- document split local-only/generic libraries and separate libunwind-ptrace.a + convenience-library +- document new "tdep" member in unw_proc_info_t structure +- for DWARF 2, use a dummy CIE entry with an augmentation that + provides the dyn-info-list-address + +=== taken care of: + +Testing: + + ensure that saving r4-r7 in a stacked register properly preserves + the NaT bit, even in the face of register-rotation + + ensure that IA64_INSN_MOVE_STACKED works correctly in the face of + register rotation + + on Linux, test access to f32-f127 in a signal handler (e.g., verify + that fph partition gets initialized properly) ++ According to Nicholas S. Wourms , adding this to the + Makefile.am: + AUTOMAKE_OPTIONS = 1.6 subdir-objects + ensures that object-files are build in separate subdirectories and that + in turn makes it possible for source files in different directories to + have the same filename, thus avoiding the need for those ugly -x86, -ia64, + etc., postfixes. ++ Switch ia64 (and rest over) to using Debug() instead of debug() ++ implement non-local versions of dwarf_readXX() ++ consolidate mostly architecture-independent code such as + unw_get_accessors() into shared files ++ caching is pretty fundamentally broken, what should happen is this: + o On unw_init_local()/unw_init_remote(), libunwind should validate + that the cached information is still valid and, if not, flush the + cache on its own. Rationale: once unw_init_local() has been + called, it is clear that the unwind info for the calling thread + cannot change (otherwise the program would be buggy anyhow) and + hence it is sufficient to validate the cache at this point. + Similarly, once unw_init_remote() has been called, the target + address space must have been stopped, because the unwinding would + otherwise be unreliable anyhow. + o glibc currently lacks a feature for dl_iterate_phdr() to support + safe caching; I proposed on 12/16/2003 that glibc maintain two + atomic counters which get inremented whenever something is added + to/removed from the dl_iterate_phdr-list. Once we have such counters, + we can use them in libunwind to implement an efficient version of a + cache-validation routine. + Once this has been fixed, update the libunwind man page accordingly. + Effectively, what this means is that unw_flush_cache() doesn't have + to be called by applications except for extraordinary circumstances + (e.g., if application implements its own runtime loader). ++ man-page for unw_is_fpreg() ++ man-page for _U_dyn_cancel() ++ man-page for _U_dyn_register() ++ global data is not protected by a lock; causes problems if two threads + call ia64_init() at almost the same time ++ cache the value of *cfm_loc; each rotate_FOO() call needs it! ++ implement the remote-lookup of the dynamic registration list ++ when doing sigreturn, must restore fp regs (and perhaps other regs) the same + way as the (user-level) gate.S sigreturn path does! ++ unw_resume() must at least restore gp (r1)! consider restoring all + scratch regs (but what's the performance impact on exception handling?); + alternative: restore scratch regs that may be used during procedure + call/return (e.g., r8-r11, f8-f11) ++ implement unw_resume() for the case where the current register frame is split + across multiple backing stores ++ document restricions on using unw_resume(): ++ implement remote cases of unw_resume() ++ test both with UNW_LOCAL_ONLY and without where this makes sense ++ allow region-length (insn_count) in unw_dyn_region_info_t to be negative + to indicate counting from the end of the procedure (to make it possible + for differently-sized procedures to share the same region list if they + share the same prologue/epilogue). ++ it appears that it is currently not possible to read register UNW_IA64_TP; + fix that => no, attempts to access r13 will result in access_reg() callbacks, + as desired; for local-case, access to r13 will fail though (since + getcontext() doesn't, and shouldn't, capture r13) ++ document the special nature of UNW_IA64_GP: read-only, but adjusted + automatically if the IP is changed ++ use pthread-mutexes where necessary, atomic ops where possible ++ man-page for unw_init_local() ++ man-page for unw_init_remote() ++ man-page for unw_create_addr_space() ++ man-page for unw_destroy_addr_space() ++ man-page for unw_get_proc_info() ++ man-page for unw_get_proc_name() ++ man-page for unw_get_accessors() ++ man-page for unw_regname() ++ man-page for unw_flush_cache() ++ man-page for unw_set_caching_policy() ++ man-page for unw_getcontext() ++ man-page for unw_is_signal_frame() ++ man-page for unw_step() ++ man-page for unw_get_reg() ++ man-page for unw_set_reg() ++ man-page for unw_get_fpreg() ++ man-page for unw_set_fpreg() ++ test with Intel compiler diff --git a/vendor/libunwind/VENDORING.md b/vendor/libunwind/VENDORING.md new file mode 100644 index 0000000000..499b914ac9 --- /dev/null +++ b/vendor/libunwind/VENDORING.md @@ -0,0 +1,151 @@ +# Vendored libunwind — Maintenance Notes + +## Source + +- **Upstream**: https://github.com/libunwind/libunwind +- **Version**: 1.8.3 (from the release tarball, *not* from the git repository) +- **Tarball**: https://github.com/libunwind/libunwind/releases/download/v1.8.3/libunwind-1.8.3.tar.gz + +## Purpose + +libunwind is vendored so the sentry-native SDK can perform stack unwinding on +Linux without requiring users to install any external packages. Only the +**local** unwinding functionality is needed. + +## Supported Architectures (built by CMake) + +| Architecture | `src/` dir | `include/tdep-*` dir | +|--------------------|----------------|-------------------------| +| x86_64 | `src/x86_64/` | `include/tdep-x86_64/` | +| x86 (i686, 32-bit) | `src/x86/` | `include/tdep-x86/` | +| aarch64 | `src/aarch64/` | `include/tdep-aarch64/` | + +Core shared code: `src/mi/`, `src/dwarf/`, `src/unwind/`, `src/os-linux.c`, +`src/dl-iterate-phdr.c`. + +## What Was Removed from the Release Tarball + +The release tarball contains 911 files. 547 were removed (the vendor tree +keeps 368 files, of which 4 are custom additions). Every removal falls into +one of four categories: + +### 1. Documentation & tests + +| Directory | Files | Reason | +|-----------|-------|--------------------------------------------------------| +| `doc/` | 84 | Man pages and LaTeX sources — not needed to build | +| `tests/` | 90 | Test suite — sentry-native has its own unwinding tests | + +### 2. Autotools / build scaffolding + +| Directory | Files | Reason | +|-----------|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `m4/` | 5 | Autotools M4 macros — the vendor uses a custom CMake build | +| `config/` | 9 | Generic autotools helper scripts (`ltmain.sh`, `config.guess`, `config.sub`, `install-sh`, `compile`, `depcomp`, `ar-lib`, `missing`, `test-driver`) — boilerplate regenerated by `autoreconf`, not useful as reference | + +### 3. Unsupported CPU architectures + +Source and include directories for architectures sentry-native does not target: + +| Architecture | Removed `src/` dir | Removed `include/tdep-*` dir | +|-----------------------|--------------------|------------------------------| +| HP PA-RISC | `src/hppa/` | `include/tdep-hppa/` | +| Intel Itanium (IA-64) | `src/ia64/` | `include/tdep-ia64/` | +| LoongArch 64 | `src/loongarch64/` | `include/tdep-loongarch64/` | +| MIPS | `src/mips/` | `include/tdep-mips/` | +| PowerPC (shared) | `src/ppc/` | — | +| PowerPC 32-bit | `src/ppc32/` | `include/tdep-ppc32/` | +| PowerPC 64-bit | `src/ppc64/` | `include/tdep-ppc64/` | +| IBM System/390 | `src/s390x/` | `include/tdep-s390x/` | +| SuperH | `src/sh/` | `include/tdep-sh/` | + +### 4. Unused feature modules + +These are separate `libunwind` "accessor" libraries for non-local unwinding use +cases. sentry-native only uses local unwinding (unwinding the current process +in-process), so none of these are needed: + +| Directory | Purpose | Why removed | +|-----------------|-------------------------------------|-----------------------------------| +| `src/coredump/` | Unwinding from a coredump file | Not a live-process use case | +| `src/nto/` | QNX Neutrino ptrace-based unwinding | QNX is not a sentry-native target | +| `src/ptrace/` | Remote unwinding via `ptrace()` | Only local unwinding is needed | +| `src/setjmp/` | `setjmp`/`longjmp` wrappers | Not relevant for crash reporting | + +### What is kept but NOT built + +The following are present in the vendor tree but are **not** compiled by the +custom `CMakeLists.txt`: + +| Path | Notes | +|----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------| +| `src/arm/`, `include/tdep-arm/` | ARM 32-bit — kept for potential future use | +| `src/riscv/`, `include/tdep-riscv/` | RISC-V — kept for potential future use | +| `include/libunwind-*.h` for removed arches | Referenced via `#ifdef` in `include/libunwind.h` — harmless dead code | +| Autotools artifacts (`configure`, `configure.ac`, `Makefile.am`, `Makefile.in`, `aclocal.m4`, `INSTALL`) | Carried over from the release tarball. Not used by CMake, but `configure.ac` and `Makefile.am` are useful as reference for the build logic | + +## Custom Additions (not in the upstream tarball) + +| File | Purpose | +|-------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------| +| `CMakeLists.txt` | Custom CMake build that replaces the upstream autotools + upstream CMake build. Builds a static `unwind` target for x86, x86_64, and aarch64 only | +| `cmake/config.h.cmake.in` | CMake template for `config.h` (replaces autotools `configure`-generated header) | +| `cmake/libunwind-common.h.cmake.in` | CMake template for `libunwind-common.h` | +| `VENDORING.md` | This file | + +## Source Modifications + +Only **one** upstream source file was modified: + +### `include/libunwind-aarch64.h` — `alignas` → `__attribute__((aligned))` + +```c +// UPSTREAM (requires C11 / alignas): +alignas(16) uint8_t __reserved[(66 * 8)]; + +// VENDOR (C99-compatible): +uint8_t __reserved[(66 * 8)] __attribute__((aligned(16))); +``` + +**Reason**: The SDK targets C99. `alignas` is a C11 keyword. The +`__attribute__((aligned(...)))` form is semantically equivalent and supported by +both GCC and Clang. + +## How to Update the Vendored Version + +1. Download the **release tarball** (not a git checkout) from + https://github.com/libunwind/libunwind/releases + +2. Extract it. The tarball includes autotools-generated files (`configure`, + `Makefile.in`, `config/`, etc.) that are not in the git repository. + +3. Delete and re-copy these directories from the new tarball, **excluding** the + removed architecture dirs listed above: + - `src/` — keep only: `aarch64/`, `arm/`, `dwarf/`, `mi/`, `riscv/`, + `unwind/`, `x86/`, `x86_64/`, and top-level `.c` / `.h` files + - `include/` — keep only: `tdep/`, `tdep-aarch64/`, `tdep-arm/`, + `tdep-riscv/`, `tdep-x86/`, `tdep-x86_64/`, and all top-level `.h` / + `.h.in` files + - Top-level files (`configure`, `configure.ac`, `Makefile.am`, `Makefile.in`, + `aclocal.m4`, `NEWS`, `README`, `COPYING`, `AUTHORS`, `ChangeLog`, `TODO`, + `INSTALL`) — do **not** copy `config/` + +4. **Do NOT overwrite** `CMakeLists.txt`, `cmake/`, or `VENDORING.md` — these + are custom. + +5. Review the upstream `src/CMakeLists.txt` (or `src/Makefile.am`) for any + **new source files** added to the architectures we build, and add them to + our custom `CMakeLists.txt`. + +6. **Re-apply source modifications**: + - Check `include/libunwind-aarch64.h` for `alignas` — replace with + `__attribute__((aligned(...)))`. + - Scan for other C11/C23 constructs incompatible with C99. + +7. Build and test on all three architectures: x86_64, x86 (32-bit), aarch64. + +8. To add a **new architecture**, also: + - Keep its `src//` and `include/tdep-/` directories from the + tarball + - Add its source files to `CMakeLists.txt` + - Verify `cmake/config.h.cmake.in` covers any new `#define`s diff --git a/vendor/libunwind/aclocal.m4 b/vendor/libunwind/aclocal.m4 new file mode 100644 index 0000000000..0fd6cf146d --- /dev/null +++ b/vendor/libunwind/aclocal.m4 @@ -0,0 +1,1308 @@ +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, +[m4_warning([this file was generated for autoconf 2.71. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.16' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.16.5], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.16.5])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# Copyright (C) 2011-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_AR([ACT-IF-FAIL]) +# ------------------------- +# Try to determine the archiver interface, and trigger the ar-lib wrapper +# if it is needed. If the detection of archiver interface fails, run +# ACT-IF-FAIL (default is to abort configure with a proper error message). +AC_DEFUN([AM_PROG_AR], +[AC_BEFORE([$0], [LT_INIT])dnl +AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([ar-lib])dnl +AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) +: ${AR=ar} + +AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], + [AC_LANG_PUSH([C]) + am_cv_ar_interface=ar + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], + [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=ar + else + am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=lib + else + am_cv_ar_interface=unknown + fi + fi + rm -f conftest.lib libconftest.a + ]) + AC_LANG_POP([C])]) + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR="$am_aux_dir/ar-lib $AR" + ;; +unknown) + m4_default([$1], + [AC_MSG_ERROR([could not determine $AR interface])]) + ;; +esac +AC_SUBST([AR])dnl +]) + +# Figure out how to run the assembler. -*- Autoconf -*- + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_AS +# ---------- +AC_DEFUN([AM_PROG_AS], +[# By default we simply use the C compiler to build assembly code. +AC_REQUIRE([AC_PROG_CC]) +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS +AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)]) +AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)]) +_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl +]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_COND_IF -*- Autoconf -*- + +# Copyright (C) 2008-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_COND_IF +# _AM_COND_ELSE +# _AM_COND_ENDIF +# -------------- +# These macros are only used for tracing. +m4_define([_AM_COND_IF]) +m4_define([_AM_COND_ELSE]) +m4_define([_AM_COND_ENDIF]) + +# AM_COND_IF(COND, [IF-TRUE], [IF-FALSE]) +# --------------------------------------- +# If the shell condition COND is true, execute IF-TRUE, otherwise execute +# IF-FALSE. Allow automake to learn about conditional instantiating macros +# (the AC_CONFIG_FOOS). +AC_DEFUN([AM_COND_IF], +[m4_ifndef([_AM_COND_VALUE_$1], + [m4_fatal([$0: no such condition "$1"])])dnl +_AM_COND_IF([$1])dnl +if test -z "$$1_TRUE"; then : + m4_n([$2])[]dnl +m4_ifval([$3], +[_AM_COND_ELSE([$1])dnl +else + $3 +])dnl +_AM_COND_ENDIF([$1])dnl +fi[]dnl +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? + done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +m4_ifdef([_$0_ALREADY_INIT], + [m4_fatal([$0 expanded multiple times +]m4_defn([_$0_ALREADY_INIT]))], + [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. +AC_DEFUN([AM_MAKE_INCLUDE], +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) diff --git a/vendor/libunwind/cmake/config.h.cmake.in b/vendor/libunwind/cmake/config.h.cmake.in new file mode 100644 index 0000000000..74000ba4a7 --- /dev/null +++ b/vendor/libunwind/cmake/config.h.cmake.in @@ -0,0 +1,86 @@ +/* config.h - Generated by CMake for vendored libunwind */ + +/* Enable Debug Frame */ +/* #undef CONFIG_DEBUG_FRAME */ + +/* Block signals before mutex operations */ +/* #undef CONFIG_BLOCK_SIGNALS */ + +/* Support for Microsoft ABI extensions */ +/* #undef CONFIG_MSABI_SUPPORT */ + +/* Define if the weak 'backtrace' symbol is provided. */ +/* #undef CONFIG_WEAK_BACKTRACE */ + +/* Define to 1 if you want every memory access validated */ +/* #undef CONSERVATIVE_CHECKS */ + +#cmakedefine HAVE_ASM_PTRACE_H 1 +/* #undef HAVE_ASM_PTRACE_OFFSETS_H */ +/* #undef HAVE_ASM_VSYSCALL_H */ +#cmakedefine HAVE_BYTESWAP_H 1 + +#cmakedefine01 HAVE_DECL_PTRACE_CONT +#cmakedefine01 HAVE_DECL_PTRACE_POKEDATA +#cmakedefine01 HAVE_DECL_PTRACE_POKEUSER +#cmakedefine01 HAVE_DECL_PTRACE_SETREGSET +#cmakedefine01 HAVE_DECL_PTRACE_SINGLESTEP +#cmakedefine01 HAVE_DECL_PTRACE_SYSCALL +#cmakedefine01 HAVE_DECL_PTRACE_TRACEME + +/* PT_* BSD-style declarations - not available on Linux */ +#define HAVE_DECL_PT_CONTINUE 0 +#define HAVE_DECL_PT_GETFPREGS 0 +#define HAVE_DECL_PT_GETREGS 0 +#define HAVE_DECL_PT_IO 0 +#define HAVE_DECL_PT_STEP 0 +#define HAVE_DECL_PT_SYSCALL 0 +#define HAVE_DECL_PT_TRACE_ME 0 + +/* #undef HAVE_DLFCN_H */ +/* #undef HAVE_DLMODINFO */ +#cmakedefine HAVE_DL_ITERATE_PHDR 1 +/* #undef HAVE_DL_PHDR_REMOVALS_COUNTER */ +/* #undef HAVE_ELF_FPREGSET_T */ +#cmakedefine HAVE_ELF_H 1 +#cmakedefine HAVE_ENDIAN_H 1 +#cmakedefine HAVE_EXECINFO_H 1 +/* #undef HAVE_EXECVPE */ +/* #undef HAVE_GETUNWIND */ +/* #undef HAVE_IA64INTRIN_H */ +#define HAVE_INTTYPES_H 1 +#cmakedefine HAVE_LINK_H 1 +/* #undef HAVE_LZMA */ +#cmakedefine HAVE_MINCORE 1 +#cmakedefine HAVE_PIPE2 1 +/* #undef HAVE_PROCFS_STATUS */ +#cmakedefine HAVE_SIGALTSTACK 1 +#cmakedefine HAVE_SIGNAL_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +#cmakedefine HAVE_STRUCT_DL_PHDR_INFO_DLPI_SUBS 1 +/* #undef HAVE_STRUCT_ELF_PRSTATUS */ +/* #undef HAVE_STRUCT_PRSTATUS */ +/* #undef HAVE_SYS_ELF_H */ +/* #undef HAVE_SYS_ENDIAN_H */ +/* #undef HAVE_SYS_LINK_H */ +#cmakedefine HAVE_SYS_PARAM_H 1 +#cmakedefine HAVE_SYS_PROCFS_H 1 +#cmakedefine HAVE_SYS_PTRACE_H 1 +#cmakedefine HAVE_SYS_STAT_H 1 +#cmakedefine HAVE_SYS_SYSCALL_H 1 +#cmakedefine HAVE_SYS_TYPES_H 1 +/* #undef HAVE_SYS_UC_ACCESS_H */ +#define HAVE_UNISTD_H 1 +/* #undef HAVE_ZLIB */ + +#define PACKAGE_STRING "libunwind 1.8.3" +#define PACKAGE_BUGREPORT "N/A" + +#define STDC_HEADERS 1 + +/* size of off_t type */ +#define SIZEOF_OFF_T 8 diff --git a/vendor/libunwind/cmake/libunwind-common.h.cmake.in b/vendor/libunwind/cmake/libunwind-common.h.cmake.in new file mode 100644 index 0000000000..948bb6462c --- /dev/null +++ b/vendor/libunwind/cmake/libunwind-common.h.cmake.in @@ -0,0 +1,337 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2001-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#define UNW_VERSION_MAJOR 1 +#define UNW_VERSION_MINOR 8 +#define UNW_VERSION_EXTRA 3 + +#define UNW_VERSION_CODE(maj,min) (((maj) << 16) | (min)) +#define UNW_VERSION UNW_VERSION_CODE(UNW_VERSION_MAJOR, UNW_VERSION_MINOR) + +#ifdef __sun +#undef _U +#endif + +#define UNW_PASTE2(x,y) x##y +#define UNW_PASTE(x,y) UNW_PASTE2(x,y) +#define UNW_OBJ(fn) UNW_PASTE(UNW_PREFIX, fn) +#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn) + +#ifdef UNW_LOCAL_ONLY +# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_UL,UNW_TARGET),_) +#else /* !UNW_LOCAL_ONLY */ +# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_) +#endif /* !UNW_LOCAL_ONLY */ + +/* Error codes. The unwind routines return the *negated* values of + these error codes on error and a non-negative value on success. */ +typedef enum + { + UNW_ESUCCESS = 0, /* no error */ + UNW_EUNSPEC, /* unspecified (general) error */ + UNW_ENOMEM, /* out of memory */ + UNW_EBADREG, /* bad register number */ + UNW_EREADONLYREG, /* attempt to write read-only register */ + UNW_ESTOPUNWIND, /* stop unwinding */ + UNW_EINVALIDIP, /* invalid IP */ + UNW_EBADFRAME, /* bad frame */ + UNW_EINVAL, /* unsupported operation or bad value */ + UNW_EBADVERSION, /* unwind info has unsupported version */ + UNW_ENOINFO /* no unwind info found */ + } +unw_error_t; + +/* The following enum defines the indices for a couple of + (pseudo-)registers which have the same meaning across all + platforms. (RO) means read-only. (RW) means read-write. General + registers (aka "integer registers") are expected to start with + index 0. The number of such registers is architecture-dependent. + The remaining indices can be used as an architecture sees fit. The + last valid register index is given by UNW_REG_LAST. */ +typedef enum + { + UNW_REG_IP = UNW_TDEP_IP, /* (rw) instruction pointer (pc) */ + UNW_REG_SP = UNW_TDEP_SP, /* (ro) stack pointer */ + UNW_REG_EH = UNW_TDEP_EH, /* (rw) exception-handling reg base */ + UNW_REG_LAST = UNW_TDEP_LAST_REG + } +unw_frame_regnum_t; + +/* Number of exception-handler argument registers: */ +#define UNW_NUM_EH_REGS UNW_TDEP_NUM_EH_REGS + +typedef enum + { + UNW_CACHE_NONE, /* no caching */ + UNW_CACHE_GLOBAL, /* shared global cache */ + UNW_CACHE_PER_THREAD /* per-thread caching */ + } +unw_caching_policy_t; + +typedef enum + { + UNW_INIT_SIGNAL_FRAME = 1 /* We know this is a signal frame */ + } +unw_init_local2_flags_t; + +typedef int unw_regnum_t; + +/* The unwind cursor starts at the youngest (most deeply nested) frame + and is used to track the frame state as the unwinder steps from + frame to frame. It is safe to make (shallow) copies of variables + of this type. */ +typedef struct unw_cursor + { + unw_word_t opaque[UNW_TDEP_CURSOR_LEN]; + } +unw_cursor_t; + +/* This type encapsulates the entire (preserved) machine-state. */ +typedef unw_tdep_context_t unw_context_t; + +/* unw_getcontext() fills the unw_context_t pointed to by UC with the + machine state as it exists at the call-site. For implementation + reasons, this needs to be a target-dependent macro. It's easiest + to think of unw_getcontext() as being identical to getcontext(). */ +#define unw_getcontext(uc) unw_tdep_getcontext(uc) + +/* Return 1 if register number R is a floating-point register, zero + otherwise. + This routine is signal-safe. */ +#define unw_is_fpreg(r) unw_tdep_is_fpreg(r) + +typedef unw_tdep_fpreg_t unw_fpreg_t; + +typedef struct unw_addr_space *unw_addr_space_t; + +/* Each target may define it's own set of flags, but bits 0-15 are + reserved for general libunwind-use. */ +#define UNW_PI_FLAG_FIRST_TDEP_BIT 16 +/* The information comes from a .debug_frame section. */ +#define UNW_PI_FLAG_DEBUG_FRAME 32 + +typedef struct unw_proc_info + { + unw_word_t start_ip; /* first IP covered by this procedure */ + unw_word_t end_ip; /* first IP NOT covered by this procedure */ +#if defined(NEED_LAST_IP) + unw_word_t last_ip; /* first IP that could begin another procedure */ +#endif + unw_word_t lsda; /* address of lang.-spec. data area (if any) */ + unw_word_t handler; /* optional personality routine */ + unw_word_t gp; /* global-pointer value for this procedure */ + unw_word_t flags; /* misc. flags */ + + int format; /* unwind-info format (arch-specific) */ + int unwind_info_size; /* size of the information (if applicable) */ + void *unwind_info; /* unwind-info (arch-specific) */ + unw_tdep_proc_info_t extra; /* target-dependent auxiliary proc-info */ + } +unw_proc_info_t; + +typedef int (*unw_reg_states_callback)(void *token, + void *reg_states_data, + size_t reg_states_data_size, + unw_word_t start_ip, unw_word_t end_ip); + +/* These are backend callback routines that provide access to the + state of a "remote" process. This can be used, for example, to + unwind another process through the ptrace() interface. */ +typedef struct unw_accessors + { + /* Look up the unwind info associated with instruction-pointer IP. + On success, the routine fills in the PROC_INFO structure. */ + int (*find_proc_info) (unw_addr_space_t, unw_word_t, unw_proc_info_t *, + int, void *); + + /* Release any resources (e.g., memory) that were allocated for + the unwind info returned in by a previous call to + find_proc_info() with NEED_UNWIND_INFO set to 1. */ + void (*put_unwind_info) (unw_addr_space_t, unw_proc_info_t *, void *); + + /* Return the list-head of the dynamically registered unwind + info. */ + int (*get_dyn_info_list_addr) (unw_addr_space_t, unw_word_t *, void *); + + /* Access aligned word at address ADDR. The value is returned + according to the endianness of the host (e.g., if the host is + little-endian and the target is big-endian, access_mem() needs + to byte-swap the value before returning it). */ + int (*access_mem) (unw_addr_space_t, unw_word_t, unw_word_t *, int, + void *); + + /* Access register number REG at address ADDR. */ + int (*access_reg) (unw_addr_space_t, unw_regnum_t, unw_word_t *, int, + void *); + + /* Access register number REG at address ADDR. */ + int (*access_fpreg) (unw_addr_space_t, unw_regnum_t, + unw_fpreg_t *, int, void *); + + int (*resume) (unw_addr_space_t, unw_cursor_t *, void *); + + /* Optional call back to obtain the name of a (static) procedure. + Dynamically generated procedures are handled automatically by + libunwind. This callback is optional and may be set to + NULL. */ + int (*get_proc_name) (unw_addr_space_t, unw_word_t, char *, size_t, + unw_word_t *, void *); + + /* Optional call back to obtain the name of a elf file where the ip belongs to. + This callback is optional and may be set to NULL. */ + int (*get_elf_filename) (unw_addr_space_t, unw_word_t, char *, size_t, + unw_word_t *, void *); + + /* Optional call back to obtain the start and end ip of a procedure. + * procedure ip range is [start, end), the range is without end. + * This callback is optional and may be set to NULL. + */ + int (*get_proc_ip_range) (unw_addr_space_t, unw_word_t, unw_word_t *, + unw_word_t *, void *); + + /* Optional call back to return a mask to be used with pointer + * authentication on arm64. + * + * The on bits in the returned mask indicate which bits in a return address + * are part of a pointer authentication code. These are the bits in the + * return address to turn off so that the calling frame can be found + * for the unwinding to continue. + * + * The return value must be host-endian. e.g. if the target is big-endian + * and the host is little endian, the implementation of this function + * must byte swap. + * + * This callback is optional and may be set to NULL. In this case all + * the bits in the return address are used, as if no masking were done. + */ + unw_word_t (*ptrauth_insn_mask) (unw_addr_space_t, void *); + + } +unw_accessors_t; + +typedef enum unw_save_loc_type + { + UNW_SLT_NONE, /* register is not saved ("not an l-value") */ + UNW_SLT_MEMORY, /* register has been saved in memory */ + UNW_SLT_REG /* register has been saved in (another) register */ + } +unw_save_loc_type_t; + +typedef struct unw_save_loc + { + unw_save_loc_type_t type; + union + { + unw_word_t addr; /* valid if type==UNW_SLT_MEMORY */ + unw_regnum_t regnum; /* valid if type==UNW_SLT_REG */ + } + u; + unw_tdep_save_loc_t extra; /* target-dependent additional information */ + } +unw_save_loc_t; + +struct dl_phdr_info; +typedef int (*unw_iterate_phdr_callback_t) (struct dl_phdr_info *, size_t, void *); +typedef int (*unw_iterate_phdr_func_t) (unw_iterate_phdr_callback_t, void *); + +/* These routines work both for local and remote unwinding. */ + +#define unw_local_addr_space UNW_OBJ(local_addr_space) +#define unw_create_addr_space UNW_OBJ(create_addr_space) +#define unw_destroy_addr_space UNW_OBJ(destroy_addr_space) +#define unw_get_accessors UNW_ARCH_OBJ(get_accessors) +#define unw_get_accessors_int UNW_ARCH_OBJ(get_accessors_int) +#define unw_init_local UNW_OBJ(init_local) +#define unw_init_local2 UNW_OBJ(init_local2) +#define unw_init_remote UNW_OBJ(init_remote) +#define unw_step UNW_OBJ(step) +#define unw_resume UNW_OBJ(resume) +#define unw_get_proc_info UNW_OBJ(get_proc_info) +#define unw_get_proc_info_by_ip UNW_OBJ(get_proc_info_by_ip) +#define unw_get_proc_info_in_range UNW_OBJ(get_proc_info_in_range) +#define unw_reg_states_iterate UNW_OBJ(reg_states_iterate) +#define unw_apply_reg_state UNW_OBJ(apply_reg_state) +#define unw_get_reg UNW_OBJ(get_reg) +#define unw_set_reg UNW_OBJ(set_reg) +#define unw_get_fpreg UNW_OBJ(get_fpreg) +#define unw_set_fpreg UNW_OBJ(set_fpreg) +#define unw_get_save_loc UNW_OBJ(get_save_loc) +#define unw_is_signal_frame UNW_OBJ(is_signal_frame) +#define unw_is_plt_entry UNW_OBJ(is_plt_entry) +#define unw_get_proc_name UNW_OBJ(get_proc_name) +#define unw_get_proc_name_by_ip UNW_OBJ(get_proc_name_by_ip) +#define unw_get_elf_filename UNW_OBJ(get_elf_filename) +#define unw_get_elf_filename_by_ip UNW_OBJ(get_elf_filename_by_ip) +#define unw_set_caching_policy UNW_OBJ(set_caching_policy) +#define unw_set_cache_size UNW_OBJ(set_cache_size) +#define unw_set_iterate_phdr_function UNW_OBJ(set_iterate_phdr_function) +#define unw_regname UNW_ARCH_OBJ(regname) +#define unw_flush_cache UNW_ARCH_OBJ(flush_cache) +#define unw_strerror UNW_ARCH_OBJ(strerror) + +extern unw_addr_space_t unw_create_addr_space (unw_accessors_t *, int); +extern void unw_destroy_addr_space (unw_addr_space_t); +extern unw_accessors_t *unw_get_accessors (unw_addr_space_t); +extern unw_accessors_t *unw_get_accessors_int (unw_addr_space_t); +extern void unw_flush_cache (unw_addr_space_t, unw_word_t, unw_word_t); +extern int unw_set_caching_policy (unw_addr_space_t, unw_caching_policy_t); +extern int unw_set_cache_size (unw_addr_space_t, size_t, int); +extern void unw_set_iterate_phdr_function (unw_addr_space_t, unw_iterate_phdr_func_t); +extern const char *unw_regname (unw_regnum_t); + +extern int unw_init_local (unw_cursor_t *, unw_context_t *); +extern int unw_init_local2 (unw_cursor_t *, unw_context_t *, int); +extern int unw_init_remote (unw_cursor_t *, unw_addr_space_t, void *); +extern int unw_step (unw_cursor_t *); +extern int unw_resume (unw_cursor_t *); +extern int unw_get_proc_info (unw_cursor_t *, unw_proc_info_t *); +extern int unw_get_proc_info_by_ip (unw_addr_space_t, unw_word_t, + unw_proc_info_t *, void *); +extern int unw_get_proc_info_in_range (unw_word_t, unw_word_t, + unw_word_t, unw_word_t, + unw_word_t, unw_word_t, + unw_addr_space_t, unw_word_t, + unw_proc_info_t *, int, + void *); +extern int unw_reg_states_iterate (unw_cursor_t *, unw_reg_states_callback, void *); +extern int unw_apply_reg_state (unw_cursor_t *, void *); +extern int unw_get_reg (unw_cursor_t *, int, unw_word_t *); +extern int unw_set_reg (unw_cursor_t *, int, unw_word_t); +extern int unw_get_fpreg (unw_cursor_t *, int, unw_fpreg_t *); +extern int unw_set_fpreg (unw_cursor_t *, int, unw_fpreg_t); +extern int unw_get_save_loc (unw_cursor_t *, int, unw_save_loc_t *); +extern int unw_is_signal_frame (unw_cursor_t *); +extern int unw_is_plt_entry (unw_cursor_t *); +extern int unw_get_proc_name (unw_cursor_t *, char *, size_t, unw_word_t *); +extern int unw_get_proc_name_by_ip (unw_addr_space_t, unw_word_t, char *, + size_t, unw_word_t *, void *); +extern int unw_get_elf_filename (unw_cursor_t *, char *, size_t, unw_word_t *); +extern int unw_get_elf_filename_by_ip (unw_addr_space_t, unw_word_t, char *, + size_t, unw_word_t *, void *); +extern const char *unw_strerror (int); +extern int unw_backtrace (void **, int); +extern int unw_backtrace2 (void **, int, unw_context_t*, int); + +extern unw_addr_space_t unw_local_addr_space; diff --git a/vendor/libunwind/configure b/vendor/libunwind/configure new file mode 100755 index 0000000000..c0541c5bc7 --- /dev/null +++ b/vendor/libunwind/configure @@ -0,0 +1,23960 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.71 for libunwind 1.8.3. +# +# Report bugs to . +# +# +# This file is part of libunwind. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# +# +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else \$as_nop + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : + +else \$as_nop + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null +then : + as_have_required=yes +else $as_nop + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : + +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$as_shell as_have_required=yes + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : + break 2 +fi +fi + done;; + esac + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi + + + if test "x$CONFIG_SHELL" != x +then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + else + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and https://github.com/libunwind/libunwind +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='libunwind' +PACKAGE_TARNAME='libunwind' +PACKAGE_VERSION='1.8.3' +PACKAGE_STRING='libunwind 1.8.3' +PACKAGE_BUGREPORT='https://github.com/libunwind/libunwind' +PACKAGE_URL='' + +ac_unique_file="src/mi/backtrace.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_STDIO_H +# include +#endif +#ifdef HAVE_STDLIB_H +# include +#endif +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_c_list= +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +enable_debug_frame +enable_cxx_exceptions +PKG_MAINTAINER +PKG_EXTRA +PKG_MINOR +PKG_MAJOR +LDFLAGS_NOSTARTFILES +LDFLAGS_STATIC_LIBCXA +ARCH +arch +build_arch +COMPILER_SUPPORTS_MARCH_ARMV8_A_SVE_FALSE +COMPILER_SUPPORTS_MARCH_ARMV8_A_SVE_TRUE +HAVE_ZLIB_FALSE +HAVE_ZLIB_TRUE +LIBZ +HAVE_LZMA_FALSE +HAVE_LZMA_TRUE +LIBLZMA +USE_DWARF_FALSE +USE_DWARF_TRUE +USE_ELFXX_FALSE +USE_ELFXX_TRUE +USE_ELF64_FALSE +USE_ELF64_TRUE +USE_ELF32_FALSE +USE_ELF32_TRUE +OS_SOLARIS_FALSE +OS_SOLARIS_TRUE +OS_QNX_FALSE +OS_QNX_TRUE +OS_FREEBSD_FALSE +OS_FREEBSD_TRUE +OS_HPUX_FALSE +OS_HPUX_TRUE +OS_LINUX_FALSE +OS_LINUX_TRUE +ARCH_LOONGARCH64_FALSE +ARCH_LOONGARCH64_TRUE +ARCH_RISCV_FALSE +ARCH_RISCV_TRUE +ARCH_S390X_FALSE +ARCH_S390X_TRUE +ARCH_SH_FALSE +ARCH_SH_TRUE +ARCH_PPC64_FALSE +ARCH_PPC64_TRUE +ARCH_PPC32_FALSE +ARCH_PPC32_TRUE +ARCH_X86_64_FALSE +ARCH_X86_64_TRUE +ARCH_X86_FALSE +ARCH_X86_TRUE +ARCH_MIPS_FALSE +ARCH_MIPS_TRUE +ARCH_HPPA_FALSE +ARCH_HPPA_TRUE +ARCH_IA64_FALSE +ARCH_IA64_TRUE +ARCH_ARM_FALSE +ARCH_ARM_TRUE +ARCH_AARCH64_FALSE +ARCH_AARCH64_TRUE +REMOTE_ONLY_FALSE +REMOTE_ONLY_TRUE +CROSS_BUILD_FALSE +CROSS_BUILD_TRUE +XFAIL_PTRACE_TEST_FALSE +XFAIL_PTRACE_TEST_TRUE +ENABLE_UNW_RESUME_TESTS_FALSE +ENABLE_UNW_RESUME_TESTS_TRUE +CONFIG_DOCS_FALSE +CONFIG_DOCS_TRUE +LATEX2MAN +UNW_CRT_LDFLAGS +UNW_CRT_LIBADD +SUPPORT_CXX_EXCEPTIONS_FALSE +SUPPORT_CXX_EXCEPTIONS_TRUE +UNW_TESTDRIVER +BACKTRACELIB +PTHREADS_LIB +DLLIB +CONFIG_TESTS_FALSE +CONFIG_TESTS_TRUE +BUILD_UNWIND_HEADER_FALSE +BUILD_UNWIND_HEADER_TRUE +CONFIG_WEAK_BACKTRACE_FALSE +CONFIG_WEAK_BACKTRACE_TRUE +BUILD_SETJMP_FALSE +BUILD_SETJMP_TRUE +BUILD_NTO_FALSE +BUILD_NTO_TRUE +BUILD_PTRACE_FALSE +BUILD_PTRACE_TRUE +BUILD_COREDUMP_FALSE +BUILD_COREDUMP_TRUE +USE_ALTIVEC_FALSE +USE_ALTIVEC_TRUE +am__fastdepCCAS_FALSE +am__fastdepCCAS_TRUE +CCASDEPMODE +CCASFLAGS +CCAS +CXXCPP +LT_SYS_LIBRARY_PATH +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +DLLTOOL +OBJDUMP +FILECMD +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +LIBTOOL +ac_ct_AR +AR +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +CSCOPE +ETAGS +CTAGS +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_maintainer_mode +enable_dependency_tracking +enable_shared +enable_static +enable_pic +with_pic +enable_fast_install +enable_aix_soname +with_aix_soname +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_coredump +enable_ptrace +enable_nto +enable_setjmp +enable_weak_backtrace +enable_unwind_header +enable_per_thread_cache +enable_tests +with_testdriver +enable_debug +enable_cxx_exceptions +enable_documentation +enable_debug_frame +enable_block_signals +enable_conservative_checks +enable_msabi_support +enable_minidebuginfo +enable_zlibdebuginfo +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CXX +CXXFLAGS +CCC +LT_SYS_LIBRARY_PATH +CXXCPP +CCAS +CCASFLAGS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir runstatedir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures libunwind 1.8.3 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/libunwind] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of libunwind 1.8.3:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-maintainer-mode + enable make rules and dependencies not useful (and + sometimes confusing) to the casual installer + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --enable-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-coredump build libunwind-coredump library + [default=autodetect] + --enable-ptrace build libunwind-ptrace library [default=autodetect] + --enable-nto build libunwind-nto library [default=autodetect] + --enable-setjmp build libunwind-setjmp library [default=autodetect] + --disable-weak-backtrace + do not provide the weak 'backtrace' symbol + [default=no] + --disable-unwind-header do not export the 'unwind.h' header [default=no] + --enable-per-thread-cache + build with support for UNW_CACHE_PER_THREAD (which + imposes a high TLS memory usage) [default=no] + --disable-tests disable building tests [default=no] + --enable-debug enable debug support (slows down execution) + [default=no] + --enable-cxx-exceptions use libunwind to handle C++ exceptions + [default=autodetect] + --enable-documentation enable generating the man pages [default=yes] + --enable-debug-frame Load the ".debug_frame" section if available + --enable-block-signals Block signals before performing mutex operations + --enable-conservative-checks + Validate all memory addresses before use + --enable-msabi-support Enables support for Microsoft ABI extensions + --enable-minidebuginfo Enables support for LZMA-compressed symbol tables + --enable-zlibdebuginfo Enables support for ZLIB-compressed symbol tables + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot[=DIR] Search for dependent libraries within DIR (or the + compiler's sysroot if not specified). + --with-testdriver use designated test driver instead of default + LOG_DRIVER + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. + CXXCPP C++ preprocessor + CCAS assembler compiler command (defaults to CC) + CCASFLAGS assembler compiler flags (defaults to CFLAGS) + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +libunwind configure 1.8.3 +generated by GNU Autoconf 2.71 + +Copyright (C) 2021 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. + + + This file is part of libunwind. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. */ + +#include +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main (void) +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_cpp + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=$ac_mid; break +else $as_nop + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_lo=$ac_mid; break +else $as_nop + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done +else $as_nop + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=$ac_mid +else $as_nop + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval (void) { return $2; } +static unsigned long int ulongval (void) { return $2; } +#include +#include +int +main (void) +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + echo >>conftest.val; read $3 &5 +printf %s "checking for $2.$3... " >&6; } +if eval test \${$4+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main (void) +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$4=yes" +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main (void) +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$4=yes" +else $as_nop + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$4 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_member + +# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR +# ------------------------------------------------------------------ +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. +ac_fn_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS + +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_check_decl +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by libunwind $as_me 1.8.3, which was +generated by GNU Autoconf 2.71. Invocation command line was + + $ $0$ac_configure_args_raw + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" + # Save into config.log some information that might help in debugging. + { + echo + + printf "%s\n" "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + printf "%s\n" "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + printf "%s\n" "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + printf "%s\n" "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +printf "%s\n" "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + ac_site_files="$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" +else + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +fi + +for ac_site_file in $ac_site_files +do + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif + +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +# Test code for whether the C++ compiler supports C++98 (global declarations) +ac_cxx_conftest_cxx98_globals=' +// Does the compiler advertise C++98 conformance? +#if !defined __cplusplus || __cplusplus < 199711L +# error "Compiler does not advertise C++98 conformance" +#endif + +// These inclusions are to reject old compilers that +// lack the unsuffixed header files. +#include +#include + +// and are *not* freestanding headers in C++98. +extern void assert (int); +namespace std { + extern int strcmp (const char *, const char *); +} + +// Namespaces, exceptions, and templates were all added after "C++ 2.0". +using std::exception; +using std::strcmp; + +namespace { + +void test_exception_syntax() +{ + try { + throw "test"; + } catch (const char *s) { + // Extra parentheses suppress a warning when building autoconf itself, + // due to lint rules shared with more typical C programs. + assert (!(strcmp) (s, "test")); + } +} + +template struct test_template +{ + T const val; + explicit test_template(T t) : val(t) {} + template T add(U u) { return static_cast(u) + val; } +}; + +} // anonymous namespace +' + +# Test code for whether the C++ compiler supports C++98 (body of main) +ac_cxx_conftest_cxx98_main=' + assert (argc); + assert (! argv[0]); +{ + test_exception_syntax (); + test_template tt (2.0); + assert (tt.add (4) == 6.0); + assert (true && !false); +} +' + +# Test code for whether the C++ compiler supports C++11 (global declarations) +ac_cxx_conftest_cxx11_globals=' +// Does the compiler advertise C++ 2011 conformance? +#if !defined __cplusplus || __cplusplus < 201103L +# error "Compiler does not advertise C++11 conformance" +#endif + +namespace cxx11test +{ + constexpr int get_val() { return 20; } + + struct testinit + { + int i; + double d; + }; + + class delegate + { + public: + delegate(int n) : n(n) {} + delegate(): delegate(2354) {} + + virtual int getval() { return this->n; }; + protected: + int n; + }; + + class overridden : public delegate + { + public: + overridden(int n): delegate(n) {} + virtual int getval() override final { return this->n * 2; } + }; + + class nocopy + { + public: + nocopy(int i): i(i) {} + nocopy() = default; + nocopy(const nocopy&) = delete; + nocopy & operator=(const nocopy&) = delete; + private: + int i; + }; + + // for testing lambda expressions + template Ret eval(Fn f, Ret v) + { + return f(v); + } + + // for testing variadic templates and trailing return types + template auto sum(V first) -> V + { + return first; + } + template auto sum(V first, Args... rest) -> V + { + return first + sum(rest...); + } +} +' + +# Test code for whether the C++ compiler supports C++11 (body of main) +ac_cxx_conftest_cxx11_main=' +{ + // Test auto and decltype + auto a1 = 6538; + auto a2 = 48573953.4; + auto a3 = "String literal"; + + int total = 0; + for (auto i = a3; *i; ++i) { total += *i; } + + decltype(a2) a4 = 34895.034; +} +{ + // Test constexpr + short sa[cxx11test::get_val()] = { 0 }; +} +{ + // Test initializer lists + cxx11test::testinit il = { 4323, 435234.23544 }; +} +{ + // Test range-based for + int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, + 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; + for (auto &x : array) { x += 23; } +} +{ + // Test lambda expressions + using cxx11test::eval; + assert (eval ([](int x) { return x*2; }, 21) == 42); + double d = 2.0; + assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); + assert (d == 5.0); + assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); + assert (d == 5.0); +} +{ + // Test use of variadic templates + using cxx11test::sum; + auto a = sum(1); + auto b = sum(1, 2); + auto c = sum(1.0, 2.0, 3.0); +} +{ + // Test constructor delegation + cxx11test::delegate d1; + cxx11test::delegate d2(); + cxx11test::delegate d3(45); +} +{ + // Test override and final + cxx11test::overridden o1(55464); +} +{ + // Test nullptr + char *c = nullptr; +} +{ + // Test template brackets + test_template<::test_template> v(test_template(12)); +} +{ + // Unicode literals + char const *utf8 = u8"UTF-8 string \u2500"; + char16_t const *utf16 = u"UTF-8 string \u2500"; + char32_t const *utf32 = U"UTF-32 string \u2500"; +} +' + +# Test code for whether the C compiler supports C++11 (complete). +ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} +${ac_cxx_conftest_cxx11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + ${ac_cxx_conftest_cxx11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C++98 (complete). +ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" + +# Auxiliary files required by this configure script. +ac_aux_files="ltmain.sh ar-lib compile missing install-sh config.guess config.sub" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}/config" + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +printf %s "checking target system type... " >&6; } +if test ${ac_cv_target+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "${ac_aux_dir}config.sub" $target_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +printf "%s\n" "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- +am__api_version='1.16' + + + # Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test ${ac_cv_path_install+y}; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` + + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + + + if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + 'BusyBox '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test ${ac_cv_path_mkdir+y}; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SET_MAKE= +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# Check whether --enable-silent-rules was given. +if test ${enable_silent_rules+y} +then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='libunwind' + VERSION='1.8.3' + + +printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h + + +printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + +# Check whether --enable-silent-rules was given. +if test ${enable_silent_rules+y} +then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=0;; +esac +am_make=${MAKE-make} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test ${enable_maintainer_mode+y} +then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else $as_nop + USE_MAINTAINER_MODE=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +printf "%s\n" "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + +ac_config_headers="$ac_config_headers include/config.h" + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion -version; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else $as_nop + ac_file='' +fi +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else $as_nop + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf "%s\n" "${_am_result}" >&6; } + +# Check whether --enable-dependency-tracking was given. +if test ${enable_dependency_tracking+y} +then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + + + + + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf "%s\n" "$ac_ct_CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 +printf %s "checking whether the compiler supports GNU C++... " >&6; } +if test ${ac_cv_cxx_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+y} +ac_save_CXXFLAGS=$CXXFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +printf %s "checking whether $CXX accepts -g... " >&6; } +if test ${ac_cv_prog_cxx_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_g=yes +else $as_nop + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + +else $as_nop + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } +if test $ac_test_CXXFLAGS; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_prog_cxx_stdcxx=no +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 +printf %s "checking for $CXX option to enable C++11 features... " >&6; } +if test ${ac_cv_prog_cxx_11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_11=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx11_program +_ACEOF +for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx11" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx11" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 + ac_prog_cxx_stdcxx=cxx11 +fi +fi +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 +printf %s "checking for $CXX option to enable C++98 features... " >&6; } +if test ${ac_cv_prog_cxx_98+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_98=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx98_program +_ACEOF +for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx98=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx98" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx98" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx98" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx98" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 + ac_prog_cxx_stdcxx=cxx98 +fi +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CXX_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SET_MAKE= +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + + + if test -n "$ac_tool_prefix"; then + for ac_prog in ar lib "link -lib" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar lib "link -lib" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 +printf %s "checking the archiver ($AR) interface... " >&6; } +if test ${am_cv_ar_interface+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + am_cv_ar_interface=ar + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int some_variable = 0; +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 + (eval $am_ar_try) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=ar + else + am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 + (eval $am_ar_try) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=lib + else + am_cv_ar_interface=unknown + fi + fi + rm -f conftest.lib libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 +printf "%s\n" "$am_cv_ar_interface" >&6; } + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR="$am_aux_dir/ar-lib $AR" + ;; +unknown) + as_fn_error $? "could not determine $AR interface" "$LINENO" 5 + ;; +esac + +case `pwd` in + *\ * | *\ *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.5.4' +macro_revision='2.5.4' + + + + + + + + + + + + + + +ltmain=$ac_aux_dir/ltmain.sh + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +printf %s "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case $ECHO in + printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +printf "%s\n" "printf" >&6; } ;; + print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +printf "%s\n" "print -r" >&6; } ;; + *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +printf "%s\n" "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +printf %s "checking for fgrep... " >&6; } +if test ${ac_cv_path_FGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in fgrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +printf "%s\n" "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test ${with_gnu_ld+y} +then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else $as_nop + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw* | *-*-windows*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test ${lt_cv_path_NM+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM=$NM +else + lt_nm_to_check=${ac_tool_prefix}nm + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw* | windows*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break 2 + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS=$lt_save_ifs + done + : ${lt_cv_path_NM=no} +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +printf "%s\n" "$lt_cv_path_NM" >&6; } +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +printf "%s\n" "$DUMPBIN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +printf "%s\n" "$ac_ct_DUMPBIN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test : != "$DUMPBIN"; then + NM=$DUMPBIN + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +printf %s "checking the name lister ($NM) interface... " >&6; } +if test ${lt_cv_nm_interface+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +printf "%s\n" "$lt_cv_nm_interface" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +printf %s "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +printf "%s\n" "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +printf %s "checking the maximum length of command line arguments... " >&6; } +if test ${lt_cv_sys_max_cmd_len+y} +then : + printf %s "(cached) " >&6 +else $as_nop + i=0 + teststring=ABCD + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu* | ironclad*) + # Under GNU Hurd and Ironclad, this test is not required because there + # is no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | windows* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test 17 != "$i" # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n "$lt_cv_sys_max_cmd_len"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 +printf "%s\n" "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +printf %s "checking how to convert $build file names to $host format... " >&6; } +if test ${lt_cv_to_host_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* | *-*-windows* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* | *-*-windows* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +printf %s "checking how to convert $build file names to toolchain format... " >&6; } +if test ${lt_cv_to_tool_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* | *-*-windows* ) + case $build in + *-*-mingw* | *-*-windows* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +printf %s "checking for $LD option to reload object files... " >&6; } +if test ${lt_cv_ld_reload_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ld_reload_flag='-r' +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | windows* | pw32* | cegcc*) + if test yes != "$GCC"; then + reload_cmds=false + fi + ;; + darwin*) + if test yes = "$GCC"; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +# Extract the first word of "file", so it can be a program name with args. +set dummy file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$FILECMD"; then + ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_FILECMD="file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_FILECMD" && ac_cv_prog_FILECMD=":" +fi +fi +FILECMD=$ac_cv_prog_FILECMD +if test -n "$FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 +printf "%s\n" "$FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +printf %s "checking how to recognize dependent libraries... " >&6; } +if test ${lt_cv_deplibs_check_method+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# 'unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'file_magic [[regex]]' -- check by looking for files in library path +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='$FILECMD -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | windows* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly* | midnightbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=$FILECMD + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=$FILECMD + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +*-mlibc) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=$FILECMD + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +serenity*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | windows* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +printf %s "checking how to associate runtime and link libraries... " >&6; } +if test ${lt_cv_sharedlib_from_linklib_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | windows* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; +esac + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} + + + + + + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because that's what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS + + + + + + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +printf %s "checking for archiver @FILE support... " >&6; } +if test ${lt_cv_ar_at_file+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +printf "%s\n" "$lt_cv_ar_at_file" >&6; } + +if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +printf %s "checking command to parse $NM output from $compiler object... " >&6; } +if test ${lt_cv_sys_global_symbol_pipe+y} +then : + printf %s "(cached) " >&6 +else $as_nop + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | windows* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test ia64 = "$host_cpu"; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BCDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw* | windows*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++ or ICC, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(void){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 + if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +printf "%s\n" "failed" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +printf "%s\n" "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +printf %s "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test ${with_sysroot+y} +then : + withval=$with_sysroot; +else $as_nop + with_sysroot=no +fi + + +lt_sysroot= +case $with_sysroot in #( + yes) + if test yes = "$GCC"; then + # Trim trailing / since we'll always append absolute paths and we want + # to avoid //, if only for less confusing output for the user. + lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +printf "%s\n" "$with_sysroot" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +printf "%s\n" "${lt_sysroot:-no}" >&6; } + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +printf %s "checking for a working dd... " >&6; } +if test ${ac_cv_path_lt_DD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +if test -z "$lt_DD"; then + ac_path_lt_DD_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in dd + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_lt_DD" || continue +if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi + $ac_path_lt_DD_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_lt_DD"; then + : + fi +else + ac_cv_path_lt_DD=$lt_DD +fi + +rm -f conftest.i conftest2.i conftest.out +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +printf "%s\n" "$ac_cv_path_lt_DD" >&6; } + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +printf %s "checking how to truncate binary pipes... " >&6; } +if test ${lt_cv_truncate_bin+y} +then : + printf %s "(cached) " >&6 +else $as_nop + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +printf "%s\n" "$lt_cv_truncate_bin" >&6; } + + + + + + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + +# Check whether --enable-libtool-lock was given. +if test ${enable_libtool_lock+y} +then : + enableval=$enable_libtool_lock; +fi + +test no = "$enable_libtool_lock" || enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `$FILECMD conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE=32 + ;; + *ELF-64*) + HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test yes = "$lt_cv_prog_gnu_ld"; then + case `$FILECMD conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `$FILECMD conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + emul=elf + case `$FILECMD conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `$FILECMD conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `$FILECMD conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `$FILECMD conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*|x86_64-gnu*) + case `$FILECMD conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*|x86_64-gnu*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -belf" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +printf %s "checking whether the C compiler needs -belf... " >&6; } +if test ${lt_cv_cc_needs_belf+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_cc_needs_belf=yes +else $as_nop + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } + if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS=$SAVE_CFLAGS + fi + ;; +*-*solaris*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `$FILECMD conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD=${LD-ld}_sol2 + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks=$enable_libtool_lock + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +printf "%s\n" "$MANIFEST_TOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if test ${lt_cv_path_manifest_tool+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_path_manifest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_manifest_tool=yes + fi + rm -f conftest* +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_manifest_tool" >&5 +printf "%s\n" "$lt_cv_path_manifest_tool" >&6; } +if test yes != "$lt_cv_path_manifest_tool"; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +printf "%s\n" "$DSYMUTIL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +printf "%s\n" "$NMEDIT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +printf "%s\n" "$ac_ct_NMEDIT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +printf "%s\n" "$LIPO" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +printf "%s\n" "$ac_ct_LIPO" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +printf "%s\n" "$OTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +printf "%s\n" "$ac_ct_OTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +printf "%s\n" "$OTOOL64" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +printf "%s\n" "$ac_ct_OTOOL64" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +printf %s "checking for -single_module linker flag... " >&6; } +if test ${lt_cv_apple_cc_single_mod+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_apple_cc_single_mod=no + if test -z "$LT_MULTI_MODULE"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } + + # Feature test to disable chained fixups since it is not + # compatible with '-undefined dynamic_lookup' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -no_fixup_chains linker flag" >&5 +printf %s "checking for -no_fixup_chains linker flag... " >&6; } +if test ${lt_cv_support_no_fixup_chains+y} +then : + printf %s "(cached) " >&6 +else $as_nop + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_support_no_fixup_chains=yes +else $as_nop + lt_cv_support_no_fixup_chains=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_support_no_fixup_chains" >&5 +printf "%s\n" "$lt_cv_support_no_fixup_chains" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +printf %s "checking for -exported_symbols_list linker flag... " >&6; } +if test ${lt_cv_ld_exported_symbols_list+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_ld_exported_symbols_list=yes +else $as_nop + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +printf %s "checking for -force_load linker flag... " >&6; } +if test ${lt_cv_ld_force_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 + $AR $AR_FLAGS libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main(void) { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +printf "%s\n" "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[012],*|,*powerpc*-darwin[5-8]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' + if test yes = "$lt_cv_support_no_fixup_chains"; then + as_fn_append _lt_dar_allow_undefined ' $wl-no_fixup_chains' + fi + ;; + esac + ;; + esac + if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi + _lt_dar_needs_single_mod=no + case $host_os in + rhapsody* | darwin1.*) + _lt_dar_needs_single_mod=yes ;; + darwin*) + # When targeting Mac OS X 10.4 (darwin 8) or later, + # -single_module is the default and -multi_module is unsupported. + # The toolchain on macOS 10.14 (darwin 18) and later cannot + # target any OS version that needs -single_module. + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*-darwin[567].*|10.[0-3],*-darwin[5-9].*|10.[0-3],*-darwin1[0-7].*) + _lt_dar_needs_single_mod=yes ;; + esac + ;; + esac + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + fi + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes +then : + printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h + +fi + + + + +func_stripname_cnf () +{ + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; + esac +} # func_stripname_cnf + + + + + +# Set options + + + + enable_dlopen=no + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test ${enable_shared+y} +then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test ${enable_static+y} +then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop + enable_static=yes +fi + + + + + + + + + + # Check whether --enable-pic was given. +if test ${enable_pic+y} +then : + enableval=$enable_pic; lt_p=${PACKAGE-default} + case $enableval in + yes|no) pic_mode=$enableval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop + # Check whether --with-pic was given. +if test ${with_pic+y} +then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop + pic_mode=default +fi + + +fi + + + + + + + + + # Check whether --enable-fast-install was given. +if test ${enable_fast_install+y} +then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop + enable_fast_install=yes +fi + + + + + + + + + shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[5-9]*,yes) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +printf %s "checking which variant of shared library versioning to provide... " >&6; } + # Check whether --enable-aix-soname was given. +if test ${enable_aix_soname+y} +then : + enableval=$enable_aix_soname; case $enableval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --enable-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$enable_aix_soname +else $as_nop + # Check whether --with-aix-soname was given. +if test ${with_aix_soname+y} +then : + withval=$with_aix_soname; case $withval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname +else $as_nop + if test ${lt_cv_with_aix_soname+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_with_aix_soname=aix +fi + +fi + + enable_aix_soname=$lt_cv_with_aix_soname +fi + + with_aix_soname=$enable_aix_soname + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +printf "%s\n" "$with_aix_soname" >&6; } + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS=$ltmain + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +printf %s "checking for objdir... " >&6; } +if test ${lt_cv_objdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +printf "%s\n" "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). +libext=a + +with_gnu_ld=$lt_cv_prog_gnu_ld + +old_CC=$CC +old_CFLAGS=$CFLAGS + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +printf %s "checking for ${ac_tool_prefix}file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/${ac_tool_prefix}file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +printf %s "checking for file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC=$CC +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(void){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test ${lt_cv_prog_compiler_rtti_exceptions+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test yes = "$GCC"; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + lt_prog_compiler_pic='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + + mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64, which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + *flang* | ftn | f18* | f95*) + # Flang compiler. + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | $SED 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *-mlibc) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + serenity*) + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works"; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_static_works=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works"; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } + if test no = "$hard_links"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | windows* | pw32* | cegcc*) + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++ or Intel C++ Compiler. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) + with_gnu_ld=yes + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test yes = "$lt_use_gnu_ld_interface"; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='$wl' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + export_dynamic_flag_spec='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test ia64 != "$host_cpu"; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | windows* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='$wl--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + file_list_spec='@' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs=no + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + file_list_spec='@' + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test linux-dietlibc = "$host_os"; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | $SED 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + tcc*) + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + export_dynamic_flag_spec='-rdynamic' + ;; + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + *-mlibc) + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test no = "$ld_shlibs"; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct=no + hardcode_direct_absolute=no + ;; + esac + + if test yes = "$GCC"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + export_dynamic_flag_spec='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' $wl-bernotok' + allow_undefined_flag=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | windows* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++ or Intel C++ Compiler. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl* | icl*) + # Native MSVC or ICC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -Fe$output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -Fe$tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC and ICC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly* | midnightbsd*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test yes = "$GCC"; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='$wl-E' + ;; + + hpux10*) + if test yes,no = "$GCC,$with_gnu_ld"; then + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +printf %s "checking if $CC understands -b... " >&6; } +if test ${lt_cv_prog_compiler__b+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler__b=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } + +if test yes = "$lt_cv_prog_compiler__b"; then + archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test yes = "$GCC"; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if test ${lt_cv_irix_exported_symbol+y} +then : + printf %s "(cached) " >&6 +else $as_nop + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_irix_exported_symbol=yes +else $as_nop + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } + if test yes = "$lt_cv_irix_exported_symbol"; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + ld_shlibs=yes + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + ;; + esac + ;; + + *-mlibc) + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + else + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + file_list_spec='@' + ;; + + osf3*) + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + serenity*) + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test yes = "$GCC"; then + wlarc='$wl' + archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='$wl' + archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. GCC discards it without '$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test yes = "$GCC"; then + whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='$wl-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='$wl-z,text' + allow_undefined_flag='$wl-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='$wl-Blargedynsym' + ;; + esac + fi + fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +printf "%s\n" "$ld_shlibs" >&6; } +test no = "$ld_shlibs" && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc+y} +then : + printf %s "(cached) " >&6 +else $as_nop + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } + +if test yes = "$GCC"; then + case $host_os in + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in + mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary... + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo = "/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's|/\([A-Za-z]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + + + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | windows* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + # If user builds GCC with multilib enabled, + # it should just install on $(libdir) + # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones. + if test xyes = x"$multilib"; then + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + $install_prog $dir/$dlname $destdir/$dlname~ + chmod a+x $destdir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib $destdir/$dlname'\'' || exit \$?; + fi' + else + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + fi + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | windows* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl* | *,icl*) + # Native MSVC or ICC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw* | windows*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC and ICC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly* | midnightbsd*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + case $host_cpu in + powerpc64) + # On FreeBSD bi-arch platforms, a different variable is used for 32-bit + # binaries. See . + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int test_pointer_size[sizeof (void *) - 5]; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + shlibpath_var=LD_LIBRARY_PATH +else $as_nop + shlibpath_var=LD_32_LIBRARY_PATH +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + *) + shlibpath_var=LD_LIBRARY_PATH + ;; + esac + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' + sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' + hardcode_into_libs=no + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # -rpath works at least for libraries that are not overridden by + # libraries installed in system locations. + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Ideally, we could use ldconfig to report *all* directories which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +*-mlibc) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='mlibc ld.so' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +serenity*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + dynamic_linker='SerenityOS LibELF' + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +emscripten*) + version_type=none + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + dynamic_linker="Emscripten linker" + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test yes = "$GCC"; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + lt_prog_compiler_pic='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + + mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64, which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + *flang* | ftn | f18* | f95*) + # Flang compiler. + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | $SED 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *-mlibc) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + serenity*) + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works"; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_static_works=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works"; then + : +else + lt_prog_compiler_static= +fi + + + +='-fPIC' + archive_cmds='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib' + archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym' + archive_cmds_need_lc=no + no_undefined_flag= + ;; + +*) + dynamic_linker=no + ;; +esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test yes = "$hardcode_automatic"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && + test no != "$hardcode_minus_L"; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +printf "%s\n" "$hardcode_action" >&6; } + +if test relink = "$hardcode_action" || + test yes = "$inherit_rpath"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | windows* | pw32* | cegcc*) + lt_cv_dlopen=LoadLibrary + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dl_dlopen=yes +else $as_nop + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else $as_nop + + lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes +then : + lt_cv_dlopen=shl_load +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +printf %s "checking for shl_load in -ldld... " >&6; } +if test ${ac_cv_lib_dld_shl_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main (void) +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dld_shl_load=yes +else $as_nop + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes +then : + lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld +else $as_nop + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes +then : + lt_cv_dlopen=dlopen +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dl_dlopen=yes +else $as_nop + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +printf %s "checking for dlopen in -lsvld... " >&6; } +if test ${ac_cv_lib_svld_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_svld_dlopen=yes +else $as_nop + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes +then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +printf %s "checking for dld_link in -ldld... " >&6; } +if test ${ac_cv_lib_dld_dld_link+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main (void) +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dld_dld_link=yes +else $as_nop + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes +then : + lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test no = "$lt_cv_dlopen"; then + enable_dlopen=no + else + enable_dlopen=yes + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +printf %s "checking whether a program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord (void) __attribute__((visibility("default"))); +#endif + +int fnord (void) { return 42; } +int main (void) +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +printf "%s\n" "$lt_cv_dlopen_self" >&6; } + + if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +printf %s "checking whether a statically linked program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self_static+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord (void) __attribute__((visibility("default"))); +#endif + +int fnord (void) { return 42; } +int main (void) +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +printf %s "checking whether stripping libraries is possible... " >&6; } +if test -z "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +else + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + esac + fi +fi + + + + + + + + + + + + + # Report what library types will actually be built + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +printf %s "checking if libtool supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +printf "%s\n" "$can_build_shared" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +printf %s "checking whether to build shared libraries... " >&6; } + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +printf "%s\n" "$enable_shared" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +printf %s "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +printf "%s\n" "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC + + if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +printf %s "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if test ${ac_cv_prog_CXXCPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CXX needs to be expanded + for CXXCPP in "$CXX -E" cpp /lib/cpp + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : + +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +printf "%s\n" "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : + +else $as_nop + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else $as_nop + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +else + _lt_caught_CXX_error=yes +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +compiler_needs_object_CXX=no +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_direct_absolute_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +inherit_rpath_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_caught_CXX_error"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + + # save warnings/boilerplate of simple test code + ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + + ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + compiler_CXX=$CC + func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test yes = "$GXX"; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' + else + lt_prog_compiler_no_builtin_flag_CXX= + fi + + if test yes = "$GXX"; then + # Set up default GNU C++ configuration + + + +# Check whether --with-gnu-ld was given. +if test ${with_gnu_ld+y} +then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else $as_nop + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw* | *-*-windows*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test yes = "$with_gnu_ld"; then + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='$wl' + + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [-]L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + ld_shlibs_CXX=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix[4-9]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + file_list_spec_CXX='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct_CXX=no + hardcode_direct_absolute_CXX=no + ;; + esac + + if test yes = "$GXX"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + export_dynamic_flag_spec_CXX='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + always_export_symbols_CXX=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + # The "-G" linker flag allows undefined symbols. + no_undefined_flag_CXX='-bernotok' + # Determine the default libpath from the value encoded in an empty + # executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if test ${lt_cv_aix_libpath__CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if test ${lt_cv_aix_libpath__CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' $wl-bernotok' + allow_undefined_flag_CXX=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi + archive_cmds_need_lc_CXX=yes + archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | windows* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='$wl--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + file_list_spec_CXX='@' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + + + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec_CXX='' + fi + link_all_deplibs_CXX=yes + allow_undefined_flag_CXX=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds_CXX="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + if test yes = "$_lt_dar_needs_single_mod" -a yes != "$lt_cv_apple_cc_single_mod"; then + archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + fi + + else + ld_shlibs_CXX=no + fi + + ;; + + os2*) + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_minus_L_CXX=yes + allow_undefined_flag_CXX=unsupported + shrext_cmds=.dll + archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_from_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes_CXX=yes + file_list_spec_CXX='@' + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + ld_shlibs_CXX=no + ;; + + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + + freebsd* | dragonfly* | midnightbsd*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs_CXX=no + ;; + + hpux9*) + hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='$wl-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "[-]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + export_dynamic_flag_spec_CXX='$wl-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " [-]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + interix[3-9]*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + hardcode_libdir_separator_CXX=: + inherit_rpath_CXX=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) + prelink_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + old_archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + export_dynamic_flag_spec_CXX='$wl--export-dynamic' + archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | $SED 5q` in + *Sun\ C*) + # Sun C++ 5.9 + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' + hardcode_libdir_flag_spec_CXX='-R$libdir' + whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object_CXX=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + *-mlibc) + ld_shlibs_CXX=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + ld_shlibs_CXX=yes + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + hardcode_direct_absolute_CXX=yes + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='$wl-E' + whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + ld_shlibs_CXX=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + case $host in + osf3*) + allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' + archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + ;; + *) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + ;; + esac + + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes,no = "$GXX,$with_gnu_ld"; then + allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' + case $host in + osf3*) + archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + *) + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [-]L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + serenity*) + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test yes,no = "$GXX,$with_gnu_ld"; then + no_undefined_flag_CXX=' $wl-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [-]L"' + else + # g++ 2.7 appears to require '-G' NOT '-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " [-]L"' + fi + + hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='$wl-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_CXX='$wl-z,text' + allow_undefined_flag_CXX='$wl-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" + ;; + *) + archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +printf "%s\n" "$ld_shlibs_CXX" >&6; } + test no = "$ld_shlibs_CXX" && can_build_shared=no + + GCC_CXX=$GXX + LD_CXX=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + # Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF + + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $prev$p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R,l}" and the path. + # Remove the space. + if test x-L = x"$p" || + test x-R = x"$p" || + test x-l = x"$p"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test no = "$pre_test_object_deps_done"; then + case $prev in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX=$prev$p + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX=$prev$p + else + postdeps_CXX="${postdeps_CXX} $prev$p" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test no = "$pre_test_object_deps_done"; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX=$p + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX=$p + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +case $host_os in +interix[3-9]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + compiler_lib_search_dirs_CXX= +if test -n "${compiler_lib_search_path_CXX}"; then + compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + + + # C++ specific cases for pic, static, wl, etc. + if test yes = "$GXX"; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + lt_prog_compiler_pic_CXX='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic_CXX='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static_CXX='$wl-static' + ;; + esac + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix[4-9]*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly* | midnightbsd*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64, which still supported -KPIC. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-qpic' + lt_prog_compiler_static_CXX='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | $SED 5q` in + *Sun\ C*) + # Sun C++ 5.9 + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + ;; + *-mlibc) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + serenity*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works_CXX=yes + fi + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_static_works_CXX=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works_CXX=yes + fi + else + lt_cv_prog_compiler_static_works_CXX=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then + : +else + lt_prog_compiler_static_CXX= +fi + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } + if test no = "$hard_links"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + case $host_os in + aix[4-9]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX=$ltdll_cmds + ;; + cygwin* | mingw* | windows* | cegcc*) + case $cc_basename in + cl* | icl*) + exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +printf "%s\n" "$ld_shlibs_CXX" >&6; } +test no = "$ld_shlibs_CXX" && can_build_shared=no + +with_gnu_ld_CXX=$with_gnu_ld + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } + +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + + + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | windows* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + # If user builds GCC with multilib enabled, + # it should just install on $(libdir) + # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones. + if test xyes = x"$multilib"; then + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + $install_prog $dir/$dlname $destdir/$dlname~ + chmod a+x $destdir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib $destdir/$dlname'\'' || exit \$?; + fi' + else + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + fi + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + ;; + mingw* | windows* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl* | *,icl*) + # Native MSVC or ICC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw* | windows*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC and ICC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly* | midnightbsd*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + case $host_cpu in + powerpc64) + # On FreeBSD bi-arch platforms, a different variable is used for 32-bit + # binaries. See . + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int test_pointer_size[sizeof (void *) - 5]; + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + shlibpath_var=LD_LIBRARY_PATH +else $as_nop + shlibpath_var=LD_32_LIBRARY_PATH +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + *) + shlibpath_var=LD_LIBRARY_PATH + ;; + esac + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/boot/system/non-packaged/develop/lib /boot/system/develop/lib' + sys_lib_dlsearch_path_spec='/boot/home/config/non-packaged/lib /boot/home/config/lib /boot/system/non-packaged/lib /boot/system/lib' + hardcode_into_libs=no + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # -rpath works at least for libraries that are not overridden by + # libraries installed in system locations. + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Ideally, we could use ldconfig to report *all* directories which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +*-mlibc) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='mlibc ld.so' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +serenity*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + dynamic_linker='SerenityOS LibELF' + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +emscripten*) + version_type=none + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + dynamic_linker="Emscripten linker" + lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + + + # C++ specific cases for pic, static, wl, etc. + if test yes = "$GXX"; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + lt_prog_compiler_pic_CXX='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic_CXX='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static_CXX='$wl-static' + ;; + esac + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix[4-9]*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly* | midnightbsd*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='$wl-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64, which still supported -KPIC. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-qpic' + lt_prog_compiler_static_CXX='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | $SED 5q` in + *Sun\ C*) + # Sun C++ 5.9 + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + ;; + *-mlibc) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + serenity*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works_CXX=yes + fi + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_static_works_CXX=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works_CXX=yes + fi + else + lt_cv_prog_compiler_static_works_CXX=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then + : +else + lt_prog_compiler_static_CXX= +fi + + + +='-fPIC' + archive_cmds_CXX='$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib' + archive_expsym_cmds_CXX='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -sSIDE_MODULE=2 -shared $libobjs $deplibs $compiler_flags -o $lib -s EXPORTED_FUNCTIONS=@$output_objdir/$soname.expsym' + archive_cmds_need_lc_CXX=no + no_undefined_flag_CXX= + ;; + +*) + dynamic_linker=no + ;; +esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || + test -n "$runpath_var_CXX" || + test yes = "$hardcode_automatic_CXX"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct_CXX" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && + test no != "$hardcode_minus_L_CXX"; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 +printf "%s\n" "$hardcode_action_CXX" >&6; } + +if test relink = "$hardcode_action_CXX" || + test yes = "$inherit_rpath_CXX"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test yes != "$_lt_caught_CXX_error" + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + +# By default we simply use the C compiler to build assembly code. + +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS + + + +depcc="$CCAS" am_compiler_list= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CCAS_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CCAS_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CCAS_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CCAS_dependencies_compiler_type=none +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CCAS_dependencies_compiler_type" >&6; } +CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then + am__fastdepCCAS_TRUE= + am__fastdepCCAS_FALSE='#' +else + am__fastdepCCAS_TRUE='#' + am__fastdepCCAS_FALSE= +fi + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +printf %s "checking for an ANSI C-conforming const... " >&6; } +if test ${ac_cv_c_const+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* IBM XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_const=yes +else $as_nop + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +printf "%s\n" "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +printf "%s\n" "#define const /**/" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo (void) {return 0; } +$ac_kw foo_t foo (void) {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes +then : + +else $as_nop + +printf "%s\n" "#define size_t unsigned int" >>confdefs.h + +fi + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 +printf %s "checking size of off_t... " >&6; } +if test ${ac_cv_sizeof_off_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default" +then : + +else $as_nop + if test "$ac_cv_type_off_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (off_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_off_t=0 + fi +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 +printf "%s\n" "$ac_cv_sizeof_off_t" >&6; } + + + +printf "%s\n" "#define SIZEOF_OFF_T $ac_cv_sizeof_off_t" >>confdefs.h + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: --- Checking for header files ---" >&5 +printf "%s\n" "$as_me: --- Checking for header files ---" >&6;} +ac_fn_c_check_header_compile "$LINENO" "asm/ptrace_offsets.h" "ac_cv_header_asm_ptrace_offsets_h" "$ac_includes_default" +if test "x$ac_cv_header_asm_ptrace_offsets_h" = xyes +then : + printf "%s\n" "#define HAVE_ASM_PTRACE_OFFSETS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "asm/ptrace.h" "ac_cv_header_asm_ptrace_h" "$ac_includes_default" +if test "x$ac_cv_header_asm_ptrace_h" = xyes +then : + printf "%s\n" "#define HAVE_ASM_PTRACE_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "asm/vsyscall.h" "ac_cv_header_asm_vsyscall_h" "$ac_includes_default" +if test "x$ac_cv_header_asm_vsyscall_h" = xyes +then : + printf "%s\n" "#define HAVE_ASM_VSYSCALL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "endian.h" "ac_cv_header_endian_h" "$ac_includes_default" +if test "x$ac_cv_header_endian_h" = xyes +then : + printf "%s\n" "#define HAVE_ENDIAN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/endian.h" "ac_cv_header_sys_endian_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_endian_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_ENDIAN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "execinfo.h" "ac_cv_header_execinfo_h" "$ac_includes_default" +if test "x$ac_cv_header_execinfo_h" = xyes +then : + printf "%s\n" "#define HAVE_EXECINFO_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "ia64intrin.h" "ac_cv_header_ia64intrin_h" "$ac_includes_default" +if test "x$ac_cv_header_ia64intrin_h" = xyes +then : + printf "%s\n" "#define HAVE_IA64INTRIN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/uc_access.h" "ac_cv_header_sys_uc_access_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_uc_access_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_UC_ACCESS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = xyes +then : + printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default" +if test "x$ac_cv_header_signal_h" = xyes +then : + printf "%s\n" "#define HAVE_SIGNAL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/procfs.h" "ac_cv_header_sys_procfs_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_procfs_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PROCFS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/ptrace.h" "ac_cv_header_sys_ptrace_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ptrace_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PTRACE_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/syscall.h" "ac_cv_header_sys_syscall_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_syscall_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SYSCALL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "byteswap.h" "ac_cv_header_byteswap_h" "$ac_includes_default" +if test "x$ac_cv_header_byteswap_h" = xyes +then : + printf "%s\n" "#define HAVE_BYTESWAP_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "elf.h" "ac_cv_header_elf_h" "$ac_includes_default" +if test "x$ac_cv_header_elf_h" = xyes +then : + printf "%s\n" "#define HAVE_ELF_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/elf.h" "ac_cv_header_sys_elf_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_elf_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_ELF_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "link.h" "ac_cv_header_link_h" "$ac_includes_default" +if test "x$ac_cv_header_link_h" = xyes +then : + printf "%s\n" "#define HAVE_LINK_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/link.h" "ac_cv_header_sys_link_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_link_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_LINK_H 1" >>confdefs.h + +fi + + +CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: --- Checking for available types ---" >&5 +printf "%s\n" "$as_me: --- Checking for available types ---" >&6;} +ac_fn_c_check_member "$LINENO" "struct dl_phdr_info" "dlpi_subs" "ac_cv_member_struct_dl_phdr_info_dlpi_subs" "#include +" +if test "x$ac_cv_member_struct_dl_phdr_info_dlpi_subs" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_DL_PHDR_INFO_DLPI_SUBS 1" >>confdefs.h + + +fi + +ac_fn_c_check_type "$LINENO" "struct elf_prstatus" "ac_cv_type_struct_elf_prstatus" "$ac_includes_default +#if HAVE_SYS_PROCFS_H +# include +#endif + +" +if test "x$ac_cv_type_struct_elf_prstatus" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_ELF_PRSTATUS 1" >>confdefs.h + + +fi +ac_fn_c_check_type "$LINENO" "struct prstatus" "ac_cv_type_struct_prstatus" "$ac_includes_default +#if HAVE_SYS_PROCFS_H +# include +#endif + +" +if test "x$ac_cv_type_struct_prstatus" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_PRSTATUS 1" >>confdefs.h + + +fi +ac_fn_c_check_type "$LINENO" "procfs_status" "ac_cv_type_procfs_status" "$ac_includes_default +#if HAVE_SYS_PROCFS_H +# include +#endif + +" +if test "x$ac_cv_type_procfs_status" = xyes +then : + +printf "%s\n" "#define HAVE_PROCFS_STATUS 1" >>confdefs.h + + +fi +ac_fn_c_check_type "$LINENO" "elf_fpregset_t" "ac_cv_type_elf_fpregset_t" "$ac_includes_default +#if HAVE_SYS_PROCFS_H +# include +#endif + +" +if test "x$ac_cv_type_elf_fpregset_t" = xyes +then : + +printf "%s\n" "#define HAVE_ELF_FPREGSET_T 1" >>confdefs.h + + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: --- Checking for libraries ---" >&5 +printf "%s\n" "$as_me: --- Checking for libraries ---" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing __uc_get_grs" >&5 +printf %s "checking for library containing __uc_get_grs... " >&6; } +if test ${ac_cv_search___uc_get_grs+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char __uc_get_grs (); +int +main (void) +{ +return __uc_get_grs (); + ; + return 0; +} +_ACEOF +for ac_lib in '' uca +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search___uc_get_grs=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search___uc_get_grs+y} +then : + break +fi +done +if test ${ac_cv_search___uc_get_grs+y} +then : + +else $as_nop + ac_cv_search___uc_get_grs=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search___uc_get_grs" >&5 +printf "%s\n" "$ac_cv_search___uc_get_grs" >&6; } +ac_res=$ac_cv_search___uc_get_grs +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + +ac_fn_c_check_func "$LINENO" "dl_iterate_phdr" "ac_cv_func_dl_iterate_phdr" +if test "x$ac_cv_func_dl_iterate_phdr" = xyes +then : + printf "%s\n" "#define HAVE_DL_ITERATE_PHDR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "dl_phdr_removals_counter" "ac_cv_func_dl_phdr_removals_counter" +if test "x$ac_cv_func_dl_phdr_removals_counter" = xyes +then : + printf "%s\n" "#define HAVE_DL_PHDR_REMOVALS_COUNTER 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "dlmodinfo" "ac_cv_func_dlmodinfo" +if test "x$ac_cv_func_dlmodinfo" = xyes +then : + printf "%s\n" "#define HAVE_DLMODINFO 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getunwind" "ac_cv_func_getunwind" +if test "x$ac_cv_func_getunwind" = xyes +then : + printf "%s\n" "#define HAVE_GETUNWIND 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "ttrace" "ac_cv_func_ttrace" +if test "x$ac_cv_func_ttrace" = xyes +then : + printf "%s\n" "#define HAVE_TTRACE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mincore" "ac_cv_func_mincore" +if test "x$ac_cv_func_mincore" = xyes +then : + printf "%s\n" "#define HAVE_MINCORE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pipe2" "ac_cv_func_pipe2" +if test "x$ac_cv_func_pipe2" = xyes +then : + printf "%s\n" "#define HAVE_PIPE2 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sigaltstack" "ac_cv_func_sigaltstack" +if test "x$ac_cv_func_sigaltstack" = xyes +then : + printf "%s\n" "#define HAVE_SIGALTSTACK 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "execvpe" "ac_cv_func_execvpe" +if test "x$ac_cv_func_execvpe" = xyes +then : + printf "%s\n" "#define HAVE_EXECVPE 1" >>confdefs.h + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if building with AltiVec" >&5 +printf %s "checking if building with AltiVec... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifndef __ALTIVEC__ +# error choke +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + use_altivec=yes +else $as_nop + use_altivec=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test x$use_altivec = xyes; then + USE_ALTIVEC_TRUE= + USE_ALTIVEC_FALSE='#' +else + USE_ALTIVEC_TRUE='#' + USE_ALTIVEC_FALSE= +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $use_altivec" >&5 +printf "%s\n" "$use_altivec" >&6; } + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifndef __powerpc64__ +# error choke +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ppc_bits=64 +else $as_nop + ppc_bits=32 +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + + + case $build_cpu in #( + aarch64*) : + build_arch=aarch64 ;; #( + arm*) : + build_arch=arm ;; #( + i?86) : + build_arch=x86 ;; #( + hppa*) : + build_arch=hppa ;; #( + mips*) : + build_arch=mips ;; #( + powerpc*) : + build_arch=ppc$ppc_bits ;; #( + sh*) : + build_arch=sh ;; #( + amd64) : + build_arch=x86_64 ;; #( + riscv*) : + build_arch=riscv ;; #( + loongarch64*) : + build_arch=loongarch64 ;; #( + *) : + build_arch=$build_cpu ;; +esac + + + case $host_cpu in #( + aarch64*) : + host_arch=aarch64 ;; #( + arm*) : + host_arch=arm ;; #( + i?86) : + host_arch=x86 ;; #( + hppa*) : + host_arch=hppa ;; #( + mips*) : + host_arch=mips ;; #( + powerpc*) : + host_arch=ppc$ppc_bits ;; #( + sh*) : + host_arch=sh ;; #( + amd64) : + host_arch=x86_64 ;; #( + riscv*) : + host_arch=riscv ;; #( + loongarch64*) : + host_arch=loongarch64 ;; #( + *) : + host_arch=$host_cpu ;; +esac + + + case $target_cpu in #( + aarch64*) : + target_arch=aarch64 ;; #( + arm*) : + target_arch=arm ;; #( + i?86) : + target_arch=x86 ;; #( + hppa*) : + target_arch=hppa ;; #( + mips*) : + target_arch=mips ;; #( + powerpc*) : + target_arch=ppc$ppc_bits ;; #( + sh*) : + target_arch=sh ;; #( + amd64) : + target_arch=x86_64 ;; #( + riscv*) : + target_arch=riscv ;; #( + loongarch64*) : + target_arch=loongarch64 ;; #( + *) : + target_arch=$target_cpu ;; +esac + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libunwind-coredump should be built" >&5 +printf %s "checking if libunwind-coredump should be built... " >&6; } +# Check whether --enable-coredump was given. +if test ${enable_coredump+y} +then : + enableval=$enable_coredump; +else $as_nop + enable_coredump="check" + +fi + +if test "$enable_coredump" = "check" +then : + case $host_arch in #( + aarch64*|arm*|mips*|sh*|x86*|riscv*|loongarch64) : + enable_coredump=yes ;; #( + *) : + enable_coredump=no ;; +esac + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_coredump" >&5 +printf "%s\n" "$enable_coredump" >&6; } + if test x$enable_coredump = xyes; then + BUILD_COREDUMP_TRUE= + BUILD_COREDUMP_FALSE='#' +else + BUILD_COREDUMP_TRUE='#' + BUILD_COREDUMP_FALSE= +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libunwind-ptrace should be built" >&5 +printf %s "checking if libunwind-ptrace should be built... " >&6; } +# Check whether --enable-ptrace was given. +if test ${enable_ptrace+y} +then : + enableval=$enable_ptrace; +else $as_nop + enable_ptrace="check" + +fi + +if test "$enable_ptrace" != "no" +then : + if test "$ac_cv_header_sys_ptrace_h" = "yes" +then : + enable_ptrace=yes +elif test "$enable_ptrace" != "check" +then : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "--enable-ptrace given but + ptrace not supported on target +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + enable_ptrace="no" + +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_ptrace" >&5 +printf "%s\n" "$enable_ptrace" >&6; } + if test x$enable_ptrace = xyes; then + BUILD_PTRACE_TRUE= + BUILD_PTRACE_FALSE='#' +else + BUILD_PTRACE_TRUE='#' + BUILD_PTRACE_FALSE= +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +(void) strchr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +extern void ac_decl (int, char *); + +int +main (void) +{ +(void) ac_decl (0, (char *) 0); + (void) ac_decl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x +then : + ac_cv_c_undeclared_builtin_options='none needed' +else $as_nop + ac_cv_c_undeclared_builtin_options=$ac_arg +fi + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in #( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See \`config.log' for more details" "$LINENO" 5; } ;; #( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; #( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac + +if test -z "$BUILD_PTRACE_TRUE"; then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: --- Checking for ptrace symbols ---" >&5 +printf "%s\n" "$as_me: --- Checking for ptrace symbols ---" >&6;} + ac_fn_check_decl "$LINENO" "PTRACE_POKEUSER" "ac_cv_have_decl_PTRACE_POKEUSER" "$ac_includes_default + #if HAVE_SYS_TYPES_H + #include + #endif + #include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_PTRACE_POKEUSER" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_PTRACE_POKEUSER $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "PTRACE_POKEDATA" "ac_cv_have_decl_PTRACE_POKEDATA" "$ac_includes_default + #if HAVE_SYS_TYPES_H + #include + #endif + #include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_PTRACE_POKEDATA" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_PTRACE_POKEDATA $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "PTRACE_SETREGSET" "ac_cv_have_decl_PTRACE_SETREGSET" "$ac_includes_default + #if HAVE_SYS_TYPES_H + #include + #endif + #include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_PTRACE_SETREGSET" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_PTRACE_SETREGSET $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "PTRACE_TRACEME" "ac_cv_have_decl_PTRACE_TRACEME" "$ac_includes_default + #if HAVE_SYS_TYPES_H + #include + #endif + #include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_PTRACE_TRACEME" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_PTRACE_TRACEME $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "PTRACE_CONT" "ac_cv_have_decl_PTRACE_CONT" "$ac_includes_default + #if HAVE_SYS_TYPES_H + #include + #endif + #include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_PTRACE_CONT" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_PTRACE_CONT $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "PTRACE_SINGLESTEP" "ac_cv_have_decl_PTRACE_SINGLESTEP" "$ac_includes_default + #if HAVE_SYS_TYPES_H + #include + #endif + #include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_PTRACE_SINGLESTEP" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_PTRACE_SINGLESTEP $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "PTRACE_SYSCALL" "ac_cv_have_decl_PTRACE_SYSCALL" "$ac_includes_default + #if HAVE_SYS_TYPES_H + #include + #endif + #include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_PTRACE_SYSCALL" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_PTRACE_SYSCALL $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "PT_IO" "ac_cv_have_decl_PT_IO" "$ac_includes_default + #if HAVE_SYS_TYPES_H + #include + #endif + #include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_PT_IO" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_PT_IO $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "PT_GETREGS" "ac_cv_have_decl_PT_GETREGS" "$ac_includes_default + #if HAVE_SYS_TYPES_H + #include + #endif + #include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_PT_GETREGS" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_PT_GETREGS $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "PT_GETFPREGS" "ac_cv_have_decl_PT_GETFPREGS" "$ac_includes_default + #if HAVE_SYS_TYPES_H + #include + #endif + #include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_PT_GETFPREGS" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_PT_GETFPREGS $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "PT_CONTINUE" "ac_cv_have_decl_PT_CONTINUE" "$ac_includes_default + #if HAVE_SYS_TYPES_H + #include + #endif + #include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_PT_CONTINUE" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_PT_CONTINUE $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "PT_TRACE_ME" "ac_cv_have_decl_PT_TRACE_ME" "$ac_includes_default + #if HAVE_SYS_TYPES_H + #include + #endif + #include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_PT_TRACE_ME" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_PT_TRACE_ME $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "PT_STEP" "ac_cv_have_decl_PT_STEP" "$ac_includes_default + #if HAVE_SYS_TYPES_H + #include + #endif + #include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_PT_STEP" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_PT_STEP $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "PT_SYSCALL" "ac_cv_have_decl_PT_SYSCALL" "$ac_includes_default + #if HAVE_SYS_TYPES_H + #include + #endif + #include + +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_PT_SYSCALL" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_PT_SYSCALL $ac_have_decl" >>confdefs.h + + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libunwind-nto should be built" >&5 +printf %s "checking if libunwind-nto should be built... " >&6; } +# Check whether --enable-nto was given. +if test ${enable_nto+y} +then : + enableval=$enable_nto; +else $as_nop + enable_nto="check" + +fi + +if test "$enable_nto" != "no" +then : + ac_fn_c_check_header_compile "$LINENO" "sys/neutrino.h" "ac_cv_header_sys_neutrino_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_neutrino_h" = xyes +then : + enable_nto=yes +else $as_nop + enable_nto=no +fi + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_nto" >&5 +printf "%s\n" "$enable_nto" >&6; } + if test x$enable_nto = xyes; then + BUILD_NTO_TRUE= + BUILD_NTO_FALSE='#' +else + BUILD_NTO_TRUE='#' + BUILD_NTO_FALSE= +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libunwind-setjmp should be built" >&5 +printf %s "checking if libunwind-setjmp should be built... " >&6; } +# Check whether --enable-setjmp was given. +if test ${enable_setjmp+y} +then : + enableval=$enable_setjmp; +else $as_nop + enable_setjmp=check + +fi + +if test "$enable_setjmp" = check +then : + if test x$target_arch = x$host_arch +then : + enable_setjmp=yes +else $as_nop + enable_setjmp=no +fi + if expr x$target_os : xnto-qnx >/dev/null +then : + enable_setjmp=no +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_setjmp" >&5 +printf "%s\n" "$enable_setjmp" >&6; } + if test x$enable_setjmp = xyes; then + BUILD_SETJMP_TRUE= + BUILD_SETJMP_FALSE='#' +else + BUILD_SETJMP_TRUE='#' + BUILD_SETJMP_FALSE= +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if weak-backtrace is enabled" >&5 +printf %s "checking if weak-backtrace is enabled... " >&6; } +# Check whether --enable-weak-backtrace was given. +if test ${enable_weak_backtrace+y} +then : + enableval=$enable_weak_backtrace; +else $as_nop + enable_weak_backtrace=yes + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_weak_backtrace" >&5 +printf "%s\n" "$enable_weak_backtrace" >&6; } + if test "x$enable_weak_backtrace" = xyes; then + CONFIG_WEAK_BACKTRACE_TRUE= + CONFIG_WEAK_BACKTRACE_FALSE='#' +else + CONFIG_WEAK_BACKTRACE_TRUE='#' + CONFIG_WEAK_BACKTRACE_FALSE= +fi + +if test -z "$CONFIG_WEAK_BACKTRACE_TRUE"; then : + + +printf "%s\n" "#define CONFIG_WEAK_BACKTRACE 1" >>confdefs.h + + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if unwind.h should be exported" >&5 +printf %s "checking if unwind.h should be exported... " >&6; } +# Check whether --enable-unwind-header was given. +if test ${enable_unwind_header+y} +then : + enableval=$enable_unwind_header; +else $as_nop + enable_unwind_header=yes + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_unwind_header" >&5 +printf "%s\n" "$enable_unwind_header" >&6; } + if test "x$enable_unwind_header" = xyes; then + BUILD_UNWIND_HEADER_TRUE= + BUILD_UNWIND_HEADER_FALSE='#' +else + BUILD_UNWIND_HEADER_TRUE='#' + BUILD_UNWIND_HEADER_FALSE= +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support UNW_CACHE_PER_THREAD" >&5 +printf %s "checking whether to support UNW_CACHE_PER_THREAD... " >&6; } +# Check whether --enable-per-thread-cache was given. +if test ${enable_per_thread_cache+y} +then : + enableval=$enable_per_thread_cache; +else $as_nop + enable_per_thread_cache=no + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_per_thread_cache" >&5 +printf "%s\n" "$enable_per_thread_cache" >&6; } +if test x$enable_per_thread_cache = xyes +then : + +printf "%s\n" "#define HAVE___CACHE_PER_THREAD 1" >>confdefs.h + + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if testsuite should be built" >&5 +printf %s "checking if testsuite should be built... " >&6; } +# Check whether --enable-tests was given. +if test ${enable_tests+y} +then : + enableval=$enable_tests; +else $as_nop + enable_tests=yes + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_tests" >&5 +printf "%s\n" "$enable_tests" >&6; } + if test x$enable_tests = xyes; then + CONFIG_TESTS_TRUE= + CONFIG_TESTS_FALSE='#' +else + CONFIG_TESTS_TRUE='#' + CONFIG_TESTS_FALSE= +fi + +if test -z "$CONFIG_TESTS_TRUE"; then : + + old_LIBS="$LIBS" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: --- Checking for extra libraries linked to tests ---" >&5 +printf "%s\n" "$as_me: --- Checking for extra libraries linked to tests ---" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 +printf %s "checking for library containing dlopen... " >&6; } +if test ${ac_cv_search_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dl +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_dlopen=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_dlopen+y} +then : + break +fi +done +if test ${ac_cv_search_dlopen+y} +then : + +else $as_nop + ac_cv_search_dlopen=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 +printf "%s\n" "$ac_cv_search_dlopen" >&6; } +ac_res=$ac_cv_search_dlopen +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + if test "$ac_cv_search_dlopen" != "none required" +then : + DLLIB="$ac_cv_search_dlopen" + +fi +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5 +printf %s "checking for library containing pthread_create... " >&6; } +if test ${ac_cv_search_pthread_create+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char pthread_create (); +int +main (void) +{ +return pthread_create (); + ; + return 0; +} +_ACEOF +for ac_lib in '' pthread +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_pthread_create=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_pthread_create+y} +then : + break +fi +done +if test ${ac_cv_search_pthread_create+y} +then : + +else $as_nop + ac_cv_search_pthread_create=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_create" >&5 +printf "%s\n" "$ac_cv_search_pthread_create" >&6; } +ac_res=$ac_cv_search_pthread_create +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + if test "$ac_cv_search_pthread_create" != "none required" +then : + PTHREADS_LIB="$ac_cv_search_pthread_create" + +fi +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing backtrace" >&5 +printf %s "checking for library containing backtrace... " >&6; } +if test ${ac_cv_search_backtrace+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char backtrace (); +int +main (void) +{ +return backtrace (); + ; + return 0; +} +_ACEOF +for ac_lib in '' execinfo +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search_backtrace=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search_backtrace+y} +then : + break +fi +done +if test ${ac_cv_search_backtrace+y} +then : + +else $as_nop + ac_cv_search_backtrace=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_backtrace" >&5 +printf "%s\n" "$ac_cv_search_backtrace" >&6; } +ac_res=$ac_cv_search_backtrace +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + if test "$ac_cv_search_backtrace" != "none required" +then : + BACKTRACELIB="$ac_cv_search_backtrace" + +fi +fi + + LIBS="$old_LIBS" + ac_config_files="$ac_config_files tests/Makefile" + + ac_config_files="$ac_config_files tests/check-namespace.sh" + + +fi + +# Check whether --with-testdriver was given. +if test ${with_testdriver+y} +then : + withval=$with_testdriver; +else $as_nop + with_testdriver=\$\(top_srcdir\)/config/test-driver +fi + +UNW_TESTDRIVER=$with_testdriver + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if debug support should be built" >&5 +printf %s "checking if debug support should be built... " >&6; } +# Check whether --enable-debug was given. +if test ${enable_debug+y} +then : + enableval=$enable_debug; +else $as_nop + enable_debug=no + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_debug" >&5 +printf "%s\n" "$enable_debug" >&6; } +if test x$enable_debug = xyes +then : + CPPFLAGS="${CPPFLAGS} -DDEBUG" +else $as_nop + CPPFLAGS="${CPPFLAGS} -DNDEBUG" + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if C++ exception support should be built" >&5 +printf %s "checking if C++ exception support should be built... " >&6; } +# Check whether --enable-cxx_exceptions was given. +if test ${enable_cxx_exceptions+y} +then : + enableval=$enable_cxx_exceptions; +else $as_nop + enable_cxx_exceptions=check + +fi + +if test $enable_cxx_exceptions = check +then : + case $target_arch in #( + aarch64*|arm*|mips*|x86*|s390x*|loongarch64) : + enable_cxx_exceptions=no ;; #( + *) : + enable_cxx_exceptions=yes ;; +esac + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_cxx_exceptions" >&5 +printf "%s\n" "$enable_cxx_exceptions" >&6; } + if test x$enable_cxx_exceptions = xyes; then + SUPPORT_CXX_EXCEPTIONS_TRUE= + SUPPORT_CXX_EXCEPTIONS_FALSE='#' +else + SUPPORT_CXX_EXCEPTIONS_TRUE='#' + SUPPORT_CXX_EXCEPTIONS_FALSE= +fi + +if test -z "$SUPPORT_CXX_EXCEPTIONS_TRUE"; then : + save_LDFLAGS="$LDFLAGS" + LDFLAGS="${LDFLAGS} -nostdlib" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing _Unwind_Resume" >&5 +printf %s "checking for library containing _Unwind_Resume... " >&6; } +if test ${ac_cv_search__Unwind_Resume+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char _Unwind_Resume (); +int +main (void) +{ +return _Unwind_Resume (); + ; + return 0; +} +_ACEOF +for ac_lib in '' gcc_s gcc +do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO" +then : + ac_cv_search__Unwind_Resume=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext + if test ${ac_cv_search__Unwind_Resume+y} +then : + break +fi +done +if test ${ac_cv_search__Unwind_Resume+y} +then : + +else $as_nop + ac_cv_search__Unwind_Resume=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search__Unwind_Resume" >&5 +printf "%s\n" "$ac_cv_search__Unwind_Resume" >&6; } +ac_res=$ac_cv_search__Unwind_Resume +if test "$ac_res" != no +then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + if test "$ac_cv_search__Unwind_Resume" != "none required" +then : + UNW_CRT_LIBADD="-lc $ac_cv_search__Unwind_Resume" + + UNW_CRT_LDFLAGS="-WCClinker -nostdlib" + +fi + -lc +fi + + LDFLAGS="$save_LDFLAGS" + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if documentation should be built" >&5 +printf %s "checking if documentation should be built... " >&6; } +# Check whether --enable-documentation was given. +if test ${enable_documentation+y} +then : + enableval=$enable_documentation; +else $as_nop + enable_documentation=yes +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_documentation" >&5 +printf "%s\n" "$enable_documentation" >&6; } +# Extract the first word of "latex2man", so it can be a program name with args. +set dummy latex2man; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_LATEX2MAN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $LATEX2MAN in + [\\/]* | ?:[\\/]*) + ac_cv_path_LATEX2MAN="$LATEX2MAN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_LATEX2MAN="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +LATEX2MAN=$ac_cv_path_LATEX2MAN +if test -n "$LATEX2MAN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LATEX2MAN" >&5 +printf "%s\n" "$LATEX2MAN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +if test "x$LATEX2MAN" = "x" && test "x$enable_documentation" != "xno" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: latex2man not found. Install latex2man. Disabling docs." >&5 +printf "%s\n" "$as_me: WARNING: latex2man not found. Install latex2man. Disabling docs." >&2;} + enable_documentation="no"; + +fi + if test x$enable_documentation != xno; then + CONFIG_DOCS_TRUE= + CONFIG_DOCS_FALSE='#' +else + CONFIG_DOCS_TRUE='#' + CONFIG_DOCS_FALSE= +fi + +if test -z "$CONFIG_DOCS_TRUE"; then : + ac_config_files="$ac_config_files doc/Makefile doc/common.tex" + +fi + +# Enable tests built around unw_resume, which is not supported on all targets +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we should enable unw_resume tests" >&5 +printf %s "checking if we should enable unw_resume tests... " >&6; } +case $target_os in #( + nto-qnx*) : + enable_unw_resume_tests=no ;; #( + *) : + enable_unw_resume_tests=yes ;; +esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_unw_resume_tests" >&5 +printf "%s\n" "$enable_unw_resume_tests" >&6; } + if test x$enable_unw_resume_tests = xyes; then + ENABLE_UNW_RESUME_TESTS_TRUE= + ENABLE_UNW_RESUME_TESTS_FALSE='#' +else + ENABLE_UNW_RESUME_TESTS_TRUE='#' + ENABLE_UNW_RESUME_TESTS_FALSE= +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for build architecture" >&5 +printf %s "checking for build architecture... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $build_arch" >&5 +printf "%s\n" "$build_arch" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for host architecture" >&5 +printf %s "checking for host architecture... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $host_arch" >&5 +printf "%s\n" "$host_arch" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for target architecture" >&5 +printf %s "checking for target architecture... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $target_arch" >&5 +printf "%s\n" "$target_arch" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for target operating system" >&5 +printf %s "checking for target operating system... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $target_os" >&5 +printf "%s\n" "$target_os" >&6; } + + if echo $CFLAGS | grep -q '\-m32\>'; then + XFAIL_PTRACE_TEST_TRUE= + XFAIL_PTRACE_TEST_FALSE='#' +else + XFAIL_PTRACE_TEST_TRUE='#' + XFAIL_PTRACE_TEST_FALSE= +fi + + if test x$build_arch != x$host_arch; then + CROSS_BUILD_TRUE= + CROSS_BUILD_FALSE='#' +else + CROSS_BUILD_TRUE='#' + CROSS_BUILD_FALSE= +fi + + if test x$target_arch != x$host_arch; then + REMOTE_ONLY_TRUE= + REMOTE_ONLY_FALSE='#' +else + REMOTE_ONLY_TRUE='#' + REMOTE_ONLY_FALSE= +fi + + if test x$target_arch = xaarch64; then + ARCH_AARCH64_TRUE= + ARCH_AARCH64_FALSE='#' +else + ARCH_AARCH64_TRUE='#' + ARCH_AARCH64_FALSE= +fi + + if test x$target_arch = xarm; then + ARCH_ARM_TRUE= + ARCH_ARM_FALSE='#' +else + ARCH_ARM_TRUE='#' + ARCH_ARM_FALSE= +fi + + if test x$target_arch = xia64; then + ARCH_IA64_TRUE= + ARCH_IA64_FALSE='#' +else + ARCH_IA64_TRUE='#' + ARCH_IA64_FALSE= +fi + + if test x$target_arch = xhppa; then + ARCH_HPPA_TRUE= + ARCH_HPPA_FALSE='#' +else + ARCH_HPPA_TRUE='#' + ARCH_HPPA_FALSE= +fi + + if test x$target_arch = xmips; then + ARCH_MIPS_TRUE= + ARCH_MIPS_FALSE='#' +else + ARCH_MIPS_TRUE='#' + ARCH_MIPS_FALSE= +fi + + if test x$target_arch = xx86; then + ARCH_X86_TRUE= + ARCH_X86_FALSE='#' +else + ARCH_X86_TRUE='#' + ARCH_X86_FALSE= +fi + + if test x$target_arch = xx86_64; then + ARCH_X86_64_TRUE= + ARCH_X86_64_FALSE='#' +else + ARCH_X86_64_TRUE='#' + ARCH_X86_64_FALSE= +fi + + if test x$target_arch = xppc32; then + ARCH_PPC32_TRUE= + ARCH_PPC32_FALSE='#' +else + ARCH_PPC32_TRUE='#' + ARCH_PPC32_FALSE= +fi + + if test x$target_arch = xppc64; then + ARCH_PPC64_TRUE= + ARCH_PPC64_FALSE='#' +else + ARCH_PPC64_TRUE='#' + ARCH_PPC64_FALSE= +fi + + if test x$target_arch = xsh; then + ARCH_SH_TRUE= + ARCH_SH_FALSE='#' +else + ARCH_SH_TRUE='#' + ARCH_SH_FALSE= +fi + + if test x$target_arch = xs390x; then + ARCH_S390X_TRUE= + ARCH_S390X_FALSE='#' +else + ARCH_S390X_TRUE='#' + ARCH_S390X_FALSE= +fi + + if test x$target_arch = xriscv; then + ARCH_RISCV_TRUE= + ARCH_RISCV_FALSE='#' +else + ARCH_RISCV_TRUE='#' + ARCH_RISCV_FALSE= +fi + + if test x$target_arch = xloongarch64; then + ARCH_LOONGARCH64_TRUE= + ARCH_LOONGARCH64_FALSE='#' +else + ARCH_LOONGARCH64_TRUE='#' + ARCH_LOONGARCH64_FALSE= +fi + + if expr x$target_os : xlinux >/dev/null; then + OS_LINUX_TRUE= + OS_LINUX_FALSE='#' +else + OS_LINUX_TRUE='#' + OS_LINUX_FALSE= +fi + + if expr x$target_os : xhpux >/dev/null; then + OS_HPUX_TRUE= + OS_HPUX_FALSE='#' +else + OS_HPUX_TRUE='#' + OS_HPUX_FALSE= +fi + + if expr x$target_os : xfreebsd >/dev/null; then + OS_FREEBSD_TRUE= + OS_FREEBSD_FALSE='#' +else + OS_FREEBSD_TRUE='#' + OS_FREEBSD_FALSE= +fi + + if expr x$target_os : xnto-qnx >/dev/null; then + OS_QNX_TRUE= + OS_QNX_FALSE='#' +else + OS_QNX_TRUE='#' + OS_QNX_FALSE= +fi + + if expr x$target_os : xsolaris >/dev/null; then + OS_SOLARIS_TRUE= + OS_SOLARIS_FALSE='#' +else + OS_SOLARIS_TRUE='#' + OS_SOLARIS_FALSE= +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ELF helper width" >&5 +printf %s "checking for ELF helper width... " >&6; } +case ${target_arch} in #( + arm|hppa|ppc32|x86|sh) : + use_elf32=yes; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: 32" >&5 +printf "%s\n" "32" >&6; } ;; #( + aarch64|ia64|ppc64|x86_64|s390x) : + use_elf64=yes; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: 64" >&5 +printf "%s\n" "64" >&6; } ;; #( + mips|riscv|loongarch64) : + use_elfxx=yes; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: xx" >&5 +printf "%s\n" "xx" >&6; } ;; #( + *) : + as_fn_error $? "Unknown ELF target: ${target_arch}" "$LINENO" 5 + ;; +esac + if test x$use_elf32 = xyes; then + USE_ELF32_TRUE= + USE_ELF32_FALSE='#' +else + USE_ELF32_TRUE='#' + USE_ELF32_FALSE= +fi + + if test x$use_elf64 = xyes; then + USE_ELF64_TRUE= + USE_ELF64_FALSE='#' +else + USE_ELF64_TRUE='#' + USE_ELF64_FALSE= +fi + + if test x$use_elfxx = xyes; then + USE_ELFXX_TRUE= + USE_ELFXX_FALSE='#' +else + USE_ELFXX_TRUE='#' + USE_ELFXX_FALSE= +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to include DWARF support" >&5 +printf %s "checking whether to include DWARF support... " >&6; } +if test x$target_arch != xia64; then + use_dwarf=yes +else + use_dwarf=no +fi + if test x$use_dwarf = xyes; then + USE_DWARF_TRUE= + USE_DWARF_FALSE='#' +else + USE_DWARF_TRUE='#' + USE_DWARF_FALSE= +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $use_dwarf" >&5 +printf "%s\n" "$use_dwarf" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to restrict build to remote support" >&5 +printf %s "checking whether to restrict build to remote support... " >&6; } +if test x$target_arch != x$host_arch; then + CPPFLAGS="${CPPFLAGS} -DUNW_REMOTE_ONLY" + remote_only=yes +else + remote_only=no +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $remote_only" >&5 +printf "%s\n" "$remote_only" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to load .debug_frame sections" >&5 +printf %s "checking whether to load .debug_frame sections... " >&6; } +# Check whether --enable-debug_frame was given. +if test ${enable_debug_frame+y} +then : + enableval=$enable_debug_frame; +else $as_nop + +case "${target_arch}" in + (arm) enable_debug_frame=yes;; + (aarch64) enable_debug_frame=yes;; + (*) enable_debug_frame=no;; +esac +fi + +if test x$remote_only = xyes; then + enable_debug_frame=no +fi +if test x$enable_debug_frame = xyes; then + +printf "%s\n" "#define CONFIG_DEBUG_FRAME /**/" >>confdefs.h + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_debug_frame" >&5 +printf "%s\n" "$enable_debug_frame" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to block signals during mutex ops" >&5 +printf %s "checking whether to block signals during mutex ops... " >&6; } +# Check whether --enable-block_signals was given. +if test ${enable_block_signals+y} +then : + enableval=$enable_block_signals; +else $as_nop + enable_block_signals=yes +fi + +if test x$enable_block_signals = xyes; then + +printf "%s\n" "#define CONFIG_BLOCK_SIGNALS /**/" >>confdefs.h + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_block_signals" >&5 +printf "%s\n" "$enable_block_signals" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to validate memory addresses before use" >&5 +printf %s "checking whether to validate memory addresses before use... " >&6; } +# Check whether --enable-conservative_checks was given. +if test ${enable_conservative_checks+y} +then : + enableval=$enable_conservative_checks; +else $as_nop + enable_conservative_checks=yes +fi + +if test x$enable_conservative_checks = xyes; then + +printf "%s\n" "#define CONSERVATIVE_CHECKS 1" >>confdefs.h + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_conservative_checks" >&5 +printf "%s\n" "$enable_conservative_checks" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable msabi support" >&5 +printf %s "checking whether to enable msabi support... " >&6; } +# Check whether --enable-msabi_support was given. +if test ${enable_msabi_support+y} +then : + enableval=$enable_msabi_support; +fi + +if test x$enable_msabi_support = xyes; then + +printf "%s\n" "#define CONFIG_MSABI_SUPPORT /**/" >>confdefs.h + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_msabi_support" >&5 +printf "%s\n" "$enable_msabi_support" >&6; } + +LIBLZMA= +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support LZMA-compressed symbol tables" >&5 +printf %s "checking whether to support LZMA-compressed symbol tables... " >&6; } +# Check whether --enable-minidebuginfo was given. +if test ${enable_minidebuginfo+y} +then : + enableval=$enable_minidebuginfo; +else $as_nop + enable_minidebuginfo=auto +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_minidebuginfo" >&5 +printf "%s\n" "$enable_minidebuginfo" >&6; } +if test x$enable_minidebuginfo != xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lzma_mf_is_supported in -llzma" >&5 +printf %s "checking for lzma_mf_is_supported in -llzma... " >&6; } +if test ${ac_cv_lib_lzma_lzma_mf_is_supported+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-llzma $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char lzma_mf_is_supported (); +int +main (void) +{ +return lzma_mf_is_supported (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_lzma_lzma_mf_is_supported=yes +else $as_nop + ac_cv_lib_lzma_lzma_mf_is_supported=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_mf_is_supported" >&5 +printf "%s\n" "$ac_cv_lib_lzma_lzma_mf_is_supported" >&6; } +if test "x$ac_cv_lib_lzma_lzma_mf_is_supported" = xyes +then : + LIBLZMA=-llzma + +printf "%s\n" "#define HAVE_LZMA 1" >>confdefs.h + + enable_minidebuginfo=yes +else $as_nop + if test x$enable_minidebuginfo = xyes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "liblzma not found +See \`config.log' for more details" "$LINENO" 5; } + fi +fi + +fi + + if test x$enable_minidebuginfo = xyes; then + HAVE_LZMA_TRUE= + HAVE_LZMA_FALSE='#' +else + HAVE_LZMA_TRUE='#' + HAVE_LZMA_FALSE= +fi + + +LIBZ= +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to support ZLIB-compressed symbol tables" >&5 +printf %s "checking whether to support ZLIB-compressed symbol tables... " >&6; } +# Check whether --enable-zlibdebuginfo was given. +if test ${enable_zlibdebuginfo+y} +then : + enableval=$enable_zlibdebuginfo; +else $as_nop + enable_zlibdebuginfo=auto +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_zlibdebuginfo" >&5 +printf "%s\n" "$enable_zlibdebuginfo" >&6; } +if test x$enable_zlibdebuginfo != xno; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uncompress in -lz" >&5 +printf %s "checking for uncompress in -lz... " >&6; } +if test ${ac_cv_lib_z_uncompress+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char uncompress (); +int +main (void) +{ +return uncompress (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_z_uncompress=yes +else $as_nop + ac_cv_lib_z_uncompress=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_uncompress" >&5 +printf "%s\n" "$ac_cv_lib_z_uncompress" >&6; } +if test "x$ac_cv_lib_z_uncompress" = xyes +then : + LIBZ=-lz + +printf "%s\n" "#define HAVE_ZLIB 1" >>confdefs.h + + enable_zlibdebuginfo=yes +else $as_nop + if test x$enable_zlibdebuginfo = xyes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "libz not found +See \`config.log' for more details" "$LINENO" 5; } + fi +fi + +fi + + if test x$enable_zlibdebuginfo = xyes; then + HAVE_ZLIB_TRUE= + HAVE_ZLIB_FALSE='#' +else + HAVE_ZLIB_TRUE='#' + HAVE_ZLIB_FALSE= +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Intel compiler" >&5 +printf %s "checking for Intel compiler... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __INTEL_COMPILER +#error choke me +#endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + intel_compiler=yes +else $as_nop + intel_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +if test x$GCC = xyes -a x$intel_compiler != xyes; then + CFLAGS="${CFLAGS} -fexceptions -Wall -Wsign-compare" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $intel_compiler" >&5 +printf "%s\n" "$intel_compiler" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if building on Solaris then define __EXTENSIONS__ macro" >&5 +printf %s "checking if building on Solaris then define __EXTENSIONS__ macro... " >&6; } +if $OS_SOLARIS; then + CFLAGS="${CFLAGS} -D__EXTENSIONS__" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for QCC compiler" >&5 +printf %s "checking for QCC compiler... " >&6; } +case $CC in #( + qcc*|QCC*) : + qcc_compiler=yes ;; #( + *) : + qcc_compiler=no ;; +esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $qcc_compiler" >&5 +printf "%s\n" "$qcc_compiler" >&6; } + +if test x$intel_compiler = xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if linker supports -static-libcxa" >&5 +printf %s "checking if linker supports -static-libcxa... " >&6; } + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -static-libcxa" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + have_static_libcxa=yes +else $as_nop + have_static_libcxa=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + if test "x$have_static_libcxa" = xyes; then + LDFLAGS_STATIC_LIBCXA="-XCClinker -static-libcxa" + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_static_libcxa" >&5 +printf "%s\n" "$have_static_libcxa" >&6; } +fi + +if test x$qcc_compiler = xyes; then + LDFLAGS_NOSTARTFILES="-XCClinker -Wc,-nostartfiles" +else + LDFLAGS_NOSTARTFILES="-XCClinker -nostartfiles" +fi + +OLD_CFLAGS="${CFLAGS}" +CFLAGS="${CFLAGS} -march=armv8-a+sve" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler supports -march=armv8-a+sve" >&5 +printf %s "checking if compiler supports -march=armv8-a+sve... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + supports_march_armv8_a_sve=yes +else $as_nop + supports_march_armv8_a_sve=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test x$supports_march_armv8_a_sve = xyes; then + COMPILER_SUPPORTS_MARCH_ARMV8_A_SVE_TRUE= + COMPILER_SUPPORTS_MARCH_ARMV8_A_SVE_FALSE='#' +else + COMPILER_SUPPORTS_MARCH_ARMV8_A_SVE_TRUE='#' + COMPILER_SUPPORTS_MARCH_ARMV8_A_SVE_FALSE= +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $supports_march_armv8_a_sve" >&5 +printf "%s\n" "$supports_march_armv8_a_sve" >&6; } +CFLAGS="${OLD_CFLAGS}" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __builtin___clear_cache" >&5 +printf %s "checking for __builtin___clear_cache... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +__builtin___clear_cache(0, 0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + have__builtin___clear_cache=yes +else $as_nop + have__builtin___clear_cache=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +if test x$have__builtin___clear_cache = xyes; then + +printf "%s\n" "#define HAVE__BUILTIN___CLEAR_CACHE 1" >>confdefs.h + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have__builtin___clear_cache" >&5 +printf "%s\n" "$have__builtin___clear_cache" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __builtin_unreachable" >&5 +printf %s "checking for __builtin_unreachable... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +__builtin_unreachable() + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + have__builtin_unreachable=yes +else $as_nop + have__builtin_unreachable=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +if test x$have__builtin_unreachable = xyes; then + +printf "%s\n" "#define HAVE__BUILTIN_UNREACHABLE 1" >>confdefs.h + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have__builtin_unreachable" >&5 +printf "%s\n" "$have__builtin_unreachable" >&6; } + +CCASFLAGS="${CCASFLAGS} ${CPPFLAGS}" + +arch="$target_arch" +ARCH=`echo $target_arch | tr a-z A-Z` + +PKG_MAJOR=1 +PKG_MINOR=8 +PKG_EXTRA=3 +PKG_MAINTAINER=https://github.com/libunwind/libunwind + + + + + + + + + + + + + + + + +ac_config_files="$ac_config_files Makefile src/Makefile include/libunwind-common.h include/libunwind.h include/tdep/libunwind_i.h" + +ac_config_files="$ac_config_files src/unwind/libunwind.pc src/coredump/libunwind-coredump.pc src/ptrace/libunwind-ptrace.pc src/setjmp/libunwind-setjmp.pc src/libunwind-generic.pc" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_ALTIVEC_TRUE}" && test -z "${USE_ALTIVEC_FALSE}"; then + as_fn_error $? "conditional \"USE_ALTIVEC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_COREDUMP_TRUE}" && test -z "${BUILD_COREDUMP_FALSE}"; then + as_fn_error $? "conditional \"BUILD_COREDUMP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_PTRACE_TRUE}" && test -z "${BUILD_PTRACE_FALSE}"; then + as_fn_error $? "conditional \"BUILD_PTRACE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_NTO_TRUE}" && test -z "${BUILD_NTO_FALSE}"; then + as_fn_error $? "conditional \"BUILD_NTO\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_SETJMP_TRUE}" && test -z "${BUILD_SETJMP_FALSE}"; then + as_fn_error $? "conditional \"BUILD_SETJMP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${CONFIG_WEAK_BACKTRACE_TRUE}" && test -z "${CONFIG_WEAK_BACKTRACE_FALSE}"; then + as_fn_error $? "conditional \"CONFIG_WEAK_BACKTRACE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${BUILD_UNWIND_HEADER_TRUE}" && test -z "${BUILD_UNWIND_HEADER_FALSE}"; then + as_fn_error $? "conditional \"BUILD_UNWIND_HEADER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${CONFIG_TESTS_TRUE}" && test -z "${CONFIG_TESTS_FALSE}"; then + as_fn_error $? "conditional \"CONFIG_TESTS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${SUPPORT_CXX_EXCEPTIONS_TRUE}" && test -z "${SUPPORT_CXX_EXCEPTIONS_FALSE}"; then + as_fn_error $? "conditional \"SUPPORT_CXX_EXCEPTIONS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${CONFIG_DOCS_TRUE}" && test -z "${CONFIG_DOCS_FALSE}"; then + as_fn_error $? "conditional \"CONFIG_DOCS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_UNW_RESUME_TESTS_TRUE}" && test -z "${ENABLE_UNW_RESUME_TESTS_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_UNW_RESUME_TESTS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${XFAIL_PTRACE_TEST_TRUE}" && test -z "${XFAIL_PTRACE_TEST_FALSE}"; then + as_fn_error $? "conditional \"XFAIL_PTRACE_TEST\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${CROSS_BUILD_TRUE}" && test -z "${CROSS_BUILD_FALSE}"; then + as_fn_error $? "conditional \"CROSS_BUILD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${REMOTE_ONLY_TRUE}" && test -z "${REMOTE_ONLY_FALSE}"; then + as_fn_error $? "conditional \"REMOTE_ONLY\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ARCH_AARCH64_TRUE}" && test -z "${ARCH_AARCH64_FALSE}"; then + as_fn_error $? "conditional \"ARCH_AARCH64\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ARCH_ARM_TRUE}" && test -z "${ARCH_ARM_FALSE}"; then + as_fn_error $? "conditional \"ARCH_ARM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ARCH_IA64_TRUE}" && test -z "${ARCH_IA64_FALSE}"; then + as_fn_error $? "conditional \"ARCH_IA64\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ARCH_HPPA_TRUE}" && test -z "${ARCH_HPPA_FALSE}"; then + as_fn_error $? "conditional \"ARCH_HPPA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ARCH_MIPS_TRUE}" && test -z "${ARCH_MIPS_FALSE}"; then + as_fn_error $? "conditional \"ARCH_MIPS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ARCH_X86_TRUE}" && test -z "${ARCH_X86_FALSE}"; then + as_fn_error $? "conditional \"ARCH_X86\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ARCH_X86_64_TRUE}" && test -z "${ARCH_X86_64_FALSE}"; then + as_fn_error $? "conditional \"ARCH_X86_64\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ARCH_PPC32_TRUE}" && test -z "${ARCH_PPC32_FALSE}"; then + as_fn_error $? "conditional \"ARCH_PPC32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ARCH_PPC64_TRUE}" && test -z "${ARCH_PPC64_FALSE}"; then + as_fn_error $? "conditional \"ARCH_PPC64\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ARCH_SH_TRUE}" && test -z "${ARCH_SH_FALSE}"; then + as_fn_error $? "conditional \"ARCH_SH\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ARCH_S390X_TRUE}" && test -z "${ARCH_S390X_FALSE}"; then + as_fn_error $? "conditional \"ARCH_S390X\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ARCH_RISCV_TRUE}" && test -z "${ARCH_RISCV_FALSE}"; then + as_fn_error $? "conditional \"ARCH_RISCV\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ARCH_LOONGARCH64_TRUE}" && test -z "${ARCH_LOONGARCH64_FALSE}"; then + as_fn_error $? "conditional \"ARCH_LOONGARCH64\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${OS_LINUX_TRUE}" && test -z "${OS_LINUX_FALSE}"; then + as_fn_error $? "conditional \"OS_LINUX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${OS_HPUX_TRUE}" && test -z "${OS_HPUX_FALSE}"; then + as_fn_error $? "conditional \"OS_HPUX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${OS_FREEBSD_TRUE}" && test -z "${OS_FREEBSD_FALSE}"; then + as_fn_error $? "conditional \"OS_FREEBSD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${OS_QNX_TRUE}" && test -z "${OS_QNX_FALSE}"; then + as_fn_error $? "conditional \"OS_QNX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${OS_SOLARIS_TRUE}" && test -z "${OS_SOLARIS_FALSE}"; then + as_fn_error $? "conditional \"OS_SOLARIS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_ELF32_TRUE}" && test -z "${USE_ELF32_FALSE}"; then + as_fn_error $? "conditional \"USE_ELF32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_ELF64_TRUE}" && test -z "${USE_ELF64_FALSE}"; then + as_fn_error $? "conditional \"USE_ELF64\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_ELFXX_TRUE}" && test -z "${USE_ELFXX_FALSE}"; then + as_fn_error $? "conditional \"USE_ELFXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_DWARF_TRUE}" && test -z "${USE_DWARF_FALSE}"; then + as_fn_error $? "conditional \"USE_DWARF\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_LZMA_TRUE}" && test -z "${HAVE_LZMA_FALSE}"; then + as_fn_error $? "conditional \"HAVE_LZMA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_ZLIB_TRUE}" && test -z "${HAVE_ZLIB_FALSE}"; then + as_fn_error $? "conditional \"HAVE_ZLIB\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${COMPILER_SUPPORTS_MARCH_ARMV8_A_SVE_TRUE}" && test -z "${COMPILER_SUPPORTS_MARCH_ARMV8_A_SVE_FALSE}"; then + as_fn_error $? "conditional \"COMPILER_SUPPORTS_MARCH_ARMV8_A_SVE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by libunwind $as_me 1.8.3, which was +generated by GNU Autoconf 2.71. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config='$ac_cs_config_escaped' +ac_cs_version="\\ +libunwind config.status 1.8.3 +configured by $0, generated by GNU Autoconf 2.71, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2021 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + printf "%s\n" "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + printf "%s\n" "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + printf "%s\n" "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + printf "%s\n" "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +FILECMD \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ +AR \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_import \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_cv_nm_interface \ +nm_file_list_spec \ +lt_cv_truncate_bin \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib \ +compiler_lib_search_dirs \ +predep_objects \ +postdep_objects \ +predeps \ +postdeps \ +compiler_lib_search_path \ +LD_CXX \ +reload_flag_CXX \ +compiler_CXX \ +lt_prog_compiler_no_builtin_flag_CXX \ +lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ +lt_prog_compiler_static_CXX \ +lt_cv_prog_compiler_c_o_CXX \ +export_dynamic_flag_spec_CXX \ +whole_archive_flag_spec_CXX \ +compiler_needs_object_CXX \ +with_gnu_ld_CXX \ +allow_undefined_flag_CXX \ +no_undefined_flag_CXX \ +hardcode_libdir_flag_spec_CXX \ +hardcode_libdir_separator_CXX \ +exclude_expsyms_CXX \ +include_expsyms_CXX \ +file_list_spec_CXX \ +compiler_lib_search_dirs_CXX \ +predep_objects_CXX \ +postdep_objects_CXX \ +predeps_CXX \ +postdeps_CXX \ +compiler_lib_search_path_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path \ +reload_cmds_CXX \ +old_archive_cmds_CXX \ +old_archive_from_new_cmds_CXX \ +old_archive_from_expsyms_cmds_CXX \ +archive_cmds_CXX \ +archive_expsym_cmds_CXX \ +module_cmds_CXX \ +module_expsym_cmds_CXX \ +export_symbols_cmds_CXX \ +prelink_cmds_CXX \ +postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' + +# See if we are running on zsh, and set the options that allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + RM='$RM' + ofile='$ofile' + + + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "tests/check-namespace.sh") CONFIG_FILES="$CONFIG_FILES tests/check-namespace.sh" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "doc/common.tex") CONFIG_FILES="$CONFIG_FILES doc/common.tex" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "include/libunwind-common.h") CONFIG_FILES="$CONFIG_FILES include/libunwind-common.h" ;; + "include/libunwind.h") CONFIG_FILES="$CONFIG_FILES include/libunwind.h" ;; + "include/tdep/libunwind_i.h") CONFIG_FILES="$CONFIG_FILES include/tdep/libunwind_i.h" ;; + "src/unwind/libunwind.pc") CONFIG_FILES="$CONFIG_FILES src/unwind/libunwind.pc" ;; + "src/coredump/libunwind-coredump.pc") CONFIG_FILES="$CONFIG_FILES src/coredump/libunwind-coredump.pc" ;; + "src/ptrace/libunwind-ptrace.pc") CONFIG_FILES="$CONFIG_FILES src/ptrace/libunwind-ptrace.pc" ;; + "src/setjmp/libunwind-setjmp.pc") CONFIG_FILES="$CONFIG_FILES src/setjmp/libunwind-setjmp.pc" ;; + "src/libunwind-generic.pc") CONFIG_FILES="$CONFIG_FILES src/libunwind-generic.pc" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`printf "%s\n" "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + + cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL +# Generated automatically by $as_me ($PACKAGE) $VERSION +# NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +# Copyright (C) 2024 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# The names of the tagged configurations supported by this script. +available_tags='CXX ' + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shared archive member basename,for filename based shared library versioning on AIX. +shared_archive_member_spec=$shared_archive_member_spec + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# A file(cmd) program that detects file types. +FILECMD=$lt_FILECMD + +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive (by configure). +lt_ar_flags=$lt_ar_flags + +# Flags to create an archive. +AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm into a list of symbols to manually relocate. +global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name lister interface. +nm_interface=$lt_lt_cv_nm_interface + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and where our libraries should be installed. +lt_sysroot=$lt_sysroot + +# Command to truncate a binary pipe. +lt_truncate_bin=$lt_lt_cv_truncate_bin + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e. impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects +postdep_objects=$lt_postdep_objects +predeps=$lt_predeps +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# ### END LIBTOOL CONFIG + +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + + +ltmain=$ac_aux_dir/ltmain.sh + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + $SED '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: CXX + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_CXX + +# A language specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU compiler? +with_gcc=$GCC_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_CXX + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_CXX + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e. impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute_CXX + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_CXX + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_CXX + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_CXX + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects_CXX +postdep_objects=$lt_postdep_objects_CXX +predeps=$lt_predeps_CXX +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# ### END LIBTOOL TAG CONFIG: CXX +_LT_EOF + + ;; + "tests/check-namespace.sh":F) chmod +x tests/check-namespace.sh ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + diff --git a/vendor/libunwind/configure.ac b/vendor/libunwind/configure.ac new file mode 100644 index 0000000000..14762b84e2 --- /dev/null +++ b/vendor/libunwind/configure.ac @@ -0,0 +1,576 @@ +# +# configure.ac +# +# Process this file with autoconf to produce a configure script. +AC_COPYRIGHT([ + This file is part of libunwind. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +]) + + +define(pkg_major, 1) +define(pkg_minor, 8) +define(pkg_extra, 3) +define(pkg_maintainer, https://github.com/libunwind/libunwind) +define(mkvers, $1.$2.$3) +AC_INIT([libunwind],[mkvers(pkg_major, pkg_minor, pkg_extra)],[pkg_maintainer]) +AC_CONFIG_SRCDIR(src/mi/backtrace.c) +AC_CONFIG_AUX_DIR(config) +AC_CONFIG_MACRO_DIRS([m4]) +AC_CANONICAL_TARGET +AM_INIT_AUTOMAKE([1.7 subdir-objects -Wall]) +AM_SILENT_RULES([yes]) +AM_MAINTAINER_MODE +AC_CONFIG_HEADERS([include/config.h]) + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_CXX +AC_PROG_INSTALL +AC_PROG_MAKE_SET +m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) +LT_INIT +AM_PROG_AS +AM_PROG_CC_C_O + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_C_INLINE +AC_TYPE_SIZE_T +AC_CHECK_SIZEOF(off_t) + +dnl Checks for header files. +AC_MSG_NOTICE([--- Checking for header files ---]) +AC_CHECK_HEADERS(asm/ptrace_offsets.h asm/ptrace.h asm/vsyscall.h endian.h sys/endian.h \ + sys/param.h execinfo.h ia64intrin.h sys/uc_access.h unistd.h signal.h \ + sys/types.h sys/procfs.h sys/ptrace.h sys/syscall.h byteswap.h elf.h \ + sys/elf.h link.h sys/link.h) + +CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE" + +AC_MSG_NOTICE([--- Checking for available types ---]) +AC_CHECK_MEMBERS([struct dl_phdr_info.dlpi_subs],,,[#include ]) +AC_CHECK_TYPES([struct elf_prstatus, struct prstatus, procfs_status, elf_fpregset_t], [], [], +[$ac_includes_default +#if HAVE_SYS_PROCFS_H +# include +#endif +]) + +dnl Checks for libraries. +AC_MSG_NOTICE([--- Checking for libraries ---]) +AC_SEARCH_LIBS([__uc_get_grs], [uca]) + +dnl Checks for library functions. +AC_CHECK_FUNCS(dl_iterate_phdr dl_phdr_removals_counter dlmodinfo getunwind \ + ttrace mincore pipe2 sigaltstack execvpe) + +AC_MSG_CHECKING([if building with AltiVec]) +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#ifndef __ALTIVEC__ +# error choke +#endif +]])], [use_altivec=yes],[use_altivec=no]) +AM_CONDITIONAL(USE_ALTIVEC, [test x$use_altivec = xyes]) +AC_MSG_RESULT([$use_altivec]) + +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#ifndef __powerpc64__ +# error choke +#endif +]])], [ppc_bits=64], [ppc_bits=32]) + +AC_DEFUN([SET_ARCH],[ + AS_CASE([$1], + [aarch64*],[$2=aarch64], + [arm*],[$2=arm], + [i?86],[$2=x86], + [hppa*],[$2=hppa], + [mips*],[$2=mips], + [powerpc*],[$2=ppc$ppc_bits], + [sh*],[$2=sh], + [amd64],[$2=x86_64], + [riscv*],[$2=riscv], + [loongarch64*],[$2=loongarch64], + [$2=$1]) +]) dnl SET_ARCH + +SET_ARCH([$build_cpu],[build_arch]) +SET_ARCH([$host_cpu],[host_arch]) +SET_ARCH([$target_cpu],[target_arch]) + +AC_MSG_CHECKING([if libunwind-coredump should be built]) +AC_ARG_ENABLE([coredump], + [AS_HELP_STRING([--enable-coredump], + [build libunwind-coredump library + @<:@default=autodetect@:>@])], + [], + [enable_coredump="check"] +) +AS_IF([test "$enable_coredump" = "check"], + [AS_CASE([$host_arch], + [aarch64*|arm*|mips*|sh*|x86*|riscv*|loongarch64], [enable_coredump=yes], + [enable_coredump=no])] +) +AC_MSG_RESULT([$enable_coredump]) +AM_CONDITIONAL(BUILD_COREDUMP, test x$enable_coredump = xyes) + +AC_MSG_CHECKING([if libunwind-ptrace should be built]) +AC_ARG_ENABLE([ptrace], + [AS_HELP_STRING([--enable-ptrace], + [build libunwind-ptrace library + @<:@default=autodetect@:>@])], + [], + [enable_ptrace="check"] +) +AS_IF([test "$enable_ptrace" != "no"], + [AS_IF([test "$ac_cv_header_sys_ptrace_h" = "yes"], [enable_ptrace=yes], + [test "$enable_ptrace" != "check"], [AC_MSG_FAILURE([--enable-ptrace given but + ptrace not supported on target])], + [enable_ptrace="no"] + )] +) +AC_MSG_RESULT([$enable_ptrace]) +AM_CONDITIONAL([BUILD_PTRACE], [test x$enable_ptrace = xyes]) +AM_COND_IF([BUILD_PTRACE], [ + AC_MSG_NOTICE([--- Checking for ptrace symbols ---]) + AC_CHECK_DECLS([PTRACE_POKEUSER, PTRACE_POKEDATA, PTRACE_SETREGSET, + PTRACE_TRACEME, PTRACE_CONT, PTRACE_SINGLESTEP, + PTRACE_SYSCALL, PT_IO, PT_GETREGS, + PT_GETFPREGS, PT_CONTINUE, PT_TRACE_ME, + PT_STEP, PT_SYSCALL], + [], + [], + [$ac_includes_default + #if HAVE_SYS_TYPES_H + #include + #endif + #include + ]) +]) + +AC_MSG_CHECKING([if libunwind-nto should be built]) +AC_ARG_ENABLE(nto, + [AS_HELP_STRING([--enable-nto], + [build libunwind-nto library + @<:@default=autodetect@:>@])], + [], + [enable_nto="check"] +) +AS_IF([test "$enable_nto" != "no"], + [AC_CHECK_HEADER([sys/neutrino.h], [enable_nto=yes], [enable_nto=no])] +) +AC_MSG_RESULT([$enable_nto]) +AM_CONDITIONAL([BUILD_NTO], [test x$enable_nto = xyes]) + +AC_MSG_CHECKING([if libunwind-setjmp should be built]) +AC_ARG_ENABLE([setjmp], + [AS_HELP_STRING([--enable-setjmp], + [build libunwind-setjmp library + @<:@default=autodetect@:>@])], + [], + [enable_setjmp=check] +) +AS_IF([test "$enable_setjmp" = check], + [AS_IF([test x$target_arch = x$host_arch], + [enable_setjmp=yes], + [enable_setjmp=no])] + [AS_IF([expr x$target_os : xnto-qnx >/dev/null], + [enable_setjmp=no])] +) +AC_MSG_RESULT([$enable_setjmp]) +AM_CONDITIONAL(BUILD_SETJMP, test x$enable_setjmp = xyes) + +AC_MSG_CHECKING([if weak-backtrace is enabled]) +AC_ARG_ENABLE([weak-backtrace], + [AS_HELP_STRING([--disable-weak-backtrace], + [do not provide the weak 'backtrace' symbol + @<:@default=no@:>@])], + [], + [enable_weak_backtrace=yes] +) +AC_MSG_RESULT([$enable_weak_backtrace]) +AM_CONDITIONAL([CONFIG_WEAK_BACKTRACE], [test "x$enable_weak_backtrace" = xyes]) +AM_COND_IF([CONFIG_WEAK_BACKTRACE], [ + AC_DEFINE([CONFIG_WEAK_BACKTRACE], [1], [Define if the weak 'backtrace' symbol is provided.]) +]) + + +AC_MSG_CHECKING([if unwind.h should be exported]) +AC_ARG_ENABLE([unwind-header], + [AS_HELP_STRING([--disable-unwind-header], + [do not export the 'unwind.h' header + @<:@default=no@:>@])], + [], + [enable_unwind_header=yes] +) +AC_MSG_RESULT([$enable_unwind_header]) +AM_CONDITIONAL(BUILD_UNWIND_HEADER, test "x$enable_unwind_header" = xyes) + +AC_MSG_CHECKING([whether to support UNW_CACHE_PER_THREAD]) +AC_ARG_ENABLE([per-thread-cache], + [AS_HELP_STRING([--enable-per-thread-cache], + [build with support for UNW_CACHE_PER_THREAD + (which imposes a high TLS memory usage) + @<:@default=no@:>@])], + [], + [enable_per_thread_cache=no] +) +AC_MSG_RESULT([$enable_per_thread_cache]) +AS_IF([test x$enable_per_thread_cache = xyes], + [AC_DEFINE([HAVE___CACHE_PER_THREAD], 1, [Define to 1 if --enable-per-thread-cache])] +) + +AC_MSG_CHECKING([if testsuite should be built]) +AC_ARG_ENABLE([tests], + [AS_HELP_STRING([--disable-tests], + [disable building tests @<:@default=no@:>@])], + [], + [enable_tests=yes] +) +AC_MSG_RESULT([$enable_tests]) +AM_CONDITIONAL([CONFIG_TESTS], [test x$enable_tests = xyes]) +AM_COND_IF([CONFIG_TESTS], [ + old_LIBS="$LIBS" + AC_MSG_NOTICE([--- Checking for extra libraries linked to tests ---]) + AC_SEARCH_LIBS([dlopen], [dl], + [AS_IF([test "$ac_cv_search_dlopen" != "none required"], + [AC_SUBST([DLLIB], ["$ac_cv_search_dlopen"])])]) + AC_SEARCH_LIBS([pthread_create], [pthread], + [AS_IF([test "$ac_cv_search_pthread_create" != "none required"], + [AC_SUBST([PTHREADS_LIB],["$ac_cv_search_pthread_create"])])]) + AC_SEARCH_LIBS([backtrace], [execinfo], + [AS_IF([test "$ac_cv_search_backtrace" != "none required"], + [AC_SUBST([BACKTRACELIB],["$ac_cv_search_backtrace"])])]) + LIBS="$old_LIBS" + AC_CONFIG_FILES([tests/Makefile]) + AC_CONFIG_FILES([tests/check-namespace.sh], [chmod +x tests/check-namespace.sh]) +]) +AC_ARG_WITH([testdriver], + [AS_HELP_STRING([--with-testdriver], + [use designated test driver instead of default LOG_DRIVER])], + [], + [with_testdriver=\$\(top_srcdir\)/config/test-driver]) +AC_SUBST([UNW_TESTDRIVER], $with_testdriver) + + +AC_MSG_CHECKING([if debug support should be built]) +AC_ARG_ENABLE([debug], + [AS_HELP_STRING([--enable-debug], + [enable debug support (slows down execution) + @<:@default=no@:>@])], + [], + [enable_debug=no] +) +AC_MSG_RESULT([$enable_debug]) +AS_IF([test x$enable_debug = xyes], + [CPPFLAGS="${CPPFLAGS} -DDEBUG"], + [CPPFLAGS="${CPPFLAGS} -DNDEBUG"] +) + +AC_MSG_CHECKING([if C++ exception support should be built]) +AC_ARG_ENABLE([cxx_exceptions], + [AS_HELP_STRING([--enable-cxx-exceptions], + [use libunwind to handle C++ exceptions + @<:@default=autodetect@:>@])], + [], + [enable_cxx_exceptions=check] +) +AS_IF([test $enable_cxx_exceptions = check], + [AS_CASE([$target_arch], + [aarch64*|arm*|mips*|x86*|s390x*|loongarch64], [enable_cxx_exceptions=no], + [enable_cxx_exceptions=yes])] +) +AC_MSG_RESULT([$enable_cxx_exceptions]) +AM_CONDITIONAL([SUPPORT_CXX_EXCEPTIONS], [test x$enable_cxx_exceptions = xyes]) +AM_COND_IF([SUPPORT_CXX_EXCEPTIONS], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="${LDFLAGS} -nostdlib" + AC_SEARCH_LIBS([_Unwind_Resume], [gcc_s gcc], + [AS_IF([test "$ac_cv_search__Unwind_Resume" != "none required"], + [AC_SUBST([UNW_CRT_LIBADD], ["-lc $ac_cv_search__Unwind_Resume"]) + AC_SUBST([UNW_CRT_LDFLAGS], ["-WCClinker -nostdlib"])])] + [-lc]) + LDFLAGS="$save_LDFLAGS"] +) + +AC_MSG_CHECKING([if documentation should be built]) +AC_ARG_ENABLE([documentation], + [AS_HELP_STRING([--enable-documentation], + [enable generating the man pages @<:@default=yes@:>@])], + [], + [enable_documentation=yes]) +AC_MSG_RESULT([$enable_documentation]) +AC_PATH_PROG([LATEX2MAN],[latex2man]) +AS_IF([test "x$LATEX2MAN" = "x" && test "x$enable_documentation" != "xno"], [ + AC_MSG_WARN([latex2man not found. Install latex2man. Disabling docs.]) + enable_documentation="no"; +]) +AM_CONDITIONAL([CONFIG_DOCS], [test x$enable_documentation != xno]) +AM_COND_IF([CONFIG_DOCS], [AC_CONFIG_FILES([doc/Makefile doc/common.tex])]) + +# Enable tests built around unw_resume, which is not supported on all targets +AC_MSG_CHECKING([if we should enable unw_resume tests]) +AS_CASE([$target_os], + [nto-qnx*], [enable_unw_resume_tests=no], + [enable_unw_resume_tests=yes]) +AC_MSG_RESULT([$enable_unw_resume_tests]) +AM_CONDITIONAL([ENABLE_UNW_RESUME_TESTS], [test x$enable_unw_resume_tests = xyes]) + +AC_MSG_CHECKING([for build architecture]) +AC_MSG_RESULT([$build_arch]) +AC_MSG_CHECKING([for host architecture]) +AC_MSG_RESULT([$host_arch]) +AC_MSG_CHECKING([for target architecture]) +AC_MSG_RESULT([$target_arch]) +AC_MSG_CHECKING([for target operating system]) +AC_MSG_RESULT([$target_os]) + +AM_CONDITIONAL([XFAIL_PTRACE_TEST], [echo $CFLAGS | grep -q '\-m32\>']) +AM_CONDITIONAL([CROSS_BUILD], [test x$build_arch != x$host_arch]) +AM_CONDITIONAL(REMOTE_ONLY, test x$target_arch != x$host_arch) +AM_CONDITIONAL(ARCH_AARCH64, test x$target_arch = xaarch64) +AM_CONDITIONAL(ARCH_ARM, test x$target_arch = xarm) +AM_CONDITIONAL(ARCH_IA64, test x$target_arch = xia64) +AM_CONDITIONAL(ARCH_HPPA, test x$target_arch = xhppa) +AM_CONDITIONAL(ARCH_MIPS, test x$target_arch = xmips) +AM_CONDITIONAL(ARCH_X86, test x$target_arch = xx86) +AM_CONDITIONAL(ARCH_X86_64, test x$target_arch = xx86_64) +AM_CONDITIONAL(ARCH_PPC32, test x$target_arch = xppc32) +AM_CONDITIONAL(ARCH_PPC64, test x$target_arch = xppc64) +AM_CONDITIONAL(ARCH_SH, test x$target_arch = xsh) +AM_CONDITIONAL(ARCH_S390X, test x$target_arch = xs390x) +AM_CONDITIONAL(ARCH_RISCV, test x$target_arch = xriscv) +AM_CONDITIONAL(ARCH_LOONGARCH64, test x$target_arch = xloongarch64) +AM_CONDITIONAL(OS_LINUX, expr x$target_os : xlinux >/dev/null) +AM_CONDITIONAL(OS_HPUX, expr x$target_os : xhpux >/dev/null) +AM_CONDITIONAL(OS_FREEBSD, expr x$target_os : xfreebsd >/dev/null) +AM_CONDITIONAL(OS_QNX, expr x$target_os : xnto-qnx >/dev/null) +AM_CONDITIONAL(OS_SOLARIS, expr x$target_os : xsolaris >/dev/null) + +AC_MSG_CHECKING([for ELF helper width]) +AS_CASE([${target_arch}], + [arm|hppa|ppc32|x86|sh], [use_elf32=yes; AC_MSG_RESULT([32])], + [aarch64|ia64|ppc64|x86_64|s390x], [use_elf64=yes; AC_MSG_RESULT([64])], + [mips|riscv|loongarch64], [use_elfxx=yes; AC_MSG_RESULT([xx])], + [AC_MSG_ERROR([Unknown ELF target: ${target_arch}])] +) +AM_CONDITIONAL(USE_ELF32, [test x$use_elf32 = xyes]) +AM_CONDITIONAL(USE_ELF64, [test x$use_elf64 = xyes]) +AM_CONDITIONAL(USE_ELFXX, [test x$use_elfxx = xyes]) + +AC_MSG_CHECKING([whether to include DWARF support]) +if test x$target_arch != xia64; then + use_dwarf=yes +else + use_dwarf=no +fi +AM_CONDITIONAL(USE_DWARF, [test x$use_dwarf = xyes]) +AC_MSG_RESULT([$use_dwarf]) + +AC_MSG_CHECKING([whether to restrict build to remote support]) +if test x$target_arch != x$host_arch; then + CPPFLAGS="${CPPFLAGS} -DUNW_REMOTE_ONLY" + remote_only=yes +else + remote_only=no +fi +AC_MSG_RESULT([$remote_only]) + +AC_MSG_CHECKING([whether to load .debug_frame sections]) +AC_ARG_ENABLE(debug_frame, +AS_HELP_STRING([--enable-debug-frame],[Load the ".debug_frame" section if available]),, [ +case "${target_arch}" in + (arm) enable_debug_frame=yes;; + (aarch64) enable_debug_frame=yes;; + (*) enable_debug_frame=no;; +esac]) +if test x$remote_only = xyes; then + enable_debug_frame=no +fi +if test x$enable_debug_frame = xyes; then + AC_DEFINE([CONFIG_DEBUG_FRAME], [], [Enable Debug Frame]) +fi +AC_MSG_RESULT([$enable_debug_frame]) + +AC_MSG_CHECKING([whether to block signals during mutex ops]) +AC_ARG_ENABLE(block_signals, +AS_HELP_STRING([--enable-block-signals],[Block signals before performing mutex operations]),, +[enable_block_signals=yes]) +if test x$enable_block_signals = xyes; then + AC_DEFINE([CONFIG_BLOCK_SIGNALS], [], [Block signals before mutex operations]) +fi +AC_MSG_RESULT([$enable_block_signals]) + +AC_MSG_CHECKING([whether to validate memory addresses before use]) +AC_ARG_ENABLE(conservative_checks, +AS_HELP_STRING([--enable-conservative-checks],[Validate all memory addresses before use]),, +[enable_conservative_checks=yes]) +if test x$enable_conservative_checks = xyes; then + AC_DEFINE(CONSERVATIVE_CHECKS, 1, + [Define to 1 if you want every memory access validated]) +fi +AC_MSG_RESULT([$enable_conservative_checks]) + +AC_MSG_CHECKING([whether to enable msabi support]) +AC_ARG_ENABLE(msabi_support, +AS_HELP_STRING([--enable-msabi-support],[Enables support for Microsoft ABI extensions])) +if test x$enable_msabi_support = xyes; then + AC_DEFINE([CONFIG_MSABI_SUPPORT], [], [Support for Microsoft ABI extensions]) +fi +AC_MSG_RESULT([$enable_msabi_support]) + +LIBLZMA= +AC_MSG_CHECKING([whether to support LZMA-compressed symbol tables]) +AC_ARG_ENABLE(minidebuginfo, +AS_HELP_STRING([--enable-minidebuginfo], [Enables support for LZMA-compressed symbol tables]),, [enable_minidebuginfo=auto]) +AC_MSG_RESULT([$enable_minidebuginfo]) +if test x$enable_minidebuginfo != xno; then + AC_CHECK_LIB([lzma], [lzma_mf_is_supported], + [LIBLZMA=-llzma + AC_DEFINE([HAVE_LZMA], [1], [Define if you have liblzma]) + enable_minidebuginfo=yes], + [if test x$enable_minidebuginfo = xyes; then + AC_MSG_FAILURE([liblzma not found]) + fi]) +fi +AC_SUBST([LIBLZMA]) +AM_CONDITIONAL(HAVE_LZMA, test x$enable_minidebuginfo = xyes) + +LIBZ= +AC_MSG_CHECKING([whether to support ZLIB-compressed symbol tables]) +AC_ARG_ENABLE(zlibdebuginfo, +AS_HELP_STRING([--enable-zlibdebuginfo], [Enables support for ZLIB-compressed symbol tables]),, [enable_zlibdebuginfo=auto]) +AC_MSG_RESULT([$enable_zlibdebuginfo]) +if test x$enable_zlibdebuginfo != xno; then + AC_CHECK_LIB([z], [uncompress], + [LIBZ=-lz + AC_DEFINE([HAVE_ZLIB], [1], [Define if you have libz]) + enable_zlibdebuginfo=yes], + [if test x$enable_zlibdebuginfo = xyes; then + AC_MSG_FAILURE([libz not found]) + fi]) +fi +AC_SUBST([LIBZ]) +AM_CONDITIONAL(HAVE_ZLIB, test x$enable_zlibdebuginfo = xyes) + +AC_MSG_CHECKING([for Intel compiler]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[#ifndef __INTEL_COMPILER +#error choke me +#endif]])],[intel_compiler=yes],[intel_compiler=no]) + +if test x$GCC = xyes -a x$intel_compiler != xyes; then + CFLAGS="${CFLAGS} -fexceptions -Wall -Wsign-compare" +fi +AC_MSG_RESULT([$intel_compiler]) + +AC_MSG_CHECKING([if building on Solaris then define __EXTENSIONS__ macro]) +if $OS_SOLARIS; then + CFLAGS="${CFLAGS} -D__EXTENSIONS__" + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + +AC_MSG_CHECKING([for QCC compiler]) +AS_CASE([$CC], [qcc*|QCC*], [qcc_compiler=yes], [qcc_compiler=no]) +AC_MSG_RESULT([$qcc_compiler]) + +if test x$intel_compiler = xyes; then + AC_MSG_CHECKING([if linker supports -static-libcxa]) + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -static-libcxa" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[have_static_libcxa=yes],[have_static_libcxa=no]) + LDFLAGS="$save_LDFLAGS" + if test "x$have_static_libcxa" = xyes; then + LDFLAGS_STATIC_LIBCXA="-XCClinker -static-libcxa" + fi + AC_MSG_RESULT([$have_static_libcxa]) +fi + +if test x$qcc_compiler = xyes; then + LDFLAGS_NOSTARTFILES="-XCClinker -Wc,-nostartfiles" +else + LDFLAGS_NOSTARTFILES="-XCClinker -nostartfiles" +fi + +OLD_CFLAGS="${CFLAGS}" +CFLAGS="${CFLAGS} -march=armv8-a+sve" +AC_MSG_CHECKING([if compiler supports -march=armv8-a+sve]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [supports_march_armv8_a_sve=yes],[supports_march_armv8_a_sve=no]) +AM_CONDITIONAL(COMPILER_SUPPORTS_MARCH_ARMV8_A_SVE, [test x$supports_march_armv8_a_sve = xyes]) +AC_MSG_RESULT([$supports_march_armv8_a_sve]) +CFLAGS="${OLD_CFLAGS}" + +AC_MSG_CHECKING([for __builtin___clear_cache]) +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[]], [[__builtin___clear_cache(0, 0)]])], + [have__builtin___clear_cache=yes], + [have__builtin___clear_cache=no]) +if test x$have__builtin___clear_cache = xyes; then + AC_DEFINE([HAVE__BUILTIN___CLEAR_CACHE], [1], + [Defined if __builtin___clear_cache() is available]) +fi +AC_MSG_RESULT([$have__builtin___clear_cache]) + +AC_MSG_CHECKING([for __builtin_unreachable]) +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[]], [[__builtin_unreachable()]])], + [have__builtin_unreachable=yes], + [have__builtin_unreachable=no]) +if test x$have__builtin_unreachable = xyes; then + AC_DEFINE([HAVE__BUILTIN_UNREACHABLE], [1], + [Defined if __builtin_unreachable() is available]) +fi +AC_MSG_RESULT([$have__builtin_unreachable]) + +CCASFLAGS="${CCASFLAGS} ${CPPFLAGS}" + +arch="$target_arch" +ARCH=`echo $target_arch | tr [a-z] [A-Z]` + +dnl create shell variables from the M4 macros: +PKG_MAJOR=pkg_major +PKG_MINOR=pkg_minor +PKG_EXTRA=pkg_extra +PKG_MAINTAINER=pkg_maintainer + + +AC_SUBST(build_arch) +AC_SUBST(target_os) +AC_SUBST(arch) +AC_SUBST(ARCH) +AC_SUBST(LDFLAGS_STATIC_LIBCXA) +AC_SUBST(LDFLAGS_NOSTARTFILES) +AC_SUBST(PKG_MAJOR) +AC_SUBST(PKG_MINOR) +AC_SUBST(PKG_EXTRA) +AC_SUBST(PKG_MAINTAINER) +AC_SUBST(enable_cxx_exceptions) +AC_SUBST(enable_debug_frame) + + +AC_CONFIG_FILES(Makefile src/Makefile + include/libunwind-common.h + include/libunwind.h include/tdep/libunwind_i.h) +AC_CONFIG_FILES(src/unwind/libunwind.pc src/coredump/libunwind-coredump.pc + src/ptrace/libunwind-ptrace.pc src/setjmp/libunwind-setjmp.pc + src/libunwind-generic.pc) +AC_OUTPUT diff --git a/vendor/libunwind/include/compiler.h b/vendor/libunwind/include/compiler.h new file mode 100644 index 0000000000..3d8519347b --- /dev/null +++ b/vendor/libunwind/include/compiler.h @@ -0,0 +1,80 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2001-2005 Hewlett-Packard Co + Copyright (C) 2007 David Mosberger-Tang + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +/* Compiler specific useful bits that are used in libunwind, and also in the + * tests. */ + +#ifndef COMPILER_H +#define COMPILER_H + +#ifdef __GNUC__ +#ifndef __has_attribute +# define __has_attribute(x) (0) +#endif +# define CONST_ATTR __attribute__((__const__)) +# define UNUSED __attribute__((unused)) +# define NOINLINE __attribute__((noinline)) +# define NORETURN __attribute__((noreturn)) +# define ALIAS2(name) #name +# define ALIAS(name) __attribute__((alias (ALIAS2(name)))) +# if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) +# define ALWAYS_INLINE inline __attribute__((always_inline)) +# define HIDDEN __attribute__((visibility ("hidden"))) +# if __has_attribute(fallthrough) +# define FALLTHROUGH __attribute__((fallthrough)) +# else +# define FALLTHROUGH +# endif +# else +# define ALWAYS_INLINE +# define HIDDEN +# define FALLTHROUGH +# endif +# define WEAK __attribute__((weak)) +# if (__GNUC__ >= 3) +# define likely(x) __builtin_expect ((x), 1) +# define unlikely(x) __builtin_expect ((x), 0) +# else +# define likely(x) (x) +# define unlikely(x) (x) +# endif +#else +# define ALWAYS_INLINE +# define CONST_ATTR +# define UNUSED +# define NOINLINE +# define NORETURN +# define ALIAS(name) +# define HIDDEN +# define FALLTHROUGH +# define WEAK +# define likely(x) (x) +# define unlikely(x) (x) +#endif + +#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0])) + +#endif /* COMPILER_H */ diff --git a/vendor/libunwind/include/config.h.in b/vendor/libunwind/include/config.h.in new file mode 100644 index 0000000000..d982130845 --- /dev/null +++ b/vendor/libunwind/include/config.h.in @@ -0,0 +1,260 @@ +/* include/config.h.in. Generated from configure.ac by autoheader. */ + +/* Block signals before mutex operations */ +#undef CONFIG_BLOCK_SIGNALS + +/* Enable Debug Frame */ +#undef CONFIG_DEBUG_FRAME + +/* Support for Microsoft ABI extensions */ +#undef CONFIG_MSABI_SUPPORT + +/* Define if the weak 'backtrace' symbol is provided. */ +#undef CONFIG_WEAK_BACKTRACE + +/* Define to 1 if you want every memory access validated */ +#undef CONSERVATIVE_CHECKS + +/* Define to 1 if you have the header file. */ +#undef HAVE_ASM_PTRACE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ASM_PTRACE_OFFSETS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ASM_VSYSCALL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_BYTESWAP_H + +/* Define to 1 if you have the declaration of `PTRACE_CONT', and to 0 if you + don't. */ +#undef HAVE_DECL_PTRACE_CONT + +/* Define to 1 if you have the declaration of `PTRACE_POKEDATA', and to 0 if + you don't. */ +#undef HAVE_DECL_PTRACE_POKEDATA + +/* Define to 1 if you have the declaration of `PTRACE_POKEUSER', and to 0 if + you don't. */ +#undef HAVE_DECL_PTRACE_POKEUSER + +/* Define to 1 if you have the declaration of `PTRACE_SETREGSET', and to 0 if + you don't. */ +#undef HAVE_DECL_PTRACE_SETREGSET + +/* Define to 1 if you have the declaration of `PTRACE_SINGLESTEP', and to 0 if + you don't. */ +#undef HAVE_DECL_PTRACE_SINGLESTEP + +/* Define to 1 if you have the declaration of `PTRACE_SYSCALL', and to 0 if + you don't. */ +#undef HAVE_DECL_PTRACE_SYSCALL + +/* Define to 1 if you have the declaration of `PTRACE_TRACEME', and to 0 if + you don't. */ +#undef HAVE_DECL_PTRACE_TRACEME + +/* Define to 1 if you have the declaration of `PT_CONTINUE', and to 0 if you + don't. */ +#undef HAVE_DECL_PT_CONTINUE + +/* Define to 1 if you have the declaration of `PT_GETFPREGS', and to 0 if you + don't. */ +#undef HAVE_DECL_PT_GETFPREGS + +/* Define to 1 if you have the declaration of `PT_GETREGS', and to 0 if you + don't. */ +#undef HAVE_DECL_PT_GETREGS + +/* Define to 1 if you have the declaration of `PT_IO', and to 0 if you don't. + */ +#undef HAVE_DECL_PT_IO + +/* Define to 1 if you have the declaration of `PT_STEP', and to 0 if you + don't. */ +#undef HAVE_DECL_PT_STEP + +/* Define to 1 if you have the declaration of `PT_SYSCALL', and to 0 if you + don't. */ +#undef HAVE_DECL_PT_SYSCALL + +/* Define to 1 if you have the declaration of `PT_TRACE_ME', and to 0 if you + don't. */ +#undef HAVE_DECL_PT_TRACE_ME + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the `dlmodinfo' function. */ +#undef HAVE_DLMODINFO + +/* Define to 1 if you have the `dl_iterate_phdr' function. */ +#undef HAVE_DL_ITERATE_PHDR + +/* Define to 1 if you have the `dl_phdr_removals_counter' function. */ +#undef HAVE_DL_PHDR_REMOVALS_COUNTER + +/* Define to 1 if the system has the type `elf_fpregset_t'. */ +#undef HAVE_ELF_FPREGSET_T + +/* Define to 1 if you have the header file. */ +#undef HAVE_ELF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ENDIAN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_EXECINFO_H + +/* Define to 1 if you have the `execvpe' function. */ +#undef HAVE_EXECVPE + +/* Define to 1 if you have the `getunwind' function. */ +#undef HAVE_GETUNWIND + +/* Define to 1 if you have the header file. */ +#undef HAVE_IA64INTRIN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINK_H + +/* Define if you have liblzma */ +#undef HAVE_LZMA + +/* Define to 1 if you have the `mincore' function. */ +#undef HAVE_MINCORE + +/* Define to 1 if you have the `pipe2' function. */ +#undef HAVE_PIPE2 + +/* Define to 1 if the system has the type `procfs_status'. */ +#undef HAVE_PROCFS_STATUS + +/* Define to 1 if you have the `sigaltstack' function. */ +#undef HAVE_SIGALTSTACK + +/* Define to 1 if you have the header file. */ +#undef HAVE_SIGNAL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if `dlpi_subs' is a member of `struct dl_phdr_info'. */ +#undef HAVE_STRUCT_DL_PHDR_INFO_DLPI_SUBS + +/* Define to 1 if the system has the type `struct elf_prstatus'. */ +#undef HAVE_STRUCT_ELF_PRSTATUS + +/* Define to 1 if the system has the type `struct prstatus'. */ +#undef HAVE_STRUCT_PRSTATUS + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_ELF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_ENDIAN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_LINK_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PROCFS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PTRACE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SYSCALL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_UC_ACCESS_H + +/* Define to 1 if you have the `ttrace' function. */ +#undef HAVE_TTRACE + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have libz */ +#undef HAVE_ZLIB + +/* Defined if __builtin_unreachable() is available */ +#undef HAVE__BUILTIN_UNREACHABLE + +/* Defined if __builtin___clear_cache() is available */ +#undef HAVE__BUILTIN___CLEAR_CACHE + +/* Define to 1 if --enable-per-thread-cache */ +#undef HAVE___CACHE_PER_THREAD + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#undef LT_OBJDIR + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* The size of `off_t', as computed by sizeof. */ +#undef SIZEOF_OFF_T + +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to `unsigned int' if does not define. */ +#undef size_t diff --git a/vendor/libunwind/include/dwarf-eh.h b/vendor/libunwind/include/dwarf-eh.h new file mode 100644 index 0000000000..f48e91905b --- /dev/null +++ b/vendor/libunwind/include/dwarf-eh.h @@ -0,0 +1,139 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef dwarf_eh_h +#define dwarf_eh_h + +#include "dwarf.h" +#include "libunwind_i.h" + +/* This header file defines the format of a DWARF exception-header + section (.eh_frame_hdr, pointed to by program-header + PT_GNU_EH_FRAME). The exception-header is self-describing in the + sense that the format of the addresses contained in it is expressed + as a one-byte type-descriptor called a "pointer-encoding" (PE). + + The exception header encodes the address of the .eh_frame section + and optionally contains a binary search table for the + Frame Descriptor Entries (FDEs) in the .eh_frame. The contents of + .eh_frame has the format described by the DWARF v3 standard + (http://www.eagercon.com/dwarf/dwarf3std.htm), except that code + addresses may be encoded in different ways. Also, .eh_frame has + augmentations that allow encoding a language-specific data-area + (LSDA) pointer and a pointer to a personality-routine. + + Details: + + The Common Information Entry (CIE) associated with an FDE may + contain an augmentation string. Each character in this string has + a specific meaning and either one or two associated operands. The + operands are stored in an augmentation body which appears right + after the "return_address_register" member and before the + "initial_instructions" member. The operands appear in the order + in which the characters appear in the string. For example, if the + augmentation string is "zL", the operand for 'z' would be first in + the augmentation body and the operand for 'L' would be second. + The following characters are supported for the CIE augmentation + string: + + 'z': The operand for this character is a uleb128 value that gives the + length of the CIE augmentation body, not counting the length + of the uleb128 operand itself. If present, this code must + appear as the first character in the augmentation body. + + 'L': Indicates that the FDE's augmentation body contains an LSDA + pointer. The operand for this character is a single byte + that specifies the pointer-encoding (PE) that is used for + the LSDA pointer. + + 'R': Indicates that the code-pointers (FDE members + "initial_location" and "address_range" and the operand for + DW_CFA_set_loc) in the FDE have a non-default encoding. The + operand for this character is a single byte that specifies + the pointer-encoding (PE) that is used for the + code-pointers. Note: the "address_range" member is always + encoded as an absolute value. Apart from that, the specified + FDE pointer-encoding applies. + + 'P': Indicates the presence of a personality routine (handler). + The first operand for this character specifies the + pointer-encoding (PE) that is used for the second operand, + which specifies the address of the personality routine. + + If the augmentation string contains any other characters, the + remainder of the augmentation string should be ignored. + Furthermore, if the size of the augmentation body is unknown + (i.e., 'z' is not the first character of the augmentation string), + then the entire CIE as well all associated FDEs must be ignored. + + A Frame Descriptor Entries (FDE) may contain an augmentation body + which, if present, appears right after the "address_range" member + and before the "instructions" member. The contents of this body + is implicitly defined by the augmentation string of the associated + CIE. The meaning of the characters in the CIE's augmentation + string as far as FDEs are concerned is as follows: + + 'z': The first operand in the FDE's augmentation body specifies + the total length of the augmentation body as a uleb128 (not + counting the length of the uleb128 operand itself). + + 'L': The operand for this character is an LSDA pointer, encoded + in the format specified by the corresponding operand in the + CIE's augmentation body. + +*/ + +#define DW_EH_VERSION 1 /* The version we're implementing */ + +#ifdef _MSC_VER +#pragma pack(push, 1) +#define __attribute__(x) +#endif + +struct __attribute__((packed)) dwarf_eh_frame_hdr + { + unsigned char version; + unsigned char eh_frame_ptr_enc; + unsigned char fde_count_enc; + unsigned char table_enc; + Elf_W (Addr) eh_frame; + /* The rest of the header is variable-length and consists of the + following members: + + encoded_t fde_count; + struct + { + encoded_t start_ip; // first address covered by this FDE + encoded_t fde_addr; // address of the FDE + } + binary_search_table[fde_count]; */ + }; + +#ifdef _MSC_VER +#pragma pack(pop) +#undef __attribute__ +#endif + +#endif /* dwarf_eh_h */ diff --git a/vendor/libunwind/include/dwarf.h b/vendor/libunwind/include/dwarf.h new file mode 100644 index 0000000000..4fd1dba02d --- /dev/null +++ b/vendor/libunwind/include/dwarf.h @@ -0,0 +1,457 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2003-2005 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef dwarf_h +#define dwarf_h + +#include +#include + +struct dwarf_cursor; /* forward-declaration */ +struct elf_dyn_info; + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "dwarf-config.h" + +#ifndef UNW_REMOTE_ONLY + #if defined(HAVE_LINK_H) + #include + #elif defined(HAVE_SYS_LINK_H) + #include + #else + #error Could not find + #endif + #if defined(__ANDROID__) && defined(__arm__) && __ANDROID_API__ < 21 + int dl_iterate_phdr(int (*)(struct dl_phdr_info *, size_t, void *), void *); + #endif +#endif + +#include + +/* DWARF expression opcodes. */ + +typedef enum + { + DW_OP_addr = 0x03, + DW_OP_deref = 0x06, + DW_OP_const1u = 0x08, + DW_OP_const1s = 0x09, + DW_OP_const2u = 0x0a, + DW_OP_const2s = 0x0b, + DW_OP_const4u = 0x0c, + DW_OP_const4s = 0x0d, + DW_OP_const8u = 0x0e, + DW_OP_const8s = 0x0f, + DW_OP_constu = 0x10, + DW_OP_consts = 0x11, + DW_OP_dup = 0x12, + DW_OP_drop = 0x13, + DW_OP_over = 0x14, + DW_OP_pick = 0x15, + DW_OP_swap = 0x16, + DW_OP_rot = 0x17, + DW_OP_xderef = 0x18, + DW_OP_abs = 0x19, + DW_OP_and = 0x1a, + DW_OP_div = 0x1b, + DW_OP_minus = 0x1c, + DW_OP_mod = 0x1d, + DW_OP_mul = 0x1e, + DW_OP_neg = 0x1f, + DW_OP_not = 0x20, + DW_OP_or = 0x21, + DW_OP_plus = 0x22, + DW_OP_plus_uconst = 0x23, + DW_OP_shl = 0x24, + DW_OP_shr = 0x25, + DW_OP_shra = 0x26, + DW_OP_xor = 0x27, + DW_OP_skip = 0x2f, + DW_OP_bra = 0x28, + DW_OP_eq = 0x29, + DW_OP_ge = 0x2a, + DW_OP_gt = 0x2b, + DW_OP_le = 0x2c, + DW_OP_lt = 0x2d, + DW_OP_ne = 0x2e, + DW_OP_lit0 = 0x30, + DW_OP_lit1, DW_OP_lit2, DW_OP_lit3, DW_OP_lit4, DW_OP_lit5, + DW_OP_lit6, DW_OP_lit7, DW_OP_lit8, DW_OP_lit9, DW_OP_lit10, + DW_OP_lit11, DW_OP_lit12, DW_OP_lit13, DW_OP_lit14, DW_OP_lit15, + DW_OP_lit16, DW_OP_lit17, DW_OP_lit18, DW_OP_lit19, DW_OP_lit20, + DW_OP_lit21, DW_OP_lit22, DW_OP_lit23, DW_OP_lit24, DW_OP_lit25, + DW_OP_lit26, DW_OP_lit27, DW_OP_lit28, DW_OP_lit29, DW_OP_lit30, + DW_OP_lit31, + DW_OP_reg0 = 0x50, + DW_OP_reg1, DW_OP_reg2, DW_OP_reg3, DW_OP_reg4, DW_OP_reg5, + DW_OP_reg6, DW_OP_reg7, DW_OP_reg8, DW_OP_reg9, DW_OP_reg10, + DW_OP_reg11, DW_OP_reg12, DW_OP_reg13, DW_OP_reg14, DW_OP_reg15, + DW_OP_reg16, DW_OP_reg17, DW_OP_reg18, DW_OP_reg19, DW_OP_reg20, + DW_OP_reg21, DW_OP_reg22, DW_OP_reg23, DW_OP_reg24, DW_OP_reg25, + DW_OP_reg26, DW_OP_reg27, DW_OP_reg28, DW_OP_reg29, DW_OP_reg30, + DW_OP_reg31, + DW_OP_breg0 = 0x70, + DW_OP_breg1, DW_OP_breg2, DW_OP_breg3, DW_OP_breg4, DW_OP_breg5, + DW_OP_breg6, DW_OP_breg7, DW_OP_breg8, DW_OP_breg9, DW_OP_breg10, + DW_OP_breg11, DW_OP_breg12, DW_OP_breg13, DW_OP_breg14, DW_OP_breg15, + DW_OP_breg16, DW_OP_breg17, DW_OP_breg18, DW_OP_breg19, DW_OP_breg20, + DW_OP_breg21, DW_OP_breg22, DW_OP_breg23, DW_OP_breg24, DW_OP_breg25, + DW_OP_breg26, DW_OP_breg27, DW_OP_breg28, DW_OP_breg29, DW_OP_breg30, + DW_OP_breg31, + DW_OP_regx = 0x90, + DW_OP_fbreg = 0x91, + DW_OP_bregx = 0x92, + DW_OP_piece = 0x93, + DW_OP_deref_size = 0x94, + DW_OP_xderef_size = 0x95, + DW_OP_nop = 0x96, + DW_OP_push_object_address = 0x97, + DW_OP_call2 = 0x98, + DW_OP_call4 = 0x99, + DW_OP_call_ref = 0x9a, + DW_OP_lo_user = 0xe0, + DW_OP_hi_user = 0xff + } +dwarf_expr_op_t; + +#define DWARF_CIE_VERSION 3 +#define DWARF_CIE_VERSION_MAX 4 + +#define DWARF_CFA_OPCODE_MASK 0xc0 +#define DWARF_CFA_OPERAND_MASK 0x3f + +typedef enum + { + DW_CFA_advance_loc = 0x40, + DW_CFA_offset = 0x80, + DW_CFA_restore = 0xc0, + DW_CFA_nop = 0x00, + DW_CFA_set_loc = 0x01, + DW_CFA_advance_loc1 = 0x02, + DW_CFA_advance_loc2 = 0x03, + DW_CFA_advance_loc4 = 0x04, + DW_CFA_offset_extended = 0x05, + DW_CFA_restore_extended = 0x06, + DW_CFA_undefined = 0x07, + DW_CFA_same_value = 0x08, + DW_CFA_register = 0x09, + DW_CFA_remember_state = 0x0a, + DW_CFA_restore_state = 0x0b, + DW_CFA_def_cfa = 0x0c, + DW_CFA_def_cfa_register = 0x0d, + DW_CFA_def_cfa_offset = 0x0e, + DW_CFA_def_cfa_expression = 0x0f, + DW_CFA_expression = 0x10, + DW_CFA_offset_extended_sf = 0x11, + DW_CFA_def_cfa_sf = 0x12, + DW_CFA_def_cfa_offset_sf = 0x13, + DW_CFA_val_expression = 0x16, + DW_CFA_lo_user = 0x1c, + DW_CFA_MIPS_advance_loc8 = 0x1d, + DW_CFA_GNU_window_save = 0x2d, + DW_CFA_GNU_args_size = 0x2e, + DW_CFA_GNU_negative_offset_extended = 0x2f, + DW_CFA_hi_user = 0x3c + } +dwarf_cfa_t; + +/* DWARF Pointer-Encoding (PEs). + + Pointer-Encodings were invented for the GCC exception-handling + support for C++, but they represent a rather generic way of + describing the format in which an address/pointer is stored and + hence we include the definitions here, in the main dwarf.h file. + The Pointer-Encoding format is partially documented in Linux Base + Spec v1.3 (http://www.linuxbase.org/spec/). The rest is reverse + engineered from GCC. + +*/ +#define DW_EH_PE_FORMAT_MASK 0x0f /* format of the encoded value */ +#define DW_EH_PE_APPL_MASK 0x70 /* how the value is to be applied */ +/* Flag bit. If set, the resulting pointer is the address of the word + that contains the final address. */ +#define DW_EH_PE_indirect 0x80 + +/* Pointer-encoding formats: */ +#define DW_EH_PE_omit 0xff +#define DW_EH_PE_ptr 0x00 /* pointer-sized unsigned value */ +#define DW_EH_PE_uleb128 0x01 /* unsigned LE base-128 value */ +#define DW_EH_PE_udata2 0x02 /* unsigned 16-bit value */ +#define DW_EH_PE_udata4 0x03 /* unsigned 32-bit value */ +#define DW_EH_PE_udata8 0x04 /* unsigned 64-bit value */ +#define DW_EH_PE_sleb128 0x09 /* signed LE base-128 value */ +#define DW_EH_PE_sdata2 0x0a /* signed 16-bit value */ +#define DW_EH_PE_sdata4 0x0b /* signed 32-bit value */ +#define DW_EH_PE_sdata8 0x0c /* signed 64-bit value */ + +/* Pointer-encoding application: */ +#define DW_EH_PE_absptr 0x00 /* absolute value */ +#define DW_EH_PE_pcrel 0x10 /* rel. to addr. of encoded value */ +#define DW_EH_PE_textrel 0x20 /* text-relative (GCC-specific???) */ +#define DW_EH_PE_datarel 0x30 /* data-relative */ +/* The following are not documented by LSB v1.3, yet they are used by + GCC, presumably they aren't documented by LSB since they aren't + used on Linux: */ +#define DW_EH_PE_funcrel 0x40 /* start-of-procedure-relative */ +#define DW_EH_PE_aligned 0x50 /* aligned pointer */ + +extern struct mempool dwarf_reg_state_pool; +extern struct mempool dwarf_cie_info_pool; + +typedef enum + { + DWARF_WHERE_UNDEF, /* register isn't saved at all */ + DWARF_WHERE_SAME, /* register has same value as in prev. frame */ + DWARF_WHERE_CFAREL, /* register saved at CFA-relative address */ + DWARF_WHERE_REG, /* register saved in another register */ + DWARF_WHERE_EXPR, /* register saved */ + DWARF_WHERE_VAL_EXPR, /* register has computed value */ + DWARF_WHERE_CFA, /* register is set to the computed cfa value */ + } +dwarf_where_t; + +/* For uniformity, we'd like to treat the CFA save-location like any + other register save-location, but this doesn't quite work, because + the CFA can be expressed as a (REGISTER,OFFSET) pair. To handle + this, we use two dwarf_save_loc structures to describe the CFA. + The first one (CFA_REG_COLUMN), tells us where the CFA is saved. + In the case of DWARF_WHERE_EXPR, the CFA is defined by a DWARF + location expression whose address is given by member "val". In the + case of DWARF_WHERE_REG, member "val" gives the number of the + base-register and the "val" member of DWARF_CFA_OFF_COLUMN gives + the offset value. */ +#define DWARF_CFA_REG_COLUMN DWARF_NUM_PRESERVED_REGS +#define DWARF_CFA_OFF_COLUMN (DWARF_NUM_PRESERVED_REGS + 1) + +typedef struct dwarf_reg_only_state + { + char where[DWARF_NUM_PRESERVED_REGS + 2]; /* how is the register saved? */ + unw_word_t val[DWARF_NUM_PRESERVED_REGS + 2]; /* where it's saved */ + } +dwarf_reg_only_state_t; + +typedef struct dwarf_reg_state + { + unw_word_t ret_addr_column; /* which column in rule table represents return address */ + dwarf_reg_only_state_t reg; + } +dwarf_reg_state_t; + +typedef struct dwarf_stackable_reg_state + { + struct dwarf_stackable_reg_state *next; /* for rs_stack */ + dwarf_reg_state_t state; + } +dwarf_stackable_reg_state_t; + +typedef struct dwarf_reg_cache_entry + { + unw_word_t ip; /* ip this rs is for */ + unsigned short coll_chain; /* used for hash collisions */ + unsigned short hint; /* hint for next rs to try (or -1) */ + unsigned short valid : 1; /* optional machine-dependent signal info */ + unsigned short signal_frame : 1; /* optional machine-dependent signal info */ + } +dwarf_reg_cache_entry_t; + +typedef struct dwarf_cie_info + { + unw_word_t cie_instr_start; /* start addr. of CIE "initial_instructions" */ + unw_word_t cie_instr_end; /* end addr. of CIE "initial_instructions" */ + unw_word_t fde_instr_start; /* start addr. of FDE "instructions" */ + unw_word_t fde_instr_end; /* end addr. of FDE "instructions" */ + unw_word_t code_align; /* code-alignment factor */ + unw_word_t data_align; /* data-alignment factor */ + unw_word_t ret_addr_column; /* column of return-address register */ + unw_word_t handler; /* address of personality-routine */ + uint16_t abi; + uint16_t tag; + uint8_t fde_encoding; + uint8_t lsda_encoding; + unsigned int sized_augmentation : 1; + unsigned int have_abi_marker : 1; + unsigned int signal_frame : 1; + } +dwarf_cie_info_t; + +typedef struct dwarf_state_record + { + unsigned char fde_encoding; + unw_word_t args_size; + + dwarf_reg_state_t rs_initial; /* reg-state after CIE instructions */ + dwarf_reg_state_t rs_current; /* current reg-state */ + } +dwarf_state_record_t; + +typedef struct dwarf_cursor + { + void *as_arg; /* argument to address-space callbacks */ + unw_addr_space_t as; /* reference to per-address-space info */ + + unw_word_t cfa; /* canonical frame address; aka frame-pointer */ + unw_word_t ip; /* instruction pointer */ + unw_word_t args_size; /* size of arguments */ + unw_word_t eh_args[UNW_TDEP_NUM_EH_REGS]; + unsigned int eh_valid_mask; + + dwarf_loc_t loc[DWARF_NUM_PRESERVED_REGS]; + + unsigned int stash_frames :1; /* stash frames for fast lookup */ + unsigned int use_prev_instr :1; /* use previous (= call) or current (= signal) instruction? */ + unsigned int pi_valid :1; /* is proc_info valid? */ + unsigned int pi_is_dynamic :1; /* proc_info found via dynamic proc info? */ + unw_proc_info_t pi; /* info about current procedure */ + + short hint; /* faster lookup of the rs cache */ + short prev_rs; + } +dwarf_cursor_t; + +#define DWARF_DEFAULT_LOG_UNW_CACHE_SIZE 7 +#define DWARF_DEFAULT_UNW_CACHE_SIZE (1 << DWARF_DEFAULT_LOG_UNW_CACHE_SIZE) + +#define DWARF_DEFAULT_LOG_UNW_HASH_SIZE (DWARF_DEFAULT_LOG_UNW_CACHE_SIZE + 1) +#define DWARF_DEFAULT_UNW_HASH_SIZE (1 << DWARF_DEFAULT_LOG_UNW_HASH_SIZE) + +typedef unsigned char unw_hash_index_t; + +struct dwarf_rs_cache + { + pthread_mutex_t lock; + unsigned short rr_head; /* index of least-recently allocated rs */ + + unsigned short log_size; + unsigned short prev_log_size; + + /* hash table that maps instruction pointer to rs index: */ + unsigned short *hash; + + _Atomic uint32_t generation; /* generation number */ + + /* rs cache: */ + dwarf_reg_state_t *buckets; + dwarf_reg_cache_entry_t *links; + + /* default memory, loaded in BSS segment */ + unsigned short default_hash[DWARF_DEFAULT_UNW_HASH_SIZE]; + dwarf_reg_state_t default_buckets[DWARF_DEFAULT_UNW_CACHE_SIZE]; + dwarf_reg_cache_entry_t default_links[DWARF_DEFAULT_UNW_CACHE_SIZE]; + }; + +/* A list of descriptors for loaded .debug_frame sections. */ + +struct unw_debug_frame_list + { + /* The start (inclusive) and end (exclusive) of the described region. */ + unw_word_t start; + unw_word_t end; + /* ELF load offset */ + unw_word_t load_offset; + /* The debug frame itself. */ + char *debug_frame; + size_t debug_frame_size; + /* Index (for binary search). */ + struct table_entry *index; + size_t index_size; + /* Pointer to next descriptor. */ + struct unw_debug_frame_list *next; + }; + +/* Convenience macros: */ +#define dwarf_init UNW_ARCH_OBJ (dwarf_init) +#define dwarf_callback UNW_OBJ (dwarf_callback) +#define dwarf_find_proc_info UNW_OBJ (dwarf_find_proc_info) +#define dwarf_find_debug_frame UNW_OBJ (dwarf_find_debug_frame) +#define dwarf_search_unwind_table UNW_OBJ (dwarf_search_unwind_table) +#define dwarf_find_unwind_table UNW_OBJ (dwarf_find_unwind_table) +#define dwarf_put_unwind_info UNW_OBJ (dwarf_put_unwind_info) +#define dwarf_put_unwind_info UNW_OBJ (dwarf_put_unwind_info) +#define dwarf_eval_expr UNW_OBJ (dwarf_eval_expr) +#define dwarf_stack_aligned UNW_OBJ (dwarf_stack_aligned) +#define dwarf_extract_proc_info_from_fde \ + UNW_OBJ (dwarf_extract_proc_info_from_fde) +#define dwarf_find_save_locs UNW_OBJ (dwarf_find_save_locs) +#define dwarf_make_proc_info UNW_OBJ (dwarf_make_proc_info) +#define dwarf_apply_reg_state UNW_OBJ (dwarf_apply_reg_state) +#define dwarf_reg_states_iterate UNW_OBJ (dwarf_reg_states_iterate) +#define dwarf_read_encoded_pointer UNW_OBJ (dwarf_read_encoded_pointer) +#define dwarf_step UNW_OBJ (dwarf_step) +#define dwarf_flush_rs_cache UNW_OBJ (dwarf_flush_rs_cache) + +extern int dwarf_init (void); +#ifndef UNW_REMOTE_ONLY +extern int dwarf_callback (struct dl_phdr_info *info, size_t size, void *ptr); +extern int dwarf_find_proc_info (unw_addr_space_t as, unw_word_t ip, + unw_proc_info_t *pi, + int need_unwind_info, void *arg); +#endif /* !UNW_REMOTE_ONLY */ +extern int dwarf_find_debug_frame (int found, unw_dyn_info_t *di_debug, + unw_word_t ip, unw_word_t segbase, + const char* obj_name, unw_word_t start, + unw_word_t end); +extern int dwarf_search_unwind_table (unw_addr_space_t as, + unw_word_t ip, + unw_dyn_info_t *di, + unw_proc_info_t *pi, + int need_unwind_info, void *arg); + +extern int dwarf_find_unwind_table (struct elf_dyn_info *edi, unw_addr_space_t as, + const char *path, unw_word_t segbase, unw_word_t mapoff, + unw_word_t ip); +extern void dwarf_put_unwind_info (unw_addr_space_t as, + unw_proc_info_t *pi, void *arg); +extern int dwarf_eval_expr (struct dwarf_cursor *c, unw_word_t stack_val, unw_word_t *addr, + unw_word_t len, unw_word_t *valp, + int *is_register); +extern int +dwarf_stack_aligned(struct dwarf_cursor *c, unw_word_t cfa_addr, + unw_word_t rbp_addr, unw_word_t *offset); + +extern int dwarf_extract_proc_info_from_fde (unw_addr_space_t as, + unw_accessors_t *a, + unw_word_t *fde_addr, + unw_proc_info_t *pi, + unw_word_t base, + int need_unwind_info, + int is_debug_frame, + void *arg); +extern int dwarf_find_save_locs (struct dwarf_cursor *c); +extern int dwarf_make_proc_info (struct dwarf_cursor *c); +extern int dwarf_apply_reg_state (struct dwarf_cursor *c, struct dwarf_reg_state *rs); +extern int dwarf_reg_states_iterate (struct dwarf_cursor *c, unw_reg_states_callback cb, void *token); +extern int dwarf_read_encoded_pointer (unw_addr_space_t as, + unw_accessors_t *a, + unw_word_t *addr, + unsigned char encoding, + const unw_proc_info_t *pi, + unw_word_t *valp, void *arg); +extern int dwarf_step (struct dwarf_cursor *c); +extern int dwarf_flush_rs_cache (struct dwarf_rs_cache *cache); + +#endif /* dwarf_h */ diff --git a/vendor/libunwind/include/dwarf_i.h b/vendor/libunwind/include/dwarf_i.h new file mode 100644 index 0000000000..0f47082adb --- /dev/null +++ b/vendor/libunwind/include/dwarf_i.h @@ -0,0 +1,490 @@ +#ifndef DWARF_I_H +#define DWARF_I_H + +/* This file contains definitions that cannot be used in code outside + of libunwind. In particular, most inline functions are here + because otherwise they'd generate unresolved references when the + files are compiled with inlining disabled. */ + +#include "dwarf.h" +#include "libunwind_i.h" + +/* Unless we are told otherwise, assume that a "machine address" is + the size of an unw_word_t. */ +#ifndef dwarf_addr_size +# define dwarf_addr_size(as) (sizeof (unw_word_t)) +#endif + +#ifndef dwarf_to_unw_regnum +# define dwarf_to_unw_regnum_map UNW_OBJ (dwarf_to_unw_regnum_map) +extern const uint8_t dwarf_to_unw_regnum_map[DWARF_REGNUM_MAP_LENGTH]; +/* REG is evaluated multiple times; it better be side-effects free! */ +# define dwarf_to_unw_regnum(reg) \ + (((reg) < DWARF_REGNUM_MAP_LENGTH) ? dwarf_to_unw_regnum_map[reg] : 0) +#endif + +#ifdef UNW_LOCAL_ONLY + +/* In the local-only case, we can let the compiler directly access + memory and don't need to worry about differing byte-order. */ + +typedef union __attribute__ ((packed)) + { + int8_t s8; + int16_t s16; + int32_t s32; + int64_t s64; + uint8_t u8; + uint16_t u16; + uint32_t u32; + uint64_t u64; + void *ptr; + } +dwarf_misaligned_value_t; + +static inline int +dwarf_reads8 (unw_addr_space_t as UNUSED, unw_accessors_t *a UNUSED, unw_word_t *addr, + int8_t *val, void *arg UNUSED) +{ + dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr; + + *val = mvp->s8; + *addr += sizeof (mvp->s8); + return 0; +} + +static inline int +dwarf_reads16 (unw_addr_space_t as UNUSED, unw_accessors_t *a UNUSED, unw_word_t *addr, + int16_t *val, void *arg UNUSED) +{ + dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr; + + *val = mvp->s16; + *addr += sizeof (mvp->s16); + return 0; +} + +static inline int +dwarf_reads32 (unw_addr_space_t as UNUSED, unw_accessors_t *a UNUSED, unw_word_t *addr, + int32_t *val, void *arg UNUSED) +{ + dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr; + + *val = mvp->s32; + *addr += sizeof (mvp->s32); + return 0; +} + +static inline int +dwarf_reads64 (unw_addr_space_t as UNUSED, unw_accessors_t *a UNUSED, unw_word_t *addr, + int64_t *val, void *arg UNUSED) +{ + dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr; + + *val = mvp->s64; + *addr += sizeof (mvp->s64); + return 0; +} + +static inline int +dwarf_readu8 (unw_addr_space_t as UNUSED, unw_accessors_t *a UNUSED, unw_word_t *addr, + uint8_t *val, void *arg UNUSED) +{ + dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr; + + *val = mvp->u8; + *addr += sizeof (mvp->u8); + return 0; +} + +static inline int +dwarf_readu16 (unw_addr_space_t as UNUSED, unw_accessors_t *a UNUSED, unw_word_t *addr, + uint16_t *val, void *arg UNUSED) +{ + dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr; + + *val = mvp->u16; + *addr += sizeof (mvp->u16); + return 0; +} + +static inline int +dwarf_readu32 (unw_addr_space_t as UNUSED, unw_accessors_t *a UNUSED, unw_word_t *addr, + uint32_t *val, void *arg UNUSED) +{ + dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr; + + *val = mvp->u32; + *addr += sizeof (mvp->u32); + return 0; +} + +static inline int +dwarf_readu64 (unw_addr_space_t as UNUSED, unw_accessors_t *a UNUSED, unw_word_t *addr, + uint64_t *val, void *arg UNUSED) +{ + dwarf_misaligned_value_t *mvp = (void *) (uintptr_t) *addr; + + *val = mvp->u64; + *addr += sizeof (mvp->u64); + return 0; +} + +#else /* !UNW_LOCAL_ONLY */ + +static inline int +dwarf_readu8 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, + uint8_t *valp, void *arg) +{ + unw_word_t val, aligned_addr = *addr & (~sizeof (unw_word_t) + 1); + unw_word_t off = *addr - aligned_addr; + int ret; + + *addr += 1; + ret = (*a->access_mem) (as, aligned_addr, &val, 0, arg); +#if UNW_BYTE_ORDER == UNW_LITTLE_ENDIAN + val >>= 8*off; +#else + val >>= 8*(sizeof (unw_word_t) - 1 - off); +#endif + *valp = (uint8_t) val; + return ret; +} + +static inline int +dwarf_readu16 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, + uint16_t *val, void *arg) +{ + uint8_t v0, v1; + int ret; + + if ((ret = dwarf_readu8 (as, a, addr, &v0, arg)) < 0 + || (ret = dwarf_readu8 (as, a, addr, &v1, arg)) < 0) + return ret; + + if (tdep_big_endian (as)) + *val = (uint16_t) v0 << 8 | v1; + else + *val = (uint16_t) v1 << 8 | v0; + return 0; +} + +static inline int +dwarf_readu32 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, + uint32_t *val, void *arg) +{ + uint16_t v0, v1; + int ret; + + if ((ret = dwarf_readu16 (as, a, addr, &v0, arg)) < 0 + || (ret = dwarf_readu16 (as, a, addr, &v1, arg)) < 0) + return ret; + + if (tdep_big_endian (as)) + *val = (uint32_t) v0 << 16 | v1; + else + *val = (uint32_t) v1 << 16 | v0; + return 0; +} + +static inline int +dwarf_readu64 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, + uint64_t *val, void *arg) +{ + uint32_t v0, v1; + int ret; + + if ((ret = dwarf_readu32 (as, a, addr, &v0, arg)) < 0 + || (ret = dwarf_readu32 (as, a, addr, &v1, arg)) < 0) + return ret; + + if (tdep_big_endian (as)) + *val = (uint64_t) v0 << 32 | v1; + else + *val = (uint64_t) v1 << 32 | v0; + return 0; +} + +static inline int +dwarf_reads8 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, + int8_t *val, void *arg) +{ + uint8_t uval; + int ret; + + if ((ret = dwarf_readu8 (as, a, addr, &uval, arg)) < 0) + return ret; + *val = (int8_t) uval; + return 0; +} + +static inline int +dwarf_reads16 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, + int16_t *val, void *arg) +{ + uint16_t uval; + int ret; + + if ((ret = dwarf_readu16 (as, a, addr, &uval, arg)) < 0) + return ret; + *val = (int16_t) uval; + return 0; +} + +static inline int +dwarf_reads32 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, + int32_t *val, void *arg) +{ + uint32_t uval; + int ret; + + if ((ret = dwarf_readu32 (as, a, addr, &uval, arg)) < 0) + return ret; + *val = (int32_t) uval; + return 0; +} + +static inline int +dwarf_reads64 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, + int64_t *val, void *arg) +{ + uint64_t uval; + int ret; + + if ((ret = dwarf_readu64 (as, a, addr, &uval, arg)) < 0) + return ret; + *val = (int64_t) uval; + return 0; +} + +#endif /* !UNW_LOCAL_ONLY */ + +static inline int +dwarf_readw (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, + unw_word_t *val, void *arg) +{ + uint32_t u32; + uint64_t u64; + int ret; + + switch (dwarf_addr_size (as)) + { + case 4: + ret = dwarf_readu32 (as, a, addr, &u32, arg); + if (ret < 0) + return ret; + *val = u32; + return ret; + + case 8: + ret = dwarf_readu64 (as, a, addr, &u64, arg); + if (ret < 0) + return ret; + *val = u64; + return ret; + + default: + abort (); + } +} + +/* Read an unsigned "little-endian base 128" value. See Chapter 7.6 + of DWARF spec v3. */ + +static inline int +dwarf_read_uleb128 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, + unw_word_t *valp, void *arg) +{ + unw_word_t val = 0, shift = 0; + unsigned char byte; + int ret; + + do + { + if ((ret = dwarf_readu8 (as, a, addr, &byte, arg)) < 0) + return ret; + + val |= ((unw_word_t) byte & 0x7f) << shift; + shift += 7; + } + while (byte & 0x80); + + *valp = val; + return 0; +} + +/* Read a signed "little-endian base 128" value. See Chapter 7.6 of + DWARF spec v3. */ + +static inline int +dwarf_read_sleb128 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, + unw_word_t *valp, void *arg) +{ + unw_word_t val = 0, shift = 0; + unsigned char byte; + int ret; + + do + { + if ((ret = dwarf_readu8 (as, a, addr, &byte, arg)) < 0) + return ret; + + val |= ((unw_word_t) byte & 0x7f) << shift; + shift += 7; + } + while (byte & 0x80); + + if (shift < 8 * sizeof (unw_word_t) && (byte & 0x40) != 0) + /* sign-extend negative value */ + val |= ((unw_word_t) -1) << shift; + + *valp = val; + return 0; +} + +static ALWAYS_INLINE int +dwarf_read_encoded_pointer_inlined (unw_addr_space_t as, unw_accessors_t *a, + unw_word_t *addr, unsigned char encoding, + const unw_proc_info_t *pi, + unw_word_t *valp, void *arg) +{ + unw_word_t val, initial_addr = *addr; + uint16_t uval16; + uint32_t uval32; + uint64_t uval64; + int16_t sval16 = 0; + int32_t sval32 = 0; + int64_t sval64 = 0; + int ret; + + /* DW_EH_PE_omit and DW_EH_PE_aligned don't follow the normal + format/application encoding. Handle them first. */ + if (encoding == DW_EH_PE_omit) + { + *valp = 0; + return 0; + } + else if (encoding == DW_EH_PE_aligned) + { + int size = dwarf_addr_size (as); + *addr = (initial_addr + size - 1) & -size; + return dwarf_readw (as, a, addr, valp, arg); + } + + switch (encoding & DW_EH_PE_FORMAT_MASK) + { + case DW_EH_PE_ptr: + if ((ret = dwarf_readw (as, a, addr, &val, arg)) < 0) + return ret; + break; + + case DW_EH_PE_uleb128: + if ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0) + return ret; + break; + + case DW_EH_PE_udata2: + if ((ret = dwarf_readu16 (as, a, addr, &uval16, arg)) < 0) + return ret; + val = uval16; + break; + + case DW_EH_PE_udata4: + if ((ret = dwarf_readu32 (as, a, addr, &uval32, arg)) < 0) + return ret; + val = uval32; + break; + + case DW_EH_PE_udata8: + if ((ret = dwarf_readu64 (as, a, addr, &uval64, arg)) < 0) + return ret; + val = uval64; + break; + + case DW_EH_PE_sleb128: + if ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0) + return ret; + break; + + case DW_EH_PE_sdata2: + if ((ret = dwarf_reads16 (as, a, addr, &sval16, arg)) < 0) + return ret; + val = sval16; + break; + + case DW_EH_PE_sdata4: + if ((ret = dwarf_reads32 (as, a, addr, &sval32, arg)) < 0) + return ret; + val = sval32; + break; + + case DW_EH_PE_sdata8: + if ((ret = dwarf_reads64 (as, a, addr, &sval64, arg)) < 0) + return ret; + val = sval64; + break; + + default: + Debug (1, "unexpected encoding format 0x%x\n", + encoding & DW_EH_PE_FORMAT_MASK); + return -UNW_EINVAL; + } + + if (val == 0) + { + /* 0 is a special value and always absolute. */ + *valp = 0; + return 0; + } + + switch (encoding & DW_EH_PE_APPL_MASK) + { + case DW_EH_PE_absptr: + break; + + case DW_EH_PE_pcrel: + val += initial_addr; + break; + + case DW_EH_PE_datarel: + /* XXX For now, assume that data-relative addresses are relative + to the global pointer. */ + val += pi->gp; + break; + + case DW_EH_PE_funcrel: + val += pi->start_ip; + break; + + case DW_EH_PE_textrel: + /* XXX For now we don't support text-rel values. If there is a + platform which needs this, we probably would have to add a + "segbase" member to unw_proc_info_t. */ + default: + Debug (1, "unexpected application type 0x%x\n", + encoding & DW_EH_PE_APPL_MASK); + return -UNW_EINVAL; + } + + /* Trim off any extra bits. Assume that sign extension isn't + required; the only place it is needed is MIPS kernel space + addresses. */ + if (sizeof (val) > dwarf_addr_size (as)) + { + assert (dwarf_addr_size (as) == 4); + val = (uint32_t) val; + } + + if (encoding & DW_EH_PE_indirect) + { + unw_word_t indirect_addr = val; + + if ((ret = dwarf_readw (as, a, &indirect_addr, &val, arg)) < 0) + return ret; + } + + *valp = val; + return 0; +} + +#endif /* DWARF_I_H */ diff --git a/vendor/libunwind/include/libunwind-aarch64.h b/vendor/libunwind/include/libunwind-aarch64.h new file mode 100644 index 0000000000..248eee3038 --- /dev/null +++ b/vendor/libunwind/include/libunwind-aarch64.h @@ -0,0 +1,284 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2001-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + Copyright (C) 2013 Linaro Limited + Copyright 2022 Blackberry Limited + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef LIBUNWIND_H +#define LIBUNWIND_H + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +#include +#include +#include +#include +#include + +#ifndef UNW_EMPTY_STRUCT +# define UNW_EMPTY_STRUCT uint8_t unused; +#endif + +#define UNW_TARGET aarch64 +#define UNW_TARGET_AARCH64 1 + +#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */ + +/* This needs to be big enough to accommodate "struct cursor", while + leaving some slack for future expansion. Changing this value will + require recompiling all users of this library. Stack allocation is + relatively cheap and unwind-state copying is relatively rare, so we + want to err on making it rather too big than too small. + + Calculation is regs used (64 + 34) * 2 + 40 (bytes of rest of + cursor) + padding +*/ + +#define UNW_TDEP_CURSOR_LEN 250 + +typedef uint64_t unw_word_t; +typedef int64_t unw_sword_t; + +typedef long double unw_tdep_fpreg_t; + +#define UNW_WORD_MAX UINT64_MAX + +typedef struct + { + /* no aarch64-specific auxiliary proc-info */ + UNW_EMPTY_STRUCT + } +unw_tdep_proc_info_t; + +typedef enum + { + /* 64-bit general registers. */ + UNW_AARCH64_X0, + UNW_AARCH64_X1, + UNW_AARCH64_X2, + UNW_AARCH64_X3, + UNW_AARCH64_X4, + UNW_AARCH64_X5, + UNW_AARCH64_X6, + UNW_AARCH64_X7, + UNW_AARCH64_X8, + + /* Temporary registers. */ + UNW_AARCH64_X9, + UNW_AARCH64_X10, + UNW_AARCH64_X11, + UNW_AARCH64_X12, + UNW_AARCH64_X13, + UNW_AARCH64_X14, + UNW_AARCH64_X15, + + /* Intra-procedure-call temporary registers. */ + UNW_AARCH64_X16, + UNW_AARCH64_X17, + + /* Callee-saved registers. */ + UNW_AARCH64_X18, + UNW_AARCH64_X19, + UNW_AARCH64_X20, + UNW_AARCH64_X21, + UNW_AARCH64_X22, + UNW_AARCH64_X23, + UNW_AARCH64_X24, + UNW_AARCH64_X25, + UNW_AARCH64_X26, + UNW_AARCH64_X27, + UNW_AARCH64_X28, + + /* 64-bit frame pointer. */ + UNW_AARCH64_X29, + + /* 64-bit link register. */ + UNW_AARCH64_X30, + + /* 64-bit stack pointer. */ + UNW_AARCH64_SP = 31, + UNW_AARCH64_PC, + UNW_AARCH64_PSTATE, + + /* Pseudo-register */ + UNW_AARCH64_RA_SIGN_STATE = 34, + + /* SVE Vector Granule pseudo register */ + UNW_AARCH64_VG = 46, + + /* 128-bit FP/Advanced SIMD registers. */ + UNW_AARCH64_V0 = 64, + UNW_AARCH64_V1, + UNW_AARCH64_V2, + UNW_AARCH64_V3, + UNW_AARCH64_V4, + UNW_AARCH64_V5, + UNW_AARCH64_V6, + UNW_AARCH64_V7, + UNW_AARCH64_V8, + UNW_AARCH64_V9, + UNW_AARCH64_V10, + UNW_AARCH64_V11, + UNW_AARCH64_V12, + UNW_AARCH64_V13, + UNW_AARCH64_V14, + UNW_AARCH64_V15, + UNW_AARCH64_V16, + UNW_AARCH64_V17, + UNW_AARCH64_V18, + UNW_AARCH64_V19, + UNW_AARCH64_V20, + UNW_AARCH64_V21, + UNW_AARCH64_V22, + UNW_AARCH64_V23, + UNW_AARCH64_V24, + UNW_AARCH64_V25, + UNW_AARCH64_V26, + UNW_AARCH64_V27, + UNW_AARCH64_V28, + UNW_AARCH64_V29, + UNW_AARCH64_V30, + UNW_AARCH64_V31, + + UNW_AARCH64_FPSR, + UNW_AARCH64_FPCR, + + /* For AArch64, the CFA is the value of SP (x31) at the call site of the + previous frame. */ + UNW_AARCH64_CFA = UNW_AARCH64_SP, + + UNW_TDEP_LAST_REG = UNW_AARCH64_FPCR, + + UNW_TDEP_IP = UNW_AARCH64_X30, + UNW_TDEP_SP = UNW_AARCH64_SP, + UNW_TDEP_EH = UNW_AARCH64_X0 + + } +aarch64_regnum_t; + +/* Use R0 through R3 to pass exception handling information. */ +#define UNW_TDEP_NUM_EH_REGS 4 + +typedef struct unw_tdep_save_loc + { + /* Additional target-dependent info on a save location. */ + UNW_EMPTY_STRUCT + } +unw_tdep_save_loc_t; + +#ifdef __linux__ +/* On AArch64, we can directly use ucontext_t as the unwind context, + * however, the __reserved struct is quite large: tune it down to only + * the necessary used fields. */ + +struct unw_sigcontext + { + uint64_t fault_address; + uint64_t regs[31]; + uint64_t sp; + uint64_t pc; + uint64_t pstate; + uint8_t __reserved[(66 * 8)] __attribute__((aligned(16))); +}; + +typedef struct + { + unsigned long uc_flags; + struct ucontext *uc_link; + stack_t uc_stack; +#ifndef __ANDROID__ + sigset_t uc_sigmask; +#else + union { + sigset_t uc_sigmask; + sigset64_t uc_sigmask64; + }; + char __padding[128 - sizeof(sigset_t)]; +#endif + struct unw_sigcontext uc_mcontext; + } unw_tdep_context_t; + +typedef struct + { + uint32_t _ctx_magic; + uint32_t _ctx_size; + uint32_t fpsr; + uint32_t fpcr; + uint64_t vregs[64]; + } unw_fpsimd_context_t; +#else +/* On AArch64, we can directly use ucontext_t as the unwind context. */ +typedef ucontext_t unw_tdep_context_t; +#endif + + +#include "libunwind-common.h" +#include "libunwind-dynamic.h" + +#if defined(__FreeBSD__) +# define UNW_BASE register uint64_t unw_base __asm__ ("x0") = (uint64_t) unw_ctx->uc_mcontext.mc_gpregs.gp_x; +#elif defined(__QNX__) +# define UNW_BASE register uint64_t unw_base __asm__ ("x0") = (uint64_t) unw_ctx->uc_mcontext.cpu.gpr; +#else +# define UNW_BASE register uint64_t unw_base __asm__ ("x0") = (uint64_t) unw_ctx->uc_mcontext.regs; +#endif + +#define unw_tdep_getcontext(uc) ({ \ + unw_tdep_context_t *unw_ctx = (uc); \ + UNW_BASE \ + __asm__ __volatile__ ( \ + "stp x0, x1, [%[base], #0]\n" \ + "stp x2, x3, [%[base], #16]\n" \ + "stp x4, x5, [%[base], #32]\n" \ + "stp x6, x7, [%[base], #48]\n" \ + "stp x8, x9, [%[base], #64]\n" \ + "stp x10, x11, [%[base], #80]\n" \ + "stp x12, x13, [%[base], #96]\n" \ + "stp x14, x15, [%[base], #112]\n" \ + "stp x16, x17, [%[base], #128]\n" \ + "stp x18, x19, [%[base], #144]\n" \ + "stp x20, x21, [%[base], #160]\n" \ + "stp x22, x23, [%[base], #176]\n" \ + "stp x24, x25, [%[base], #192]\n" \ + "stp x26, x27, [%[base], #208]\n" \ + "stp x28, x29, [%[base], #224]\n" \ + "mov x1, sp\n" \ + "stp x30, x1, [%[base], #240]\n" \ + "adr x1, ret%=\n" \ + "str x1, [%[base], #256]\n" \ + "mov %[base], #0\n" \ + "ret%=:\n" \ + : [base] "+r" (unw_base) : : "x1", "memory"); \ + (int)unw_base; }) +#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg) + +extern int unw_tdep_is_fpreg (int); + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif /* LIBUNWIND_H */ diff --git a/vendor/libunwind/include/libunwind-arm.h b/vendor/libunwind/include/libunwind-arm.h new file mode 100644 index 0000000000..6643a185f0 --- /dev/null +++ b/vendor/libunwind/include/libunwind-arm.h @@ -0,0 +1,335 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef LIBUNWIND_H +#define LIBUNWIND_H + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +#include +#include +#include + +#ifndef UNW_EMPTY_STRUCT +# define UNW_EMPTY_STRUCT uint8_t unused; +#endif + +#define UNW_TARGET arm +#define UNW_TARGET_ARM 1 + +#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */ + +/* This needs to be big enough to accommodate "struct cursor", while + leaving some slack for future expansion. Changing this value will + require recompiling all users of this library. Stack allocation is + relatively cheap and unwind-state copying is relatively rare, so we + want to err on making it rather too big than too small. */ + +/* FIXME for ARM. Too big? What do other things use for similar tasks? */ +#define UNW_TDEP_CURSOR_LEN 4096 + +typedef uint32_t unw_word_t; +typedef int32_t unw_sword_t; + +typedef long double unw_tdep_fpreg_t; + +#define UNW_WORD_MAX UINT32_MAX + +typedef enum + { + UNW_ARM_R0, + UNW_ARM_R1, + UNW_ARM_R2, + UNW_ARM_R3, + UNW_ARM_R4, + UNW_ARM_R5, + UNW_ARM_R6, + UNW_ARM_R7, + UNW_ARM_R8, + UNW_ARM_R9, + UNW_ARM_R10, + UNW_ARM_R11, + UNW_ARM_R12, + UNW_ARM_R13, + UNW_ARM_R14, + UNW_ARM_R15, + + /* VFPv2 s0-s31 (obsolescent numberings). */ + UNW_ARM_S0 = 64, + UNW_ARM_S1, + UNW_ARM_S2, + UNW_ARM_S3, + UNW_ARM_S4, + UNW_ARM_S5, + UNW_ARM_S6, + UNW_ARM_S7, + UNW_ARM_S8, + UNW_ARM_S9, + UNW_ARM_S10, + UNW_ARM_S11, + UNW_ARM_S12, + UNW_ARM_S13, + UNW_ARM_S14, + UNW_ARM_S15, + UNW_ARM_S16, + UNW_ARM_S17, + UNW_ARM_S18, + UNW_ARM_S19, + UNW_ARM_S20, + UNW_ARM_S21, + UNW_ARM_S22, + UNW_ARM_S23, + UNW_ARM_S24, + UNW_ARM_S25, + UNW_ARM_S26, + UNW_ARM_S27, + UNW_ARM_S28, + UNW_ARM_S29, + UNW_ARM_S30, + UNW_ARM_S31, + + /* FPA register numberings. */ + UNW_ARM_F0 = 96, + UNW_ARM_F1, + UNW_ARM_F2, + UNW_ARM_F3, + UNW_ARM_F4, + UNW_ARM_F5, + UNW_ARM_F6, + UNW_ARM_F7, + + /* iWMMXt GR register numberings. */ + UNW_ARM_wCGR0 = 104, + UNW_ARM_wCGR1, + UNW_ARM_wCGR2, + UNW_ARM_wCGR3, + UNW_ARM_wCGR4, + UNW_ARM_wCGR5, + UNW_ARM_wCGR6, + UNW_ARM_wCGR7, + + /* iWMMXt register numberings. */ + UNW_ARM_wR0 = 112, + UNW_ARM_wR1, + UNW_ARM_wR2, + UNW_ARM_wR3, + UNW_ARM_wR4, + UNW_ARM_wR5, + UNW_ARM_wR6, + UNW_ARM_wR7, + UNW_ARM_wR8, + UNW_ARM_wR9, + UNW_ARM_wR10, + UNW_ARM_wR11, + UNW_ARM_wR12, + UNW_ARM_wR13, + UNW_ARM_wR14, + UNW_ARM_wR15, + + /* Two-byte encodings from here on. */ + + /* SPSR. */ + UNW_ARM_SPSR = 128, + UNW_ARM_SPSR_FIQ, + UNW_ARM_SPSR_IRQ, + UNW_ARM_SPSR_ABT, + UNW_ARM_SPSR_UND, + UNW_ARM_SPSR_SVC, + + /* User mode registers. */ + UNW_ARM_R8_USR = 144, + UNW_ARM_R9_USR, + UNW_ARM_R10_USR, + UNW_ARM_R11_USR, + UNW_ARM_R12_USR, + UNW_ARM_R13_USR, + UNW_ARM_R14_USR, + + /* FIQ registers. */ + UNW_ARM_R8_FIQ = 151, + UNW_ARM_R9_FIQ, + UNW_ARM_R10_FIQ, + UNW_ARM_R11_FIQ, + UNW_ARM_R12_FIQ, + UNW_ARM_R13_FIQ, + UNW_ARM_R14_FIQ, + + /* IRQ registers. */ + UNW_ARM_R13_IRQ = 158, + UNW_ARM_R14_IRQ, + + /* ABT registers. */ + UNW_ARM_R13_ABT = 160, + UNW_ARM_R14_ABT, + + /* UND registers. */ + UNW_ARM_R13_UND = 162, + UNW_ARM_R14_UND, + + /* SVC registers. */ + UNW_ARM_R13_SVC = 164, + UNW_ARM_R14_SVC, + + /* iWMMXt control registers. */ + UNW_ARM_wC0 = 192, + UNW_ARM_wC1, + UNW_ARM_wC2, + UNW_ARM_wC3, + UNW_ARM_wC4, + UNW_ARM_wC5, + UNW_ARM_wC6, + UNW_ARM_wC7, + + /* VFPv3/Neon 64-bit registers. */ + UNW_ARM_D0 = 256, + UNW_ARM_D1, + UNW_ARM_D2, + UNW_ARM_D3, + UNW_ARM_D4, + UNW_ARM_D5, + UNW_ARM_D6, + UNW_ARM_D7, + UNW_ARM_D8, + UNW_ARM_D9, + UNW_ARM_D10, + UNW_ARM_D11, + UNW_ARM_D12, + UNW_ARM_D13, + UNW_ARM_D14, + UNW_ARM_D15, + UNW_ARM_D16, + UNW_ARM_D17, + UNW_ARM_D18, + UNW_ARM_D19, + UNW_ARM_D20, + UNW_ARM_D21, + UNW_ARM_D22, + UNW_ARM_D23, + UNW_ARM_D24, + UNW_ARM_D25, + UNW_ARM_D26, + UNW_ARM_D27, + UNW_ARM_D28, + UNW_ARM_D29, + UNW_ARM_D30, + UNW_ARM_D31, + + /* For ARM, the CFA is the value of SP (r13) at the call site in the + previous frame. */ + UNW_ARM_CFA, + + UNW_TDEP_LAST_REG = UNW_ARM_D31, + + UNW_TDEP_IP = UNW_ARM_R15, + UNW_TDEP_SP = UNW_ARM_R13, + UNW_TDEP_EH = UNW_ARM_R0 /* FIXME. */ + } +arm_regnum_t; + +#define UNW_TDEP_NUM_EH_REGS 2 /* FIXME for ARM. */ + +typedef struct unw_tdep_save_loc + { + /* Additional target-dependent info on a save location. */ + UNW_EMPTY_STRUCT + } +unw_tdep_save_loc_t; + +/* On ARM, we define our own unw_tdep_context instead of using ucontext_t. + This allows us to support systems that don't support getcontext and + therefore do not define ucontext_t. */ +typedef struct unw_tdep_context + { + unsigned long regs[16]; + unsigned long long fpregs[16]; + } +unw_tdep_context_t; + +/* FIXME: this is a stub version which only saves GP registers. Not ideal, but + may be sufficient for all libunwind use cases. + In thumb mode, we return directly back to thumb mode on return (with bx), to + avoid altering any registers after unw_resume. */ + +#ifdef __SOFTFP__ +#define VSTMIA "nop\n\t" /* align return address to value stored by stmia */ +#else +#define VSTMIA "vstmia %[base], {d0-d15}\n\t" /* this also aligns return address to value stored by stmia */ +#endif + +#ifndef __thumb__ +#define unw_tdep_getcontext(uc) ({ \ + unw_tdep_context_t *unw_ctx = (uc); \ + register unsigned long *r0 __asm__ ("r0"); \ + register unsigned long *unw_base __asm__ ("r1") = unw_ctx->regs; \ + __asm__ __volatile__ ( \ + "mov r0, #0\n\t" \ + "stmia %[base]!, {r0-r15}\n\t" \ + VSTMIA \ + : [r0] "=r" (r0), [base] "+r" (unw_base) : : "memory"); \ + (int)r0; }) +#else /* __thumb__ */ +#define unw_tdep_getcontext(uc) ({ \ + unw_tdep_context_t *unw_ctx = (uc); \ + register unsigned long *r0 __asm__ ("r0"); \ + register unsigned long *unw_base __asm__ ("r1") = unw_ctx->regs; \ + __asm__ __volatile__ ( \ + ".align 2\n\t" \ + "bx pc\n\t" \ + "nop\n\t" \ + ".code 32\n\t" \ + "mov r0, #0\n\t" \ + "stmia %[base]!, {r0-r14}\n\t" \ + "adr r0, ret%=+1\n\t" \ + "stmia %[base]!, {r0}\n\t" \ + VSTMIA \ + "orr r0, pc, #1\n\t" \ + "bx r0\n\t" \ + ".code 16\n\t" \ + "mov r0, #0\n\t" \ + "ret%=:\n" \ + : [r0] "=r" (r0), [base] "+r" (unw_base) : : "memory", "cc"); \ + (int)r0; }) +#endif + +#include "libunwind-dynamic.h" + +typedef struct + { + /* no arm-specific auxiliary proc-info */ + UNW_EMPTY_STRUCT + } +unw_tdep_proc_info_t; + +#include "libunwind-common.h" + +#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg) +extern int unw_tdep_is_fpreg (int); + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif /* LIBUNWIND_H */ diff --git a/vendor/libunwind/include/libunwind-common.h.in b/vendor/libunwind/include/libunwind-common.h.in new file mode 100644 index 0000000000..6304e98d36 --- /dev/null +++ b/vendor/libunwind/include/libunwind-common.h.in @@ -0,0 +1,346 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2001-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#define UNW_VERSION_MAJOR @PKG_MAJOR@ +#define UNW_VERSION_MINOR @PKG_MINOR@ +#define UNW_VERSION_EXTRA @PKG_EXTRA@ + +#define UNW_VERSION_CODE(maj,min) (((maj) << 16) | (min)) +#define UNW_VERSION UNW_VERSION_CODE(UNW_VERSION_MAJOR, UNW_VERSION_MINOR) + +#ifdef __sun +// On SmartOS, gcc fails with the following error: +// +// ../include/libunwind-common.h:43:41: error: expected identifier or '(' before numeric constant +// # define UNW_PREFIX UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_) +// ^ +// +// workaround is to undefine _U explicitly. +// see https://github.com/libunwind/libunwind/issues/118 for more details. +// +#undef _U +#endif + +#define UNW_PASTE2(x,y) x##y +#define UNW_PASTE(x,y) UNW_PASTE2(x,y) +#define UNW_OBJ(fn) UNW_PASTE(UNW_PREFIX, fn) +#define UNW_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_), fn) + +#ifdef UNW_LOCAL_ONLY +# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_UL,UNW_TARGET),_) +#else /* !UNW_LOCAL_ONLY */ +# define UNW_PREFIX UNW_PASTE(UNW_PASTE(_U,UNW_TARGET),_) +#endif /* !UNW_LOCAL_ONLY */ + +/* Error codes. The unwind routines return the *negated* values of + these error codes on error and a non-negative value on success. */ +typedef enum + { + UNW_ESUCCESS = 0, /* no error */ + UNW_EUNSPEC, /* unspecified (general) error */ + UNW_ENOMEM, /* out of memory */ + UNW_EBADREG, /* bad register number */ + UNW_EREADONLYREG, /* attempt to write read-only register */ + UNW_ESTOPUNWIND, /* stop unwinding */ + UNW_EINVALIDIP, /* invalid IP */ + UNW_EBADFRAME, /* bad frame */ + UNW_EINVAL, /* unsupported operation or bad value */ + UNW_EBADVERSION, /* unwind info has unsupported version */ + UNW_ENOINFO /* no unwind info found */ + } +unw_error_t; + +/* The following enum defines the indices for a couple of + (pseudo-)registers which have the same meaning across all + platforms. (RO) means read-only. (RW) means read-write. General + registers (aka "integer registers") are expected to start with + index 0. The number of such registers is architecture-dependent. + The remaining indices can be used as an architecture sees fit. The + last valid register index is given by UNW_REG_LAST. */ +typedef enum + { + UNW_REG_IP = UNW_TDEP_IP, /* (rw) instruction pointer (pc) */ + UNW_REG_SP = UNW_TDEP_SP, /* (ro) stack pointer */ + UNW_REG_EH = UNW_TDEP_EH, /* (rw) exception-handling reg base */ + UNW_REG_LAST = UNW_TDEP_LAST_REG + } +unw_frame_regnum_t; + +/* Number of exception-handler argument registers: */ +#define UNW_NUM_EH_REGS UNW_TDEP_NUM_EH_REGS + +typedef enum + { + UNW_CACHE_NONE, /* no caching */ + UNW_CACHE_GLOBAL, /* shared global cache */ + UNW_CACHE_PER_THREAD /* per-thread caching */ + } +unw_caching_policy_t; + +typedef enum + { + UNW_INIT_SIGNAL_FRAME = 1 /* We know this is a signal frame */ + } +unw_init_local2_flags_t; + +typedef int unw_regnum_t; + +/* The unwind cursor starts at the youngest (most deeply nested) frame + and is used to track the frame state as the unwinder steps from + frame to frame. It is safe to make (shallow) copies of variables + of this type. */ +typedef struct unw_cursor + { + unw_word_t opaque[UNW_TDEP_CURSOR_LEN]; + } +unw_cursor_t; + +/* This type encapsulates the entire (preserved) machine-state. */ +typedef unw_tdep_context_t unw_context_t; + +/* unw_getcontext() fills the unw_context_t pointed to by UC with the + machine state as it exists at the call-site. For implementation + reasons, this needs to be a target-dependent macro. It's easiest + to think of unw_getcontext() as being identical to getcontext(). */ +#define unw_getcontext(uc) unw_tdep_getcontext(uc) + +/* Return 1 if register number R is a floating-point register, zero + otherwise. + This routine is signal-safe. */ +#define unw_is_fpreg(r) unw_tdep_is_fpreg(r) + +typedef unw_tdep_fpreg_t unw_fpreg_t; + +typedef struct unw_addr_space *unw_addr_space_t; + +/* Each target may define it's own set of flags, but bits 0-15 are + reserved for general libunwind-use. */ +#define UNW_PI_FLAG_FIRST_TDEP_BIT 16 +/* The information comes from a .debug_frame section. */ +#define UNW_PI_FLAG_DEBUG_FRAME 32 + +typedef struct unw_proc_info + { + unw_word_t start_ip; /* first IP covered by this procedure */ + unw_word_t end_ip; /* first IP NOT covered by this procedure */ +#if defined(NEED_LAST_IP) + unw_word_t last_ip; /* first IP that could begin another procedure */ +#endif + unw_word_t lsda; /* address of lang.-spec. data area (if any) */ + unw_word_t handler; /* optional personality routine */ + unw_word_t gp; /* global-pointer value for this procedure */ + unw_word_t flags; /* misc. flags */ + + int format; /* unwind-info format (arch-specific) */ + int unwind_info_size; /* size of the information (if applicable) */ + void *unwind_info; /* unwind-info (arch-specific) */ + unw_tdep_proc_info_t extra; /* target-dependent auxiliary proc-info */ + } +unw_proc_info_t; + +typedef int (*unw_reg_states_callback)(void *token, + void *reg_states_data, + size_t reg_states_data_size, + unw_word_t start_ip, unw_word_t end_ip); + +/* These are backend callback routines that provide access to the + state of a "remote" process. This can be used, for example, to + unwind another process through the ptrace() interface. */ +typedef struct unw_accessors + { + /* Look up the unwind info associated with instruction-pointer IP. + On success, the routine fills in the PROC_INFO structure. */ + int (*find_proc_info) (unw_addr_space_t, unw_word_t, unw_proc_info_t *, + int, void *); + + /* Release any resources (e.g., memory) that were allocated for + the unwind info returned in by a previous call to + find_proc_info() with NEED_UNWIND_INFO set to 1. */ + void (*put_unwind_info) (unw_addr_space_t, unw_proc_info_t *, void *); + + /* Return the list-head of the dynamically registered unwind + info. */ + int (*get_dyn_info_list_addr) (unw_addr_space_t, unw_word_t *, void *); + + /* Access aligned word at address ADDR. The value is returned + according to the endianness of the host (e.g., if the host is + little-endian and the target is big-endian, access_mem() needs + to byte-swap the value before returning it). */ + int (*access_mem) (unw_addr_space_t, unw_word_t, unw_word_t *, int, + void *); + + /* Access register number REG at address ADDR. */ + int (*access_reg) (unw_addr_space_t, unw_regnum_t, unw_word_t *, int, + void *); + + /* Access register number REG at address ADDR. */ + int (*access_fpreg) (unw_addr_space_t, unw_regnum_t, + unw_fpreg_t *, int, void *); + + int (*resume) (unw_addr_space_t, unw_cursor_t *, void *); + + /* Optional call back to obtain the name of a (static) procedure. + Dynamically generated procedures are handled automatically by + libunwind. This callback is optional and may be set to + NULL. */ + int (*get_proc_name) (unw_addr_space_t, unw_word_t, char *, size_t, + unw_word_t *, void *); + + /* Optional call back to obtain the name of a elf file where the ip belongs to. + This callback is optional and may be set to NULL. */ + int (*get_elf_filename) (unw_addr_space_t, unw_word_t, char *, size_t, + unw_word_t *, void *); + + /* Optional call back to obtain the start and end ip of a procedure. + * procedure ip range is [start, end), the range is without end. + * This callback is optional and may be set to NULL. + */ + int (*get_proc_ip_range) (unw_addr_space_t, unw_word_t, unw_word_t *, + unw_word_t *, void *); + + /* Optional call back to return a mask to be used with pointer + * authentication on arm64. + * + * The on bits in the returned mask indicate which bits in a return address + * are part of a pointer authentication code. These are the bits in the + * return address to turn off so that the calling frame can be found + * for the unwinding to continue. + * + * The return value must be host-endian. e.g. if the target is big-endian + * and the host is little endian, the implementation of this function + * must byte swap. + * + * This callback is optional and may be set to NULL. In this case all + * the bits in the return address are used, as if no masking were done. + */ + unw_word_t (*ptrauth_insn_mask) (unw_addr_space_t, void *); + + } +unw_accessors_t; + +typedef enum unw_save_loc_type + { + UNW_SLT_NONE, /* register is not saved ("not an l-value") */ + UNW_SLT_MEMORY, /* register has been saved in memory */ + UNW_SLT_REG /* register has been saved in (another) register */ + } +unw_save_loc_type_t; + +typedef struct unw_save_loc + { + unw_save_loc_type_t type; + union + { + unw_word_t addr; /* valid if type==UNW_SLT_MEMORY */ + unw_regnum_t regnum; /* valid if type==UNW_SLT_REG */ + } + u; + unw_tdep_save_loc_t extra; /* target-dependent additional information */ + } +unw_save_loc_t; + +struct dl_phdr_info; +typedef int (*unw_iterate_phdr_callback_t) (struct dl_phdr_info *, size_t, void *); +typedef int (*unw_iterate_phdr_func_t) (unw_iterate_phdr_callback_t, void *); + +/* These routines work both for local and remote unwinding. */ + +#define unw_local_addr_space UNW_OBJ(local_addr_space) +#define unw_create_addr_space UNW_OBJ(create_addr_space) +#define unw_destroy_addr_space UNW_OBJ(destroy_addr_space) +#define unw_get_accessors UNW_ARCH_OBJ(get_accessors) +#define unw_get_accessors_int UNW_ARCH_OBJ(get_accessors_int) +#define unw_init_local UNW_OBJ(init_local) +#define unw_init_local2 UNW_OBJ(init_local2) +#define unw_init_remote UNW_OBJ(init_remote) +#define unw_step UNW_OBJ(step) +#define unw_resume UNW_OBJ(resume) +#define unw_get_proc_info UNW_OBJ(get_proc_info) +#define unw_get_proc_info_by_ip UNW_OBJ(get_proc_info_by_ip) +#define unw_get_proc_info_in_range UNW_OBJ(get_proc_info_in_range) +#define unw_reg_states_iterate UNW_OBJ(reg_states_iterate) +#define unw_apply_reg_state UNW_OBJ(apply_reg_state) +#define unw_get_reg UNW_OBJ(get_reg) +#define unw_set_reg UNW_OBJ(set_reg) +#define unw_get_fpreg UNW_OBJ(get_fpreg) +#define unw_set_fpreg UNW_OBJ(set_fpreg) +#define unw_get_save_loc UNW_OBJ(get_save_loc) +#define unw_is_signal_frame UNW_OBJ(is_signal_frame) +#define unw_is_plt_entry UNW_OBJ(is_plt_entry) +#define unw_get_proc_name UNW_OBJ(get_proc_name) +#define unw_get_proc_name_by_ip UNW_OBJ(get_proc_name_by_ip) +#define unw_get_elf_filename UNW_OBJ(get_elf_filename) +#define unw_get_elf_filename_by_ip UNW_OBJ(get_elf_filename_by_ip) +#define unw_set_caching_policy UNW_OBJ(set_caching_policy) +#define unw_set_cache_size UNW_OBJ(set_cache_size) +#define unw_set_iterate_phdr_function UNW_OBJ(set_iterate_phdr_function) +#define unw_regname UNW_ARCH_OBJ(regname) +#define unw_flush_cache UNW_ARCH_OBJ(flush_cache) +#define unw_strerror UNW_ARCH_OBJ(strerror) + +extern unw_addr_space_t unw_create_addr_space (unw_accessors_t *, int); +extern void unw_destroy_addr_space (unw_addr_space_t); +extern unw_accessors_t *unw_get_accessors (unw_addr_space_t); +extern unw_accessors_t *unw_get_accessors_int (unw_addr_space_t); +extern void unw_flush_cache (unw_addr_space_t, unw_word_t, unw_word_t); +extern int unw_set_caching_policy (unw_addr_space_t, unw_caching_policy_t); +extern int unw_set_cache_size (unw_addr_space_t, size_t, int); +extern void unw_set_iterate_phdr_function (unw_addr_space_t, unw_iterate_phdr_func_t); +extern const char *unw_regname (unw_regnum_t); + +extern int unw_init_local (unw_cursor_t *, unw_context_t *); +extern int unw_init_local2 (unw_cursor_t *, unw_context_t *, int); +extern int unw_init_remote (unw_cursor_t *, unw_addr_space_t, void *); +extern int unw_step (unw_cursor_t *); +extern int unw_resume (unw_cursor_t *); +extern int unw_get_proc_info (unw_cursor_t *, unw_proc_info_t *); +extern int unw_get_proc_info_by_ip (unw_addr_space_t, unw_word_t, + unw_proc_info_t *, void *); +extern int unw_get_proc_info_in_range (unw_word_t, unw_word_t, + unw_word_t, unw_word_t, + unw_word_t, unw_word_t, + unw_addr_space_t, unw_word_t, + unw_proc_info_t *, int, + void *); +extern int unw_reg_states_iterate (unw_cursor_t *, unw_reg_states_callback, void *); +extern int unw_apply_reg_state (unw_cursor_t *, void *); +extern int unw_get_reg (unw_cursor_t *, int, unw_word_t *); +extern int unw_set_reg (unw_cursor_t *, int, unw_word_t); +extern int unw_get_fpreg (unw_cursor_t *, int, unw_fpreg_t *); +extern int unw_set_fpreg (unw_cursor_t *, int, unw_fpreg_t); +extern int unw_get_save_loc (unw_cursor_t *, int, unw_save_loc_t *); +extern int unw_is_signal_frame (unw_cursor_t *); +extern int unw_is_plt_entry (unw_cursor_t *); +extern int unw_get_proc_name (unw_cursor_t *, char *, size_t, unw_word_t *); +extern int unw_get_proc_name_by_ip (unw_addr_space_t, unw_word_t, char *, + size_t, unw_word_t *, void *); +extern int unw_get_elf_filename (unw_cursor_t *, char *, size_t, unw_word_t *); +extern int unw_get_elf_filename_by_ip (unw_addr_space_t, unw_word_t, char *, + size_t, unw_word_t *, void *); +extern const char *unw_strerror (int); +extern int unw_backtrace (void **, int); +extern int unw_backtrace2 (void **, int, unw_context_t*, int); + +extern unw_addr_space_t unw_local_addr_space; diff --git a/vendor/libunwind/include/libunwind-coredump.h b/vendor/libunwind/include/libunwind-coredump.h new file mode 100644 index 0000000000..83a974af48 --- /dev/null +++ b/vendor/libunwind/include/libunwind-coredump.h @@ -0,0 +1,75 @@ +/* libunwind - a platform-independent unwind library + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef libunwind_coredump_h +#define libunwind_coredump_h + +#include + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +/* Helper routines which make it easy to use libunwind on a coredump. + They're available only if UNW_REMOTE_ONLY is _not_ defined and they + aren't really part of the libunwind API. They are implemented in a + archive library called libunwind-coredump.a. */ + +struct UCD_info; + +extern struct UCD_info *_UCD_create(const char *filename); +extern void _UCD_destroy(struct UCD_info *); + +extern int _UCD_get_num_threads(struct UCD_info *); +extern void _UCD_select_thread(struct UCD_info *, int); +extern pid_t _UCD_get_pid(struct UCD_info *); +extern int _UCD_get_cursig(struct UCD_info *); +extern int _UCD_add_backing_file_at_segment(struct UCD_info *, int phdr_no, const char *filename); +extern int _UCD_add_backing_file_at_vaddr(struct UCD_info *, + unsigned long vaddr, + const char *filename); + +extern int _UCD_find_proc_info (unw_addr_space_t, unw_word_t, + unw_proc_info_t *, int, void *); +extern void _UCD_put_unwind_info (unw_addr_space_t, unw_proc_info_t *, void *); +extern int _UCD_get_dyn_info_list_addr (unw_addr_space_t, unw_word_t *, + void *); +extern int _UCD_access_mem (unw_addr_space_t, unw_word_t, unw_word_t *, int, + void *); +extern int _UCD_access_reg (unw_addr_space_t, unw_regnum_t, unw_word_t *, + int, void *); +extern int _UCD_access_fpreg (unw_addr_space_t, unw_regnum_t, unw_fpreg_t *, + int, void *); +extern int _UCD_get_proc_name (unw_addr_space_t, unw_word_t, char *, size_t, + unw_word_t *, void *); +extern int _UCD_get_elf_filename (unw_addr_space_t, unw_word_t, char *, size_t, + unw_word_t *, void *); +extern int _UCD_resume (unw_addr_space_t, unw_cursor_t *, void *); +extern unw_accessors_t _UCD_accessors; + + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif /* libunwind_coredump_h */ diff --git a/vendor/libunwind/include/libunwind-dynamic.h b/vendor/libunwind/include/libunwind-dynamic.h new file mode 100644 index 0000000000..a26f2c9962 --- /dev/null +++ b/vendor/libunwind/include/libunwind-dynamic.h @@ -0,0 +1,215 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +/* This file defines the runtime-support routines for dynamically +generated code. Even though it is implemented as part of libunwind, +it is logically separate from the interface to perform the actual +unwinding. In particular, this interface is always used in the +context of the unwind target, whereas the rest of the unwind API is +used in context of the process that is doing the unwind (which may be +a debugger running on another machine, for example). + +Note that the data-structures declared here server a dual purpose: +when a program registers a dynamically generated procedure, it uses +these structures directly. On the other hand, with remote-unwinding, +the data-structures are read from the remote process's memory and +translated into internalized versions. To facilitate remote-access, +the following rules should be followed in declaring these structures: + + (1) Declare a member as a pointer only if the the information the + member points to needs to be internalized as well (e.g., a + string representing a procedure name should be declared as + "const char *", but the instruction pointer should be declared + as unw_word_t). + + (2) Provide sufficient padding to ensure that no implicit padding + will be needed on any of the supported target architectures. For + the time being, padding data structures with the assumption that + sizeof (unw_word_t) == 8 should be sufficient. (Note: it's not + impossible to internalize structures with internal padding, but + it does make the process a bit harder). + + (3) Don't declare members that contain bitfields or floating-point + values. + + (4) Don't declare members with enumeration types. Declare them as + int32_t instead. */ + +typedef enum + { + UNW_DYN_STOP = 0, /* end-of-unwind-info marker */ + UNW_DYN_SAVE_REG, /* save register to another register */ + UNW_DYN_SPILL_FP_REL, /* frame-pointer-relative register spill */ + UNW_DYN_SPILL_SP_REL, /* stack-pointer-relative register spill */ + UNW_DYN_ADD, /* add constant value to a register */ + UNW_DYN_POP_FRAMES, /* drop one or more stack frames */ + UNW_DYN_LABEL_STATE, /* name the current state */ + UNW_DYN_COPY_STATE, /* set the region's entry-state */ + UNW_DYN_ALIAS /* get unwind info from an alias */ + } +unw_dyn_operation_t; + +typedef enum + { + UNW_INFO_FORMAT_DYNAMIC, /* unw_dyn_proc_info_t */ + UNW_INFO_FORMAT_TABLE, /* unw_dyn_table_t */ + UNW_INFO_FORMAT_REMOTE_TABLE, /* unw_dyn_remote_table_t */ + UNW_INFO_FORMAT_ARM_EXIDX, /* ARM specific unwind info */ + UNW_INFO_FORMAT_IP_OFFSET /* Like UNW_INFO_FORMAT_REMOTE_TABLE, but + table entries are considered + relative to di->start_ip, rather + than di->segbase */ + } +unw_dyn_info_format_t; + +typedef struct unw_dyn_op + { + int8_t tag; /* what operation? */ + int8_t qp; /* qualifying predicate register */ + int16_t reg; /* what register */ + int32_t when; /* when does it take effect? */ + unw_word_t val; /* auxiliary value */ + } +unw_dyn_op_t; + +typedef struct unw_dyn_region_info + { + struct unw_dyn_region_info *next; /* linked list of regions */ + int32_t insn_count; /* region length (# of instructions) */ + uint32_t op_count; /* length of op-array */ + unw_dyn_op_t op[1]; /* variable-length op-array */ + } +unw_dyn_region_info_t; + +typedef struct unw_dyn_proc_info + { + unw_word_t name_ptr; /* address of human-readable procedure name */ + unw_word_t handler; /* address of personality routine */ + uint32_t flags; + int32_t pad0; + unw_dyn_region_info_t *regions; + } +unw_dyn_proc_info_t; + +typedef struct unw_dyn_table_info + { + unw_word_t name_ptr; /* addr. of table name (e.g., library name) */ + unw_word_t segbase; /* segment base */ + unw_word_t table_len; /* must be a multiple of sizeof(unw_word_t)! */ + unw_word_t *table_data; + } +unw_dyn_table_info_t; + +typedef struct unw_dyn_remote_table_info + { + unw_word_t name_ptr; /* addr. of table name (e.g., library name) */ + unw_word_t segbase; /* segment base */ + unw_word_t table_len; /* must be a multiple of sizeof(unw_word_t)! */ + unw_word_t table_data; + } +unw_dyn_remote_table_info_t; + +typedef struct unw_dyn_info + { + /* doubly-linked list of dyn-info structures: */ + struct unw_dyn_info *next; + struct unw_dyn_info *prev; + unw_word_t start_ip; /* first IP covered by this entry */ + unw_word_t end_ip; /* first IP NOT covered by this entry */ + unw_word_t gp; /* global-pointer in effect for this entry */ + int32_t format; /* real type: unw_dyn_info_format_t */ + int32_t pad; + unw_word_t load_offset; /* ELF load offset */ + union + { + unw_dyn_proc_info_t pi; + unw_dyn_table_info_t ti; + unw_dyn_remote_table_info_t rti; + } + u; + } +unw_dyn_info_t; + +typedef struct unw_dyn_info_list + { + uint32_t version; + uint32_t generation; + unw_dyn_info_t *first; + } +unw_dyn_info_list_t; + +/* Return the size (in bytes) of an unw_dyn_region_info_t structure that can + hold OP_COUNT ops. */ +#define _U_dyn_region_info_size(op_count) \ + ((char *) (((unw_dyn_region_info_t *) NULL)->op + (op_count)) \ + - (char *) NULL) + +/* Register the unwind info for a single procedure. + This routine is NOT signal-safe. */ +extern void _U_dyn_register (unw_dyn_info_t *); + +/* Cancel the unwind info for a single procedure. + This routine is NOT signal-safe. */ +extern void _U_dyn_cancel (unw_dyn_info_t *); + + +/* Convenience routines. */ + +#define _U_dyn_op(_tag, _qp, _when, _reg, _val) \ + ((unw_dyn_op_t) { (_tag), (_qp), (_reg), (_when), (_val) }) + +#define _U_dyn_op_save_reg(op, qp, when, reg, dst) \ + (*(op) = _U_dyn_op (UNW_DYN_SAVE_REG, (qp), (when), (reg), (dst))) + +#define _U_dyn_op_spill_fp_rel(op, qp, when, reg, offset) \ + (*(op) = _U_dyn_op (UNW_DYN_SPILL_FP_REL, (qp), (when), (reg), \ + (offset))) + +#define _U_dyn_op_spill_sp_rel(op, qp, when, reg, offset) \ + (*(op) = _U_dyn_op (UNW_DYN_SPILL_SP_REL, (qp), (when), (reg), \ + (offset))) + +#define _U_dyn_op_add(op, qp, when, reg, value) \ + (*(op) = _U_dyn_op (UNW_DYN_ADD, (qp), (when), (reg), (value))) + +#define _U_dyn_op_pop_frames(op, qp, when, num_frames) \ + (*(op) = _U_dyn_op (UNW_DYN_POP_FRAMES, (qp), (when), 0, (num_frames))) + +#define _U_dyn_op_label_state(op, label) \ + (*(op) = _U_dyn_op (UNW_DYN_LABEL_STATE, _U_QP_TRUE, -1, 0, (label))) + +#define _U_dyn_op_copy_state(op, label) \ + (*(op) = _U_dyn_op (UNW_DYN_COPY_STATE, _U_QP_TRUE, -1, 0, (label))) + +#define _U_dyn_op_alias(op, qp, when, addr) \ + (*(op) = _U_dyn_op (UNW_DYN_ALIAS, (qp), (when), 0, (addr))) + +#define _U_dyn_op_stop(op) \ + (*(op) = _U_dyn_op (UNW_DYN_STOP, _U_QP_TRUE, -1, 0, 0)) + +/* The target-dependent qualifying predicate which is always TRUE. On + IA-64, that's p0 (0), on non-predicated architectures, the value is + ignored. */ +#define _U_QP_TRUE _U_TDEP_QP_TRUE diff --git a/vendor/libunwind/include/libunwind-hppa.h b/vendor/libunwind/include/libunwind-hppa.h new file mode 100644 index 0000000000..ad592db85b --- /dev/null +++ b/vendor/libunwind/include/libunwind-hppa.h @@ -0,0 +1,134 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef LIBUNWIND_H +#define LIBUNWIND_H + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +#include +#include +#include + +#ifndef UNW_EMPTY_STRUCT +# define UNW_EMPTY_STRUCT uint8_t unused; +#endif + +#define UNW_TARGET hppa +#define UNW_TARGET_HPPA 1 + +#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */ + +/* This needs to be big enough to accommodate "struct cursor", while + leaving some slack for future expansion. Changing this value will + require recompiling all users of this library. Stack allocation is + relatively cheap and unwind-state copying is relatively rare, so we + want to err on making it rather too big than too small. */ +#define UNW_TDEP_CURSOR_LEN 511 + +typedef uint32_t unw_word_t; +typedef int32_t unw_sword_t; + +#define UNW_WORD_MAX UINT32_MAX + +typedef union + { + struct { unw_word_t bits[2]; } raw; + double val; + } +unw_tdep_fpreg_t; + +typedef enum + { + /* Note: general registers are expected to start with index 0. + This convention facilitates architecture-independent + implementation of the C++ exception handling ABI. See + _Unwind_SetGR() and _Unwind_GetGR() for details. */ + UNW_HPPA_GR = 0, + UNW_HPPA_RP = 2, /* return pointer */ + UNW_HPPA_FP = 3, /* frame pointer */ + UNW_HPPA_SP = UNW_HPPA_GR + 30, + + UNW_HPPA_FR = UNW_HPPA_GR + 32, + + UNW_HPPA_IP = UNW_HPPA_FR + 32, /* instruction pointer */ + + /* other "preserved" registers (fpsr etc.)... */ + + /* PA-RISC has 4 exception-argument registers but they're not + contiguous. To deal with this, we define 4 pseudo + exception-handling registers which we then alias to the actual + physical register. */ + + UNW_HPPA_EH0 = UNW_HPPA_IP + 1, /* alias for UNW_HPPA_GR + 20 */ + UNW_HPPA_EH1 = UNW_HPPA_EH0 + 1, /* alias for UNW_HPPA_GR + 21 */ + UNW_HPPA_EH2 = UNW_HPPA_EH1 + 1, /* alias for UNW_HPPA_GR + 22 */ + UNW_HPPA_EH3 = UNW_HPPA_EH2 + 1, /* alias for UNW_HPPA_GR + 31 */ + + /* frame info (read-only) */ + UNW_HPPA_CFA, + + UNW_TDEP_LAST_REG = UNW_HPPA_IP, + + UNW_TDEP_IP = UNW_HPPA_IP, + UNW_TDEP_SP = UNW_HPPA_SP, + UNW_TDEP_EH = UNW_HPPA_EH0 + } +hppa_regnum_t; + +#define UNW_TDEP_NUM_EH_REGS 4 + +typedef struct unw_tdep_save_loc + { + /* Additional target-dependent info on a save location. */ + UNW_EMPTY_STRUCT + } +unw_tdep_save_loc_t; + +/* On PA-RISC, we can directly use ucontext_t as the unwind context. */ +typedef ucontext_t unw_tdep_context_t; + +#define unw_tdep_is_fpreg(r) ((unsigned) ((r) - UNW_HPPA_FR) < 32) + +#include "libunwind-dynamic.h" + +typedef struct + { + /* no PA-RISC-specific auxiliary proc-info */ + UNW_EMPTY_STRUCT + } +unw_tdep_proc_info_t; + +#include "libunwind-common.h" + +#define unw_tdep_getcontext UNW_ARCH_OBJ (getcontext) +extern int unw_tdep_getcontext (unw_tdep_context_t *); + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif /* LIBUNWIND_H */ diff --git a/vendor/libunwind/include/libunwind-ia64.h b/vendor/libunwind/include/libunwind-ia64.h new file mode 100644 index 0000000000..49741f0e35 --- /dev/null +++ b/vendor/libunwind/include/libunwind-ia64.h @@ -0,0 +1,202 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2001-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef LIBUNWIND_H +#define LIBUNWIND_H + +#include +#include +#include + +#ifndef UNW_EMPTY_STRUCT +# define UNW_EMPTY_STRUCT uint8_t unused; +#endif + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +#ifdef ia64 + /* This works around a bug in Intel's ECC v7.0 which defines "ia64" + as "1". */ +# undef ia64 +#endif + +#ifdef __hpux + /* On HP-UX, there is no hope of supporting UNW_LOCAL_ONLY, because + it's impossible to obtain the address of the members in the + sigcontext structure. */ +# undef UNW_LOCAL_ONLY +# define UNW_GENERIC_ONLY +#endif + +#define UNW_TARGET ia64 +#define UNW_TARGET_IA64 1 + +#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */ + +/* This needs to be big enough to accommodate "struct cursor", while + leaving some slack for future expansion. Changing this value will + require recompiling all users of this library. Stack allocation is + relatively cheap and unwind-state copying is relatively rare, so we + want to err on making it rather too big than too small. */ +#define UNW_TDEP_CURSOR_LEN 511 + +/* If this bit is it indicates that the procedure saved all of ar.bsp, + ar.bspstore, and ar.rnat. If, additionally, ar.bsp != saved ar.bsp, + then this procedure has performed a register-backing-store switch. */ +#define UNW_PI_FLAG_IA64_RBS_SWITCH_BIT (UNW_PI_FLAG_FIRST_TDEP_BIT + 0) + +#define UNW_PI_FLAG_IA64_RBS_SWITCH (1 << UNW_PI_FLAG_IA64_RBS_SWITCH_BIT) + +typedef uint64_t unw_word_t; +typedef int64_t unw_sword_t; + +#define UNW_WORD_MAX UINT64_MAX + +/* On IA-64, we want to access the contents of floating-point + registers as a pair of "words", but to ensure 16-byte alignment, we + make it a union that contains a "long double". This will do the + Right Thing on all known IA-64 platforms, including HP-UX. */ +typedef union + { + struct { unw_word_t bits[2]; } raw; + long double dummy; /* dummy to force 16-byte alignment */ + } +unw_tdep_fpreg_t; + +typedef struct + { + /* no ia64-specific auxiliary proc-info */ + UNW_EMPTY_STRUCT + } +unw_tdep_proc_info_t; + +typedef enum + { + /* Note: general registers are excepted to start with index 0. + This convention facilitates architecture-independent + implementation of the C++ exception handling ABI. See + _Unwind_SetGR() and _Unwind_GetGR() for details. */ + UNW_IA64_GR = 0, /* general registers (r0..r127) */ + UNW_IA64_GP = UNW_IA64_GR + 1, + UNW_IA64_TP = UNW_IA64_GR + 13, + + UNW_IA64_NAT = UNW_IA64_GR + 128, /* NaT registers (nat0..nat127) */ + + UNW_IA64_FR = UNW_IA64_NAT + 128, /* fp registers (f0..f127) */ + + UNW_IA64_AR = UNW_IA64_FR + 128, /* application registers (ar0..r127) */ + UNW_IA64_AR_RSC = UNW_IA64_AR + 16, + UNW_IA64_AR_BSP = UNW_IA64_AR + 17, + UNW_IA64_AR_BSPSTORE = UNW_IA64_AR + 18, + UNW_IA64_AR_RNAT = UNW_IA64_AR + 19, + UNW_IA64_AR_CSD = UNW_IA64_AR + 25, + UNW_IA64_AR_26 = UNW_IA64_AR + 26, + UNW_IA64_AR_SSD = UNW_IA64_AR_26, + UNW_IA64_AR_CCV = UNW_IA64_AR + 32, + UNW_IA64_AR_UNAT = UNW_IA64_AR + 36, + UNW_IA64_AR_FPSR = UNW_IA64_AR + 40, + UNW_IA64_AR_PFS = UNW_IA64_AR + 64, + UNW_IA64_AR_LC = UNW_IA64_AR + 65, + UNW_IA64_AR_EC = UNW_IA64_AR + 66, + + UNW_IA64_BR = UNW_IA64_AR + 128, /* branch registers (b0..p7) */ + UNW_IA64_RP = UNW_IA64_BR + 0, /* return pointer (rp) */ + UNW_IA64_PR = UNW_IA64_BR + 8, /* predicate registers (p0..p63) */ + UNW_IA64_CFM, + + /* frame info: */ + UNW_IA64_BSP, + UNW_IA64_IP, + UNW_IA64_SP, + + UNW_TDEP_LAST_REG = UNW_IA64_SP, + + UNW_TDEP_IP = UNW_IA64_IP, + UNW_TDEP_SP = UNW_IA64_SP, + UNW_TDEP_EH = UNW_IA64_GR + 15 + } +ia64_regnum_t; + +#define UNW_TDEP_NUM_EH_REGS 4 /* r15-r18 are exception args */ + +typedef struct unw_tdep_save_loc + { + /* Additional target-dependent info on a save location. On IA-64, + we use this to provide the bit number in which a NaT bit gets + saved. */ + uint8_t nat_bitnr; + + /* Padding reserved for future use. */ + uint8_t reserved[7]; + } +unw_tdep_save_loc_t; + +/* On IA-64, we can directly use ucontext_t as the unwind context. */ +typedef ucontext_t unw_tdep_context_t; + +#define unw_tdep_is_fpreg(r) ((unsigned) ((r) - UNW_IA64_FR) < 128) + +#include "libunwind-dynamic.h" +#include "libunwind-common.h" + +#ifdef __hpux + /* In theory, we could use _Uia64_getcontext() on HP-UX as well, but + the benefit of doing so would be marginal given that it can't + support UNW_LOCAL_ONLY. */ +# define unw_tdep_getcontext getcontext +#else +# define unw_tdep_getcontext UNW_ARCH_OBJ (getcontext) + extern int unw_tdep_getcontext (unw_tdep_context_t *); +#endif + +/* This is a helper routine to search an ia64 unwind table. If the + address-space argument AS points to something other than the local + address-space, the memory for the unwind-info will be allocated + with malloc(), and should be free()d during the put_unwind_info() + callback. This routine is signal-safe for the local-address-space + case ONLY. */ +#define unw_search_ia64_unwind_table UNW_OBJ(search_unwind_table) +extern int unw_search_ia64_unwind_table (unw_addr_space_t, unw_word_t, + unw_dyn_info_t *, unw_proc_info_t *, + int, void *); + +/* This is a helper routine which the get_dyn_info_list_addr() + callback can use to locate the special dynamic-info list entry in + an IA-64 unwind table. If the entry exists in the table, the + list-address is returned. In all other cases, 0 is returned. */ +extern unw_word_t _Uia64_find_dyn_list (unw_addr_space_t, unw_dyn_info_t *, + void *); + +/* This is a helper routine to obtain the kernel-unwind info. It is + signal-safe. */ +extern int _Uia64_get_kernel_table (unw_dyn_info_t *); + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif /* LIBUNWIND_H */ diff --git a/vendor/libunwind/include/libunwind-loongarch64.h b/vendor/libunwind/include/libunwind-loongarch64.h new file mode 100644 index 0000000000..7f768cd89e --- /dev/null +++ b/vendor/libunwind/include/libunwind-loongarch64.h @@ -0,0 +1,146 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2001-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + Copyright (C) 2021 Loongson Technology Corporation Limited + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef LIBUNWIND_H +#define LIBUNWIND_H + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +#include +#include +#include + +#ifndef UNW_EMPTY_STRUCT +# define UNW_EMPTY_STRUCT uint8_t unused; +#endif + +#define UNW_TARGET loongarch64 +#define UNW_TARGET_LOONGARCH64 1 + +#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */ + +/* This needs to be big enough to accommodate "struct cursor", while + leaving some slack for future expansion. Changing this value will + require recompiling all users of this library. Stack allocation is + relatively cheap and unwind-state copying is relatively rare, so we + want to err on making it rather too big than too small. */ + +/* FIXME for LoongArch64. Too big? What do other things use for similar tasks? */ +#define UNW_TDEP_CURSOR_LEN 4096 + +typedef uint64_t unw_word_t; +typedef int64_t unw_sword_t; + +typedef long double unw_tdep_fpreg_t; + +#define UNW_WORD_MAX UINT64_MAX + +typedef enum + { + UNW_LOONGARCH64_R0, + UNW_LOONGARCH64_R1, + UNW_LOONGARCH64_R2, + UNW_LOONGARCH64_R3, + UNW_LOONGARCH64_R4, + UNW_LOONGARCH64_R5, + UNW_LOONGARCH64_R6, + UNW_LOONGARCH64_R7, + UNW_LOONGARCH64_R8, + UNW_LOONGARCH64_R9, + UNW_LOONGARCH64_R10, + UNW_LOONGARCH64_R11, + UNW_LOONGARCH64_R12, + UNW_LOONGARCH64_R13, + UNW_LOONGARCH64_R14, + UNW_LOONGARCH64_R15, + UNW_LOONGARCH64_R16, + UNW_LOONGARCH64_R17, + UNW_LOONGARCH64_R18, + UNW_LOONGARCH64_R19, + UNW_LOONGARCH64_R20, + UNW_LOONGARCH64_R21, + UNW_LOONGARCH64_R22, + UNW_LOONGARCH64_R23, + UNW_LOONGARCH64_R24, + UNW_LOONGARCH64_R25, + UNW_LOONGARCH64_R26, + UNW_LOONGARCH64_R27, + UNW_LOONGARCH64_R28, + UNW_LOONGARCH64_R29, + UNW_LOONGARCH64_R30, + UNW_LOONGARCH64_R31, + + UNW_LOONGARCH64_PC = 33, + + /* FIXME: Other registers! */ + + /* For LoongArch64, the CFA is the value of SP (r3) at the call site in the + previous frame. */ + UNW_LOONGARCH64_CFA, + + UNW_TDEP_LAST_REG = UNW_LOONGARCH64_PC, + + UNW_TDEP_IP = UNW_LOONGARCH64_R1, + UNW_TDEP_SP = UNW_LOONGARCH64_R3, + UNW_TDEP_EH = UNW_LOONGARCH64_R0 /* FIXME. */ + } +loongarch64_regnum_t; + +#define UNW_TDEP_NUM_EH_REGS 4 + +typedef struct unw_tdep_save_loc + { + /* Additional target-dependent info on a save location. */ + UNW_EMPTY_STRUCT + } +unw_tdep_save_loc_t; + +/* On LoongArch64, we can directly use ucontext_t as the unwind context. */ +typedef ucontext_t unw_tdep_context_t; + +typedef struct + { + /* no loongarch64-specific auxiliary proc-info */ + UNW_EMPTY_STRUCT + } +unw_tdep_proc_info_t; + +#include "libunwind-dynamic.h" +#include "libunwind-common.h" + +#define unw_tdep_getcontext UNW_ARCH_OBJ(getcontext) +extern int unw_tdep_getcontext (ucontext_t *uc); + +#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg) +extern int unw_tdep_is_fpreg (int); + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif /* LIBUNWIND_H */ diff --git a/vendor/libunwind/include/libunwind-mips.h b/vendor/libunwind/include/libunwind-mips.h new file mode 100644 index 0000000000..9cb5051eea --- /dev/null +++ b/vendor/libunwind/include/libunwind-mips.h @@ -0,0 +1,169 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef LIBUNWIND_H +#define LIBUNWIND_H + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +#include +#include +#include + +#ifdef mips +# undef mips +#endif + +#ifndef UNW_EMPTY_STRUCT +# define UNW_EMPTY_STRUCT uint8_t unused; +#endif + +#define UNW_TARGET mips +#define UNW_TARGET_MIPS 1 + +#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */ + +/* This needs to be big enough to accommodate "struct cursor", while + leaving some slack for future expansion. Changing this value will + require recompiling all users of this library. Stack allocation is + relatively cheap and unwind-state copying is relatively rare, so we + want to err on making it rather too big than too small. */ + +/* FIXME for MIPS. Too big? What do other things use for similar tasks? */ +#define UNW_TDEP_CURSOR_LEN 4096 + +/* The size of a "word" varies on MIPS. This type is used for memory + addresses and register values, which are 32-bit wide for O32 and N32 + ABIs, and 64-bit wide for N64 ABI. */ +#if _MIPS_SIM == _ABI64 +typedef uint64_t unw_word_t; +# define UNW_WORD_MAX UINT64_MAX +#else +typedef uint32_t unw_word_t; +# define UNW_WORD_MAX UINT32_MAX +#endif +typedef int32_t unw_sword_t; + +/* FIXME: MIPS ABIs. */ +typedef long double unw_tdep_fpreg_t; + +typedef enum + { + UNW_MIPS_R0, + UNW_MIPS_R1, + UNW_MIPS_R2, + UNW_MIPS_R3, + UNW_MIPS_R4, + UNW_MIPS_R5, + UNW_MIPS_R6, + UNW_MIPS_R7, + UNW_MIPS_R8, + UNW_MIPS_R9, + UNW_MIPS_R10, + UNW_MIPS_R11, + UNW_MIPS_R12, + UNW_MIPS_R13, + UNW_MIPS_R14, + UNW_MIPS_R15, + UNW_MIPS_R16, + UNW_MIPS_R17, + UNW_MIPS_R18, + UNW_MIPS_R19, + UNW_MIPS_R20, + UNW_MIPS_R21, + UNW_MIPS_R22, + UNW_MIPS_R23, + UNW_MIPS_R24, + UNW_MIPS_R25, + UNW_MIPS_R26, + UNW_MIPS_R27, + UNW_MIPS_R28, + UNW_MIPS_R29, + UNW_MIPS_R30, + UNW_MIPS_R31, + + UNW_MIPS_PC = 64, + + /* FIXME: Other registers! */ + + /* For MIPS, the CFA is the value of SP (r29) at the call site in the + previous frame. */ + UNW_MIPS_CFA, + + UNW_TDEP_LAST_REG = UNW_MIPS_PC, + + UNW_TDEP_IP = UNW_MIPS_R31, + UNW_TDEP_SP = UNW_MIPS_R29, + UNW_TDEP_EH = UNW_MIPS_R0 /* FIXME. */ + } +mips_regnum_t; + +typedef enum + { + UNW_MIPS_ABI_O32, + UNW_MIPS_ABI_N32, + UNW_MIPS_ABI_N64 + } +mips_abi_t; + +#define UNW_TDEP_NUM_EH_REGS 2 /* FIXME for MIPS. */ + +typedef struct unw_tdep_save_loc + { + /* Additional target-dependent info on a save location. */ + UNW_EMPTY_STRUCT + } +unw_tdep_save_loc_t; + +/* On x86, we can directly use ucontext_t as the unwind context. FIXME for + MIPS. */ +typedef ucontext_t unw_tdep_context_t; + +#include "libunwind-dynamic.h" + +typedef struct + { + /* no mips-specific auxiliary proc-info */ + UNW_EMPTY_STRUCT + } +unw_tdep_proc_info_t; + +#include "libunwind-common.h" + +/* There is no getcontext() on MIPS. Use a stub version which only saves GP + registers. FIXME: Not ideal, may not be sufficient for all libunwind + use cases. */ +#define unw_tdep_getcontext UNW_ARCH_OBJ(getcontext) +extern int unw_tdep_getcontext (ucontext_t *uc); + +#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg) +extern int unw_tdep_is_fpreg (int); + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif /* LIBUNWIND_H */ diff --git a/vendor/libunwind/include/libunwind-nto.h b/vendor/libunwind/include/libunwind-nto.h new file mode 100644 index 0000000000..50d72c65a2 --- /dev/null +++ b/vendor/libunwind/include/libunwind-nto.h @@ -0,0 +1,69 @@ +/** + * Public interface for the QNX Neutrino remote unwinding library. + * + * This library provides helper routines to make it possible to use libunwind + * via the QNX Neutrino procfs. + */ +/* + * Copyright 2020, 2022 QNX Blackberry Limited. + * + * This file is part of libunwind. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +#ifndef LIBUNWIND_NTO_H +#define LIBUNWIND_NTO_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +static const pthread_t LUT_ALL_THREADS = -1; + +/** + * Helper routines to make it easy to unwind using devctl() on unw_nto. + */ +extern void *unw_nto_create(pid_t, pthread_t); +extern void unw_nto_destroy(void *); + +extern int unw_nto_find_proc_info(unw_addr_space_t, unw_word_t, unw_proc_info_t *, int, void *); +extern void unw_nto_put_unwind_info(unw_addr_space_t, unw_proc_info_t *, void *); +extern int unw_nto_get_dyn_info_list_addr(unw_addr_space_t, unw_word_t *, void *); +extern int unw_nto_access_mem(unw_addr_space_t, unw_word_t, unw_word_t *, int, void *); +extern int unw_nto_access_reg(unw_addr_space_t, unw_regnum_t, unw_word_t *, int, void *); +extern int unw_nto_access_fpreg(unw_addr_space_t, unw_regnum_t, unw_fpreg_t *, int, void *); +extern int unw_nto_get_proc_name(unw_addr_space_t, unw_word_t, char *, size_t, unw_word_t *, void *); +extern int unw_nto_get_proc_ip_range (unw_addr_space_t as, unw_word_t ip, unw_word_t *start, unw_word_t *end, void *); +extern int unw_nto_get_elf_filename(unw_addr_space_t, unw_word_t, char *, size_t, unw_word_t *, void *); +extern int unw_nto_resume(unw_addr_space_t, unw_cursor_t *, void *); + +/** + * A handy pre-defined accessor with all of the above. + */ +extern unw_accessors_t unw_nto_accessors; + +#if defined(__cplusplus) +} /* extern "C" */ +#endif + +#endif /* LIBUNWIND_NTO_H */ diff --git a/vendor/libunwind/include/libunwind-ppc32.h b/vendor/libunwind/include/libunwind-ppc32.h new file mode 100644 index 0000000000..303597c02d --- /dev/null +++ b/vendor/libunwind/include/libunwind-ppc32.h @@ -0,0 +1,216 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2006-2007 IBM + Contributed by + Corey Ashford + Jose Flavio Aguilar Paulino + + Copied from libunwind-x86_64.h, modified slightly for building + frysk successfully on ppc64, by Wu Zhou + Will be replaced when libunwind is ready on ppc64 platform. + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef LIBUNWIND_H +#define LIBUNWIND_H + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +#include +#include +#include + +#ifndef UNW_EMPTY_STRUCT +# define UNW_EMPTY_STRUCT uint8_t unused; +#endif + +#define UNW_TARGET ppc32 +#define UNW_TARGET_PPC32 1 + +#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */ + +/* + * This needs to be big enough to accommodate "struct cursor", while + * leaving some slack for future expansion. Changing this value will + * require recompiling all users of this library. Stack allocation is + * relatively cheap and unwind-state copying is relatively rare, so we want + * to err on making it rather too big than too small. + * + * To simplify this whole process, we are at least initially taking the + * tack that UNW_PPC32_* map straight across to the .eh_frame column register + * numbers. These register numbers come from gcc's source in + * gcc/config/rs6000/rs6000.h + * + * UNW_TDEP_CURSOR_LEN is in terms of unw_word_t size. Since we have 115 + * elements in the loc array, each sized 2 * unw_word_t, plus the rest of + * the cursor struct, this puts us at about 2 * 115 + 40 = 270. Let's + * round that up to 280. + */ + +#define UNW_TDEP_CURSOR_LEN 280 + +#if __WORDSIZE==32 +typedef uint32_t unw_word_t; +typedef int32_t unw_sword_t; +# define UNW_WORD_MAX UINT32_MAX +#else +typedef uint64_t unw_word_t; +typedef int64_t unw_sword_t; +# define UNW_WORD_MAX UINT64_MAX +#endif + +typedef long double unw_tdep_fpreg_t; + +typedef enum + { + UNW_PPC32_R0, + UNW_PPC32_R1, /* called STACK_POINTER in gcc */ + UNW_PPC32_R2, + UNW_PPC32_R3, + UNW_PPC32_R4, + UNW_PPC32_R5, + UNW_PPC32_R6, + UNW_PPC32_R7, + UNW_PPC32_R8, + UNW_PPC32_R9, + UNW_PPC32_R10, + UNW_PPC32_R11, /* called STATIC_CHAIN in gcc */ + UNW_PPC32_R12, + UNW_PPC32_R13, + UNW_PPC32_R14, + UNW_PPC32_R15, + UNW_PPC32_R16, + UNW_PPC32_R17, + UNW_PPC32_R18, + UNW_PPC32_R19, + UNW_PPC32_R20, + UNW_PPC32_R21, + UNW_PPC32_R22, + UNW_PPC32_R23, + UNW_PPC32_R24, + UNW_PPC32_R25, + UNW_PPC32_R26, + UNW_PPC32_R27, + UNW_PPC32_R28, + UNW_PPC32_R29, + UNW_PPC32_R30, + UNW_PPC32_R31, /* called HARD_FRAME_POINTER in gcc */ + + /* Count Register */ + UNW_PPC32_CTR = 32, + /* Fixed-Point Status and Control Register */ + UNW_PPC32_XER = 33, + /* Condition Register */ + UNW_PPC32_CCR = 34, + /* Machine State Register */ + //UNW_PPC32_MSR = 35, + /* MQ or SPR0, not part of generic Power, part of MPC601 */ + //UNW_PPC32_MQ = 36, + /* Link Register */ + UNW_PPC32_LR = 36, + /* Floating Pointer Status and Control Register */ + UNW_PPC32_FPSCR = 37, + + UNW_PPC32_F0 = 48, + UNW_PPC32_F1, + UNW_PPC32_F2, + UNW_PPC32_F3, + UNW_PPC32_F4, + UNW_PPC32_F5, + UNW_PPC32_F6, + UNW_PPC32_F7, + UNW_PPC32_F8, + UNW_PPC32_F9, + UNW_PPC32_F10, + UNW_PPC32_F11, + UNW_PPC32_F12, + UNW_PPC32_F13, + UNW_PPC32_F14, + UNW_PPC32_F15, + UNW_PPC32_F16, + UNW_PPC32_F17, + UNW_PPC32_F18, + UNW_PPC32_F19, + UNW_PPC32_F20, + UNW_PPC32_F21, + UNW_PPC32_F22, + UNW_PPC32_F23, + UNW_PPC32_F24, + UNW_PPC32_F25, + UNW_PPC32_F26, + UNW_PPC32_F27, + UNW_PPC32_F28, + UNW_PPC32_F29, + UNW_PPC32_F30, + UNW_PPC32_F31, + + UNW_TDEP_LAST_REG = UNW_PPC32_F31, + + UNW_TDEP_IP = UNW_PPC32_LR, + UNW_TDEP_SP = UNW_PPC32_R1, + UNW_TDEP_EH = UNW_PPC32_R12 + } +ppc32_regnum_t; + +/* + * According to David Edelsohn, GNU gcc uses R3, R4, R5, and maybe R6 for + * passing parameters to exception handlers. + */ + +#define UNW_TDEP_NUM_EH_REGS 4 + +typedef struct unw_tdep_save_loc + { + /* Additional target-dependent info on a save location. */ + UNW_EMPTY_STRUCT + } +unw_tdep_save_loc_t; + +/* On ppc, we can directly use ucontext_t as the unwind context. */ +typedef ucontext_t unw_tdep_context_t; + +/* XXX this is not ideal: an application should not be prevented from + using the "getcontext" name just because it's using libunwind. We + can't just use __getcontext() either, because that isn't exported + by glibc... */ +#define unw_tdep_getcontext(uc) (getcontext (uc), 0) + +#include "libunwind-dynamic.h" + +typedef struct + { + /* no ppc32-specific auxiliary proc-info */ + UNW_EMPTY_STRUCT + } +unw_tdep_proc_info_t; + +#include "libunwind-common.h" + +#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg) +extern int unw_tdep_is_fpreg (int); + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif /* LIBUNWIND_H */ diff --git a/vendor/libunwind/include/libunwind-ppc64.h b/vendor/libunwind/include/libunwind-ppc64.h new file mode 100644 index 0000000000..1ce48bf7e9 --- /dev/null +++ b/vendor/libunwind/include/libunwind-ppc64.h @@ -0,0 +1,280 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2006-2007 IBM + Contributed by + Corey Ashford + Jose Flavio Aguilar Paulino + + Copied from libunwind-x86_64.h, modified slightly for building + frysk successfully on ppc64, by Wu Zhou + Will be replaced when libunwind is ready on ppc64 platform. + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef LIBUNWIND_H +#define LIBUNWIND_H + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +#include +#include +#include + +#ifndef UNW_EMPTY_STRUCT +# define UNW_EMPTY_STRUCT uint8_t unused; +#endif + +#define UNW_TARGET ppc64 +#define UNW_TARGET_PPC64 1 + +#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */ + +/* + * This needs to be big enough to accommodate "struct cursor", while + * leaving some slack for future expansion. Changing this value will + * require recompiling all users of this library. Stack allocation is + * relatively cheap and unwind-state copying is relatively rare, so we want + * to err on making it rather too big than too small. + * + * To simplify this whole process, we are at least initially taking the + * tack that UNW_PPC64_* map straight across to the .eh_frame column register + * numbers. These register numbers come from gcc's source in + * gcc/config/rs6000/rs6000.h + * + * UNW_TDEP_CURSOR_LEN is in terms of unw_word_t size. Since we have 115 + * elements in the loc array, each sized 2 * unw_word_t, plus the rest of + * the cursor struct, this puts us at about 2 * 115 + 40 = 270. Let's + * round that up to 280. + */ + +#define UNW_TDEP_CURSOR_LEN 280 + +#if __WORDSIZE==32 +typedef uint32_t unw_word_t; +typedef int32_t unw_sword_t; +#define UNW_WORD_MAX UINT32_MAX +#else +typedef uint64_t unw_word_t; +typedef int64_t unw_sword_t; +#define UNW_WORD_MAX UINT64_MAX +#endif + +typedef double unw_tdep_fpreg_t; + +/* + * Vector register (in PowerPC64 used for AltiVec registers) + */ +typedef struct { + uint64_t halves[2]; +} unw_tdep_vreg_t; + +typedef enum + { + UNW_PPC64_R0, + UNW_PPC64_R1, /* called STACK_POINTER in gcc */ + UNW_PPC64_R2, + UNW_PPC64_R3, + UNW_PPC64_R4, + UNW_PPC64_R5, + UNW_PPC64_R6, + UNW_PPC64_R7, + UNW_PPC64_R8, + UNW_PPC64_R9, + UNW_PPC64_R10, + UNW_PPC64_R11, /* called STATIC_CHAIN in gcc */ + UNW_PPC64_R12, + UNW_PPC64_R13, + UNW_PPC64_R14, + UNW_PPC64_R15, + UNW_PPC64_R16, + UNW_PPC64_R17, + UNW_PPC64_R18, + UNW_PPC64_R19, + UNW_PPC64_R20, + UNW_PPC64_R21, + UNW_PPC64_R22, + UNW_PPC64_R23, + UNW_PPC64_R24, + UNW_PPC64_R25, + UNW_PPC64_R26, + UNW_PPC64_R27, + UNW_PPC64_R28, + UNW_PPC64_R29, + UNW_PPC64_R30, + UNW_PPC64_R31, /* called HARD_FRAME_POINTER in gcc */ + + UNW_PPC64_F0 = 32, + UNW_PPC64_F1, + UNW_PPC64_F2, + UNW_PPC64_F3, + UNW_PPC64_F4, + UNW_PPC64_F5, + UNW_PPC64_F6, + UNW_PPC64_F7, + UNW_PPC64_F8, + UNW_PPC64_F9, + UNW_PPC64_F10, + UNW_PPC64_F11, + UNW_PPC64_F12, + UNW_PPC64_F13, + UNW_PPC64_F14, + UNW_PPC64_F15, + UNW_PPC64_F16, + UNW_PPC64_F17, + UNW_PPC64_F18, + UNW_PPC64_F19, + UNW_PPC64_F20, + UNW_PPC64_F21, + UNW_PPC64_F22, + UNW_PPC64_F23, + UNW_PPC64_F24, + UNW_PPC64_F25, + UNW_PPC64_F26, + UNW_PPC64_F27, + UNW_PPC64_F28, + UNW_PPC64_F29, + UNW_PPC64_F30, + UNW_PPC64_F31, + /* Note that there doesn't appear to be an .eh_frame register column + for the FPSCR register. I don't know why this is. Since .eh_frame + info is what this implementation uses for unwinding, we have no way + to unwind this register, and so we will not expose an FPSCR register + number in the libunwind API. + */ + + UNW_PPC64_LR = 65, + UNW_PPC64_CTR = 66, + UNW_PPC64_ARG_POINTER = 67, + + UNW_PPC64_CR0 = 68, + UNW_PPC64_CR1, + UNW_PPC64_CR2, + UNW_PPC64_CR3, + UNW_PPC64_CR4, + /* CR5 .. CR7 are currently unused */ + UNW_PPC64_CR5, + UNW_PPC64_CR6, + UNW_PPC64_CR7, + + UNW_PPC64_XER = 76, + + UNW_PPC64_V0 = 77, + UNW_PPC64_V1, + UNW_PPC64_V2, + UNW_PPC64_V3, + UNW_PPC64_V4, + UNW_PPC64_V5, + UNW_PPC64_V6, + UNW_PPC64_V7, + UNW_PPC64_V8, + UNW_PPC64_V9, + UNW_PPC64_V10, + UNW_PPC64_V11, + UNW_PPC64_V12, + UNW_PPC64_V13, + UNW_PPC64_V14, + UNW_PPC64_V15, + UNW_PPC64_V16, + UNW_PPC64_V17, + UNW_PPC64_V18, + UNW_PPC64_V19, + UNW_PPC64_V20, + UNW_PPC64_V21, + UNW_PPC64_V22, + UNW_PPC64_V23, + UNW_PPC64_V24, + UNW_PPC64_V25, + UNW_PPC64_V26, + UNW_PPC64_V27, + UNW_PPC64_V28, + UNW_PPC64_V29, + UNW_PPC64_V30, + UNW_PPC64_V31, + + UNW_PPC64_VRSAVE = 109, + UNW_PPC64_VSCR = 110, + UNW_PPC64_SPE_ACC = 111, + UNW_PPC64_SPEFSCR = 112, + + /* frame info (read-only) */ + UNW_PPC64_FRAME_POINTER, + UNW_PPC64_NIP, + + + UNW_TDEP_LAST_REG = UNW_PPC64_NIP, + + UNW_TDEP_IP = UNW_PPC64_NIP, + UNW_TDEP_SP = UNW_PPC64_R1, + UNW_TDEP_EH = UNW_PPC64_R12 + } +ppc64_regnum_t; + +typedef enum + { + UNW_PPC64_ABI_ELFv1, + UNW_PPC64_ABI_ELFv2 + } +ppc64_abi_t; + +/* + * According to David Edelsohn, GNU gcc uses R3, R4, R5, and maybe R6 for + * passing parameters to exception handlers. + */ + +#define UNW_TDEP_NUM_EH_REGS 4 + +typedef struct unw_tdep_save_loc + { + /* Additional target-dependent info on a save location. */ + UNW_EMPTY_STRUCT + } +unw_tdep_save_loc_t; + +/* On ppc64, we can directly use ucontext_t as the unwind context. */ +typedef ucontext_t unw_tdep_context_t; + +/* XXX this is not ideal: an application should not be prevented from + using the "getcontext" name just because it's using libunwind. We + can't just use __getcontext() either, because that isn't exported + by glibc... */ +#define unw_tdep_getcontext(uc) (getcontext (uc), 0) + +#include "libunwind-dynamic.h" + +typedef struct + { + /* no ppc64-specific auxiliary proc-info */ + UNW_EMPTY_STRUCT + } +unw_tdep_proc_info_t; + +#include "libunwind-common.h" + +#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg) +extern int unw_tdep_is_fpreg (int); + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif /* LIBUNWIND_H */ diff --git a/vendor/libunwind/include/libunwind-ptrace.h b/vendor/libunwind/include/libunwind-ptrace.h new file mode 100644 index 0000000000..081d2b8452 --- /dev/null +++ b/vendor/libunwind/include/libunwind-ptrace.h @@ -0,0 +1,67 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef libunwind_ptrace_h +#define libunwind_ptrace_h + +#include +#include + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +/* Helper routines which make it easy to use libunwind via ptrace(). + They're available only if UNW_REMOTE_ONLY is _not_ defined and they + aren't really part of the libunwind API. They are implemented in a + archive library called libunwind-ptrace.a. */ + +extern void *_UPT_create (pid_t); +extern void _UPT_destroy (void *); +extern int _UPT_find_proc_info (unw_addr_space_t, unw_word_t, + unw_proc_info_t *, int, void *); +extern void _UPT_put_unwind_info (unw_addr_space_t, unw_proc_info_t *, void *); +extern int _UPT_get_dyn_info_list_addr (unw_addr_space_t, unw_word_t *, + void *); +extern int _UPT_access_mem (unw_addr_space_t, unw_word_t, unw_word_t *, int, + void *); +extern int _UPT_access_reg (unw_addr_space_t, unw_regnum_t, unw_word_t *, + int, void *); +extern int _UPT_access_fpreg (unw_addr_space_t, unw_regnum_t, unw_fpreg_t *, + int, void *); +extern int _UPT_get_proc_name (unw_addr_space_t, unw_word_t, char *, size_t, + unw_word_t *, void *); +extern int _UPT_get_elf_filename (unw_addr_space_t, unw_word_t, char *, size_t, + unw_word_t *, void *); +extern int _UPT_resume (unw_addr_space_t, unw_cursor_t *, void *); +extern unw_word_t _UPT_ptrauth_insn_mask (unw_addr_space_t, void *); +extern unw_accessors_t _UPT_accessors; + + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif /* libunwind_ptrace_h */ diff --git a/vendor/libunwind/include/libunwind-riscv.h b/vendor/libunwind/include/libunwind-riscv.h new file mode 100644 index 0000000000..55605fe779 --- /dev/null +++ b/vendor/libunwind/include/libunwind-riscv.h @@ -0,0 +1,194 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + + Modified for riscv by Zhaofeng Li + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef LIBUNWIND_H +#define LIBUNWIND_H + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +#include +#include +#include +#include + +#ifndef UNW_EMPTY_STRUCT +# define UNW_EMPTY_STRUCT uint8_t unused; +#endif + +#define UNW_TARGET riscv +#define UNW_TARGET_RISCV 1 + +#define _U_TDEP_QP_TRUE 0 /* ignored - see libunwind-dynamic.h */ + +/* This needs to be big enough to accommodate "struct cursor", while + leaving some slack for future expansion. Changing this value will + require recompiling all users of this library. Stack allocation is + relatively cheap and unwind-state copying is relatively rare, so we + want to err on making it rather too big than too small. */ +/* FIXME for riscv: Figure out a more reasonable size */ +#define UNW_TDEP_CURSOR_LEN 4096 + +#if __riscv_xlen == 32 +typedef uint32_t unw_word_t; +typedef int32_t unw_sword_t; +# define UNW_WORD_MAX UINT32_MAX +#elif __riscv_xlen == 64 +typedef uint64_t unw_word_t; +typedef int64_t unw_sword_t; +# define UNW_WORD_MAX UINT64_MAX +#endif + +#if __riscv_flen == 64 +typedef double unw_tdep_fpreg_t; +#elif __riscv_flen == 32 +typedef float unw_tdep_fpreg_t; +#else +# error "Unsupported RISC-V floating-point size" +#endif + +/* Also see src/riscv/Gglobal.c. This ordering is consistent with + https://github.com/riscv/riscv-elf-psabi-doc/blob/74ecf07bcebd0cb4bf3c39f3f9d96946cd6aba61/riscv-elf.md#dwarf-register-numbers- */ + +typedef enum + { + /* integer registers */ + UNW_RISCV_X0, + UNW_RISCV_X1, + UNW_RISCV_X2, + UNW_RISCV_X3, + UNW_RISCV_X4, + UNW_RISCV_X5, + UNW_RISCV_X6, + UNW_RISCV_X7, + UNW_RISCV_X8, + UNW_RISCV_X9, + UNW_RISCV_X10, + UNW_RISCV_X11, + UNW_RISCV_X12, + UNW_RISCV_X13, + UNW_RISCV_X14, + UNW_RISCV_X15, + UNW_RISCV_X16, + UNW_RISCV_X17, + UNW_RISCV_X18, + UNW_RISCV_X19, + UNW_RISCV_X20, + UNW_RISCV_X21, + UNW_RISCV_X22, + UNW_RISCV_X23, + UNW_RISCV_X24, + UNW_RISCV_X25, + UNW_RISCV_X26, + UNW_RISCV_X27, + UNW_RISCV_X28, + UNW_RISCV_X29, + UNW_RISCV_X30, + UNW_RISCV_X31, + + /* floating point registers */ + UNW_RISCV_F0, + UNW_RISCV_F1, + UNW_RISCV_F2, + UNW_RISCV_F3, + UNW_RISCV_F4, + UNW_RISCV_F5, + UNW_RISCV_F6, + UNW_RISCV_F7, + UNW_RISCV_F8, + UNW_RISCV_F9, + UNW_RISCV_F10, + UNW_RISCV_F11, + UNW_RISCV_F12, + UNW_RISCV_F13, + UNW_RISCV_F14, + UNW_RISCV_F15, + UNW_RISCV_F16, + UNW_RISCV_F17, + UNW_RISCV_F18, + UNW_RISCV_F19, + UNW_RISCV_F20, + UNW_RISCV_F21, + UNW_RISCV_F22, + UNW_RISCV_F23, + UNW_RISCV_F24, + UNW_RISCV_F25, + UNW_RISCV_F26, + UNW_RISCV_F27, + UNW_RISCV_F28, + UNW_RISCV_F29, + UNW_RISCV_F30, + UNW_RISCV_F31, + + UNW_RISCV_PC, + + UNW_TDEP_LAST_REG = UNW_RISCV_PC, + + /* The CFA is the value of SP in previous frame */ + UNW_RISCV_CFA = UNW_RISCV_X2, + + UNW_TDEP_IP = UNW_RISCV_PC, + UNW_TDEP_SP = UNW_RISCV_X2, + UNW_TDEP_EH = UNW_RISCV_X10, + } +riscv_regnum_t; + +/* https://github.com/gcc-mirror/gcc/blob/16e2427f50c208dfe07d07f18009969502c25dc8/gcc/config/riscv/riscv.h#L104-L106 */ +#define UNW_TDEP_NUM_EH_REGS 4 + +typedef struct unw_tdep_save_loc + { + /* Additional target-dependent info on a save location. */ + UNW_EMPTY_STRUCT + } +unw_tdep_save_loc_t; + +/* On riscv, we can directly use ucontext_t as the unwind context. */ +typedef ucontext_t unw_tdep_context_t; + +typedef struct + { + /* no riscv-specific auxiliary proc-info */ + UNW_EMPTY_STRUCT + } +unw_tdep_proc_info_t; + +#include "libunwind-dynamic.h" +#include "libunwind-common.h" + +#define unw_tdep_getcontext UNW_ARCH_OBJ(getcontext) +#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg) + +extern int unw_tdep_getcontext (unw_tdep_context_t *); +extern int unw_tdep_is_fpreg (int); + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif /* LIBUNWIND_H */ diff --git a/vendor/libunwind/include/libunwind-s390x.h b/vendor/libunwind/include/libunwind-s390x.h new file mode 100644 index 0000000000..7d38a747b6 --- /dev/null +++ b/vendor/libunwind/include/libunwind-s390x.h @@ -0,0 +1,150 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + + Modified for s390x by Michael Munday + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef LIBUNWIND_H +#define LIBUNWIND_H + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +#include +#include +#include + +#ifndef UNW_EMPTY_STRUCT +# define UNW_EMPTY_STRUCT uint8_t unused; +#endif + +#define UNW_TARGET s390x +#define UNW_TARGET_S390X 1 + +#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */ + +/* This needs to be big enough to accommodate "struct cursor", while + leaving some slack for future expansion. Changing this value will + require recompiling all users of this library. Stack allocation is + relatively cheap and unwind-state copying is relatively rare, so we + want to err on making it rather too big than too small. */ +#define UNW_TDEP_CURSOR_LEN 384 + +typedef uint64_t unw_word_t; +typedef int64_t unw_sword_t; + +typedef double unw_tdep_fpreg_t; + +#define UNW_WORD_MAX UINT64_MAX + +typedef enum + { + /* general purpose registers */ + UNW_S390X_R0, + UNW_S390X_R1, + UNW_S390X_R2, + UNW_S390X_R3, + UNW_S390X_R4, + UNW_S390X_R5, + UNW_S390X_R6, + UNW_S390X_R7, + UNW_S390X_R8, + UNW_S390X_R9, + UNW_S390X_R10, + UNW_S390X_R11, + UNW_S390X_R12, + UNW_S390X_R13, + UNW_S390X_R14, + UNW_S390X_R15, + + /* floating point registers */ + UNW_S390X_F0, + UNW_S390X_F1, + UNW_S390X_F2, + UNW_S390X_F3, + UNW_S390X_F4, + UNW_S390X_F5, + UNW_S390X_F6, + UNW_S390X_F7, + UNW_S390X_F8, + UNW_S390X_F9, + UNW_S390X_F10, + UNW_S390X_F11, + UNW_S390X_F12, + UNW_S390X_F13, + UNW_S390X_F14, + UNW_S390X_F15, + + /* PSW */ + UNW_S390X_IP, + + UNW_TDEP_LAST_REG = UNW_S390X_IP, + + /* TODO: access, vector registers */ + + /* frame info (read-only) */ + UNW_S390X_CFA, + + UNW_TDEP_IP = UNW_S390X_IP, + UNW_TDEP_SP = UNW_S390X_R15, + + /* TODO: placeholders */ + UNW_TDEP_EH = UNW_S390X_R0, + } +s390x_regnum_t; + +#define UNW_TDEP_NUM_EH_REGS 2 /* XXX Not sure what this means */ + +typedef struct unw_tdep_save_loc + { + /* Additional target-dependent info on a save location. */ + UNW_EMPTY_STRUCT + } +unw_tdep_save_loc_t; + +/* On s390x, we can directly use ucontext_t as the unwind context. */ +typedef ucontext_t unw_tdep_context_t; + +typedef struct + { + /* no s390x-specific auxiliary proc-info */ + UNW_EMPTY_STRUCT + } +unw_tdep_proc_info_t; + +#include "libunwind-dynamic.h" +#include "libunwind-common.h" + +#define unw_tdep_getcontext UNW_ARCH_OBJ(getcontext) +#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg) + +extern int unw_tdep_getcontext (unw_tdep_context_t *); +extern int unw_tdep_is_fpreg (int); + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif /* LIBUNWIND_H */ diff --git a/vendor/libunwind/include/libunwind-sh.h b/vendor/libunwind/include/libunwind-sh.h new file mode 100644 index 0000000000..2218c6c602 --- /dev/null +++ b/vendor/libunwind/include/libunwind-sh.h @@ -0,0 +1,123 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2012 Tommi Rantala + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef LIBUNWIND_H +#define LIBUNWIND_H + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +#include +#include +#include +#include + +#ifndef UNW_EMPTY_STRUCT +# define UNW_EMPTY_STRUCT uint8_t unused; +#endif + +#define UNW_TARGET sh +#define UNW_TARGET_SH 1 + +#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */ + +/* This needs to be big enough to accommodate "struct cursor", while + leaving some slack for future expansion. Changing this value will + require recompiling all users of this library. Stack allocation is + relatively cheap and unwind-state copying is relatively rare, so we + want to err on making it rather too big than too small. */ + +#define UNW_TDEP_CURSOR_LEN 4096 + +typedef uint32_t unw_word_t; +typedef int32_t unw_sword_t; + +typedef long double unw_tdep_fpreg_t; + +#define UNW_WORD_MAX UINT32_MAX + +typedef enum + { + UNW_SH_R0, + UNW_SH_R1, + UNW_SH_R2, + UNW_SH_R3, + UNW_SH_R4, + UNW_SH_R5, + UNW_SH_R6, + UNW_SH_R7, + UNW_SH_R8, + UNW_SH_R9, + UNW_SH_R10, + UNW_SH_R11, + UNW_SH_R12, + UNW_SH_R13, + UNW_SH_R14, + UNW_SH_R15, + + UNW_SH_PC, + UNW_SH_PR, + + UNW_TDEP_LAST_REG = UNW_SH_PR, + + UNW_TDEP_IP = UNW_SH_PR, + UNW_TDEP_SP = UNW_SH_R15, + UNW_TDEP_EH = UNW_SH_R0 + } +sh_regnum_t; + +#define UNW_TDEP_NUM_EH_REGS 2 + +typedef ucontext_t unw_tdep_context_t; + +#define unw_tdep_getcontext(uc) (getcontext (uc), 0) + +typedef struct unw_tdep_save_loc + { + /* Additional target-dependent info on a save location. */ + UNW_EMPTY_STRUCT + } +unw_tdep_save_loc_t; + +#include "libunwind-dynamic.h" + +typedef struct + { + /* no sh-specific auxiliary proc-info */ + UNW_EMPTY_STRUCT + } +unw_tdep_proc_info_t; + +#include "libunwind-common.h" + +#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg) +extern int unw_tdep_is_fpreg (int); + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif /* LIBUNWIND_H */ diff --git a/vendor/libunwind/include/libunwind-x86.h b/vendor/libunwind/include/libunwind-x86.h new file mode 100644 index 0000000000..cd42c60e49 --- /dev/null +++ b/vendor/libunwind/include/libunwind-x86.h @@ -0,0 +1,196 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef LIBUNWIND_H +#define LIBUNWIND_H + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +#include +#include +#include +#include + +#ifndef UNW_EMPTY_STRUCT +# define UNW_EMPTY_STRUCT uint8_t unused; +#endif + +#define UNW_TARGET x86 +#define UNW_TARGET_X86 1 + +#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */ + +/* This needs to be big enough to accommodate "struct cursor", while + leaving some slack for future expansion. Changing this value will + require recompiling all users of this library. Stack allocation is + relatively cheap and unwind-state copying is relatively rare, so we + want to err on making it rather too big than too small. */ +#define UNW_TDEP_CURSOR_LEN 127 + +typedef uint32_t unw_word_t; +typedef int32_t unw_sword_t; + +#define UNW_WORD_MAX UINT32_MAX + +typedef union { + struct { uint8_t b[4]; } val32; + struct { uint8_t b[10]; } val80; + struct { uint8_t b[16]; } val128; +} unw_tdep_fpreg_t; + +typedef enum + { + /* Note: general registers are expected to start with index 0. + This convention facilitates architecture-independent + implementation of the C++ exception handling ABI. See + _Unwind_SetGR() and _Unwind_GetGR() for details. + + The described register usage convention is based on "System V + Application Binary Interface, Intel386 Architecture Processor + Supplement, Fourth Edition" at + + http://www.linuxbase.org/spec/refspecs/elf/abi386-4.pdf + + It would have been nice to use the same register numbering as + DWARF, but that doesn't work because the libunwind requires + that the exception argument registers be consecutive, which the + wouldn't be with the DWARF numbering. */ + UNW_X86_EAX, /* scratch (exception argument 1) */ + UNW_X86_EDX, /* scratch (exception argument 2) */ + UNW_X86_ECX, /* scratch */ + UNW_X86_EBX, /* preserved */ + UNW_X86_ESI, /* preserved */ + UNW_X86_EDI, /* preserved */ + UNW_X86_EBP, /* (optional) frame-register */ + UNW_X86_ESP, /* (optional) frame-register */ + UNW_X86_EIP, /* frame-register */ + UNW_X86_EFLAGS, /* scratch (except for "direction", which is fixed */ + UNW_X86_TRAPNO, /* scratch */ + + /* MMX/stacked-fp registers */ + UNW_X86_ST0, /* fp return value */ + UNW_X86_ST1, /* scratch */ + UNW_X86_ST2, /* scratch */ + UNW_X86_ST3, /* scratch */ + UNW_X86_ST4, /* scratch */ + UNW_X86_ST5, /* scratch */ + UNW_X86_ST6, /* scratch */ + UNW_X86_ST7, /* scratch */ + + UNW_X86_FCW, /* scratch */ + UNW_X86_FSW, /* scratch */ + UNW_X86_FTW, /* scratch */ + UNW_X86_FOP, /* scratch */ + UNW_X86_FCS, /* scratch */ + UNW_X86_FIP, /* scratch */ + UNW_X86_FEA, /* scratch */ + UNW_X86_FDS, /* scratch */ + + /* SSE registers */ + UNW_X86_XMM0_lo, /* scratch */ + UNW_X86_XMM0_hi, /* scratch */ + UNW_X86_XMM1_lo, /* scratch */ + UNW_X86_XMM1_hi, /* scratch */ + UNW_X86_XMM2_lo, /* scratch */ + UNW_X86_XMM2_hi, /* scratch */ + UNW_X86_XMM3_lo, /* scratch */ + UNW_X86_XMM3_hi, /* scratch */ + UNW_X86_XMM4_lo, /* scratch */ + UNW_X86_XMM4_hi, /* scratch */ + UNW_X86_XMM5_lo, /* scratch */ + UNW_X86_XMM5_hi, /* scratch */ + UNW_X86_XMM6_lo, /* scratch */ + UNW_X86_XMM6_hi, /* scratch */ + UNW_X86_XMM7_lo, /* scratch */ + UNW_X86_XMM7_hi, /* scratch */ + + UNW_X86_MXCSR, /* scratch */ + + /* segment registers */ + UNW_X86_GS, /* special */ + UNW_X86_FS, /* special */ + UNW_X86_ES, /* special */ + UNW_X86_DS, /* special */ + UNW_X86_SS, /* special */ + UNW_X86_CS, /* special */ + UNW_X86_TSS, /* special */ + UNW_X86_LDT, /* special */ + + /* frame info (read-only) */ + UNW_X86_CFA, + + UNW_X86_XMM0, /* scratch */ + UNW_X86_XMM1, /* scratch */ + UNW_X86_XMM2, /* scratch */ + UNW_X86_XMM3, /* scratch */ + UNW_X86_XMM4, /* scratch */ + UNW_X86_XMM5, /* scratch */ + UNW_X86_XMM6, /* scratch */ + UNW_X86_XMM7, /* scratch */ + + UNW_TDEP_LAST_REG = UNW_X86_XMM7, + + UNW_TDEP_IP = UNW_X86_EIP, + UNW_TDEP_SP = UNW_X86_ESP, + UNW_TDEP_EH = UNW_X86_EAX + } +x86_regnum_t; + +#define UNW_TDEP_NUM_EH_REGS 2 /* eax and edx are exception args */ + +typedef struct unw_tdep_save_loc + { + /* Additional target-dependent info on a save location. */ + UNW_EMPTY_STRUCT + } +unw_tdep_save_loc_t; + +/* On x86, we can directly use ucontext_t as the unwind context. */ +typedef ucontext_t unw_tdep_context_t; + +#include "libunwind-dynamic.h" + +typedef struct + { + /* no x86-specific auxiliary proc-info */ + UNW_EMPTY_STRUCT + } +unw_tdep_proc_info_t; + +#include "libunwind-common.h" + +#define unw_tdep_getcontext UNW_ARCH_OBJ(getcontext) +extern int unw_tdep_getcontext (unw_tdep_context_t *); + +#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg) +extern int unw_tdep_is_fpreg (int); + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif /* LIBUNWIND_H */ diff --git a/vendor/libunwind/include/libunwind-x86_64.h b/vendor/libunwind/include/libunwind-x86_64.h new file mode 100644 index 0000000000..a2fea33b3b --- /dev/null +++ b/vendor/libunwind/include/libunwind-x86_64.h @@ -0,0 +1,148 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef LIBUNWIND_H +#define LIBUNWIND_H + +#if defined(__cplusplus) || defined(c_plusplus) +extern "C" { +#endif + +#include +#include +#include +#include + +#ifndef UNW_EMPTY_STRUCT +# define UNW_EMPTY_STRUCT uint8_t unused; +#endif + +#define UNW_TARGET x86_64 +#define UNW_TARGET_X86_64 1 + +#define _U_TDEP_QP_TRUE 0 /* see libunwind-dynamic.h */ + +/* This needs to be big enough to accommodate "struct cursor", while + leaving some slack for future expansion. Changing this value will + require recompiling all users of this library. Stack allocation is + relatively cheap and unwind-state copying is relatively rare, so we + want to err on making it rather too big than too small. */ +#define UNW_TDEP_CURSOR_LEN 127 + +typedef uint64_t unw_word_t; +typedef int64_t unw_sword_t; + +typedef long double unw_tdep_fpreg_t; + +#define UNW_WORD_MAX UINT64_MAX + +typedef enum + { + UNW_X86_64_RAX, + UNW_X86_64_RDX, + UNW_X86_64_RCX, + UNW_X86_64_RBX, + UNW_X86_64_RSI, + UNW_X86_64_RDI, + UNW_X86_64_RBP, + UNW_X86_64_RSP, + UNW_X86_64_R8, + UNW_X86_64_R9, + UNW_X86_64_R10, + UNW_X86_64_R11, + UNW_X86_64_R12, + UNW_X86_64_R13, + UNW_X86_64_R14, + UNW_X86_64_R15, + UNW_X86_64_RIP, +#ifdef CONFIG_MSABI_SUPPORT + UNW_X86_64_XMM0, + UNW_X86_64_XMM1, + UNW_X86_64_XMM2, + UNW_X86_64_XMM3, + UNW_X86_64_XMM4, + UNW_X86_64_XMM5, + UNW_X86_64_XMM6, + UNW_X86_64_XMM7, + UNW_X86_64_XMM8, + UNW_X86_64_XMM9, + UNW_X86_64_XMM10, + UNW_X86_64_XMM11, + UNW_X86_64_XMM12, + UNW_X86_64_XMM13, + UNW_X86_64_XMM14, + UNW_X86_64_XMM15, + UNW_TDEP_LAST_REG = UNW_X86_64_XMM15, +#else + UNW_TDEP_LAST_REG = UNW_X86_64_RIP, +#endif + + /* XXX Add other regs here */ + + /* frame info (read-only) */ + UNW_X86_64_CFA, + + UNW_TDEP_IP = UNW_X86_64_RIP, + UNW_TDEP_SP = UNW_X86_64_RSP, + UNW_TDEP_BP = UNW_X86_64_RBP, + UNW_TDEP_EH = UNW_X86_64_RAX + } +x86_64_regnum_t; + +#define UNW_TDEP_NUM_EH_REGS 2 /* XXX Not sure what this means */ + +typedef struct unw_tdep_save_loc + { + /* Additional target-dependent info on a save location. */ + UNW_EMPTY_STRUCT + } +unw_tdep_save_loc_t; + +/* On x86_64, we can directly use ucontext_t as the unwind context. */ +typedef ucontext_t unw_tdep_context_t; + +typedef struct + { + /* no x86-64-specific auxiliary proc-info */ + UNW_EMPTY_STRUCT + } +unw_tdep_proc_info_t; + +#include "libunwind-dynamic.h" +#include "libunwind-common.h" + +#define unw_tdep_getcontext UNW_ARCH_OBJ(getcontext) +#define unw_tdep_is_fpreg UNW_ARCH_OBJ(is_fpreg) + +extern int unw_tdep_getcontext (unw_tdep_context_t *); +extern int unw_tdep_is_fpreg (int); + +#if defined(__cplusplus) || defined(c_plusplus) +} +#endif + +#endif /* LIBUNWIND_H */ diff --git a/vendor/libunwind/include/libunwind.h b/vendor/libunwind/include/libunwind.h new file mode 100644 index 0000000000..62491c5f5a --- /dev/null +++ b/vendor/libunwind/include/libunwind.h @@ -0,0 +1,40 @@ +/* Provide a real file - not a symlink - as it would cause multiarch conflicts + when multiple different arch releases are installed simultaneously. */ + +#ifndef UNW_REMOTE_ONLY + +#if defined __aarch64__ +#include "libunwind-aarch64.h" +#elif defined __arm__ +# include "libunwind-arm.h" +#elif defined __hppa__ +# include "libunwind-hppa.h" +#elif defined __ia64__ +# include "libunwind-ia64.h" +#elif defined __mips__ +# include "libunwind-mips.h" +#elif defined __powerpc__ && !defined __powerpc64__ +# include "libunwind-ppc32.h" +#elif defined __powerpc64__ +# include "libunwind-ppc64.h" +#elif defined __sh__ +# include "libunwind-sh.h" +#elif defined __i386__ +# include "libunwind-x86.h" +#elif defined __x86_64__ +# include "libunwind-x86_64.h" +#elif defined __s390x__ +# include "libunwind-s390x.h" +#elif defined __riscv || defined __riscv__ +# include "libunwind-riscv.h" +#elif defined __loongarch64 +# include "libunwind-loongarch64.h" +#else +# error "Unsupported arch" +#endif + +#else /* UNW_REMOTE_ONLY */ + +# include "libunwind-x86_64.h" + +#endif /* UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/include/libunwind.h.in b/vendor/libunwind/include/libunwind.h.in new file mode 100644 index 0000000000..5ed37ea575 --- /dev/null +++ b/vendor/libunwind/include/libunwind.h.in @@ -0,0 +1,40 @@ +/* Provide a real file - not a symlink - as it would cause multiarch conflicts + when multiple different arch releases are installed simultaneously. */ + +#ifndef UNW_REMOTE_ONLY + +#if defined __aarch64__ +#include "libunwind-aarch64.h" +#elif defined __arm__ +# include "libunwind-arm.h" +#elif defined __hppa__ +# include "libunwind-hppa.h" +#elif defined __ia64__ +# include "libunwind-ia64.h" +#elif defined __mips__ +# include "libunwind-mips.h" +#elif defined __powerpc__ && !defined __powerpc64__ +# include "libunwind-ppc32.h" +#elif defined __powerpc64__ +# include "libunwind-ppc64.h" +#elif defined __sh__ +# include "libunwind-sh.h" +#elif defined __i386__ +# include "libunwind-x86.h" +#elif defined __x86_64__ +# include "libunwind-x86_64.h" +#elif defined __s390x__ +# include "libunwind-s390x.h" +#elif defined __riscv || defined __riscv__ +# include "libunwind-riscv.h" +#elif defined __loongarch64 +# include "libunwind-loongarch64.h" +#else +# error "Unsupported arch" +#endif + +#else /* UNW_REMOTE_ONLY */ + +# include "libunwind-@arch@.h" + +#endif /* UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/include/libunwind_i.h b/vendor/libunwind/include/libunwind_i.h new file mode 100644 index 0000000000..1dbcb6a86d --- /dev/null +++ b/vendor/libunwind/include/libunwind_i.h @@ -0,0 +1,439 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2001-2005 Hewlett-Packard Co + Copyright (C) 2007 David Mosberger-Tang + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +/* This files contains libunwind-internal definitions which are + subject to frequent change and are not to be exposed to + libunwind-users. */ + +#ifndef libunwind_i_h +#define libunwind_i_h + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "compiler.h" + +#if defined(HAVE___CACHE_PER_THREAD) && HAVE___CACHE_PER_THREAD +#define UNWI_DEFAULT_CACHING_POLICY UNW_CACHE_PER_THREAD +#else +#define UNWI_DEFAULT_CACHING_POLICY UNW_CACHE_GLOBAL +#endif + +/* Platform-independent libunwind-internal declarations. */ + +#include /* HP-UX needs this before include of pthread.h */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(HAVE_SYS_SYSCALL_H) +# include /* For SYS_xxx definitions */ +#endif + +#if defined(HAVE_ELF_H) +# include +#elif defined(HAVE_SYS_ELF_H) +# include +#else +# error Could not locate +#endif +#if defined(ELFCLASS32) +# define UNW_ELFCLASS32 ELFCLASS32 +#else +# define UNW_ELFCLASS32 1 +#endif +#if defined(ELFCLASS64) +# define UNW_ELFCLASS64 ELFCLASS64 +#else +# define UNW_ELFCLASS64 2 +#endif + +#if defined(HAVE_ENDIAN_H) +# include +#elif defined(HAVE_SYS_ENDIAN_H) +# include +#elif defined(HAVE_SYS_PARAM_H) +# include +#endif + +#if defined(__LITTLE_ENDIAN) +# define UNW_LITTLE_ENDIAN __LITTLE_ENDIAN +#elif defined(_LITTLE_ENDIAN) +# define UNW_LITTLE_ENDIAN _LITTLE_ENDIAN +#elif defined(LITTLE_ENDIAN) +# define UNW_LITTLE_ENDIAN LITTLE_ENDIAN +#else +# define UNW_LITTLE_ENDIAN 1234 +#endif + +#if defined(__BIG_ENDIAN) +# define UNW_BIG_ENDIAN __BIG_ENDIAN +#elif defined(_BIG_ENDIAN) +# define UNW_BIG_ENDIAN _BIG_ENDIAN +#elif defined(BIG_ENDIAN) +# define UNW_BIG_ENDIAN BIG_ENDIAN +#else +# define UNW_BIG_ENDIAN 4321 +#endif + +#if defined(__BYTE_ORDER) +# define UNW_BYTE_ORDER __BYTE_ORDER +#elif defined(_BYTE_ORDER) +# define UNW_BYTE_ORDER _BYTE_ORDER +#elif defined(BIG_ENDIAN) +# define UNW_BYTE_ORDER BYTE_ORDER +#else +# if defined(__hpux) +# define UNW_BYTE_ORDER UNW_BIG_ENDIAN +# else +# error Target has unknown byte ordering. +# endif +#endif + +static inline int +byte_order_is_valid(int byte_order) +{ + return byte_order == UNW_BIG_ENDIAN + || byte_order == UNW_LITTLE_ENDIAN; +} + +static inline int +byte_order_is_big_endian(int byte_order) +{ + return byte_order == UNW_BIG_ENDIAN; +} + +static inline int +target_is_big_endian(void) +{ + return byte_order_is_big_endian(UNW_BYTE_ORDER); +} + +#if defined(HAVE__BUILTIN_UNREACHABLE) +# define unreachable() __builtin_unreachable() +#else +# define unreachable() do { } while (1) +#endif + +#ifdef DEBUG +# define UNW_DEBUG 1 +#else +# undef UNW_DEBUG +#endif + +/* Make it easy to write thread-safe code which may or may not be + linked against libpthread. The macros below can be used + unconditionally and if -lpthread is around, they'll call the + corresponding routines otherwise, they do nothing. */ + +#pragma weak pthread_mutex_init +#pragma weak pthread_mutex_lock +#pragma weak pthread_mutex_unlock +#pragma weak pthread_sigmask + +#define mutex_init(l) \ + (pthread_mutex_init != NULL ? pthread_mutex_init ((l), NULL) : 0) +#define mutex_lock(l) \ + (pthread_mutex_lock != NULL ? pthread_mutex_lock (l) : 0) +#define mutex_unlock(l) \ + (pthread_mutex_unlock != NULL ? pthread_mutex_unlock (l) : 0) + +#define UNWI_OBJ(fn) UNW_PASTE(UNW_PREFIX,UNW_PASTE(I,fn)) +#define UNWI_ARCH_OBJ(fn) UNW_PASTE(UNW_PASTE(UNW_PASTE(_UI,UNW_TARGET),_), fn) + +#define unwi_full_mask UNWI_ARCH_OBJ(full_mask) + +/* Type of a mask that can be used to inhibit preemption. At the + userlevel, preemption is caused by signals and hence sigset_t is + appropriate. In contrast, the Linux kernel uses "unsigned long" + to hold the processor "flags" instead. */ +typedef sigset_t intrmask_t; + +extern intrmask_t unwi_full_mask; + +/* Silence compiler warnings about variables which are used only if libunwind + is configured in a certain way */ +static inline void mark_as_used(void *v UNUSED) { +} + +#if defined(CONFIG_BLOCK_SIGNALS) +/* SIGPROCMASK ignores return values, so we do not have to correct for pthread_sigmask() returning + errno on failure when sigprocmask() returns -1. */ +# define SIGPROCMASK(how, new_mask, old_mask) \ + (pthread_sigmask != NULL ? pthread_sigmask((how), (new_mask), (old_mask)) \ + : sigprocmask((how), (new_mask), (old_mask))) +#else +# define SIGPROCMASK(how, new_mask, old_mask) mark_as_used(old_mask) +#endif + +/* Prefer adaptive mutexes if available */ +#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP +#define UNW_PTHREAD_MUTEX_INITIALIZER PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP +#else +#define UNW_PTHREAD_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER +#endif + +#define define_lock(name) \ + pthread_mutex_t name = UNW_PTHREAD_MUTEX_INITIALIZER +#define lock_init(l) mutex_init (l) +#define lock_acquire(l,m) \ +do { \ + SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &(m)); \ + mutex_lock (l); \ +} while (0) +#define lock_release(l,m) \ +do { \ + mutex_unlock (l); \ + SIGPROCMASK (SIG_SETMASK, &(m), NULL); \ +} while (0) + +#define SOS_MEMORY_SIZE 16384 /* see src/mi/mempool.c */ + +/* Provide an internal syscall version of mmap to improve signal safety. */ +static ALWAYS_INLINE void * +mi_mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset) +{ +#if defined(SYS_mmap) && !defined(__i386__) + /* Where supported, bypass libc and invoke the syscall directly. */ +# if defined(__FreeBSD__) // prefer over syscall on *BSD + long int ret = __syscall (SYS_mmap, addr, len, prot, flags, fd, offset); +# else + long int ret = syscall (SYS_mmap, addr, len, prot, flags, fd, offset); +# endif + // @todo this is very likely Linux specific + if ((unsigned long int)ret > -4096UL) + return MAP_FAILED; + else + return (void *)ret; +#else + /* Where direct syscalls are not supported, forward to the libc call. */ + return mmap (addr, len, prot, flags, fd, offset); +#endif +} + +/* Provide an internal syscall version of munmap to improve signal safety. */ +static ALWAYS_INLINE int +mi_munmap (void *addr, size_t len) +{ +#ifdef SYS_munmap + return syscall (SYS_munmap, addr, len); +#else + return munmap (addr, len); +#endif +} + +#ifndef MAP_ANONYMOUS +# define MAP_ANONYMOUS MAP_ANON +#endif +#define GET_MEMORY(mem, size) \ +do { \ + mem = mi_mmap (NULL, size, PROT_READ | PROT_WRITE, \ + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); \ + if (mem == MAP_FAILED) \ + mem = NULL; \ +} while (0) + +#define unwi_find_dynamic_proc_info UNWI_OBJ(find_dynamic_proc_info) +#define unwi_extract_dynamic_proc_info UNWI_OBJ(extract_dynamic_proc_info) +#define unwi_put_dynamic_unwind_info UNWI_OBJ(put_dynamic_unwind_info) +#define unwi_dyn_remote_find_proc_info UNWI_OBJ(dyn_remote_find_proc_info) +#define unwi_dyn_remote_put_unwind_info UNWI_OBJ(dyn_remote_put_unwind_info) +#define unwi_dyn_validate_cache UNWI_OBJ(dyn_validate_cache) + +extern int unwi_find_dynamic_proc_info (unw_addr_space_t as, + unw_word_t ip, + unw_proc_info_t *pi, + int need_unwind_info, void *arg); +extern int unwi_extract_dynamic_proc_info (unw_addr_space_t as, + unw_word_t ip, + unw_proc_info_t *pi, + unw_dyn_info_t *di, + int need_unwind_info, + void *arg); +extern void unwi_put_dynamic_unwind_info (unw_addr_space_t as, + unw_proc_info_t *pi, void *arg); + +/* These handle the remote (cross-address-space) case of accessing + dynamic unwind info. */ + +extern int unwi_dyn_remote_find_proc_info (unw_addr_space_t as, + unw_word_t ip, + unw_proc_info_t *pi, + int need_unwind_info, + void *arg); +extern void unwi_dyn_remote_put_unwind_info (unw_addr_space_t as, + unw_proc_info_t *pi, + void *arg); +extern int unwi_dyn_validate_cache (unw_addr_space_t as, void *arg); + +extern unw_dyn_info_list_t _U_dyn_info_list; +extern pthread_mutex_t _U_dyn_info_list_lock; + +#define unw_address_is_valid UNWI_ARCH_OBJ(address_is_valid) +HIDDEN bool unw_address_is_valid(unw_word_t, size_t); + + +#if defined(UNW_DEBUG) +# define unwi_debug_level UNWI_ARCH_OBJ(debug_level) +extern long unwi_debug_level; + +# include +# include +# include + +#define Debug(level, ...) _unw_debug(level, __FUNCTION__, __VA_ARGS__) + +/** + * Send a debug message to stderr. + * + * This function may be called from within a signal handler context where + * fprintf(3) is not safe to call. The write(2) call is safe, however, and we're + * going to have to assume that snprintf(3) is signal safe otherwise it's pretty + * pointless to use Debug() calls anywhere. + */ +static inline void _unw_debug(int level, char const * const fname, char const * const fmt, ...) +{ + if (unwi_debug_level >= level) + { + enum { buf_size = 512 }; + char buf[buf_size]; + + if (level > 16) level = 16; + int bcount = snprintf (buf, buf_size, "%*c>%s: ", level, ' ', fname); + int res = write(STDERR_FILENO, buf, bcount); + + va_list ap; + va_start(ap, fmt); + bcount = vsnprintf (buf, buf_size, fmt, ap); + va_end(ap); + res = write(STDERR_FILENO, buf, bcount); + (void)res; /* silence "variable set but not used" warning */ + } +} +# define Dprintf(/* format */ ...) \ + fprintf (stderr, /* format */ __VA_ARGS__) +#else /* defined(UNW_DEBUG) */ +# define Debug(level, /* format */ ...) +# define Dprintf( /* format */ ...) +#endif /* defined(UNW_DEBUG) */ + +static ALWAYS_INLINE int +print_error (const char *string) +{ + return write (2, string, strlen (string)); +} + +HIDDEN extern long unw_page_size; + +static inline unw_word_t unw_page_start(unw_word_t addr) +{ + return addr & ~(unw_page_size - 1); +} + +#define mi_init UNWI_ARCH_OBJ(mi_init) + +extern void mi_init (void); /* machine-independent initializations */ +extern unw_word_t _U_dyn_info_list_addr (void); + +/* This is needed/used by ELF targets only. */ + +struct elf_image + { + void *image; /* pointer to mmap'd image */ + size_t size; /* (file-) size of the image */ + }; + +struct elf_dyn_info + { + struct elf_image ei; + unw_dyn_info_t di_cache; + unw_dyn_info_t di_debug; /* additional table info for .debug_frame */ +#if UNW_TARGET_IA64 + unw_dyn_info_t ktab; +#endif +#if UNW_TARGET_ARM + unw_dyn_info_t di_arm; /* additional table info for .ARM.exidx */ +#endif + }; + +static inline void invalidate_edi (struct elf_dyn_info *edi) +{ + if (edi->ei.image) + mi_munmap (edi->ei.image, edi->ei.size); + memset (edi, 0, sizeof (*edi)); + edi->di_cache.format = -1; + edi->di_debug.format = -1; +#if UNW_TARGET_ARM + edi->di_arm.format = -1; +#endif +} + + +/* Provide a place holder for architecture to override for fast access + to memory when known not to need to validate and know the access + will be local to the process. A suitable override will improve + unw_tdep_trace() performance in particular. */ +#define ACCESS_MEM_FAST(ret,validate,cur,addr,to) \ + do { (ret) = dwarf_get ((cur), DWARF_MEM_LOC ((cur), (addr)), &(to)); } \ + while (0) + +/* Define GNU and processor specific values for the Phdr p_type field in case + they aren't defined by . */ +#ifndef PT_GNU_EH_FRAME +# define PT_GNU_EH_FRAME 0x6474e550 +#endif /* !PT_GNU_EH_FRAME */ +#ifndef PT_ARM_EXIDX +# define PT_ARM_EXIDX 0x70000001 /* ARM unwind segment */ +#endif /* !PT_ARM_EXIDX */ + +#include "tdep/libunwind_i.h" + +#ifndef TDEP_DWARF_SP +#define TDEP_DWARF_SP UNW_TDEP_SP +#endif + +#ifndef tdep_get_func_addr +# define tdep_get_func_addr(as,addr,v) (*(v) = addr, 0) +#endif + +#ifndef DWARF_VAL_LOC +# define DWARF_IS_VAL_LOC(l) 0 +# define DWARF_VAL_LOC(c,v) DWARF_NULL_LOC +#endif + +#define UNW_ALIGN(x,a) (((x)+(a)-1UL)&~((a)-1UL)) + +#endif /* libunwind_i_h */ diff --git a/vendor/libunwind/include/mempool.h b/vendor/libunwind/include/mempool.h new file mode 100644 index 0000000000..60b9137280 --- /dev/null +++ b/vendor/libunwind/include/mempool.h @@ -0,0 +1,89 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002-2003 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef mempool_h +#define mempool_h + +/* Memory pools provide simple memory management of fixed-size + objects. Memory pools are used for two purposes: + + o To ensure a stack can be unwound even when a process + is out of memory. + + o To ensure a stack can be unwound at any time in a + multi-threaded process (e.g., even at a time when the normal + malloc-lock is taken, possibly by the very thread that is + being unwind). + + + To achieve the second objective, memory pools allocate memory + directly via mmap() system call (or an equivalent facility). + + The first objective is accomplished by reserving memory ahead of + time. Since the memory requirements of stack unwinding generally + depends on the complexity of the procedures being unwind, there is + no absolute guarantee that unwinding will always work, but in + practice, this should not be a serious problem. */ + +#include + +#include "libunwind_i.h" + +#define sos_alloc(s) UNWI_ARCH_OBJ(_sos_alloc)(s) +#define mempool_init(p,s,r) UNWI_ARCH_OBJ(_mempool_init)(p,s,r) +#define mempool_alloc(p) UNWI_ARCH_OBJ(_mempool_alloc)(p) +#define mempool_free(p,o) UNWI_ARCH_OBJ(_mempool_free)(p,o) + +/* The mempool structure should be treated as an opaque object. It's + declared here only to enable static allocation of mempools. */ +struct mempool + { + pthread_mutex_t lock; + size_t obj_size; /* object size (rounded up for alignment) */ + size_t chunk_size; /* allocation granularity */ + size_t reserve; /* minimum (desired) size of the free-list */ + size_t num_free; /* number of objects on the free-list */ + struct object + { + struct object *next; + } + *free_list; + }; + +/* Emergency allocation for one-time stuff that doesn't fit the memory + pool model. A limited amount of memory is available in this + fashion and once allocated, there is no way to free it. */ +extern void *sos_alloc (size_t size); + +/* Initialize POOL for an object size of OBJECT_SIZE bytes. RESERVE + is the number of objects that should be reserved for use under + tight memory situations. If it is zero, mempool attempts to pick a + reasonable default value. */ +extern void mempool_init (struct mempool *pool, + size_t obj_size, size_t reserve); +extern void *mempool_alloc (struct mempool *pool); +extern void mempool_free (struct mempool *pool, void *object); + +#endif /* mempool_h */ diff --git a/vendor/libunwind/include/remote.h b/vendor/libunwind/include/remote.h new file mode 100644 index 0000000000..99839f6622 --- /dev/null +++ b/vendor/libunwind/include/remote.h @@ -0,0 +1,129 @@ +#ifndef REMOTE_H +#define REMOTE_H + +/* Helper functions for accessing (remote) memory. These functions + assume that all addresses are naturally aligned (e.g., 32-bit + quantity is stored at a 32-bit-aligned address. */ + +#ifdef UNW_LOCAL_ONLY + +static inline int +fetch8 (unw_addr_space_t as UNUSED, unw_accessors_t *a UNUSED, + unw_word_t *addr, int8_t *valp, void *arg UNUSED) +{ + *valp = *(int8_t *) (uintptr_t) *addr; + *addr += 1; + return 0; +} + +static inline int +fetch16 (unw_addr_space_t as UNUSED, unw_accessors_t *a UNUSED, + unw_word_t *addr, int16_t *valp, void *arg UNUSED) +{ + *valp = *(int16_t *) (uintptr_t) *addr; + *addr += 2; + return 0; +} + +static inline int +fetch32 (unw_addr_space_t as UNUSED, unw_accessors_t *a UNUSED, + unw_word_t *addr, int32_t *valp, void *arg UNUSED) +{ + *valp = *(int32_t *) (uintptr_t) *addr; + *addr += 4; + return 0; +} + +static inline int +fetchw (unw_addr_space_t as UNUSED, unw_accessors_t *a UNUSED, + unw_word_t *addr, unw_word_t *valp, void *arg UNUSED) +{ + *valp = *(unw_word_t *) (uintptr_t) *addr; + *addr += sizeof (unw_word_t); + return 0; +} + +#else /* !UNW_LOCAL_ONLY */ + +#define WSIZE (sizeof (unw_word_t)) + +static inline int +fetch8 (unw_addr_space_t as, unw_accessors_t *a, + unw_word_t *addr, int8_t *valp, void *arg) +{ + unw_word_t val, aligned_addr = *addr & (~WSIZE + 1), off = *addr - aligned_addr; + int ret; + + *addr += 1; + + ret = (*a->access_mem) (as, aligned_addr, &val, 0, arg); + +#if UNW_BYTE_ORDER == UNW_LITTLE_ENDIAN + val >>= 8*off; +#else + val >>= 8*(WSIZE - 1 - off); +#endif + *valp = val & 0xff; + return ret; +} + +static inline int +fetch16 (unw_addr_space_t as, unw_accessors_t *a, + unw_word_t *addr, int16_t *valp, void *arg) +{ + unw_word_t val, aligned_addr = *addr & (~WSIZE + 1), off = *addr - aligned_addr; + int ret; + + if ((off & 0x1) != 0) + return -UNW_EINVAL; + + *addr += 2; + + ret = (*a->access_mem) (as, aligned_addr, &val, 0, arg); + +#if UNW_BYTE_ORDER == UNW_LITTLE_ENDIAN + val >>= 8*off; +#else + val >>= 8*(WSIZE - 2 - off); +#endif + *valp = val & 0xffff; + return ret; +} + +static inline int +fetch32 (unw_addr_space_t as, unw_accessors_t *a, + unw_word_t *addr, int32_t *valp, void *arg) +{ + unw_word_t val, aligned_addr = *addr & (~WSIZE + 1), off = *addr - aligned_addr; + int ret; + + if ((off & 0x3) != 0) + return -UNW_EINVAL; + + *addr += 4; + + ret = (*a->access_mem) (as, aligned_addr, &val, 0, arg); + +#if UNW_BYTE_ORDER == UNW_LITTLE_ENDIAN + val >>= 8*off; +#else + val >>= 8*(WSIZE - 4 - off); +#endif + *valp = val & 0xffffffff; + return ret; +} + +static inline int +fetchw (unw_addr_space_t as, unw_accessors_t *a, + unw_word_t *addr, unw_word_t *valp, void *arg) +{ + int ret; + + ret = (*a->access_mem) (as, *addr, valp, 0, arg); + *addr += WSIZE; + return ret; +} + +#endif /* !UNW_LOCAL_ONLY */ + +#endif /* REMOTE_H */ diff --git a/vendor/libunwind/include/tdep-aarch64/dwarf-config.h b/vendor/libunwind/include/tdep-aarch64/dwarf-config.h new file mode 100644 index 0000000000..f65db17ee6 --- /dev/null +++ b/vendor/libunwind/include/tdep-aarch64/dwarf-config.h @@ -0,0 +1,52 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2012 Tommi Rantala + Copyright (C) 2013 Linaro Limited + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef dwarf_config_h +#define dwarf_config_h + +/* This matches the value udes by GCC (see + gcc/config/aarch64/aarch64.h:DWARF_FRAME_REGISTERS. */ +#define DWARF_NUM_PRESERVED_REGS 97 + +/* Return TRUE if the ADDR_SPACE uses big-endian byte-order. */ +#define dwarf_is_big_endian(addr_space) 0 + +#define dwarf_to_unw_regnum(reg) (((reg) <= UNW_AARCH64_V31) ? (reg) : 0) + +/* Convert a pointer to a dwarf_cursor structure to a pointer to + unw_cursor_t. */ +#define dwarf_to_cursor(c) ((unw_cursor_t *) (c)) + +typedef struct dwarf_loc + { + unw_word_t val; +#ifndef UNW_LOCAL_ONLY + unw_word_t type; /* see DWARF_LOC_TYPE_* macros. */ +#endif + } +dwarf_loc_t; + +#endif /* dwarf_config_h */ diff --git a/vendor/libunwind/include/tdep-aarch64/jmpbuf.h b/vendor/libunwind/include/tdep-aarch64/jmpbuf.h new file mode 100644 index 0000000000..8479bf2b58 --- /dev/null +++ b/vendor/libunwind/include/tdep-aarch64/jmpbuf.h @@ -0,0 +1,41 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2013 Linaro Limited + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +/* Use glibc's jump-buffer indices; NPTL peeks at SP: */ + +/* FIXME for AArch64 */ + +#if defined __FreeBSD__ +#define JB_SP 1 +#define JB_RP 13 +#define JB_MASK_SAVED 0 +#define JB_MASK 22 +#define _JB_STK_SHIFT 0 +#else +#define JB_SP 13 +#define JB_RP 14 +#define JB_MASK_SAVED 15 +#define JB_MASK 16 +#endif diff --git a/vendor/libunwind/include/tdep-aarch64/libunwind_i.h b/vendor/libunwind/include/tdep-aarch64/libunwind_i.h new file mode 100644 index 0000000000..5a516e4fe4 --- /dev/null +++ b/vendor/libunwind/include/tdep-aarch64/libunwind_i.h @@ -0,0 +1,338 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2001-2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + Copyright (C) 2013 Linaro Limited + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef AARCH64_LIBUNWIND_I_H +#define AARCH64_LIBUNWIND_I_H + +/* Target-dependent definitions that are internal to libunwind but need + to be shared with target-independent code. */ + +#include +#include +#include + +#include "elf64.h" +#include "mempool.h" +#include "dwarf.h" + +typedef enum + { + UNW_AARCH64_FRAME_STANDARD = -2, /* regular fp, sp +/- offset */ + UNW_AARCH64_FRAME_SIGRETURN = -1, /* special sigreturn frame */ + UNW_AARCH64_FRAME_OTHER = 0, /* not cacheable (special or unrecognised) */ + UNW_AARCH64_FRAME_GUESSED = 1 /* guessed it was regular, but not known */ + } +unw_tdep_frame_type_t; + +typedef struct + { + uint64_t virtual_address; + int64_t frame_type : 2; /* unw_tdep_frame_type_t classification */ + int64_t last_frame : 1; /* non-zero if last frame in chain */ + int64_t cfa_reg_sp : 1; /* cfa dwarf base register is sp vs. fp */ + int64_t cfa_reg_offset : 30; /* cfa is at this offset from base register value */ + int64_t fp_cfa_offset : 30; /* fp saved at this offset from cfa (-1 = not saved) */ + int64_t lr_cfa_offset : 30; /* lr saved at this offset from cfa (-1 = not saved) */ + int64_t sp_cfa_offset : 30; /* sp saved at this offset from cfa (-1 = not saved) */ + } +unw_tdep_frame_t; + +#ifdef UNW_LOCAL_ONLY + +typedef unw_word_t aarch64_loc_t; + +#else /* !UNW_LOCAL_ONLY */ + +typedef struct aarch64_loc + { + unw_word_t w0, w1; + } +aarch64_loc_t; + +#endif /* !UNW_LOCAL_ONLY */ + +struct unw_addr_space + { + struct unw_accessors acc; + int big_endian; +#ifndef UNW_REMOTE_ONLY + unw_iterate_phdr_func_t iterate_phdr_function; +#endif + unw_caching_policy_t caching_policy; + _Atomic uint32_t cache_generation; + unw_word_t dyn_generation; /* see dyn-common.h */ + unw_word_t dyn_info_list_addr; /* (cached) dyn_info_list_addr */ + struct dwarf_rs_cache global_cache; + struct unw_debug_frame_list *debug_frames; + }; + +struct cursor + { + struct dwarf_cursor dwarf; /* must be first */ + + unw_tdep_frame_t frame_info; /* quick tracing assist info */ + + enum + { + AARCH64_SCF_NONE, + AARCH64_SCF_LINUX_RT_SIGFRAME, + AARCH64_SCF_FREEBSD_RT_SIGFRAME, + AARCH64_SCF_QNX_RT_SIGFRAME, + } + sigcontext_format; + unw_word_t sigcontext_addr; + unw_word_t sigcontext_sp; + unw_word_t sigcontext_pc; + int validate; + unw_context_t *uc; + }; + +static inline unw_context_t * +dwarf_get_uc(const struct dwarf_cursor *cursor) +{ + const struct cursor *c = (struct cursor *) cursor->as_arg; + return c->uc; +} + +#define DWARF_GET_LOC(l) ((l).val) + +#ifdef UNW_LOCAL_ONLY +# define DWARF_NULL_LOC DWARF_LOC (0, 0) +# define DWARF_IS_NULL_LOC(l) (DWARF_GET_LOC (l) == 0) +# define DWARF_LOC(r, t) ((dwarf_loc_t) { .val = (r) }) +# define DWARF_IS_REG_LOC(l) 0 +# define DWARF_REG_LOC(c,r) (DWARF_LOC((unw_word_t) \ + tdep_uc_addr(dwarf_get_uc(c), (r)), 0)) +# define DWARF_MEM_LOC(c,m) DWARF_LOC ((m), 0) +# define DWARF_FPREG_LOC(c,r) (DWARF_LOC((unw_word_t) \ + tdep_uc_addr(dwarf_get_uc(c), (r)), 0)) + +static inline int +dwarf_getfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t *val) +{ + if (!DWARF_GET_LOC (loc)) + return -1; + *val = *(unw_fpreg_t *) DWARF_GET_LOC (loc); + return 0; +} + +static inline int +dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val) +{ + if (!DWARF_GET_LOC (loc)) + return -1; + *(unw_fpreg_t *) DWARF_GET_LOC (loc) = val; + return 0; +} + +static inline int +dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val) +{ + if (!DWARF_GET_LOC (loc)) + return -1; + *val = *(unw_word_t *) DWARF_GET_LOC (loc); + return 0; +} + +static inline int +dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) +{ + if (!DWARF_GET_LOC (loc)) + return -1; + *(unw_word_t *) DWARF_GET_LOC (loc) = val; + return 0; +} + +#else /* !UNW_LOCAL_ONLY */ +# define DWARF_LOC_TYPE_FP (1 << 0) +# define DWARF_LOC_TYPE_REG (1 << 1) +# define DWARF_NULL_LOC DWARF_LOC (0, 0) + +static inline int +dwarf_is_null_loc(dwarf_loc_t l) +{ + return l.val == 0 && l.type == 0; +} + +# define DWARF_IS_NULL_LOC(l) dwarf_is_null_loc(l) +# define DWARF_LOC(r, t) ((dwarf_loc_t) { .val = (r), .type = (t) }) +# define DWARF_IS_REG_LOC(l) (((l).type & DWARF_LOC_TYPE_REG) != 0) +# define DWARF_IS_FP_LOC(l) (((l).type & DWARF_LOC_TYPE_FP) != 0) +# define DWARF_REG_LOC(c,r) DWARF_LOC((r), DWARF_LOC_TYPE_REG) +# define DWARF_MEM_LOC(c,m) DWARF_LOC ((m), 0) +# define DWARF_FPREG_LOC(c,r) DWARF_LOC((r), (DWARF_LOC_TYPE_REG \ + | DWARF_LOC_TYPE_FP)) + +static inline int +dwarf_getfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t *val) +{ + char *valp = (char *) &val; + unw_word_t addr; + int ret; + + if (DWARF_IS_NULL_LOC (loc)) + return -UNW_EBADREG; + + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_fpreg) (c->as, DWARF_GET_LOC (loc), + val, 0, c->as_arg); + + addr = DWARF_GET_LOC (loc); + if ((ret = (*c->as->acc.access_mem) (c->as, addr + 0, (unw_word_t *) valp, + 0, c->as_arg)) < 0) + return ret; + + return (*c->as->acc.access_mem) (c->as, addr + 4, (unw_word_t *) valp + 1, 0, + c->as_arg); +} + +static inline int +dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val) +{ + char *valp = (char *) &val; + unw_word_t addr; + int ret; + + if (DWARF_IS_NULL_LOC (loc)) + return -UNW_EBADREG; + + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_fpreg) (c->as, DWARF_GET_LOC (loc), + &val, 1, c->as_arg); + + addr = DWARF_GET_LOC (loc); + if ((ret = (*c->as->acc.access_mem) (c->as, addr + 0, (unw_word_t *) valp, + 1, c->as_arg)) < 0) + return ret; + + return (*c->as->acc.access_mem) (c->as, addr + 4, (unw_word_t *) valp + 1, + 1, c->as_arg); +} + +static inline int +dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val) +{ + if (DWARF_IS_NULL_LOC (loc)) + return -UNW_EBADREG; + + /* If a code-generator were to save a value of type unw_word_t in a + floating-point register, we would have to support this case. I + suppose it could happen with MMX registers, but does it really + happen? */ + assert (!DWARF_IS_FP_LOC (loc)); + + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), val, + 0, c->as_arg); + else + return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), val, + 0, c->as_arg); +} + +static inline int +dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) +{ + if (DWARF_IS_NULL_LOC (loc)) + return -UNW_EBADREG; + + /* If a code-generator were to save a value of type unw_word_t in a + floating-point register, we would have to support this case. I + suppose it could happen with MMX registers, but does it really + happen? */ + assert (!DWARF_IS_FP_LOC (loc)); + + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), &val, + 1, c->as_arg); + else + return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), &val, + 1, c->as_arg); +} + +#endif /* !UNW_LOCAL_ONLY */ + + + +#define tdep_getcontext_trace UNW_ARCH_OBJ(getcontext_trace) +#define tdep_init_done UNW_OBJ(init_done) +#define tdep_init UNW_OBJ(init) +/* Platforms that support UNW_INFO_FORMAT_TABLE need to define + tdep_search_unwind_table. */ +#define tdep_search_unwind_table dwarf_search_unwind_table +#define tdep_find_unwind_table dwarf_find_unwind_table +#define tdep_uc_addr UNW_OBJ(uc_addr) +#define tdep_get_elf_image UNW_ARCH_OBJ(get_elf_image) +#define tdep_get_exe_image_path UNW_ARCH_OBJ(get_exe_image_path) +#define tdep_access_reg UNW_OBJ(access_reg) +#define tdep_access_fpreg UNW_OBJ(access_fpreg) +#define tdep_fetch_frame(c,ip,n) do {} while(0) +#define tdep_cache_frame(c) 0 +#define tdep_reuse_frame(c,frame) do {} while(0) +#define tdep_stash_frame UNW_OBJ(tdep_stash_frame) +#define tdep_trace UNW_OBJ(tdep_trace) +#define tdep_strip_ptrauth_insn_mask UNW_OBJ(tdep_strip_ptrauth_insn_mask) + +#ifdef UNW_LOCAL_ONLY +# define tdep_find_proc_info(c,ip,n) \ + dwarf_find_proc_info((c)->as, (ip), &(c)->pi, (n), \ + (c)->as_arg) +# define tdep_put_unwind_info(as,pi,arg) \ + dwarf_put_unwind_info((as), (pi), (arg)) +#else +# define tdep_find_proc_info(c,ip,n) \ + (*(c)->as->acc.find_proc_info)((c)->as, (ip), &(c)->pi, (n), \ + (c)->as_arg) +# define tdep_put_unwind_info(as,pi,arg) \ + (*(as)->acc.put_unwind_info)((as), (pi), (arg)) +#endif + +#define tdep_get_as(c) ((c)->dwarf.as) +#define tdep_get_as_arg(c) ((c)->dwarf.as_arg) +#define tdep_get_ip(c) ((c)->dwarf.ip) +#define tdep_big_endian(as) ((as)->big_endian) + +extern atomic_bool tdep_init_done; + +extern void tdep_init (void); +extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, + unw_dyn_info_t *di, unw_proc_info_t *pi, + int need_unwind_info, void *arg); +extern void *tdep_uc_addr (unw_context_t *uc, int reg); +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen); +extern void tdep_get_exe_image_path (char *path); +extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, + unw_word_t *valp, int write); +extern int tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, + unw_fpreg_t *valp, int write); +extern int tdep_trace (unw_cursor_t *cursor, void **addresses, int *n); +extern void tdep_stash_frame (struct dwarf_cursor *c, + struct dwarf_reg_state *rs); +extern int tdep_getcontext_trace (unw_context_t *); +extern unw_word_t tdep_strip_ptrauth_insn_mask (unw_cursor_t *cursor, unw_word_t ip); + +#endif /* AARCH64_LIBUNWIND_I_H */ diff --git a/vendor/libunwind/include/tdep-arm/dwarf-config.h b/vendor/libunwind/include/tdep-arm/dwarf-config.h new file mode 100644 index 0000000000..f50228975e --- /dev/null +++ b/vendor/libunwind/include/tdep-arm/dwarf-config.h @@ -0,0 +1,51 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2012 Tommi Rantala + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef dwarf_config_h +#define dwarf_config_h + +/* This is FIRST_PSEUDO_REGISTER in GCC, since DWARF_FRAME_REGISTERS is not + explicitly defined. */ +#define DWARF_NUM_PRESERVED_REGS 128 + +#define dwarf_to_unw_regnum(reg) (((reg) < 16) ? (reg) : 0) + +/* Return TRUE if the ADDR_SPACE uses big-endian byte-order. */ +#define dwarf_is_big_endian(addr_space) 0 + +/* Convert a pointer to a dwarf_cursor structure to a pointer to + unw_cursor_t. */ +#define dwarf_to_cursor(c) ((unw_cursor_t *) (c)) + +typedef struct dwarf_loc + { + unw_word_t val; +#ifndef UNW_LOCAL_ONLY + unw_word_t type; /* see DWARF_LOC_TYPE_* macros. */ +#endif + } +dwarf_loc_t; + +#endif /* dwarf_config_h */ diff --git a/vendor/libunwind/include/tdep-arm/ex_tables.h b/vendor/libunwind/include/tdep-arm/ex_tables.h new file mode 100644 index 0000000000..9df5e0a9fa --- /dev/null +++ b/vendor/libunwind/include/tdep-arm/ex_tables.h @@ -0,0 +1,55 @@ +/* libunwind - a platform-independent unwind library + Copyright 2011 Linaro Limited + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef ARM_EX_TABLES_H +#define ARM_EX_TABLES_H + +typedef enum arm_exbuf_cmd { + ARM_EXIDX_CMD_FINISH, + ARM_EXIDX_CMD_DATA_PUSH, + ARM_EXIDX_CMD_DATA_POP, + ARM_EXIDX_CMD_REG_POP, + ARM_EXIDX_CMD_REG_TO_SP, + ARM_EXIDX_CMD_VFP_POP, + ARM_EXIDX_CMD_WREG_POP, + ARM_EXIDX_CMD_WCGR_POP, + ARM_EXIDX_CMD_RESERVED, + ARM_EXIDX_CMD_REFUSED, +} arm_exbuf_cmd_t; + +struct arm_exbuf_data +{ + arm_exbuf_cmd_t cmd; + uint32_t data; +}; + +#define arm_exidx_extract UNW_OBJ(arm_exidx_extract) +#define arm_exidx_decode UNW_OBJ(arm_exidx_decode) +#define arm_exidx_apply_cmd UNW_OBJ(arm_exidx_apply_cmd) + +int arm_exidx_extract (struct dwarf_cursor *c, uint8_t *buf); +int arm_exidx_decode (const uint8_t *buf, uint8_t len, struct dwarf_cursor *c); +int arm_exidx_apply_cmd (struct arm_exbuf_data *edata, struct dwarf_cursor *c); + +#endif // ARM_EX_TABLES_H diff --git a/vendor/libunwind/include/tdep-arm/jmpbuf.h b/vendor/libunwind/include/tdep-arm/jmpbuf.h new file mode 100644 index 0000000000..008e77f796 --- /dev/null +++ b/vendor/libunwind/include/tdep-arm/jmpbuf.h @@ -0,0 +1,32 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +/* Use glibc's jump-buffer indices; NPTL peeks at SP: */ + +/* FIXME for ARM! */ + +#define JB_SP 4 +#define JB_RP 5 +#define JB_MASK_SAVED 6 +#define JB_MASK 7 diff --git a/vendor/libunwind/include/tdep-arm/libunwind_i.h b/vendor/libunwind/include/tdep-arm/libunwind_i.h new file mode 100644 index 0000000000..35b13c79fb --- /dev/null +++ b/vendor/libunwind/include/tdep-arm/libunwind_i.h @@ -0,0 +1,337 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef ARM_LIBUNWIND_I_H +#define ARM_LIBUNWIND_I_H + +/* Target-dependent definitions that are internal to libunwind but need + to be shared with target-independent code. */ + +#include +#include +#include + +#include "elf32.h" +#include "mempool.h" +#include "dwarf.h" +#include "ex_tables.h" + +typedef enum + { + UNW_ARM_FRAME_SYSCALL = -3, /* r7 saved in r12, sp offset zero */ + UNW_ARM_FRAME_STANDARD = -2, /* regular r7, sp +/- offset */ + UNW_ARM_FRAME_SIGRETURN = -1, /* special sigreturn frame */ + UNW_ARM_FRAME_OTHER = 0, /* not cacheable (special or unrecognised) */ + UNW_ARM_FRAME_GUESSED = 1 /* guessed it was regular, but not known */ + } +unw_tdep_frame_type_t; + +typedef struct + { + uint32_t virtual_address; + int32_t frame_type : 3; /* unw_tdep_frame_type_t classification */ + int32_t last_frame : 1; /* non-zero if last frame in chain */ + int32_t cfa_reg_sp : 1; /* cfa dwarf base register is sp vs. r7 */ + int32_t cfa_reg_offset : 30; /* cfa is at this offset from base register value */ + int32_t r7_cfa_offset : 30; /* r7 saved at this offset from cfa (-1 = not saved) */ + int32_t lr_cfa_offset : 30; /* lr saved at this offset from cfa (-1 = not saved) */ + int32_t sp_cfa_offset : 30; /* sp saved at this offset from cfa (-1 = not saved) */ + } +unw_tdep_frame_t; + +struct unw_addr_space + { + struct unw_accessors acc; + int big_endian; +#ifndef UNW_REMOTE_ONLY + unw_iterate_phdr_func_t iterate_phdr_function; +#endif + unw_caching_policy_t caching_policy; + _Atomic uint32_t cache_generation; + unw_word_t dyn_generation; /* see dyn-common.h */ + unw_word_t dyn_info_list_addr; /* (cached) dyn_info_list_addr */ + struct dwarf_rs_cache global_cache; + struct unw_debug_frame_list *debug_frames; + }; + +struct cursor + { + struct dwarf_cursor dwarf; /* must be first */ + + unw_tdep_frame_t frame_info; /* quick tracing assist info */ + + enum + { + ARM_SCF_NONE, /* no signal frame */ + ARM_SCF_LINUX_SIGFRAME, /* non-RT signal frame, kernel >=2.6.18 */ + ARM_SCF_LINUX_RT_SIGFRAME, /* RT signal frame, kernel >=2.6.18 */ + ARM_SCF_LINUX_OLD_SIGFRAME, /* non-RT signal frame, kernel < 2.6.18 */ + ARM_SCF_LINUX_OLD_RT_SIGFRAME, /* RT signal frame, kernel < 2.6.18 */ + ARM_SCF_FREEBSD_SIGFRAME, /* FreeBSD sigframe */ + ARM_SCF_FREEBSD_SYSCALL, /* FreeBSD syscall stub */ + } + sigcontext_format; + unw_word_t sigcontext_addr; + unw_word_t sigcontext_sp; + unw_word_t sigcontext_pc; + int validate; + }; + +#define DWARF_GET_LOC(l) ((l).val) + +#ifdef UNW_LOCAL_ONLY +# define DWARF_NULL_LOC DWARF_LOC (0, 0) +# define DWARF_IS_NULL_LOC(l) (DWARF_GET_LOC (l) == 0) +# define DWARF_LOC(r, t) ((dwarf_loc_t) { .val = (r) }) +# define DWARF_IS_REG_LOC(l) 0 +# define DWARF_REG_LOC(c,r) (DWARF_LOC((unw_word_t) \ + tdep_uc_addr((c)->as_arg, (r)), 0)) +# define DWARF_MEM_LOC(c,m) DWARF_LOC ((m), 0) +# define DWARF_FPREG_LOC(c,r) (DWARF_LOC((unw_word_t) \ + tdep_uc_addr((c)->as_arg, (r)), 0)) + +static inline int +dwarf_getfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t *val) +{ + if (!DWARF_GET_LOC (loc)) + return -1; + *val = *(unw_fpreg_t *) DWARF_GET_LOC (loc); + return 0; +} + +static inline int +dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val) +{ + if (!DWARF_GET_LOC (loc)) + return -1; + *(unw_fpreg_t *) DWARF_GET_LOC (loc) = val; + return 0; +} + +static inline int +dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val) +{ + if (!DWARF_GET_LOC (loc)) + return -1; + *val = *(unw_word_t *) DWARF_GET_LOC (loc); + return 0; +} + +static inline int +dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) +{ + if (!DWARF_GET_LOC (loc)) + return -1; + *(unw_word_t *) DWARF_GET_LOC (loc) = val; + return 0; +} + +#else /* !UNW_LOCAL_ONLY */ +# define DWARF_LOC_TYPE_FP (1 << 0) +# define DWARF_LOC_TYPE_REG (1 << 1) +# define DWARF_NULL_LOC DWARF_LOC (0, 0) + +static inline int +dwarf_is_null_loc(dwarf_loc_t l) +{ + return l.val == 0 && l.type == 0; +} + +# define DWARF_IS_NULL_LOC(l) dwarf_is_null_loc(l) +# define DWARF_LOC(r, t) ((dwarf_loc_t) { .val = (r), .type = (t) }) +# define DWARF_IS_REG_LOC(l) (((l).type & DWARF_LOC_TYPE_REG) != 0) +# define DWARF_IS_FP_LOC(l) (((l).type & DWARF_LOC_TYPE_FP) != 0) +# define DWARF_REG_LOC(c,r) DWARF_LOC((r), DWARF_LOC_TYPE_REG) +# define DWARF_MEM_LOC(c,m) DWARF_LOC ((m), 0) +# define DWARF_FPREG_LOC(c,r) DWARF_LOC((r), (DWARF_LOC_TYPE_REG \ + | DWARF_LOC_TYPE_FP)) + +static inline int +dwarf_getfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t *val) +{ + char *valp = (char *) &val; + unw_word_t addr; + int ret; + + if (DWARF_IS_NULL_LOC (loc)) + return -UNW_EBADREG; + + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_fpreg) (c->as, DWARF_GET_LOC (loc), + val, 0, c->as_arg); + + addr = DWARF_GET_LOC (loc); + if ((ret = (*c->as->acc.access_mem) (c->as, addr + 0, (unw_word_t *) valp, + 0, c->as_arg)) < 0) + return ret; + + return (*c->as->acc.access_mem) (c->as, addr + 4, (unw_word_t *) valp + 1, 0, + c->as_arg); +} + +static inline int +dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val) +{ + char *valp = (char *) &val; + unw_word_t addr; + int ret; + + if (DWARF_IS_NULL_LOC (loc)) + return -UNW_EBADREG; + + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_fpreg) (c->as, DWARF_GET_LOC (loc), + &val, 1, c->as_arg); + + addr = DWARF_GET_LOC (loc); + if ((ret = (*c->as->acc.access_mem) (c->as, addr + 0, (unw_word_t *) valp, + 1, c->as_arg)) < 0) + return ret; + + return (*c->as->acc.access_mem) (c->as, addr + 4, (unw_word_t *) valp + 1, + 1, c->as_arg); +} + +static inline int +dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val) +{ + if (DWARF_IS_NULL_LOC (loc)) + return -UNW_EBADREG; + + /* If a code-generator were to save a value of type unw_word_t in a + floating-point register, we would have to support this case. I + suppose it could happen with MMX registers, but does it really + happen? */ + assert (!DWARF_IS_FP_LOC (loc)); + + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), val, + 0, c->as_arg); + else + return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), val, + 0, c->as_arg); +} + +static inline int +dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) +{ + if (DWARF_IS_NULL_LOC (loc)) + return -UNW_EBADREG; + + /* If a code-generator were to save a value of type unw_word_t in a + floating-point register, we would have to support this case. I + suppose it could happen with MMX registers, but does it really + happen? */ + assert (!DWARF_IS_FP_LOC (loc)); + + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), &val, + 1, c->as_arg); + else + return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), &val, + 1, c->as_arg); +} + +#endif /* !UNW_LOCAL_ONLY */ + +#define tdep_getcontext_trace unw_getcontext +#define tdep_init_done UNW_OBJ(init_done) +#define tdep_init UNW_OBJ(init) +#define arm_find_proc_info UNW_OBJ(find_proc_info) +#define arm_find_proc_info2 UNW_OBJ(find_proc_info2) +#define arm_put_unwind_info UNW_OBJ(put_unwind_info) +/* Platforms that support UNW_INFO_FORMAT_TABLE need to define + tdep_search_unwind_table. */ +#define tdep_search_unwind_table UNW_OBJ(search_unwind_table) +#define tdep_find_unwind_table dwarf_find_unwind_table +#define tdep_uc_addr UNW_ARCH_OBJ(uc_addr) +#define tdep_get_elf_image UNW_ARCH_OBJ(get_elf_image) +#define tdep_get_exe_image_path UNW_ARCH_OBJ(get_exe_image_path) +#define tdep_access_reg UNW_OBJ(access_reg) +#define tdep_access_fpreg UNW_OBJ(access_fpreg) +#define tdep_fetch_frame(c,ip,n) do {} while(0) +#define tdep_cache_frame(c) 0 +#define tdep_reuse_frame(c,frame) do {} while(0) +#define tdep_stash_frame UNW_OBJ(tdep_stash_frame) +#define tdep_trace UNW_OBJ(tdep_trace) + +#ifdef UNW_LOCAL_ONLY +# define tdep_find_proc_info(c,ip,n) \ + arm_find_proc_info((c)->as, (ip), &(c)->pi, (n), \ + (c)->as_arg) +# define tdep_put_unwind_info(as,pi,arg) \ + arm_put_unwind_info((as), (pi), (arg)) +#else +# define tdep_find_proc_info(c,ip,n) \ + (*(c)->as->acc.find_proc_info)((c)->as, (ip), &(c)->pi, (n), \ + (c)->as_arg) +# define tdep_put_unwind_info(as,pi,arg) \ + (*(as)->acc.put_unwind_info)((as), (pi), (arg)) +#endif + +#define tdep_get_as(c) ((c)->dwarf.as) +#define tdep_get_as_arg(c) ((c)->dwarf.as_arg) +#define tdep_get_ip(c) ((c)->dwarf.ip) +#define tdep_big_endian(as) ((as)->big_endian) + +extern atomic_bool tdep_init_done; + +extern void tdep_init (void); +extern int arm_find_proc_info (unw_addr_space_t as, unw_word_t ip, + unw_proc_info_t *pi, int need_unwind_info, + void *arg); +extern int arm_find_proc_info2 (unw_addr_space_t as, unw_word_t ip, + unw_proc_info_t *pi, int need_unwind_info, + void *arg, int methods); +extern void arm_put_unwind_info (unw_addr_space_t as, + unw_proc_info_t *pi, void *arg); +extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, + unw_dyn_info_t *di, unw_proc_info_t *pi, + int need_unwind_info, void *arg); +extern void *tdep_uc_addr (unw_tdep_context_t *uc, int reg); +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen); +extern void tdep_get_exe_image_path (char *path); +extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, + unw_word_t *valp, int write); +extern int tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, + unw_fpreg_t *valp, int write); +extern int tdep_trace (unw_cursor_t *cursor, void **addresses, int *n); +extern void tdep_stash_frame (struct dwarf_cursor *c, + struct dwarf_reg_state *rs); + +/* unwinding method selection support */ +#define UNW_ARM_METHOD_ALL 0xFF +#define UNW_ARM_METHOD_DWARF 0x01 +#define UNW_ARM_METHOD_FRAME 0x02 +#define UNW_ARM_METHOD_EXIDX 0x04 +#define UNW_ARM_METHOD_LR 0x08 + +#define unwi_unwind_method UNW_OBJ(unwind_method) +extern int unwi_unwind_method; + +#define UNW_TRY_METHOD(x) (unwi_unwind_method & x) + +#endif /* ARM_LIBUNWIND_I_H */ diff --git a/vendor/libunwind/include/tdep-riscv/dwarf-config.h b/vendor/libunwind/include/tdep-riscv/dwarf-config.h new file mode 100644 index 0000000000..78277761d8 --- /dev/null +++ b/vendor/libunwind/include/tdep-riscv/dwarf-config.h @@ -0,0 +1,50 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2003, 2005 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + + Modified for riscv by Zhaofeng Li + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef dwarf_config_h +#define dwarf_config_h + +/* 32 integer registers + 32 floating-point registers + 2 pseudo-registers */ +#define DWARF_NUM_PRESERVED_REGS 66 + +#define DWARF_REGNUM_MAP_LENGTH DWARF_NUM_PRESERVED_REGS + +/* Not big-endian. */ +#define dwarf_is_big_endian(addr_space) 0 + +/* Convert a pointer to a dwarf_cursor structure to a pointer to + unw_cursor_t. */ +#define dwarf_to_cursor(c) ((unw_cursor_t *) (c)) + +typedef struct dwarf_loc + { + unw_word_t val; + unw_word_t type; /* see RISCV_LOC_TYPE_* macros. */ + } +dwarf_loc_t; + +#endif /* dwarf_config_h */ diff --git a/vendor/libunwind/include/tdep-riscv/jmpbuf.h b/vendor/libunwind/include/tdep-riscv/jmpbuf.h new file mode 100644 index 0000000000..8831f6900c --- /dev/null +++ b/vendor/libunwind/include/tdep-riscv/jmpbuf.h @@ -0,0 +1,49 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2004 Hewlett-Packard Co + Contributed by Zhaofeng Li + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#if defined __linux__ + +/* https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/riscv/setjmp.S;h=0b92016b311b11aa9eeb62b38c670a262f1924c9;hb=HEAD */ +#define JB_SP 13 +#define JB_RP 0 + +#if __riscv_xlen == 64 + +/* GCC's internal structure for this depends on the floating-point ABI: + https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/riscv/rv64/jmp_buf-macros.h;h=be9199e514bf4f15f0612327b8b762e29a2b7862;hb=HEAD +*/ + +#if defined __riscv_float_abi_double +# define JB_MASK_SAVED (208>>3) +# define JB_MASK (216>>3) +#else +# error "Unsupported RISC-V floating point ABI" +#endif /* __riscv_float_abi_double */ + +#else +# error "Add offsets here" +#endif /* __riscv_xlen */ + +#endif diff --git a/vendor/libunwind/include/tdep-riscv/libunwind_i.h b/vendor/libunwind/include/tdep-riscv/libunwind_i.h new file mode 100644 index 0000000000..951de12a0b --- /dev/null +++ b/vendor/libunwind/include/tdep-riscv/libunwind_i.h @@ -0,0 +1,302 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + + Modified for riscv by Zhaofeng Li + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef RISCV_LIBUNWIND_I_H +#define RISCV_LIBUNWIND_I_H + +/* Target-dependent definitions that are internal to libunwind but need + to be shared with target-independent code. */ + +#include +#include +#include + +/* FIXME: Remote across address sizes? */ + +#if __riscv_xlen == 64 +# include "elf64.h" +#elif __riscv_xlen == 32 +# include "elf32.h" +#else +# error "Unsupported address size" +#endif + +#include "mempool.h" +#include "dwarf.h" + +typedef struct + { + /* no riscv-specific fast trace */ + } +unw_tdep_frame_t; + +struct unw_addr_space + { + struct unw_accessors acc; + + int big_endian; + unsigned int addr_size; + +#ifndef UNW_REMOTE_ONLY + unw_iterate_phdr_func_t iterate_phdr_function; +#endif + unw_caching_policy_t caching_policy; + _Atomic uint32_t cache_generation; + unw_word_t dyn_generation; /* see dyn-common.h */ + unw_word_t dyn_info_list_addr; /* (cached) dyn_info_list_addr */ + struct dwarf_rs_cache global_cache; + struct unw_debug_frame_list *debug_frames; +}; + +#define tdep_big_endian(as) ((as)->big_endian) + +struct cursor + { + struct dwarf_cursor dwarf; /* must be first */ + enum + { + RISCV_SCF_NONE, // 0 + RISCV_SCF_LINUX_RT_SIGFRAME, // 1 + } + sigcontext_format; + unw_word_t sigcontext_addr; + unw_word_t sigcontext_sp; + unw_word_t sigcontext_pc; + int validate; + ucontext_t *uc; + }; + +static inline ucontext_t * +dwarf_get_uc(const struct dwarf_cursor *cursor) +{ + const struct cursor *c = (struct cursor *) cursor->as_arg; + return c->uc; +} + +#define DWARF_GET_LOC(l) ((l).val) + +#ifdef UNW_LOCAL_ONLY +# define DWARF_NULL_LOC DWARF_LOC (0, 0) +# define DWARF_IS_NULL_LOC(l) (DWARF_GET_LOC (l) == 0) +# define DWARF_LOC(r, t) ((dwarf_loc_t) { .val = (r) }) +# define DWARF_IS_REG_LOC(l) 0 +# define DWARF_REG_LOC(c,r) (DWARF_LOC((unw_word_t) \ + tdep_uc_addr(dwarf_get_uc(c), (r)), 0)) +# define DWARF_MEM_LOC(c,m) DWARF_LOC ((m), 0) +# define DWARF_FPREG_LOC(c,r) (DWARF_LOC((unw_word_t) \ + tdep_uc_addr(dwarf_get_uc(c), (r)), 0)) + +static inline int +dwarf_getfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t *val) +{ + if (!DWARF_GET_LOC (loc)) + return -1; + *val = *(unw_fpreg_t *) (intptr_t) DWARF_GET_LOC (loc); + return 0; +} + +static inline int +dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val) +{ + if (!DWARF_GET_LOC (loc)) + return -1; + *(unw_fpreg_t *) (intptr_t) DWARF_GET_LOC (loc) = val; + return 0; +} + +static inline int +dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val) +{ + if (!DWARF_GET_LOC (loc)) + return -1; + *val = *(unw_word_t *) (intptr_t) DWARF_GET_LOC (loc); + return 0; +} + +static inline int +dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) +{ + if (!DWARF_GET_LOC (loc)) + return -1; + *(unw_word_t *) (intptr_t) DWARF_GET_LOC (loc) = val; + return 0; +} + +#else /* !UNW_LOCAL_ONLY */ +# define DWARF_LOC_TYPE_FP (1 << 0) +# define DWARF_LOC_TYPE_REG (1 << 1) +# define DWARF_NULL_LOC DWARF_LOC (0, 0) +# define DWARF_IS_NULL_LOC(l) \ + ({ dwarf_loc_t _l = (l); _l.val == 0 && _l.type == 0; }) +# define DWARF_LOC(r, t) ((dwarf_loc_t) { .val = (r), .type = (t) }) +# define DWARF_IS_REG_LOC(l) (((l).type & DWARF_LOC_TYPE_REG) != 0) +# define DWARF_IS_FP_LOC(l) (((l).type & DWARF_LOC_TYPE_FP) != 0) +# define DWARF_REG_LOC(c,r) DWARF_LOC((r), DWARF_LOC_TYPE_REG) +# define DWARF_MEM_LOC(c,m) DWARF_LOC ((m), 0) +# define DWARF_FPREG_LOC(c,r) DWARF_LOC((r), (DWARF_LOC_TYPE_REG \ + | DWARF_LOC_TYPE_FP)) + +static inline int +dwarf_getfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t *val) +{ + char *valp = (char *) &val; + unw_word_t addr; + + if (DWARF_IS_NULL_LOC (loc)) + return -UNW_EBADREG; + + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_fpreg) (c->as, DWARF_GET_LOC (loc), + val, 0, c->as_arg); + + /* FIXME: unw_word_t may not be equal to FLEN */ + addr = DWARF_GET_LOC (loc); +#if __riscv_xlen == __riscv_flen + return (*c->as->acc.access_mem) (c->as, addr, (unw_word_t *) valp, + 0, c->as_arg); +#else +# error "FIXME" +#endif +} + +static inline int +dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val) +{ + char *valp = (char *) &val; + unw_word_t addr; + + if (DWARF_IS_NULL_LOC (loc)) + return -UNW_EBADREG; + + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_fpreg) (c->as, DWARF_GET_LOC (loc), + &val, 1, c->as_arg); + + /* FIXME: unw_word_t may not be equal to FLEN */ + addr = DWARF_GET_LOC (loc); +#if __riscv_xlen == __riscv_flen + return (*c->as->acc.access_mem) (c->as, addr, (unw_word_t *) valp, + 1, c->as_arg); +#else +# error "FIXME" +#endif +} + +static inline int +dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val) +{ + if (DWARF_IS_NULL_LOC (loc)) + return -UNW_EBADREG; + + /* If a code-generator were to save a value of type unw_word_t in a + floating-point register, we would have to support this case. I + suppose it could happen with MMX registers, but does it really + happen? */ + assert (!DWARF_IS_FP_LOC (loc)); + + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), val, + 0, c->as_arg); + else + return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), val, + 0, c->as_arg); +} + +static inline int +dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) +{ + if (DWARF_IS_NULL_LOC (loc)) + return -UNW_EBADREG; + + /* If a code-generator were to save a value of type unw_word_t in a + floating-point register, we would have to support this case. I + suppose it could happen with MMX registers, but does it really + happen? */ + assert (!DWARF_IS_FP_LOC (loc)); + + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), &val, + 1, c->as_arg); + else + return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), &val, + 1, c->as_arg); +} + +#endif /* !UNW_LOCAL_ONLY */ + +#define tdep_getcontext_trace unw_getcontext +#define tdep_init_done UNW_OBJ(init_done) +#define tdep_init UNW_OBJ(init) +/* Platforms that support UNW_INFO_FORMAT_TABLE need to define + tdep_search_unwind_table. */ +#define tdep_search_unwind_table dwarf_search_unwind_table +#define tdep_find_unwind_table dwarf_find_unwind_table +#define tdep_uc_addr UNW_ARCH_OBJ(uc_addr) +#define tdep_get_elf_image UNW_ARCH_OBJ(get_elf_image) +#define tdep_get_exe_image_path UNW_ARCH_OBJ(get_exe_image_path) +#define tdep_access_reg UNW_OBJ(access_reg) +#define tdep_access_fpreg UNW_OBJ(access_fpreg) +#define tdep_fetch_frame(c,ip,n) do {} while(0) +#define tdep_cache_frame(c) 0 +#define tdep_reuse_frame(c,frame) do {} while(0) +#define tdep_stash_frame(c,rs) do {} while(0) +#define tdep_trace(cur,addr,n) (-UNW_ENOINFO) + +#ifdef UNW_LOCAL_ONLY +# define tdep_find_proc_info(c,ip,n) \ + dwarf_find_proc_info((c)->as, (ip), &(c)->pi, (n), \ + (c)->as_arg) +# define tdep_put_unwind_info(as,pi,arg) \ + dwarf_put_unwind_info((as), (pi), (arg)) +#else +# define tdep_find_proc_info(c,ip,n) \ + (*(c)->as->acc.find_proc_info)((c)->as, (ip), &(c)->pi, (n), \ + (c)->as_arg) +# define tdep_put_unwind_info(as,pi,arg) \ + (*(as)->acc.put_unwind_info)((as), (pi), (arg)) +#endif + +#define tdep_get_as(c) ((c)->dwarf.as) +#define tdep_get_as_arg(c) ((c)->dwarf.as_arg) +#define tdep_get_ip(c) ((c)->dwarf.ip) + +extern atomic_bool tdep_init_done; + +extern void tdep_init (void); +extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, + unw_dyn_info_t *di, unw_proc_info_t *pi, + int need_unwind_info, void *arg); +extern void *tdep_uc_addr (ucontext_t *uc, int reg); +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen); +extern void tdep_get_exe_image_path (char *path); +extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, + unw_word_t *valp, int write); +extern int tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, + unw_fpreg_t *valp, int write); + +#endif /* RISCV_LIBUNWIND_I_H */ diff --git a/vendor/libunwind/include/tdep-x86/dwarf-config.h b/vendor/libunwind/include/tdep-x86/dwarf-config.h new file mode 100644 index 0000000000..11398e4e62 --- /dev/null +++ b/vendor/libunwind/include/tdep-x86/dwarf-config.h @@ -0,0 +1,50 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef dwarf_config_h +#define dwarf_config_h + +/* This matches the value used by GCC (see + gcc/config/i386.h:DWARF_FRAME_REGISTERS), which leaves plenty of + room for expansion. */ +#define DWARF_NUM_PRESERVED_REGS 17 + +#define DWARF_REGNUM_MAP_LENGTH 19 + +/* Return TRUE if the ADDR_SPACE uses big-endian byte-order. */ +#define dwarf_is_big_endian(addr_space) 0 + +/* Convert a pointer to a dwarf_cursor structure to a pointer to + unw_cursor_t. */ +#define dwarf_to_cursor(c) ((unw_cursor_t *) (c)) + +typedef struct dwarf_loc + { + unw_word_t val; + unw_word_t type; /* see X86_LOC_TYPE_* macros. */ + } +dwarf_loc_t; + +#endif /* dwarf_config_h */ diff --git a/vendor/libunwind/include/tdep-x86/jmpbuf.h b/vendor/libunwind/include/tdep-x86/jmpbuf.h new file mode 100644 index 0000000000..625dac3269 --- /dev/null +++ b/vendor/libunwind/include/tdep-x86/jmpbuf.h @@ -0,0 +1,43 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +/* Use glibc's jump-buffer indices; NPTL peeks at SP: */ + +#if defined __linux__ + +#define JB_SP 4 +#define JB_RP 5 +#define JB_MASK_SAVED 6 +#define JB_MASK 7 + +#elif defined __FreeBSD__ + +#define JB_SP 2 +#define JB_RP 0 +#define JB_MASK_SAVED 11 +#define JB_MASK 7 +#define _JB_STK_SHIFT 4 + +#endif diff --git a/vendor/libunwind/include/tdep-x86/libunwind_i.h b/vendor/libunwind/include/tdep-x86/libunwind_i.h new file mode 100644 index 0000000000..58e583c3b3 --- /dev/null +++ b/vendor/libunwind/include/tdep-x86/libunwind_i.h @@ -0,0 +1,274 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002-2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef X86_LIBUNWIND_I_H +#define X86_LIBUNWIND_I_H + +/* Target-dependent definitions that are internal to libunwind but need + to be shared with target-independent code. */ + +#include +#include +#include + +#include "elf32.h" +#include "mempool.h" +#include "dwarf.h" + +typedef struct + { + /* no x86-specific fast trace */ + } +unw_tdep_frame_t; + +struct unw_addr_space + { + struct unw_accessors acc; +#ifndef UNW_REMOTE_ONLY + unw_iterate_phdr_func_t iterate_phdr_function; +#endif + unw_caching_policy_t caching_policy; + _Atomic uint32_t cache_generation; + unw_word_t dyn_generation; /* see dyn-common.h */ + unw_word_t dyn_info_list_addr; /* (cached) dyn_info_list_addr */ + struct dwarf_rs_cache global_cache; + struct unw_debug_frame_list *debug_frames; + }; + +struct cursor + { + struct dwarf_cursor dwarf; /* must be first */ + + /* Format of sigcontext structure and address at which it is + stored: */ + enum + { + X86_SCF_NONE, /* no signal frame encountered */ + X86_SCF_LINUX_SIGFRAME, /* Linux x86 sigcontext */ + X86_SCF_LINUX_RT_SIGFRAME, /* POSIX ucontext_t */ + X86_SCF_FREEBSD_SIGFRAME, /* FreeBSD x86 sigcontext */ + X86_SCF_FREEBSD_SIGFRAME4, /* FreeBSD 4.x x86 sigcontext */ + X86_SCF_FREEBSD_OSIGFRAME, /* FreeBSD pre-4.x x86 sigcontext */ + X86_SCF_FREEBSD_SYSCALL, /* FreeBSD x86 syscall */ + } + sigcontext_format; + unw_word_t sigcontext_addr; + int validate; + ucontext_t *uc; + }; + +static inline ucontext_t * +dwarf_get_uc(const struct dwarf_cursor *cursor) +{ + const struct cursor *c = (struct cursor *) cursor->as_arg; + return c->uc; +} + +#define DWARF_GET_LOC(l) ((l).val) +# define DWARF_LOC_TYPE_MEM (0 << 0) +# define DWARF_LOC_TYPE_FP (1 << 0) +# define DWARF_LOC_TYPE_REG (1 << 1) +# define DWARF_LOC_TYPE_VAL (1 << 2) + +# define DWARF_IS_REG_LOC(l) (((l).type & DWARF_LOC_TYPE_REG) != 0) +# define DWARF_IS_FP_LOC(l) (((l).type & DWARF_LOC_TYPE_FP) != 0) +# define DWARF_IS_MEM_LOC(l) ((l).type == DWARF_LOC_TYPE_MEM) +# define DWARF_IS_VAL_LOC(l) (((l).type & DWARF_LOC_TYPE_VAL) != 0) + +# define DWARF_LOC(r, t) ((dwarf_loc_t) { .val = (r), .type = (t) }) +# define DWARF_NULL_LOC DWARF_LOC (0, 0) +# define DWARF_IS_NULL_LOC(l) \ + ({ dwarf_loc_t _l = (l); _l.val == 0 && _l.type == 0; }) +# define DWARF_VAL_LOC(c,v) DWARF_LOC ((v), DWARF_LOC_TYPE_VAL) +# define DWARF_MEM_LOC(c,m) DWARF_LOC ((m), DWARF_LOC_TYPE_MEM) + +#ifdef UNW_LOCAL_ONLY +# define DWARF_REG_LOC(c,r) (DWARF_LOC((unw_word_t) \ + tdep_uc_addr(dwarf_get_uc(c), (r)), 0)) +# define DWARF_FPREG_LOC(c,r) (DWARF_LOC((unw_word_t) \ + tdep_uc_addr(dwarf_get_uc(c), (r)), 0)) + +static inline int +dwarf_getfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t *val) +{ + if (!DWARF_GET_LOC (loc)) + return -1; + *val = *(unw_fpreg_t *) DWARF_GET_LOC (loc); + return 0; +} + +static inline int +dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val) +{ + if (!DWARF_GET_LOC (loc)) + return -1; + *(unw_fpreg_t *) DWARF_GET_LOC (loc) = val; + return 0; +} + +#else /* !UNW_LOCAL_ONLY */ +# define DWARF_REG_LOC(c,r) DWARF_LOC((r), DWARF_LOC_TYPE_REG) +# define DWARF_FPREG_LOC(c,r) DWARF_LOC((r), (DWARF_LOC_TYPE_REG \ + | DWARF_LOC_TYPE_FP)) + +static inline int +dwarf_getfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t *val) +{ + char *valp = (char *) &val; + unw_word_t addr; + int ret; + + if (DWARF_IS_NULL_LOC (loc)) + return -UNW_EBADREG; + + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_fpreg) (c->as, DWARF_GET_LOC (loc), + val, 0, c->as_arg); + + addr = DWARF_GET_LOC (loc); + if ((ret = (*c->as->acc.access_mem) (c->as, addr + 0, (unw_word_t *) valp, + 0, c->as_arg)) < 0) + return ret; + + return (*c->as->acc.access_mem) (c->as, addr + 4, (unw_word_t *) valp + 1, 0, + c->as_arg); +} + +static inline int +dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val) +{ + char *valp = (char *) &val; + unw_word_t addr; + int ret; + + if (DWARF_IS_NULL_LOC (loc)) + return -UNW_EBADREG; + + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_fpreg) (c->as, DWARF_GET_LOC (loc), + &val, 1, c->as_arg); + + addr = DWARF_GET_LOC (loc); + if ((ret = (*c->as->acc.access_mem) (c->as, addr + 0, (unw_word_t *) valp, + 1, c->as_arg)) < 0) + return ret; + + return (*c->as->acc.access_mem) (c->as, addr + 4, (unw_word_t *) valp + 1, + 1, c->as_arg); +} + +#endif /* !UNW_LOCAL_ONLY */ + +static inline int +dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val) +{ + if (DWARF_IS_NULL_LOC (loc)) + return -UNW_EBADREG; + + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), val, + 0, c->as_arg); + if (DWARF_IS_MEM_LOC (loc)) + return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), val, + 0, c->as_arg); + assert(DWARF_IS_VAL_LOC (loc)); + *val = DWARF_GET_LOC (loc); + return 0; +} + +static inline int +dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) +{ + assert(!DWARF_IS_VAL_LOC (loc)); + + if (DWARF_IS_NULL_LOC (loc)) + return -UNW_EBADREG; + + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), &val, + 1, c->as_arg); + else + return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), &val, + 1, c->as_arg); +} + +// For historical reasons, the DWARF numbering does not match the libunwind +// numbering, necessitating this override +#define TDEP_DWARF_SP 4 + +#define tdep_getcontext_trace unw_getcontext +#define tdep_init_done UNW_OBJ(init_done) +#define tdep_init UNW_OBJ(init) +/* Platforms that support UNW_INFO_FORMAT_TABLE need to define + tdep_search_unwind_table. */ +#define tdep_search_unwind_table dwarf_search_unwind_table +#define tdep_find_unwind_table dwarf_find_unwind_table +#define tdep_uc_addr UNW_ARCH_OBJ(uc_addr) +#define tdep_get_elf_image UNW_ARCH_OBJ(get_elf_image) +#define tdep_get_exe_image_path UNW_ARCH_OBJ(get_exe_image_path) +#define tdep_access_reg UNW_OBJ(access_reg) +#define tdep_access_fpreg UNW_OBJ(access_fpreg) +#define tdep_fetch_frame(c,ip,n) do {} while(0) +#define tdep_cache_frame(c) 0 +#define tdep_reuse_frame(c,frame) do {} while(0) +#define tdep_stash_frame(c,rs) do {} while(0) +#define tdep_trace(cur,addr,n) (-UNW_ENOINFO) + +#ifdef UNW_LOCAL_ONLY +# define tdep_find_proc_info(c,ip,n) \ + dwarf_find_proc_info((c)->as, (ip), &(c)->pi, (n), \ + (c)->as_arg) +# define tdep_put_unwind_info(as,pi,arg) \ + dwarf_put_unwind_info((as), (pi), (arg)) +#else +# define tdep_find_proc_info(c,ip,n) \ + (*(c)->as->acc.find_proc_info)((c)->as, (ip), &(c)->pi, (n), \ + (c)->as_arg) +# define tdep_put_unwind_info(as,pi,arg) \ + (*(as)->acc.put_unwind_info)((as), (pi), (arg)) +#endif + +#define tdep_get_as(c) ((c)->dwarf.as) +#define tdep_get_as_arg(c) ((c)->dwarf.as_arg) +#define tdep_get_ip(c) ((c)->dwarf.ip) +#define tdep_big_endian(as) 0 + +extern atomic_bool tdep_init_done; + +extern void tdep_init (void); +extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, + unw_dyn_info_t *di, unw_proc_info_t *pi, + int need_unwind_info, void *arg); +extern void *tdep_uc_addr (ucontext_t *uc, int reg); +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen); +extern void tdep_get_exe_image_path (char *path); +extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, + unw_word_t *valp, int write); +extern int tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, + unw_fpreg_t *valp, int write); + +#endif /* X86_LIBUNWIND_I_H */ diff --git a/vendor/libunwind/include/tdep-x86_64/dwarf-config.h b/vendor/libunwind/include/tdep-x86_64/dwarf-config.h new file mode 100644 index 0000000000..ff77808e06 --- /dev/null +++ b/vendor/libunwind/include/tdep-x86_64/dwarf-config.h @@ -0,0 +1,57 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2003, 2005 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +/* copy of include/tdep-x86/dwarf-config.h, modified slightly for x86-64 + some consolidation is possible here */ + +#ifndef dwarf_config_h +#define dwarf_config_h + +/* XXX need to verify if this value is correct */ +#ifdef CONFIG_MSABI_SUPPORT +#define DWARF_NUM_PRESERVED_REGS 33 +#else +#define DWARF_NUM_PRESERVED_REGS 17 +#endif + +#define DWARF_REGNUM_MAP_LENGTH DWARF_NUM_PRESERVED_REGS + +/* Return TRUE if the ADDR_SPACE uses big-endian byte-order. */ +#define dwarf_is_big_endian(addr_space) 0 + +/* Convert a pointer to a dwarf_cursor structure to a pointer to + unw_cursor_t. */ +#define dwarf_to_cursor(c) ((unw_cursor_t *) (c)) + +typedef struct dwarf_loc + { + unw_word_t val; + unw_word_t type; /* see X86_LOC_TYPE_* macros. */ + } +dwarf_loc_t; + +#endif /* dwarf_config_h */ diff --git a/vendor/libunwind/include/tdep-x86_64/jmpbuf.h b/vendor/libunwind/include/tdep-x86_64/jmpbuf.h new file mode 100644 index 0000000000..c5dd87a777 --- /dev/null +++ b/vendor/libunwind/include/tdep-x86_64/jmpbuf.h @@ -0,0 +1,49 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#if defined __linux__ || defined __sun + +/* Use glibc's jump-buffer indices; NPTL peeks at SP: + https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=blob;f=sysdeps/x86_64/jmpbuf-offsets.h;h=ea94a1f90554deecceaf995ca5ee485ae8bffab7;hb=HEAD */ + +#define JB_SP 6 +#define JB_RP 7 +#define JB_MASK_SAVED 8 +#define JB_MASK 9 + +#elif defined __FreeBSD__ + +#define JB_SP 2 +#define JB_RP 0 +#ifdef __amd64__ +#define JB_MASK_SAVED 11 +#else +/* Pretend the ip cannot be 0 and mask is always saved */ +#define JB_MASK_SAVED 0 +#endif +#define JB_MASK 9 +#define _JB_STK_SHIFT 8 + +#endif diff --git a/vendor/libunwind/include/tdep-x86_64/libunwind_i.h b/vendor/libunwind/include/tdep-x86_64/libunwind_i.h new file mode 100644 index 0000000000..7ec16aafdc --- /dev/null +++ b/vendor/libunwind/include/tdep-x86_64/libunwind_i.h @@ -0,0 +1,299 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002-2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef X86_64_LIBUNWIND_I_H +#define X86_64_LIBUNWIND_I_H + +/* Target-dependent definitions that are internal to libunwind but need + to be shared with target-independent code. */ + +#include +#include +#include +#include + +#include "elf64.h" +#include "mempool.h" +#include "dwarf.h" + +typedef enum + { + UNW_X86_64_FRAME_ALIGNED = -3, /* frame stack pointer aligned */ + UNW_X86_64_FRAME_STANDARD = -2, /* regular rbp, rsp +/- offset */ + UNW_X86_64_FRAME_SIGRETURN = -1, /* special sigreturn frame */ + UNW_X86_64_FRAME_OTHER = 0, /* not cacheable (special or unrecognised) */ + UNW_X86_64_FRAME_GUESSED = 1 /* guessed it was regular, but not known */ + } +unw_tdep_frame_type_t; + +typedef struct + { + uint64_t virtual_address; + int64_t frame_type : 3; /* unw_tdep_frame_type_t classification */ + int64_t last_frame : 1; /* non-zero if last frame in chain */ + int64_t cfa_reg_rsp : 1; /* cfa dwarf base register is rsp vs. rbp */ + int64_t cfa_reg_offset : 29; /* cfa is at this offset from base register value */ + int64_t rbp_cfa_offset : 15; /* rbp saved at this offset from cfa (-1 = not saved) */ + int64_t rsp_cfa_offset : 15; /* rsp saved at this offset from cfa (-1 = not saved) */ + } +unw_tdep_frame_t; + +struct unw_addr_space + { + struct unw_accessors acc; +#ifndef UNW_REMOTE_ONLY + unw_iterate_phdr_func_t iterate_phdr_function; +#endif + unw_caching_policy_t caching_policy; + _Atomic uint32_t cache_generation; + unw_word_t dyn_generation; /* see dyn-common.h */ + unw_word_t dyn_info_list_addr; /* (cached) dyn_info_list_addr */ + struct dwarf_rs_cache global_cache; + struct unw_debug_frame_list *debug_frames; + }; + +struct cursor + { + struct dwarf_cursor dwarf; /* must be first */ + + unw_tdep_frame_t frame_info; /* quick tracing assist info */ + + /* Format of sigcontext structure and address at which it is + stored: */ + enum + { + X86_64_SCF_NONE, /* no signal frame encountered */ + X86_64_SCF_LINUX_RT_SIGFRAME, /* Linux ucontext_t */ + X86_64_SCF_FREEBSD_SIGFRAME, /* FreeBSD signal frame */ + X86_64_SCF_FREEBSD_SYSCALL, /* FreeBSD syscall */ + X86_64_SCF_SOLARIS_SIGFRAME, /* illumos/Solaris signal frame */ + } + sigcontext_format; + unw_word_t sigcontext_addr; + }; + +#define AS_ARG_UCONTEXT_MASK ~0x1UL +#define AS_ARG_VALIDATE_MASK 0x1UL + +#define AS_ARG_GET_UC_PTR(arg) \ + ((ucontext_t *) ((uintptr_t) arg & AS_ARG_UCONTEXT_MASK)) +#define AS_ARG_GET_VALIDATE(arg) \ + ((int) ((uintptr_t) arg & AS_ARG_VALIDATE_MASK)) + +static inline ucontext_t * +dwarf_get_uc(const struct dwarf_cursor *cursor) +{ + assert(cursor->as == unw_local_addr_space); + return AS_ARG_GET_UC_PTR(cursor->as_arg); +} + +static inline int +dwarf_get_validate(const struct dwarf_cursor *cursor) +{ + assert(cursor->as == unw_local_addr_space); + return AS_ARG_GET_VALIDATE(cursor->as_arg); +} + +static inline void +dwarf_set_validate(const struct dwarf_cursor *cursor, const int validate) +{ + assert(cursor->as == unw_local_addr_space); + uintptr_t *packed_args = (uintptr_t *) &cursor->as_arg; + *packed_args |= (AS_ARG_VALIDATE_MASK & validate); +} + +static inline void * +dwarf_build_as_arg(const ucontext_t *uc, const int validate) { + uintptr_t packed_args = (uintptr_t) uc; + assert((packed_args & AS_ARG_VALIDATE_MASK) == 0); + packed_args |= (AS_ARG_VALIDATE_MASK & validate); + return (void *) packed_args; +} + +#define DWARF_GET_LOC(l) ((l).val) +# define DWARF_LOC_TYPE_MEM (0 << 0) +# define DWARF_LOC_TYPE_FP (1 << 0) +# define DWARF_LOC_TYPE_REG (1 << 1) +# define DWARF_LOC_TYPE_VAL (1 << 2) + +# define DWARF_IS_REG_LOC(l) (((l).type & DWARF_LOC_TYPE_REG) != 0) +# define DWARF_IS_FP_LOC(l) (((l).type & DWARF_LOC_TYPE_FP) != 0) +# define DWARF_IS_MEM_LOC(l) ((l).type == DWARF_LOC_TYPE_MEM) +# define DWARF_IS_VAL_LOC(l) (((l).type & DWARF_LOC_TYPE_VAL) != 0) + +# define DWARF_LOC(r, t) ((dwarf_loc_t) { .val = (r), .type = (t) }) +# define DWARF_VAL_LOC(c,v) DWARF_LOC ((v), DWARF_LOC_TYPE_VAL) +# define DWARF_MEM_LOC(c,m) DWARF_LOC ((m), DWARF_LOC_TYPE_MEM) + +#ifdef UNW_LOCAL_ONLY +# define DWARF_NULL_LOC DWARF_LOC (0, 0) +# define DWARF_IS_NULL_LOC(l) (DWARF_GET_LOC (l) == 0) +# define DWARF_REG_LOC(c,r) (DWARF_LOC((unw_word_t) \ + x86_64_r_uc_addr(dwarf_get_uc(c), (r)), 0)) +# define DWARF_FPREG_LOC(c,r) (DWARF_LOC((unw_word_t) \ + x86_64_r_uc_addr(dwarf_get_uc(c), (r)), 0)) + +#else /* !UNW_LOCAL_ONLY */ + +# define DWARF_NULL_LOC DWARF_LOC (0, 0) + +static inline int +dwarf_is_null_loc(dwarf_loc_t l) +{ + return l.val == 0 && l.type == 0; +} + +# define DWARF_IS_NULL_LOC(l) dwarf_is_null_loc(l) +# define DWARF_REG_LOC(c,r) DWARF_LOC((r), DWARF_LOC_TYPE_REG) +# define DWARF_FPREG_LOC(c,r) DWARF_LOC((r), (DWARF_LOC_TYPE_REG \ + | DWARF_LOC_TYPE_FP)) + +#endif /* !UNW_LOCAL_ONLY */ + +static inline int +dwarf_getfp (struct dwarf_cursor *c UNUSED, dwarf_loc_t loc, unw_fpreg_t *val UNUSED) +{ + if (DWARF_IS_NULL_LOC (loc)) + return -UNW_EBADREG; + + abort (); +} + +static inline int +dwarf_putfp (struct dwarf_cursor *c UNUSED, dwarf_loc_t loc, unw_fpreg_t val UNUSED) +{ + if (DWARF_IS_NULL_LOC (loc)) + return -UNW_EBADREG; + + abort (); +} + +static inline int +dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val) +{ + if (DWARF_IS_NULL_LOC (loc)) + return -UNW_EBADREG; + + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), val, + 0, c->as_arg); + if (DWARF_IS_MEM_LOC (loc)) + return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), val, + 0, c->as_arg); + assert(DWARF_IS_VAL_LOC (loc)); + *val = DWARF_GET_LOC (loc); + return 0; +} + +static inline int +dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) +{ + assert(!DWARF_IS_VAL_LOC (loc)); + + if (DWARF_IS_NULL_LOC (loc)) + return -UNW_EBADREG; + + if (DWARF_IS_REG_LOC (loc)) + return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), &val, + 1, c->as_arg); + else + return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), &val, + 1, c->as_arg); +} + +#define tdep_getcontext_trace UNW_ARCH_OBJ(getcontext_trace) +#define tdep_init_done UNW_OBJ(init_done) +#define tdep_init UNW_OBJ(init) +/* Platforms that support UNW_INFO_FORMAT_TABLE need to define + tdep_search_unwind_table. */ +#define tdep_search_unwind_table dwarf_search_unwind_table +#define tdep_find_unwind_table dwarf_find_unwind_table +#define tdep_get_elf_image UNW_ARCH_OBJ(get_elf_image) +#define tdep_get_exe_image_path UNW_ARCH_OBJ(get_exe_image_path) +#define tdep_access_reg UNW_OBJ(access_reg) +#define tdep_access_fpreg UNW_OBJ(access_fpreg) +#if __linux__ +# define tdep_fetch_frame UNW_OBJ(fetch_frame) +# define tdep_cache_frame UNW_OBJ(cache_frame) +# define tdep_reuse_frame UNW_OBJ(reuse_frame) +#else +# define tdep_fetch_frame(c,ip,n) do {} while(0) +# define tdep_cache_frame(c) 0 +# define tdep_reuse_frame(c,frame) do {} while(0) +#endif +#define tdep_stash_frame UNW_OBJ(stash_frame) +#define tdep_trace UNW_OBJ(tdep_trace) +#define x86_64_r_uc_addr UNW_OBJ(r_uc_addr) + +#ifdef UNW_LOCAL_ONLY +# define tdep_find_proc_info(c,ip,n) \ + dwarf_find_proc_info((c)->as, (ip), &(c)->pi, (n), \ + (c)->as_arg) +# define tdep_put_unwind_info(as,pi,arg) \ + dwarf_put_unwind_info((as), (pi), (arg)) +#else +# define tdep_find_proc_info(c,ip,n) \ + (*(c)->as->acc.find_proc_info)((c)->as, (ip), &(c)->pi, (n), \ + (c)->as_arg) +# define tdep_put_unwind_info(as,pi,arg) \ + (*(as)->acc.put_unwind_info)((as), (pi), (arg)) +#endif + +#define tdep_get_as(c) ((c)->dwarf.as) +#define tdep_get_as_arg(c) ((c)->dwarf.as_arg) +#define tdep_get_ip(c) ((c)->dwarf.ip) +#define tdep_big_endian(as) 0 + +extern atomic_bool tdep_init_done; + +extern void tdep_init (void); +extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, + unw_dyn_info_t *di, unw_proc_info_t *pi, + int need_unwind_info, void *arg); +extern void *x86_64_r_uc_addr (ucontext_t *uc, int reg); +extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen); +extern void tdep_get_exe_image_path (char *path); +extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg, + unw_word_t *valp, int write); +extern int tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, + unw_fpreg_t *valp, int write); +#if __linux__ +extern void tdep_fetch_frame (struct dwarf_cursor *c, unw_word_t ip, + int need_unwind_info); +extern int tdep_cache_frame (struct dwarf_cursor *c); +extern void tdep_reuse_frame (struct dwarf_cursor *c, + int frame); +#endif +extern void tdep_stash_frame (struct dwarf_cursor *c, + struct dwarf_reg_state *rs); + +extern int tdep_getcontext_trace (unw_tdep_context_t *); +extern int tdep_trace (unw_cursor_t *cursor, void **addresses, int *n); + +#endif /* X86_64_LIBUNWIND_I_H */ diff --git a/vendor/libunwind/include/tdep/dwarf-config.h b/vendor/libunwind/include/tdep/dwarf-config.h new file mode 100644 index 0000000000..67ebcc934b --- /dev/null +++ b/vendor/libunwind/include/tdep/dwarf-config.h @@ -0,0 +1,32 @@ +/* Provide a real file - not a symlink - as it would cause multiarch conflicts + when multiple different arch releases are installed simultaneously. */ + +#if defined __aarch64__ +# include "tdep-aarch64/dwarf-config.h" +#elif defined __arm__ +# include "tdep-arm/dwarf-config.h" +#elif defined __hppa__ +# include "tdep-hppa/dwarf-config.h" +#elif defined __ia64__ +# include "tdep-ia64/dwarf-config.h" +#elif defined __mips__ +# include "tdep-mips/dwarf-config.h" +#elif defined __powerpc__ && !defined __powerpc64__ +# include "tdep-ppc32/dwarf-config.h" +#elif defined __powerpc64__ +# include "tdep-ppc64/dwarf-config.h" +#elif defined __s390x__ +# include "tdep-s390x/dwarf-config.h" +#elif defined __sh__ +# include "tdep-sh/dwarf-config.h" +#elif defined __i386__ +# include "tdep-x86/dwarf-config.h" +#elif defined __x86_64__ || defined __amd64__ +# include "tdep-x86_64/dwarf-config.h" +#elif defined __riscv || defined __riscv__ +# include "tdep-riscv/dwarf-config.h" +#elif defined __loongarch64 +# include "tdep-loongarch64/dwarf-config.h" +#else +# error "Unsupported arch" +#endif diff --git a/vendor/libunwind/include/tdep/jmpbuf.h b/vendor/libunwind/include/tdep/jmpbuf.h new file mode 100644 index 0000000000..0c033336ae --- /dev/null +++ b/vendor/libunwind/include/tdep/jmpbuf.h @@ -0,0 +1,32 @@ +/* Provide a real file - not a symlink - as it would cause multiarch conflicts + when multiple different arch releases are installed simultaneously. */ + +#ifndef UNW_REMOTE_ONLY + +#if defined __aarch64__ +# include "tdep-aarch64/jmpbuf.h" +#elif defined __arm__ +# include "tdep-arm/jmpbuf.h" +#elif defined __hppa__ +# include "tdep-hppa/jmpbuf.h" +#elif defined __ia64__ +# include "tdep-ia64/jmpbuf.h" +#elif defined __mips__ +# include "tdep-mips/jmpbuf.h" +#elif defined __powerpc__ && !defined __powerpc64__ +# include "tdep-ppc32/jmpbuf.h" +#elif defined __powerpc64__ +# include "tdep-ppc64/jmpbuf.h" +#elif defined __i386__ +# include "tdep-x86/jmpbuf.h" +#elif defined __x86_64__ +# include "tdep-x86_64/jmpbuf.h" +#elif defined __riscv || defined __riscv__ +# include "tdep-riscv/jmpbuf.h" +#elif defined __loongarch64 +# include "tdep-loongarch64/jmpbuf.h" +#else +# error "Unsupported arch" +#endif + +#endif /* !UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/include/tdep/libunwind_i.h b/vendor/libunwind/include/tdep/libunwind_i.h new file mode 100644 index 0000000000..1c29dd6a08 --- /dev/null +++ b/vendor/libunwind/include/tdep/libunwind_i.h @@ -0,0 +1,41 @@ +/* Provide a real file - not a symlink - as it would cause multiarch conflicts + when multiple different arch releases are installed simultaneously. */ + +#ifndef UNW_REMOTE_ONLY + +#if defined __aarch64__ +# include "tdep-aarch64/libunwind_i.h" +#elif defined __arm__ +# include "tdep-arm/libunwind_i.h" +#elif defined __hppa__ +# include "tdep-hppa/libunwind_i.h" +#elif defined __ia64__ +# include "tdep-ia64/libunwind_i.h" +#elif defined __mips__ +# include "tdep-mips/libunwind_i.h" +#elif defined __powerpc__ && !defined __powerpc64__ +# include "tdep-ppc32/libunwind_i.h" +#elif defined __powerpc64__ +# include "tdep-ppc64/libunwind_i.h" +#elif defined __sh__ +# include "tdep-sh/libunwind_i.h" +#elif defined __i386__ +# include "tdep-x86/libunwind_i.h" +#elif defined __x86_64__ +# include "tdep-x86_64/libunwind_i.h" +#elif defined __s390x__ +# include "tdep-s390x/libunwind_i.h" +#elif defined __riscv || defined __riscv__ +# include "tdep-riscv/libunwind_i.h" +#elif defined __loongarch64 +# include "tdep-loongarch64/libunwind_i.h" +#else +# error "Unsupported arch" +#endif + + +#else /* UNW_REMOTE_ONLY */ + +# include "tdep-x86_64/libunwind_i.h" + +#endif /* UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/include/tdep/libunwind_i.h.in b/vendor/libunwind/include/tdep/libunwind_i.h.in new file mode 100644 index 0000000000..f026744665 --- /dev/null +++ b/vendor/libunwind/include/tdep/libunwind_i.h.in @@ -0,0 +1,41 @@ +/* Provide a real file - not a symlink - as it would cause multiarch conflicts + when multiple different arch releases are installed simultaneously. */ + +#ifndef UNW_REMOTE_ONLY + +#if defined __aarch64__ +# include "tdep-aarch64/libunwind_i.h" +#elif defined __arm__ +# include "tdep-arm/libunwind_i.h" +#elif defined __hppa__ +# include "tdep-hppa/libunwind_i.h" +#elif defined __ia64__ +# include "tdep-ia64/libunwind_i.h" +#elif defined __mips__ +# include "tdep-mips/libunwind_i.h" +#elif defined __powerpc__ && !defined __powerpc64__ +# include "tdep-ppc32/libunwind_i.h" +#elif defined __powerpc64__ +# include "tdep-ppc64/libunwind_i.h" +#elif defined __sh__ +# include "tdep-sh/libunwind_i.h" +#elif defined __i386__ +# include "tdep-x86/libunwind_i.h" +#elif defined __x86_64__ +# include "tdep-x86_64/libunwind_i.h" +#elif defined __s390x__ +# include "tdep-s390x/libunwind_i.h" +#elif defined __riscv || defined __riscv__ +# include "tdep-riscv/libunwind_i.h" +#elif defined __loongarch64 +# include "tdep-loongarch64/libunwind_i.h" +#else +# error "Unsupported arch" +#endif + + +#else /* UNW_REMOTE_ONLY */ + +# include "tdep-@arch@/libunwind_i.h" + +#endif /* UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/include/unwind.h b/vendor/libunwind/include/unwind.h new file mode 100644 index 0000000000..93780fade8 --- /dev/null +++ b/vendor/libunwind/include/unwind.h @@ -0,0 +1,155 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef _UNWIND_H +#define _UNWIND_H + +/* For uint64_t */ +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Minimal interface as per C++ ABI draft standard: + + http://www.codesourcery.com/cxx-abi/abi-eh.html */ + +typedef enum + { + _URC_NO_REASON = 0, + _URC_FOREIGN_EXCEPTION_CAUGHT = 1, + _URC_FATAL_PHASE2_ERROR = 2, + _URC_FATAL_PHASE1_ERROR = 3, + _URC_NORMAL_STOP = 4, + _URC_END_OF_STACK = 5, + _URC_HANDLER_FOUND = 6, + _URC_INSTALL_CONTEXT = 7, + _URC_CONTINUE_UNWIND = 8 + } +_Unwind_Reason_Code; + +typedef int _Unwind_Action; + +#define _UA_SEARCH_PHASE 1 +#define _UA_CLEANUP_PHASE 2 +#define _UA_HANDLER_FRAME 4 +#define _UA_FORCE_UNWIND 8 + +struct _Unwind_Context; /* opaque data-structure */ +struct _Unwind_Exception; /* forward-declaration */ + +typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code, + struct _Unwind_Exception *); + +typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) (int, _Unwind_Action, + uint64_t, + struct _Unwind_Exception *, + struct _Unwind_Context *, + void *); + +/* The C++ ABI requires exception_class, private_1, and private_2 to + be of type uint64 and the entire structure to be + double-word-aligned. Please note that exception_class stays 64-bit + even on 32-bit machines for gcc compatibility. */ +struct _Unwind_Exception + { + alignas(8) uint64_t exception_class; + _Unwind_Exception_Cleanup_Fn exception_cleanup; + unsigned long private_1; + unsigned long private_2; + }; + +extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *); +extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *, + _Unwind_Stop_Fn, void *); +extern void _Unwind_Resume (struct _Unwind_Exception *); +extern void _Unwind_DeleteException (struct _Unwind_Exception *); +extern unsigned long _Unwind_GetGR (struct _Unwind_Context *, int); +extern void _Unwind_SetGR (struct _Unwind_Context *, int, unsigned long); +extern unsigned long _Unwind_GetIP (struct _Unwind_Context *); +extern unsigned long _Unwind_GetIPInfo (struct _Unwind_Context *, int *); +extern void _Unwind_SetIP (struct _Unwind_Context *, unsigned long); +extern unsigned long _Unwind_GetLanguageSpecificData (struct _Unwind_Context*); +extern unsigned long _Unwind_GetRegionStart (struct _Unwind_Context *); + +#ifdef _GNU_SOURCE + +/* Callback for _Unwind_Backtrace(). The backtrace stops immediately + if the callback returns any value other than _URC_NO_REASON. */ +typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) (struct _Unwind_Context *, + void *); + +/* See http://gcc.gnu.org/ml/gcc-patches/2001-09/msg00082.html for why + _UA_END_OF_STACK exists. */ +# define _UA_END_OF_STACK 16 + +/* If the unwind was initiated due to a forced unwind, resume that + operation, else re-raise the exception. This is used by + __cxa_rethrow(). */ +extern _Unwind_Reason_Code + _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *); + +/* See http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00154.html for why + _Unwind_GetBSP() exists. */ +extern unsigned long _Unwind_GetBSP (struct _Unwind_Context *); + +/* Return the "canonical frame address" for the given context. + This is used by NPTL... */ +extern unsigned long _Unwind_GetCFA (struct _Unwind_Context *); + +/* Return the base-address for data references. */ +extern unsigned long _Unwind_GetDataRelBase (struct _Unwind_Context *); + +/* Return the base-address for text references. */ +extern unsigned long _Unwind_GetTextRelBase (struct _Unwind_Context *); + +/* Call _Unwind_Trace_Fn once for each stack-frame, without doing any + cleanup. The first frame for which the callback is invoked is the + one for the caller of _Unwind_Backtrace(). _Unwind_Backtrace() + returns _URC_END_OF_STACK when the backtrace stopped due to + reaching the end of the call-chain or _URC_FATAL_PHASE1_ERROR if it + stops for any other reason. */ +extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *); + +/* Find the start-address of the procedure containing the specified IP + or NULL if it cannot be found (e.g., because the function has no + unwind info). Note: there is not necessarily a one-to-one + correspondence between source-level functions and procedures: some + functions don't have unwind-info and others are split into multiple + procedures. */ +extern void *_Unwind_FindEnclosingFunction (void *); + +/* See also Linux Standard Base Spec: + http://www.linuxbase.org/spec/refspecs/LSB_1.3.0/gLSB/gLSB/libgcc-s.html */ + +#endif /* _GNU_SOURCE */ + +#ifdef __cplusplus +}; +#endif + +#endif /* _UNWIND_H */ diff --git a/vendor/libunwind/src/Makefile.am b/vendor/libunwind/src/Makefile.am new file mode 100644 index 0000000000..641cf448eb --- /dev/null +++ b/vendor/libunwind/src/Makefile.am @@ -0,0 +1,1291 @@ +# +# This file is a part of the libunwind project. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# This permission notice shall be included in all copies or substantial portions +# of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + +# Set the DSO versions +SOVERSION=10:0:2 # See comments at end of file. +SETJMP_SO_VERSION=0:0:0 +COREDUMP_SO_VERSION=0:0:0 + +# +# Don't link with start-files since we don't use any constructors/destructors: +# +COMMON_SO_LDFLAGS = $(LDFLAGS_NOSTARTFILES) + +# +# Which libraries to build and install +# +# Order is important here. The names of the libraries need to end up in reverse +# dependency order for `make install` to do its job properly. +# +lib_LTLIBRARIES = +if !REMOTE_ONLY + lib_LTLIBRARIES += libunwind.la +endif +if ARCH_AARCH64 + lib_LTLIBRARIES += libunwind-aarch64.la +endif +if ARCH_ARM + lib_LTLIBRARIES += libunwind-arm.la +endif +if ARCH_HPPA + lib_LTLIBRARIES += libunwind-hppa.la +endif +if ARCH_IA64 + lib_LTLIBRARIES += libunwind-ia64.la +endif +if ARCH_LOONGARCH64 + lib_LTLIBRARIES += libunwind-loongarch64.la +endif +if ARCH_MIPS + lib_LTLIBRARIES += libunwind-mips.la +endif +if ARCH_PPC32 + lib_LTLIBRARIES += libunwind-ppc32.la +endif +if ARCH_PPC64 + lib_LTLIBRARIES += libunwind-ppc64.la +endif +if ARCH_RISCV + lib_LTLIBRARIES += libunwind-riscv.la +endif +if ARCH_S390X + lib_LTLIBRARIES += libunwind-s390x.la +endif +if ARCH_SH + lib_LTLIBRARIES += libunwind-sh.la +endif +if ARCH_X86 + lib_LTLIBRARIES += libunwind-x86.la +endif +if ARCH_X86_64 + lib_LTLIBRARIES += libunwind-x86_64.la +endif + +if BUILD_COREDUMP + lib_LTLIBRARIES += libunwind-coredump.la +endif +if BUILD_NTO + lib_LTLIBRARIES += libunwind-nto.la +endif +if BUILD_PTRACE + lib_LTLIBRARIES += libunwind-ptrace.la +endif +if BUILD_SETJMP + lib_LTLIBRARIES += libunwind-setjmp.la +endif + +noinst_HEADERS = +noinst_LTLIBRARIES = + +if USE_ELF32 +libunwind_elf_libs = libunwind-elf32.la +endif +if USE_ELF64 +libunwind_elf_libs = libunwind-elf64.la +endif +if USE_ELFXX +libunwind_elf_libs = libunwind-elfxx.la +endif + +# If local unwinding is being built, link in the local unwinding functions +libunwind_libadd = +if !REMOTE_ONLY + libunwind_libadd += libunwind.la +endif + +### pkg-config: +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libunwind-generic.pc + +if !REMOTE_ONLY +pkgconfig_DATA += unwind/libunwind.pc +endif +if BUILD_COREDUMP +pkgconfig_DATA += coredump/libunwind-coredump.pc +endif +if BUILD_PTRACE +pkgconfig_DATA += ptrace/libunwind-ptrace.pc +endif +if BUILD_SETJMP +pkgconfig_DATA += setjmp/libunwind-setjmp.pc +endif + +### libunwind-coredump: +noinst_HEADERS += coredump/_UCD_internal.h \ + coredump/_UCD_lib.h \ + coredump/ucd_file_table.h +libunwind_coredump_la_SOURCES = \ + coredump/_UCD_access_mem.c \ + coredump/_UCD_accessors.c \ + coredump/_UCD_corefile_elf.c \ + coredump/_UCD_create.c \ + coredump/_UCD_destroy.c \ + coredump/_UCD_elf_map_image.c \ + coredump/ucd_file_table.c \ + coredump/_UCD_find_proc_info.c \ + coredump/_UCD_get_proc_name.c \ + coredump/_UCD_get_elf_filename.c \ + \ + mi/init.c \ + coredump/_UPT_elf.c \ + coredump/_UPT_access_fpreg.c \ + coredump/_UPT_get_dyn_info_list_addr.c \ + coredump/_UPT_put_unwind_info.c \ + coredump/_UPT_resume.c +libunwind_coredump_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(COREDUMP_SO_VERSION) +libunwind_coredump_la_LIBADD = \ + libunwind-$(arch).la \ + $(LIBLZMA) $(LIBZ) + +### libunwind-nto: +noinst_HEADERS += nto/unw_nto_internal.h +libunwind_nto_la_SOURCES = \ + mi/init.c \ + nto/unw_nto_access_fpreg.c \ + nto/unw_nto_access_mem.c \ + nto/unw_nto_accessors.c \ + nto/unw_nto_access_reg.c \ + nto/unw_nto_create.c \ + nto/unw_nto_destroy.c \ + nto/unw_nto_elf.c \ + nto/unw_nto_find_proc_info.c \ + nto/unw_nto_get_dyn_info_list_addr.c \ + nto/unw_nto_get_proc_name.c \ + nto/unw_nto_get_elf_filename.c \ + nto/unw_nto_put_unwind_info.c \ + nto/unw_nto_resume.c +libunwind_nto_la_LIBADD = \ + libunwind-$(arch).la \ + $(libunwind_libadd) + +### libunwind-ptrace: +noinst_HEADERS += ptrace/_UPT_internal.h +libunwind_ptrace_la_SOURCES = \ + mi/init.c \ + ptrace/_UPT_access_fpreg.c \ + ptrace/_UPT_access_mem.c \ + ptrace/_UPT_accessors.c \ + ptrace/_UPT_access_reg.c \ + ptrace/_UPT_create.c \ + ptrace/_UPT_destroy.c \ + ptrace/_UPT_elf.c \ + ptrace/_UPT_find_proc_info.c \ + ptrace/_UPT_get_dyn_info_list_addr.c \ + ptrace/_UPT_get_proc_name.c \ + ptrace/_UPT_get_elf_filename.c \ + ptrace/_UPT_put_unwind_info.c \ + ptrace/_UPT_reg_offset.c \ + ptrace/_UPT_resume.c \ + ptrace/_UPT_ptrauth_insn_mask.c +libunwind_ptrace_la_LIBADD = \ + libunwind-$(arch).la \ + $(LIBLZMA) $(LIBZ) + +### libunwind-setjmp: +noinst_HEADERS += setjmp/setjmp_i.h +libunwind_setjmp_la_SOURCES = \ + mi/init.c \ + setjmp/longjmp.c \ + setjmp/siglongjmp.c +libunwind_setjmp_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SETJMP_SO_VERSION) +libunwind_setjmp_la_LIBADD = \ + $(libunwind_elf_libs) \ + libunwind-$(arch).la \ + $(libunwind_libadd) + +### libunwind: +libunwind_la_LIBADD = + +# List of arch-independent files needed by both local-only and generic +# libraries: +libunwind_la_SOURCES_common = \ + $(libunwind_la_SOURCES_os) \ + mi/init.c \ + mi/flush_cache.c \ + mi/mempool.c \ + mi/strerror.c + +# List of arch-independent files needed by generic library (libunwind-$ARCH): +libunwind_la_SOURCES_generic = \ + mi/Gaddress_validator.c \ + mi/Gdestroy_addr_space.c \ + mi/Gdyn-extract.c \ + mi/Gdyn-remote.c \ + mi/Gfind_dynamic_proc_info.c \ + mi/Gget_accessors.c \ + mi/Gget_fpreg.c \ + mi/Gget_proc_info_by_ip.c \ + mi/Gget_proc_name.c \ + mi/Gget_reg.c \ + mi/Gis_plt_entry.c \ + mi/Gput_dynamic_unwind_info.c \ + mi/Gset_cache_size.c \ + mi/Gset_caching_policy.c \ + mi/Gset_fpreg.c \ + mi/Gset_iterate_phdr_function.c \ + mi/Gset_reg.c \ + mi/Gget_elf_filename.c + +if SUPPORT_CXX_EXCEPTIONS +libunwind_la_SOURCES_local_unwind = \ + unwind/Backtrace.c \ + unwind/DeleteException.c \ + unwind/FindEnclosingFunction.c \ + unwind/ForcedUnwind.c \ + unwind/GetBSP.c \ + unwind/GetCFA.c \ + unwind/GetDataRelBase.c \ + unwind/GetGR.c \ + unwind/GetIP.c \ + unwind/GetIPInfo.c \ + unwind/GetLanguageSpecificData.c \ + unwind/GetRegionStart.c \ + unwind/GetTextRelBase.c \ + unwind/RaiseException.c \ + unwind/Resume.c \ + unwind/Resume_or_Rethrow.c \ + unwind/SetGR.c \ + unwind/SetIP.c + +# _ReadULEB()/_ReadSLEB() are needed for Intel C++ 8.0 compatibility +libunwind_la_SOURCES_os_linux_local = \ + mi/_ReadULEB.c \ + mi/_ReadSLEB.c +endif SUPPORT_CXX_EXCEPTIONS + +# List of arch-independent files needed by local-only library (libunwind): +libunwind_la_SOURCES_local_nounwind = \ + $(libunwind_la_SOURCES_os_local) \ + mi/backtrace.c \ + mi/dyn-cancel.c \ + mi/dyn-info-list.c \ + mi/dyn-register.c \ + mi/Laddress_validator.c \ + mi/Ldestroy_addr_space.c \ + mi/Ldyn-extract.c \ + mi/Lfind_dynamic_proc_info.c \ + mi/Lget_accessors.c \ + mi/Lget_fpreg.c mi/Lset_fpreg.c \ + mi/Lget_proc_info_by_ip.c \ + mi/Lget_proc_name.c \ + mi/Lget_reg.c \ + mi/Lis_plt_entry.c \ + mi/Lput_dynamic_unwind_info.c \ + mi/Lset_cache_size.c \ + mi/Lset_caching_policy.c \ + mi/Lset_iterate_phdr_function.c \ + mi/Lset_reg.c \ + mi/Lget_elf_filename.c + +libunwind_la_SOURCES_local = \ + $(libunwind_la_SOURCES_local_nounwind) \ + $(libunwind_la_SOURCES_local_unwind) + +noinst_HEADERS += os-linux.h + +libunwind_dwarf_common_la_SOURCES = dwarf/global.c + +libunwind_dwarf_local_la_SOURCES = \ + dwarf/Lexpr.c \ + dwarf/Lfde.c \ + dwarf/Lfind_proc_info-lsb.c \ + dwarf/Lfind_unwind_table.c \ + dwarf/Lget_proc_info_in_range.c \ + dwarf/Lparser.c \ + dwarf/Lpe.c +libunwind_dwarf_local_la_LIBADD = libunwind-dwarf-common.la + +libunwind_dwarf_generic_la_SOURCES = \ + dwarf/Gexpr.c \ + dwarf/Gfde.c \ + dwarf/Gfind_proc_info-lsb.c \ + dwarf/Gfind_unwind_table.c \ + dwarf/Gget_proc_info_in_range.c \ + dwarf/Gparser.c \ + dwarf/Gpe.c +libunwind_dwarf_generic_la_LIBADD = libunwind-dwarf-common.la + +if USE_DWARF + noinst_LTLIBRARIES += libunwind-dwarf-common.la libunwind-dwarf-generic.la +if !REMOTE_ONLY + noinst_LTLIBRARIES += libunwind-dwarf-local.la +endif + libunwind_la_LIBADD += libunwind-dwarf-local.la +endif + +noinst_HEADERS += elf32.h elf64.h elfxx.h + +libunwind_elf32_la_SOURCES = elf32.c +libunwind_elf64_la_SOURCES = elf64.c +libunwind_elfxx_la_SOURCES = elfxx.c +libunwind_elf32_la_LIBADD = $(LIBLZMA) $(LIBZ) +libunwind_elf64_la_LIBADD = $(LIBLZMA) $(LIBZ) +libunwind_elfxx_la_LIBADD = $(LIBLZMA) $(LIBZ) + +noinst_LTLIBRARIES += $(libunwind_elf_libs) +libunwind_la_LIBADD += $(libunwind_elf_libs) + +if OS_LINUX + libunwind_la_SOURCES_os = os-linux.c dl-iterate-phdr.c + libunwind_la_SOURCES_os_local = $(libunwind_la_SOURCES_os_linux_local) + libunwind_la_SOURCES_aarch64_os = aarch64/Gos-linux.c + libunwind_la_SOURCES_aarch64_os_local = aarch64/Los-linux.c + libunwind_la_SOURCES_arm_os = arm/Gos-linux.c + libunwind_la_SOURCES_arm_os_local = arm/Los-linux.c + libunwind_la_SOURCES_x86_os = x86/Gos-linux.c + libunwind_la_SOURCES_x86_os_local = x86/Los-linux.c x86/getcontext-linux.S + libunwind_la_SOURCES_x86_64_os = x86_64/Gos-linux.c + libunwind_la_SOURCES_x86_64_os_local = x86_64/Los-linux.c + libunwind_coredump_la_SOURCES += coredump/_UCD_access_reg_linux.c + libunwind_coredump_la_SOURCES += coredump/_UCD_get_threadinfo_prstatus.c + libunwind_coredump_la_SOURCES += coredump/_UCD_get_mapinfo_linux.c +endif + +if OS_HPUX + libunwind_la_SOURCES_os = os-hpux.c + libunwind_la_SOURCES_os_local = $(libunwind_la_SOURCES_os_hpux_local) +endif + +if OS_FREEBSD + libunwind_la_SOURCES_os = os-freebsd.c + libunwind_la_SOURCES_aarch64_os = aarch64/Gos-freebsd.c + libunwind_la_SOURCES_aarch64_os_local = aarch64/Los-freebsd.c aarch64/setcontext.S + libunwind_la_SOURCES_arm_os = arm/Gos-freebsd.c + libunwind_la_SOURCES_arm_os_local = arm/Los-freebsd.c + libunwind_la_SOURCES_x86_os = x86/Gos-freebsd.c + libunwind_la_SOURCES_x86_os_local = x86/Los-freebsd.c x86/getcontext-freebsd.S + libunwind_la_SOURCES_x86_64_os = x86_64/Gos-freebsd.c + libunwind_la_SOURCES_x86_64_os_local = x86_64/Los-freebsd.c + libunwind_coredump_la_SOURCES += coredump/_UCD_access_reg_freebsd.c + libunwind_coredump_la_SOURCES += coredump/_UCD_get_threadinfo_prstatus.c + libunwind_coredump_la_SOURCES += coredump/_UCD_get_mapinfo_generic.c +endif + +if OS_SOLARIS + libunwind_la_SOURCES_os = os-solaris.c + libunwind_la_SOURCES_x86_64_os = x86_64/Gos-solaris.c + libunwind_la_SOURCES_x86_64_os_local = x86_64/Los-solaris.c +endif + +if OS_QNX + libunwind_la_SOURCES_os = os-qnx.c + libunwind_la_SOURCES_aarch64_os = aarch64/Gos-qnx.c + libunwind_la_SOURCES_aarch64_os_local = aarch64/Los-qnx.c + libunwind_la_SOURCES_arm_os = arm/Gos-other.c + libunwind_la_SOURCES_arm_os_local = arm/Los-other.c + libunwind_la_SOURCES_x86_64_os = x86_64/Gos-qnx.c + libunwind_la_SOURCES_x86_64_os_local = x86_64/Los-qnx.c + libunwind_coredump_la_SOURCES += coredump/_UCD_access_reg_qnx.c + libunwind_coredump_la_SOURCES += coredump/_UCD_get_threadinfo_prstatus.c + libunwind_coredump_la_SOURCES += coredump/_UCD_get_mapinfo_qnx.c +endif + +### target AArch64: +# The list of files that go into libunwind and libunwind-aarch64: +noinst_HEADERS += aarch64/init.h aarch64/ucontext_i.h aarch64/unwind_i.h +libunwind_la_SOURCES_aarch64_common = \ + $(libunwind_la_SOURCES_common) \ + aarch64/is_fpreg.c \ + aarch64/regname.c + +# The list of files that go into libunwind: +if ARCH_AARCH64 +libunwind_la_SOURCES = \ + $(libunwind_la_SOURCES_aarch64_common) \ + $(libunwind_la_SOURCES_local) \ + $(libunwind_la_SOURCES_aarch64_os_local) \ + aarch64/getcontext.S \ + aarch64/Lapply_reg_state.c \ + aarch64/Lcreate_addr_space.c \ + aarch64/Lget_proc_info.c \ + aarch64/Lget_save_loc.c \ + aarch64/Lglobal.c \ + aarch64/Linit.c \ + aarch64/Linit_local.c \ + aarch64/Linit_remote.c \ + aarch64/Lis_signal_frame.c \ + aarch64/Lregs.c \ + aarch64/Lreg_states_iterate.c \ + aarch64/Lresume.c \ + aarch64/Lstash_frame.c \ + aarch64/Lstep.c \ + aarch64/Ltrace.c \ + aarch64/Lstrip_ptrauth_insn_mask.c + +libunwind_setjmp_la_SOURCES += \ + aarch64/longjmp.S \ + aarch64/siglongjmp.S +endif ARCH_AARCH64 + +libunwind_aarch64_la_SOURCES = \ + $(libunwind_la_SOURCES_aarch64_common) \ + $(libunwind_la_SOURCES_generic) \ + $(libunwind_la_SOURCES_aarch64_os) \ + aarch64/Gapply_reg_state.c \ + aarch64/Gcreate_addr_space.c \ + aarch64/Gget_proc_info.c \ + aarch64/Gget_save_loc.c \ + aarch64/Gglobal.c \ + aarch64/Ginit.c \ + aarch64/Ginit_local.c \ + aarch64/Ginit_remote.c \ + aarch64/Gis_signal_frame.c \ + aarch64/Gregs.c \ + aarch64/Greg_states_iterate.c \ + aarch64/Gresume.c \ + aarch64/Gstash_frame.c \ + aarch64/Gstep.c \ + aarch64/Gtrace.c \ + aarch64/Gstrip_ptrauth_insn_mask.c +libunwind_aarch64_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) +libunwind_aarch64_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf64.la \ + $(libunwind_libadd) + +### target ARMv7: +# The list of files that go into libunwind and libunwind-arm: +noinst_HEADERS += \ + arm/init.h \ + arm/offsets.h \ + arm/unwind_i.h +libunwind_la_SOURCES_arm_common = \ + $(libunwind_la_SOURCES_common) \ + arm/is_fpreg.c arm/regname.c + +# The list of files that go into libunwind: +if ARCH_ARM +libunwind_la_SOURCES = \ + $(libunwind_la_SOURCES_arm_common) \ + $(libunwind_la_SOURCES_arm_os_local) \ + $(libunwind_la_SOURCES_local) \ + arm/getcontext.S \ + arm/Lapply_reg_state.c \ + arm/Lcreate_addr_space.c \ + arm/Lex_tables.c \ + arm/Lget_proc_info.c \ + arm/Lget_save_loc.c \ + arm/Lglobal.c arm/Linit.c \ + arm/Linit_local.c \ + arm/Linit_remote.c \ + arm/Lregs.c \ + arm/Lreg_states_iterate.c \ + arm/Lresume.c \ + arm/Lstash_frame.c \ + arm/Lstep.c \ + arm/Ltrace.c + +libunwind_setjmp_la_SOURCES += arm/siglongjmp.S +endif # ARCH_ARM + +# The list of files that go into libunwind-arm: +libunwind_arm_la_SOURCES = \ + $(libunwind_la_SOURCES_arm_common) \ + $(libunwind_la_SOURCES_arm_os) \ + $(libunwind_la_SOURCES_generic) \ + arm/Gapply_reg_state.c \ + arm/Gcreate_addr_space.c \ + arm/Gex_tables.c \ + arm/Gget_proc_info.c \ + arm/Gget_save_loc.c \ + arm/Gglobal.c \ + arm/Ginit.c \ + arm/Ginit_local.c \ + arm/Ginit_remote.c \ + arm/Gregs.c \ + arm/Greg_states_iterate.c \ + arm/Gresume.c \ + arm/Gstash_frame.c \ + arm/Gstep.c \ + arm/Gtrace.c +libunwind_arm_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) +libunwind_arm_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf32.la \ + $(libunwind_libadd) + +### target HP-PA: +# The list of files that go both into libunwind and libunwind-hppa: +noinst_HEADERS += \ + hppa/init.h \ + hppa/offsets.h \ + hppa/unwind_i.h +libunwind_la_SOURCES_hppa_common = \ + $(libunwind_la_SOURCES_common) \ + hppa/regname.c + +if ARCH_HPPA +# The list of files that go into libunwind: +libunwind_la_SOURCES = \ + $(libunwind_la_SOURCES_hppa_common) \ + $(libunwind_la_SOURCES_local) \ + hppa/getcontext.S \ + hppa/Lapply_reg_state.c \ + hppa/Lcreate_addr_space.c \ + hppa/Lget_proc_info.c \ + hppa/Lget_save_loc.c \ + hppa/Lglobal.c \ + hppa/Linit.c \ + hppa/Linit_local.c \ + hppa/Linit_remote.c \ + hppa/Lis_signal_frame.c \ + hppa/Lregs.c \ + hppa/Lreg_states_iterate.c \ + hppa/Lresume.c \ + hppa/Lstep.c \ + hppa/setcontext.S + +libunwind_setjmp_la_SOURCES += hppa/siglongjmp.S +endif # ARCH_HPPA + +# The list of files that go into libunwind-hppa: +libunwind_hppa_la_SOURCES = \ + $(libunwind_la_SOURCES_hppa_common) \ + $(libunwind_la_SOURCES_generic) \ + hppa/Gapply_reg_state.c \ + hppa/Gcreate_addr_space.c \ + hppa/Gget_proc_info.c \ + hppa/Gget_save_loc.c \ + hppa/Gglobal.c \ + hppa/Ginit.c \ + hppa/Ginit_local.c \ + hppa/Ginit_remote.c \ + hppa/Gis_signal_frame.c \ + hppa/Gregs.c \ + hppa/Greg_states_iterate.c \ + hppa/Gresume.c \ + hppa/Gstep.c +libunwind_hppa_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) +libunwind_hppa_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf32.la \ + $(libunwind_libadd) + +### target IA-64: +# The list of files that go both into libunwind and libunwind-ia64: +noinst_HEADERS += \ + ia64/init.h \ + ia64/offsets.h \ + ia64/regs.h \ + ia64/ucontext_i.h \ + ia64/unwind_decoder.h \ + ia64/unwind_i.h +libunwind_la_SOURCES_ia64_common = \ + $(libunwind_la_SOURCES_common) \ + ia64/regname.c +libunwind_la_EXTRAS_ia64 = \ + ia64/mk_cursor_i \ + ia64/mk_Gcursor_i.c \ + ia64/mk_Lcursor_i.c + +if ARCH_IA64 +BUILT_SOURCES = Gcursor_i.h Lcursor_i.h +mk_Gcursor_i.s: $(srcdir)/ia64/mk_Gcursor_i.c + $(COMPILE) -S "$(srcdir)/ia64/mk_Gcursor_i.c" -o mk_Gcursor_i.s +mk_Lcursor_i.s: $(srcdir)/ia64/mk_Lcursor_i.c + $(COMPILE) -S "$(srcdir)/ia64/mk_Lcursor_i.c" -o mk_Lcursor_i.s +Gcursor_i.h: mk_Gcursor_i.s + "$(srcdir)/ia64/mk_cursor_i" mk_Gcursor_i.s > Gcursor_i.h +Lcursor_i.h: mk_Lcursor_i.s + "$(srcdir)/ia64/mk_cursor_i" mk_Lcursor_i.s > Lcursor_i.h + +# The list of files that go into libunwind: +libunwind_la_SOURCES = \ + $(libunwind_la_SOURCES_ia64_common) \ + $(libunwind_la_SOURCES_local) \ + ia64/dyn_info_list.S \ + ia64/getcontext.S \ + ia64/Lapply_reg_state.c \ + ia64/Lcreate_addr_space.c \ + ia64/Lfind_unwind_table.c \ + ia64/Lget_proc_info.c \ + ia64/Lget_save_loc.c \ + ia64/Lglobal.c \ + ia64/Linit.c \ + ia64/Linit_local.c \ + ia64/Linit_remote.c \ + ia64/Linstall_cursor.S \ + ia64/Lis_signal_frame.c \ + ia64/Lparser.c \ + ia64/Lrbs.c \ + ia64/Lregs.c \ + ia64/Lreg_states_iterate.c \ + ia64/Lresume.c \ + ia64/Lscript.c \ + ia64/Lstep.c \ + ia64/Ltables.c + +libunwind_setjmp_la_SOURCES += \ + ia64/longjmp.S \ + ia64/setjmp.S \ + ia64/siglongjmp.S \ + ia64/sigsetjmp.S +endif # ARCH_IA64 + +# The list of files that go into libunwind-ia64: +libunwind_ia64_la_SOURCES = \ + $(libunwind_la_SOURCES_ia64_common) \ + $(libunwind_la_SOURCES_generic) \ + ia64/Gapply_reg_state.c \ + ia64/Gcreate_addr_space.c \ + ia64/Gfind_unwind_table.c \ + ia64/Gget_proc_info.c \ + ia64/Gget_save_loc.c \ + ia64/Gglobal.c \ + ia64/Ginit.c \ + ia64/Ginit_local.c \ + ia64/Ginit_remote.c \ + ia64/Ginstall_cursor.S \ + ia64/Gis_signal_frame.c \ + ia64/Gparser.c \ + ia64/Grbs.c \ + ia64/Gregs.c \ + ia64/Greg_states_iterate.c \ + ia64/Gresume.c \ + ia64/Gscript.c \ + ia64/Gstep.c \ + ia64/Gtables.c +libunwind_ia64_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) +libunwind_ia64_la_LIBADD = \ + libunwind-elf64.la \ + $(libunwind_libadd) + +### target LoongArch64: +# The list of files that go info libunwind and libunwind-loongarch64: +noinst_HEADERS += \ + loongarch64/init.h \ + loongarch64/offsets.h \ + loongarch64/unwind_i.h +libunwind_la_SOURCES_loongarch64_common = \ + $(libunwind_la_SOURCES_common) \ + loongarch64/is_fpreg.c \ + loongarch64/regname.c + +if ARCH_LOONGARCH64 +# The list of files that go into libunwind: +libunwind_la_SOURCES = \ + $(libunwind_la_SOURCES_loongarch64_common) \ + $(libunwind_la_SOURCES_local) \ + loongarch64/getcontext.S \ + loongarch64/Lapply_reg_state.c \ + loongarch64/Lcreate_addr_space.c \ + loongarch64/Lget_proc_info.c \ + loongarch64/Lget_save_loc.c \ + loongarch64/Lglobal.c \ + loongarch64/Linit.c \ + loongarch64/Linit_local.c \ + loongarch64/Linit_remote.c \ + loongarch64/Lis_signal_frame.c \ + loongarch64/Lregs.c \ + loongarch64/Lreg_states_iterate.c \ + loongarch64/Lresume.c \ + loongarch64/Lstep.c + +libunwind_setjmp_la_SOURCES += \ + loongarch64/siglongjmp.S +endif # ARCH_LOONGARCH64 + +libunwind_loongarch64_la_SOURCES = \ + $(libunwind_la_SOURCES_loongarch64_common) \ + $(libunwind_la_SOURCES_generic) \ + loongarch64/Gapply_reg_state.c \ + loongarch64/Gcreate_addr_space.c \ + loongarch64/Gget_proc_info.c \ + loongarch64/Gget_save_loc.c \ + loongarch64/Gglobal.c \ + loongarch64/Ginit.c \ + loongarch64/Ginit_local.c \ + loongarch64/Ginit_remote.c \ + loongarch64/Gis_signal_frame.c \ + loongarch64/Gregs.c \ + loongarch64/Greg_states_iterate.c \ + loongarch64/Gresume.c \ + loongarch64/Gstep.c +libunwind_loongarch64_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) +libunwind_loongarch64_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf64.la \ + $(libunwind_libadd) + +### target MIPS: +# The list of files that go info libunwind and libunwind-mips: +noinst_HEADERS += \ + mips/init.h \ + mips/offsets.h \ + mips/unwind_i.h +libunwind_la_SOURCES_mips_common = \ + $(libunwind_la_SOURCES_common) \ + mips/is_fpreg.c \ + mips/regname.c + +if ARCH_MIPS +# The list of files that go into libunwind: +libunwind_la_SOURCES = \ + $(libunwind_la_SOURCES_mips_common) \ + $(libunwind_la_SOURCES_local) \ + mips/getcontext.S \ + mips/Lapply_reg_state.c \ + mips/Lcreate_addr_space.c \ + mips/Lget_proc_info.c \ + mips/Lget_save_loc.c \ + mips/Lglobal.c \ + mips/Linit.c \ + mips/Linit_local.c \ + mips/Linit_remote.c \ + mips/Lis_signal_frame.c \ + mips/Lregs.c \ + mips/Lreg_states_iterate.c \ + mips/Lresume.c \ + mips/Lstep.c + +libunwind_setjmp_la_SOURCES += mips/siglongjmp.S +endif # ARCH_MIPS + +libunwind_mips_la_SOURCES = \ + $(libunwind_la_SOURCES_mips_common) \ + $(libunwind_la_SOURCES_generic) \ + mips/Gapply_reg_state.c \ + mips/Gcreate_addr_space.c \ + mips/Gget_proc_info.c \ + mips/Gget_save_loc.c \ + mips/Gglobal.c \ + mips/Ginit.c \ + mips/Ginit_local.c \ + mips/Ginit_remote.c \ + mips/Gis_signal_frame.c \ + mips/Gregs.c \ + mips/Greg_states_iterate.c \ + mips/Gresume.c \ + mips/Gstep.c +libunwind_mips_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) +libunwind_mips_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elfxx.la \ + $(libunwind_libadd) + +### target PowerPC: +# The list of local files that go to Power 64 and 32: +libunwind_la_SOURCES_ppc = \ + ppc/Lget_proc_info.c \ + ppc/Lget_save_loc.c \ + ppc/Linit_local.c \ + ppc/Linit_remote.c \ + ppc/Lis_signal_frame.c + +# The list of generic files that go to Power 64 and 32: +libunwind_ppc_la_SOURCES_ppc_generic = \ + ppc/Gget_proc_info.c \ + ppc/Gget_save_loc.c \ + ppc/Ginit_local.c \ + ppc/Ginit_remote.c \ + ppc/Gis_signal_frame.c + + +# The list of files that go both into libunwind and libunwind-ppc32: +noinst_HEADERS += \ + ppc32/init.h \ + ppc32/unwind_i.h \ + ppc32/ucontext_i.h +libunwind_la_SOURCES_ppc32_common = \ + $(libunwind_la_SOURCES_common) \ + ppc32/get_func_addr.c \ + ppc32/is_fpreg.c \ + ppc32/regname.c + +if ARCH_PPC32 +# The list of files that go into libunwind: +libunwind_la_SOURCES = \ + $(libunwind_la_SOURCES_ppc32_common) \ + $(libunwind_la_SOURCES_local) \ + $(libunwind_la_SOURCES_ppc) \ + ppc32/Lapply_reg_state.c \ + ppc32/Lcreate_addr_space.c \ + ppc32/Lglobal.c \ + ppc32/Linit.c \ + ppc32/Lregs.c \ + ppc32/Lreg_states_iterate.c \ + ppc32/Lresume.c \ + ppc32/Lstep.c + +libunwind_setjmp_la_SOURCES += \ + ppc/longjmp.S \ + ppc/siglongjmp.S +endif # ARCH_PPC32 + +# The list of files that go into libunwind-ppc32: +libunwind_ppc32_la_SOURCES = \ + $(libunwind_la_SOURCES_ppc32_common) \ + $(libunwind_la_SOURCES_generic) \ + $(libunwind_ppc_la_SOURCES_ppc_generic)\ + ppc32/Gapply_reg_state.c \ + ppc32/Gcreate_addr_space.c \ + ppc32/Gglobal.c \ + ppc32/Ginit.c \ + ppc32/Gregs.c \ + ppc32/Greg_states_iterate.c \ + ppc32/Gresume.c \ + ppc32/Gstep.c +libunwind_ppc32_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) +libunwind_ppc32_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf32.la \ + $(libunwind_libadd) + +# The list of files that go both into libunwind and libunwind-ppc64: +noinst_HEADERS += \ + ppc64/init.h \ + ppc64/unwind_i.h \ + ppc64/ucontext_i.h +libunwind_la_SOURCES_ppc64_common = \ + $(libunwind_la_SOURCES_common) \ + ppc64/get_func_addr.c \ + ppc64/is_fpreg.c \ + ppc64/regname.c + +if ARCH_PPC64 +# The list of files that go into libunwind: +libunwind_la_SOURCES = \ + $(libunwind_la_SOURCES_ppc64_common) \ + $(libunwind_la_SOURCES_local) \ + $(libunwind_la_SOURCES_ppc) \ + ppc64/Lapply_reg_state.c \ + ppc64/Lcreate_addr_space.c \ + ppc64/Lglobal.c \ + ppc64/Linit.c \ + ppc64/Lregs.c \ + ppc64/Lreg_states_iterate.c \ + ppc64/Lresume.c \ + ppc64/Lstep.c +libunwind_setjmp_la_SOURCES += \ + ppc/longjmp.S \ + ppc/siglongjmp.S +endif # ARCH_PPC64 + +# The list of files that go into libunwind-ppc64: +libunwind_ppc64_la_SOURCES = \ + $(libunwind_la_SOURCES_ppc64_common) \ + $(libunwind_la_SOURCES_generic) \ + $(libunwind_ppc_la_SOURCES_ppc_generic)\ + ppc64/Gapply_reg_state.c \ + ppc64/Gcreate_addr_space.c \ + ppc64/Gglobal.c \ + ppc64/Ginit.c \ + ppc64/Gregs.c \ + ppc64/Greg_states_iterate.c \ + ppc64/Gresume.c \ + ppc64/Gstep.c +libunwind_ppc64_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) +libunwind_ppc64_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf64.la \ + $(libunwind_libadd) + +### target RISC-V: +# The list of files that go info libunwind and libunwind-riscv: +noinst_HEADERS += \ + riscv/asm.h \ + riscv/init.h \ + riscv/offsets.h \ + riscv/unwind_i.h +libunwind_la_SOURCES_riscv_common = \ + $(libunwind_la_SOURCES_common) \ + riscv/is_fpreg.c \ + riscv/regname.c + +if ARCH_RISCV +# The list of files that go into libunwind: +libunwind_la_SOURCES = \ + $(libunwind_la_SOURCES_riscv_common) \ + $(libunwind_la_SOURCES_local) \ + riscv/getcontext.S \ + riscv/Lapply_reg_state.c \ + riscv/Lcreate_addr_space.c \ + riscv/Lget_proc_info.c \ + riscv/Lget_save_loc.c \ + riscv/Lglobal.c \ + riscv/Linit.c \ + riscv/Linit_local.c \ + riscv/Linit_remote.c \ + riscv/Lis_signal_frame.c \ + riscv/Lregs.c \ + riscv/Lreg_states_iterate.c \ + riscv/Lresume.c \ + riscv/Lstep.c \ + riscv/setcontext.S + +libunwind_setjmp_la_SOURCES += \ + riscv/siglongjmp.S +endif # ARCH_RISCV + +libunwind_riscv_la_SOURCES = \ + $(libunwind_la_SOURCES_riscv_common) \ + $(libunwind_la_SOURCES_generic) \ + riscv/Gapply_reg_state.c \ + riscv/Gcreate_addr_space.c \ + riscv/Gget_proc_info.c \ + riscv/Gget_save_loc.c \ + riscv/Gglobal.c \ + riscv/Ginit.c \ + riscv/Ginit_local.c \ + riscv/Ginit_remote.c \ + riscv/Gis_signal_frame.c \ + riscv/Gregs.c \ + riscv/Greg_states_iterate.c \ + riscv/Gresume.c \ + riscv/Gstep.c + +libunwind_riscv_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) +libunwind_riscv_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf64.la \ + $(libunwind_libadd) + +### target s390x: +# The list of files that go both into libunwind and libunwind-s390x: +noinst_HEADERS += \ + s390x/init.h \ + s390x/unwind_i.h +libunwind_la_SOURCES_s390x_common = \ + $(libunwind_la_SOURCES_common) \ + s390x/is_fpreg.c \ + s390x/regname.c + +if ARCH_S390X +# The list of files that go into libunwind: +libunwind_la_SOURCES = \ + $(libunwind_la_SOURCES_s390x_common) \ + $(libunwind_la_SOURCES_local) \ + s390x/getcontext.S \ + s390x/Lapply_reg_state.c \ + s390x/Lcreate_addr_space.c \ + s390x/Lget_proc_info.c \ + s390x/Lget_save_loc.c \ + s390x/Lglobal.c \ + s390x/Linit.c \ + s390x/Linit_local.c \ + s390x/Linit_remote.c \ + s390x/Lis_signal_frame.c \ + s390x/Lregs.c \ + s390x/Lreg_states_iterate.c \ + s390x/Lresume.c \ + s390x/Lstep.c \ + s390x/setcontext.S +endif # ARCH_S390X + +# The list of files that go into libunwind-s390x: +libunwind_s390x_la_SOURCES = \ + $(libunwind_la_SOURCES_s390x_common) \ + $(libunwind_la_SOURCES_generic) \ + s390x/Gapply_reg_state.c \ + s390x/Gcreate_addr_space.c \ + s390x/Gget_proc_info.c \ + s390x/Gget_save_loc.c \ + s390x/Gglobal.c \ + s390x/Ginit.c \ + s390x/Ginit_local.c \ + s390x/Ginit_remote.c \ + s390x/Gis_signal_frame.c \ + s390x/Gregs.c \ + s390x/Greg_states_iterate.c \ + s390x/Gresume.c \ + s390x/Gstep.c +libunwind_s390x_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) +libunwind_s390x_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf64.la \ + $(libunwind_libadd) + +### target Sh: +# The list of files that go into libunwind and libunwind-sh: +noinst_HEADERS += \ + sh/init.h \ + sh/offsets.h \ + sh/unwind_i.h +libunwind_la_SOURCES_sh_common = \ + $(libunwind_la_SOURCES_common) \ + sh/is_fpreg.c \ + sh/regname.c + +if ARCH_SH +# The list of files that go into libunwind: +libunwind_la_SOURCES = \ + $(libunwind_la_SOURCES_sh_common) \ + $(libunwind_la_SOURCES_local) \ + sh/Lapply_reg_state.c \ + sh/Lcreate_addr_space.c \ + sh/Lget_proc_info.c \ + sh/Lget_save_loc.c \ + sh/Lglobal.c \ + sh/Linit.c \ + sh/Linit_local.c \ + sh/Linit_remote.c \ + sh/Lis_signal_frame.c \ + sh/Lregs.c \ + sh/Lreg_states_iterate.c \ + sh/Lresume.c \ + sh/Lstep.c +libunwind_setjmp_la_SOURCES += sh/siglongjmp.S +endif # ARCH_SH + +libunwind_sh_la_SOURCES = \ + $(libunwind_la_SOURCES_sh_common) \ + $(libunwind_la_SOURCES_generic) \ + sh/Gapply_reg_state.c \ + sh/Gcreate_addr_space.c \ + sh/Gget_proc_info.c \ + sh/Gget_save_loc.c \ + sh/Gglobal.c \ + sh/Ginit.c \ + sh/Ginit_local.c \ + sh/Ginit_remote.c \ + sh/Gis_signal_frame.c \ + sh/Gregs.c \ + sh/Greg_states_iterate.c \ + sh/Gresume.c \ + sh/Gstep.c +libunwind_sh_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) +libunwind_sh_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf32.la \ + $(libunwind_libadd) + +### target x86: +# The list of files that go both into libunwind and libunwind-x86: +noinst_HEADERS += \ + x86/init.h \ + x86/offsets.h \ + x86/unwind_i.h +libunwind_la_SOURCES_x86_common = \ + $(libunwind_la_SOURCES_common) \ + x86/is_fpreg.c \ + x86/regname.c + +if ARCH_X86 +# The list of files that go into libunwind: +libunwind_la_SOURCES = \ + $(libunwind_la_SOURCES_x86_common) \ + $(libunwind_la_SOURCES_x86_os_local) \ + $(libunwind_la_SOURCES_local) \ + x86/Lapply_reg_state.c \ + x86/Lcreate_addr_space.c \ + x86/Lget_proc_info.c \ + x86/Lget_save_loc.c \ + x86/Lglobal.c \ + x86/Linit.c \ + x86/Linit_local.c \ + x86/Linit_remote.c \ + x86/Lregs.c \ + x86/Lreg_states_iterate.c \ + x86/Lresume.c \ + x86/Lstep.c + +libunwind_setjmp_la_SOURCES += \ + x86/longjmp.S \ + x86/siglongjmp.S +endif # ARCH_X86 + +# The list of files that go into libunwind-x86: +libunwind_x86_la_SOURCES = \ + $(libunwind_la_SOURCES_x86_common) \ + $(libunwind_la_SOURCES_x86_os) \ + $(libunwind_la_SOURCES_generic) \ + x86/Gapply_reg_state.c \ + x86/Gcreate_addr_space.c \ + x86/Gget_proc_info.c \ + x86/Gget_save_loc.c \ + x86/Gglobal.c \ + x86/Ginit.c \ + x86/Ginit_local.c \ + x86/Ginit_remote.c \ + x86/Gregs.c \ + x86/Greg_states_iterate.c \ + x86/Gresume.c \ + x86/Gstep.c +libunwind_x86_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) +libunwind_x86_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf32.la \ + $(libunwind_libadd) + +### target x86_64: +# The list of files that go both into libunwind and libunwind-x86_64: +noinst_HEADERS += \ + x86_64/init.h \ + x86_64/ucontext_i.h \ + x86_64/unwind_i.h +libunwind_la_SOURCES_x86_64_common = \ + $(libunwind_la_SOURCES_common) \ + x86_64/is_fpreg.c \ + x86_64/regname.c + +if ARCH_X86_64 +# The list of files that go into libunwind: +libunwind_la_SOURCES = \ + $(libunwind_la_SOURCES_x86_64_common) \ + $(libunwind_la_SOURCES_x86_64_os_local)\ + $(libunwind_la_SOURCES_local) \ + x86_64/getcontext.S \ + x86_64/Lapply_reg_state.c \ + x86_64/Lcreate_addr_space.c \ + x86_64/Lget_proc_info.c \ + x86_64/Lget_save_loc.c \ + x86_64/Lglobal.c \ + x86_64/Linit.c \ + x86_64/Linit_local.c \ + x86_64/Linit_remote.c \ + x86_64/Lregs.c \ + x86_64/Lreg_states_iterate.c \ + x86_64/Lresume.c \ + x86_64/Lstash_frame.c \ + x86_64/Lstep.c \ + x86_64/Ltrace.c \ + x86_64/setcontext.S + +libunwind_setjmp_la_SOURCES += \ + x86_64/longjmp.S \ + x86_64/siglongjmp.S +endif # ARCH_X86_64 + +# The list of files that go into libunwind-x86_64: +libunwind_x86_64_la_SOURCES = \ + $(libunwind_la_SOURCES_x86_64_common) \ + $(libunwind_la_SOURCES_x86_64_os) \ + $(libunwind_la_SOURCES_generic) \ + x86_64/Gapply_reg_state.c \ + x86_64/Gcreate_addr_space.c \ + x86_64/Gget_proc_info.c \ + x86_64/Gget_save_loc.c \ + x86_64/Gglobal.c \ + x86_64/Ginit.c \ + x86_64/Ginit_local.c \ + x86_64/Ginit_remote.c \ + x86_64/Gregs.c \ + x86_64/Greg_states_iterate.c \ + x86_64/Gresume.c \ + x86_64/Gstash_frame.c \ + x86_64/Gstep.c \ + x86_64/Gtrace.c +libunwind_x86_64_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) +libunwind_x86_64_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf64.la \ + $(libunwind_libadd) + +if REMOTE_ONLY +install-exec-hook: +# Nothing to do here.... +else +# +# This is not ideal, but I know of no other way to install an +# alias for a library. For the shared version, we have to do +# a file check before creating the link, because it isn't going +# to be there if the user configured with --disable-shared. +# +install-exec-hook: + if test -f $(DESTDIR)$(libdir)/libunwind-$(arch).a; then \ + cd $(DESTDIR)$(libdir) && $(LN_S) -f libunwind-$(arch).a libunwind-generic.a; \ + fi + if test -f $(DESTDIR)$(libdir)/libunwind-$(arch).so; then \ + cd $(DESTDIR)$(libdir) && $(LN_S) -f libunwind-$(arch).so \ + libunwind-generic.so; \ + fi +endif + +# +# Don't link with standard libraries, because those may mention +# libunwind already. +# +libunwind_la_LDFLAGS = $(COMMON_SO_LDFLAGS) \ + $(UNW_CRT_LDFLAGS) \ + $(LDFLAGS_STATIC_LIBCXA) \ + -version-info $(SOVERSION) +libunwind_la_LIBADD += $(UNW_CRT_LIBADD) \ + $(LIBLZMA) \ + $(LIBZ) + +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/tdep-$(arch) -I. +AM_CCASFLAGS = $(AM_CPPFLAGS) +noinst_HEADERS += unwind/unwind-internal.h + +EXTRA_DIST = $(libunwind_la_EXTRAS_ia64) + +MAINTAINERCLEANFILES = Makefile.in + +# The -version-info flag accepts an argument of the form +# `current[:revision[:age]]'. So, passing `-version-info 3:12:1' sets +# current to 3, revision to 12, and age to 1. + +# If either revision or age are omitted, they default to 0. Also note +# that age must be less than or equal to the current interface number. + +# Here are a set of rules to help you update your library version +# information: + +# 1. Start with version information of `0:0:0' for each libtool +# library. + +# 2. Update the version information only immediately before a public +# release of your software. More frequent updates are unnecessary, +# and only guarantee that the current interface number gets larger +# faster. + +# 3. If the library source code has changed at all since the last +# update, then increment revision (`c:r:a' becomes `c:r+1:a'). + +# 4. If any interfaces have been added, removed, or changed since the +# last update, increment current, and set revision to 0. + +# 5. If any interfaces have been added since the last public release, +# then increment age. + +# 6. If any interfaces have been removed since the last public +# release, then set age to 0. diff --git a/vendor/libunwind/src/Makefile.in b/vendor/libunwind/src/Makefile.in new file mode 100644 index 0000000000..e88c5c1424 --- /dev/null +++ b/vendor/libunwind/src/Makefile.in @@ -0,0 +1,6344 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# This file is a part of the libunwind project. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# This permission notice shall be included in all copies or substantial portions +# of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# + + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +@REMOTE_ONLY_FALSE@am__append_1 = libunwind.la +@ARCH_AARCH64_TRUE@am__append_2 = libunwind-aarch64.la +@ARCH_ARM_TRUE@am__append_3 = libunwind-arm.la +@ARCH_HPPA_TRUE@am__append_4 = libunwind-hppa.la +@ARCH_IA64_TRUE@am__append_5 = libunwind-ia64.la +@ARCH_LOONGARCH64_TRUE@am__append_6 = libunwind-loongarch64.la +@ARCH_MIPS_TRUE@am__append_7 = libunwind-mips.la +@ARCH_PPC32_TRUE@am__append_8 = libunwind-ppc32.la +@ARCH_PPC64_TRUE@am__append_9 = libunwind-ppc64.la +@ARCH_RISCV_TRUE@am__append_10 = libunwind-riscv.la +@ARCH_S390X_TRUE@am__append_11 = libunwind-s390x.la +@ARCH_SH_TRUE@am__append_12 = libunwind-sh.la +@ARCH_X86_TRUE@am__append_13 = libunwind-x86.la +@ARCH_X86_64_TRUE@am__append_14 = libunwind-x86_64.la +@BUILD_COREDUMP_TRUE@am__append_15 = libunwind-coredump.la +@BUILD_NTO_TRUE@am__append_16 = libunwind-nto.la +@BUILD_PTRACE_TRUE@am__append_17 = libunwind-ptrace.la +@BUILD_SETJMP_TRUE@am__append_18 = libunwind-setjmp.la +@REMOTE_ONLY_FALSE@am__append_19 = libunwind.la +@REMOTE_ONLY_FALSE@am__append_20 = unwind/libunwind.pc +@BUILD_COREDUMP_TRUE@am__append_21 = coredump/libunwind-coredump.pc +@BUILD_PTRACE_TRUE@am__append_22 = ptrace/libunwind-ptrace.pc +@BUILD_SETJMP_TRUE@am__append_23 = setjmp/libunwind-setjmp.pc +@USE_DWARF_TRUE@am__append_24 = libunwind-dwarf-common.la libunwind-dwarf-generic.la +@REMOTE_ONLY_FALSE@@USE_DWARF_TRUE@am__append_25 = libunwind-dwarf-local.la +@USE_DWARF_TRUE@am__append_26 = libunwind-dwarf-local.la +@OS_LINUX_TRUE@am__append_27 = coredump/_UCD_access_reg_linux.c \ +@OS_LINUX_TRUE@ coredump/_UCD_get_threadinfo_prstatus.c \ +@OS_LINUX_TRUE@ coredump/_UCD_get_mapinfo_linux.c +@OS_FREEBSD_TRUE@am__append_28 = coredump/_UCD_access_reg_freebsd.c \ +@OS_FREEBSD_TRUE@ coredump/_UCD_get_threadinfo_prstatus.c \ +@OS_FREEBSD_TRUE@ coredump/_UCD_get_mapinfo_generic.c +@OS_QNX_TRUE@am__append_29 = coredump/_UCD_access_reg_qnx.c \ +@OS_QNX_TRUE@ coredump/_UCD_get_threadinfo_prstatus.c \ +@OS_QNX_TRUE@ coredump/_UCD_get_mapinfo_qnx.c +@ARCH_AARCH64_TRUE@am__append_30 = \ +@ARCH_AARCH64_TRUE@ aarch64/longjmp.S \ +@ARCH_AARCH64_TRUE@ aarch64/siglongjmp.S + +@ARCH_ARM_TRUE@am__append_31 = arm/siglongjmp.S +@ARCH_HPPA_TRUE@am__append_32 = hppa/siglongjmp.S +@ARCH_IA64_TRUE@am__append_33 = \ +@ARCH_IA64_TRUE@ ia64/longjmp.S \ +@ARCH_IA64_TRUE@ ia64/setjmp.S \ +@ARCH_IA64_TRUE@ ia64/siglongjmp.S \ +@ARCH_IA64_TRUE@ ia64/sigsetjmp.S + +@ARCH_LOONGARCH64_TRUE@am__append_34 = \ +@ARCH_LOONGARCH64_TRUE@ loongarch64/siglongjmp.S + +@ARCH_MIPS_TRUE@am__append_35 = mips/siglongjmp.S +@ARCH_PPC32_TRUE@am__append_36 = \ +@ARCH_PPC32_TRUE@ ppc/longjmp.S \ +@ARCH_PPC32_TRUE@ ppc/siglongjmp.S + +@ARCH_PPC64_TRUE@am__append_37 = \ +@ARCH_PPC64_TRUE@ ppc/longjmp.S \ +@ARCH_PPC64_TRUE@ ppc/siglongjmp.S + +@ARCH_RISCV_TRUE@am__append_38 = \ +@ARCH_RISCV_TRUE@ riscv/siglongjmp.S + +@ARCH_SH_TRUE@am__append_39 = sh/siglongjmp.S +@ARCH_X86_TRUE@am__append_40 = \ +@ARCH_X86_TRUE@ x86/longjmp.S \ +@ARCH_X86_TRUE@ x86/siglongjmp.S + +@ARCH_X86_64_TRUE@am__append_41 = \ +@ARCH_X86_64_TRUE@ x86_64/longjmp.S \ +@ARCH_X86_64_TRUE@ x86_64/siglongjmp.S + +subdir = src +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ + $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/config.h +CONFIG_CLEAN_FILES = libunwind-generic.pc +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" +LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) +libunwind_aarch64_la_DEPENDENCIES = libunwind-dwarf-generic.la \ + libunwind-elf64.la $(libunwind_libadd) +am__libunwind_aarch64_la_SOURCES_DIST = os-freebsd.c os-hpux.c \ + os-linux.c dl-iterate-phdr.c os-qnx.c os-solaris.c mi/init.c \ + mi/flush_cache.c mi/mempool.c mi/strerror.c aarch64/is_fpreg.c \ + aarch64/regname.c mi/Gaddress_validator.c \ + mi/Gdestroy_addr_space.c mi/Gdyn-extract.c mi/Gdyn-remote.c \ + mi/Gfind_dynamic_proc_info.c mi/Gget_accessors.c \ + mi/Gget_fpreg.c mi/Gget_proc_info_by_ip.c mi/Gget_proc_name.c \ + mi/Gget_reg.c mi/Gis_plt_entry.c mi/Gput_dynamic_unwind_info.c \ + mi/Gset_cache_size.c mi/Gset_caching_policy.c mi/Gset_fpreg.c \ + mi/Gset_iterate_phdr_function.c mi/Gset_reg.c \ + mi/Gget_elf_filename.c aarch64/Gos-freebsd.c \ + aarch64/Gos-linux.c aarch64/Gos-qnx.c \ + aarch64/Gapply_reg_state.c aarch64/Gcreate_addr_space.c \ + aarch64/Gget_proc_info.c aarch64/Gget_save_loc.c \ + aarch64/Gglobal.c aarch64/Ginit.c aarch64/Ginit_local.c \ + aarch64/Ginit_remote.c aarch64/Gis_signal_frame.c \ + aarch64/Gregs.c aarch64/Greg_states_iterate.c \ + aarch64/Gresume.c aarch64/Gstash_frame.c aarch64/Gstep.c \ + aarch64/Gtrace.c aarch64/Gstrip_ptrauth_insn_mask.c +@OS_FREEBSD_FALSE@@OS_HPUX_FALSE@@OS_LINUX_FALSE@@OS_QNX_FALSE@@OS_SOLARIS_TRUE@am__objects_1 = os-solaris.lo +@OS_FREEBSD_FALSE@@OS_HPUX_FALSE@@OS_LINUX_FALSE@@OS_QNX_TRUE@am__objects_1 = os-qnx.lo +@OS_FREEBSD_FALSE@@OS_HPUX_FALSE@@OS_LINUX_TRUE@am__objects_1 = \ +@OS_FREEBSD_FALSE@@OS_HPUX_FALSE@@OS_LINUX_TRUE@ os-linux.lo \ +@OS_FREEBSD_FALSE@@OS_HPUX_FALSE@@OS_LINUX_TRUE@ dl-iterate-phdr.lo +@OS_FREEBSD_FALSE@@OS_HPUX_TRUE@am__objects_1 = os-hpux.lo +@OS_FREEBSD_TRUE@am__objects_1 = os-freebsd.lo +am__dirstamp = $(am__leading_dot)dirstamp +am__objects_2 = $(am__objects_1) mi/init.lo mi/flush_cache.lo \ + mi/mempool.lo mi/strerror.lo +am__objects_3 = $(am__objects_2) aarch64/is_fpreg.lo \ + aarch64/regname.lo +am__objects_4 = mi/Gaddress_validator.lo mi/Gdestroy_addr_space.lo \ + mi/Gdyn-extract.lo mi/Gdyn-remote.lo \ + mi/Gfind_dynamic_proc_info.lo mi/Gget_accessors.lo \ + mi/Gget_fpreg.lo mi/Gget_proc_info_by_ip.lo \ + mi/Gget_proc_name.lo mi/Gget_reg.lo mi/Gis_plt_entry.lo \ + mi/Gput_dynamic_unwind_info.lo mi/Gset_cache_size.lo \ + mi/Gset_caching_policy.lo mi/Gset_fpreg.lo \ + mi/Gset_iterate_phdr_function.lo mi/Gset_reg.lo \ + mi/Gget_elf_filename.lo +@OS_FREEBSD_FALSE@@OS_LINUX_FALSE@@OS_QNX_TRUE@am__objects_5 = aarch64/Gos-qnx.lo +@OS_FREEBSD_FALSE@@OS_LINUX_TRUE@am__objects_5 = aarch64/Gos-linux.lo +@OS_FREEBSD_TRUE@am__objects_5 = aarch64/Gos-freebsd.lo +am_libunwind_aarch64_la_OBJECTS = $(am__objects_3) $(am__objects_4) \ + $(am__objects_5) aarch64/Gapply_reg_state.lo \ + aarch64/Gcreate_addr_space.lo aarch64/Gget_proc_info.lo \ + aarch64/Gget_save_loc.lo aarch64/Gglobal.lo aarch64/Ginit.lo \ + aarch64/Ginit_local.lo aarch64/Ginit_remote.lo \ + aarch64/Gis_signal_frame.lo aarch64/Gregs.lo \ + aarch64/Greg_states_iterate.lo aarch64/Gresume.lo \ + aarch64/Gstash_frame.lo aarch64/Gstep.lo aarch64/Gtrace.lo \ + aarch64/Gstrip_ptrauth_insn_mask.lo +libunwind_aarch64_la_OBJECTS = $(am_libunwind_aarch64_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libunwind_aarch64_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libunwind_aarch64_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@ARCH_AARCH64_TRUE@am_libunwind_aarch64_la_rpath = -rpath $(libdir) +libunwind_arm_la_DEPENDENCIES = libunwind-dwarf-generic.la \ + libunwind-elf32.la $(libunwind_libadd) +am__libunwind_arm_la_SOURCES_DIST = os-freebsd.c os-hpux.c os-linux.c \ + dl-iterate-phdr.c os-qnx.c os-solaris.c mi/init.c \ + mi/flush_cache.c mi/mempool.c mi/strerror.c arm/is_fpreg.c \ + arm/regname.c arm/Gos-freebsd.c arm/Gos-linux.c \ + arm/Gos-other.c mi/Gaddress_validator.c \ + mi/Gdestroy_addr_space.c mi/Gdyn-extract.c mi/Gdyn-remote.c \ + mi/Gfind_dynamic_proc_info.c mi/Gget_accessors.c \ + mi/Gget_fpreg.c mi/Gget_proc_info_by_ip.c mi/Gget_proc_name.c \ + mi/Gget_reg.c mi/Gis_plt_entry.c mi/Gput_dynamic_unwind_info.c \ + mi/Gset_cache_size.c mi/Gset_caching_policy.c mi/Gset_fpreg.c \ + mi/Gset_iterate_phdr_function.c mi/Gset_reg.c \ + mi/Gget_elf_filename.c arm/Gapply_reg_state.c \ + arm/Gcreate_addr_space.c arm/Gex_tables.c arm/Gget_proc_info.c \ + arm/Gget_save_loc.c arm/Gglobal.c arm/Ginit.c \ + arm/Ginit_local.c arm/Ginit_remote.c arm/Gregs.c \ + arm/Greg_states_iterate.c arm/Gresume.c arm/Gstash_frame.c \ + arm/Gstep.c arm/Gtrace.c +am__objects_6 = $(am__objects_2) arm/is_fpreg.lo arm/regname.lo +@OS_FREEBSD_FALSE@@OS_LINUX_FALSE@@OS_QNX_TRUE@am__objects_7 = arm/Gos-other.lo +@OS_FREEBSD_FALSE@@OS_LINUX_TRUE@am__objects_7 = arm/Gos-linux.lo +@OS_FREEBSD_TRUE@am__objects_7 = arm/Gos-freebsd.lo +am_libunwind_arm_la_OBJECTS = $(am__objects_6) $(am__objects_7) \ + $(am__objects_4) arm/Gapply_reg_state.lo \ + arm/Gcreate_addr_space.lo arm/Gex_tables.lo \ + arm/Gget_proc_info.lo arm/Gget_save_loc.lo arm/Gglobal.lo \ + arm/Ginit.lo arm/Ginit_local.lo arm/Ginit_remote.lo \ + arm/Gregs.lo arm/Greg_states_iterate.lo arm/Gresume.lo \ + arm/Gstash_frame.lo arm/Gstep.lo arm/Gtrace.lo +libunwind_arm_la_OBJECTS = $(am_libunwind_arm_la_OBJECTS) +libunwind_arm_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libunwind_arm_la_LDFLAGS) $(LDFLAGS) \ + -o $@ +@ARCH_ARM_TRUE@am_libunwind_arm_la_rpath = -rpath $(libdir) +am__DEPENDENCIES_1 = +libunwind_coredump_la_DEPENDENCIES = libunwind-$(arch).la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am__libunwind_coredump_la_SOURCES_DIST = coredump/_UCD_access_mem.c \ + coredump/_UCD_accessors.c coredump/_UCD_corefile_elf.c \ + coredump/_UCD_create.c coredump/_UCD_destroy.c \ + coredump/_UCD_elf_map_image.c coredump/ucd_file_table.c \ + coredump/_UCD_find_proc_info.c coredump/_UCD_get_proc_name.c \ + coredump/_UCD_get_elf_filename.c mi/init.c coredump/_UPT_elf.c \ + coredump/_UPT_access_fpreg.c \ + coredump/_UPT_get_dyn_info_list_addr.c \ + coredump/_UPT_put_unwind_info.c coredump/_UPT_resume.c \ + coredump/_UCD_access_reg_linux.c \ + coredump/_UCD_get_threadinfo_prstatus.c \ + coredump/_UCD_get_mapinfo_linux.c \ + coredump/_UCD_access_reg_freebsd.c \ + coredump/_UCD_get_mapinfo_generic.c \ + coredump/_UCD_access_reg_qnx.c coredump/_UCD_get_mapinfo_qnx.c +@OS_LINUX_TRUE@am__objects_8 = coredump/_UCD_access_reg_linux.lo \ +@OS_LINUX_TRUE@ coredump/_UCD_get_threadinfo_prstatus.lo \ +@OS_LINUX_TRUE@ coredump/_UCD_get_mapinfo_linux.lo +@OS_FREEBSD_TRUE@am__objects_9 = coredump/_UCD_access_reg_freebsd.lo \ +@OS_FREEBSD_TRUE@ coredump/_UCD_get_threadinfo_prstatus.lo \ +@OS_FREEBSD_TRUE@ coredump/_UCD_get_mapinfo_generic.lo +@OS_QNX_TRUE@am__objects_10 = coredump/_UCD_access_reg_qnx.lo \ +@OS_QNX_TRUE@ coredump/_UCD_get_threadinfo_prstatus.lo \ +@OS_QNX_TRUE@ coredump/_UCD_get_mapinfo_qnx.lo +am_libunwind_coredump_la_OBJECTS = coredump/_UCD_access_mem.lo \ + coredump/_UCD_accessors.lo coredump/_UCD_corefile_elf.lo \ + coredump/_UCD_create.lo coredump/_UCD_destroy.lo \ + coredump/_UCD_elf_map_image.lo coredump/ucd_file_table.lo \ + coredump/_UCD_find_proc_info.lo coredump/_UCD_get_proc_name.lo \ + coredump/_UCD_get_elf_filename.lo mi/init.lo \ + coredump/_UPT_elf.lo coredump/_UPT_access_fpreg.lo \ + coredump/_UPT_get_dyn_info_list_addr.lo \ + coredump/_UPT_put_unwind_info.lo coredump/_UPT_resume.lo \ + $(am__objects_8) $(am__objects_9) $(am__objects_10) +libunwind_coredump_la_OBJECTS = $(am_libunwind_coredump_la_OBJECTS) +libunwind_coredump_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libunwind_coredump_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@BUILD_COREDUMP_TRUE@am_libunwind_coredump_la_rpath = -rpath $(libdir) +libunwind_dwarf_common_la_LIBADD = +am_libunwind_dwarf_common_la_OBJECTS = dwarf/global.lo +libunwind_dwarf_common_la_OBJECTS = \ + $(am_libunwind_dwarf_common_la_OBJECTS) +@USE_DWARF_TRUE@am_libunwind_dwarf_common_la_rpath = +libunwind_dwarf_generic_la_DEPENDENCIES = libunwind-dwarf-common.la +am_libunwind_dwarf_generic_la_OBJECTS = dwarf/Gexpr.lo dwarf/Gfde.lo \ + dwarf/Gfind_proc_info-lsb.lo dwarf/Gfind_unwind_table.lo \ + dwarf/Gget_proc_info_in_range.lo dwarf/Gparser.lo dwarf/Gpe.lo +libunwind_dwarf_generic_la_OBJECTS = \ + $(am_libunwind_dwarf_generic_la_OBJECTS) +@USE_DWARF_TRUE@am_libunwind_dwarf_generic_la_rpath = +libunwind_dwarf_local_la_DEPENDENCIES = libunwind-dwarf-common.la +am_libunwind_dwarf_local_la_OBJECTS = dwarf/Lexpr.lo dwarf/Lfde.lo \ + dwarf/Lfind_proc_info-lsb.lo dwarf/Lfind_unwind_table.lo \ + dwarf/Lget_proc_info_in_range.lo dwarf/Lparser.lo dwarf/Lpe.lo +libunwind_dwarf_local_la_OBJECTS = \ + $(am_libunwind_dwarf_local_la_OBJECTS) +@REMOTE_ONLY_FALSE@@USE_DWARF_TRUE@am_libunwind_dwarf_local_la_rpath = +libunwind_elf32_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_libunwind_elf32_la_OBJECTS = elf32.lo +libunwind_elf32_la_OBJECTS = $(am_libunwind_elf32_la_OBJECTS) +@USE_ELF32_TRUE@am_libunwind_elf32_la_rpath = +libunwind_elf64_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_libunwind_elf64_la_OBJECTS = elf64.lo +libunwind_elf64_la_OBJECTS = $(am_libunwind_elf64_la_OBJECTS) +@USE_ELF64_TRUE@am_libunwind_elf64_la_rpath = +libunwind_elfxx_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am_libunwind_elfxx_la_OBJECTS = elfxx.lo +libunwind_elfxx_la_OBJECTS = $(am_libunwind_elfxx_la_OBJECTS) +@USE_ELFXX_TRUE@am_libunwind_elfxx_la_rpath = +libunwind_hppa_la_DEPENDENCIES = libunwind-dwarf-generic.la \ + libunwind-elf32.la $(libunwind_libadd) +am__libunwind_hppa_la_SOURCES_DIST = os-freebsd.c os-hpux.c os-linux.c \ + dl-iterate-phdr.c os-qnx.c os-solaris.c mi/init.c \ + mi/flush_cache.c mi/mempool.c mi/strerror.c hppa/regname.c \ + mi/Gaddress_validator.c mi/Gdestroy_addr_space.c \ + mi/Gdyn-extract.c mi/Gdyn-remote.c \ + mi/Gfind_dynamic_proc_info.c mi/Gget_accessors.c \ + mi/Gget_fpreg.c mi/Gget_proc_info_by_ip.c mi/Gget_proc_name.c \ + mi/Gget_reg.c mi/Gis_plt_entry.c mi/Gput_dynamic_unwind_info.c \ + mi/Gset_cache_size.c mi/Gset_caching_policy.c mi/Gset_fpreg.c \ + mi/Gset_iterate_phdr_function.c mi/Gset_reg.c \ + mi/Gget_elf_filename.c hppa/Gapply_reg_state.c \ + hppa/Gcreate_addr_space.c hppa/Gget_proc_info.c \ + hppa/Gget_save_loc.c hppa/Gglobal.c hppa/Ginit.c \ + hppa/Ginit_local.c hppa/Ginit_remote.c hppa/Gis_signal_frame.c \ + hppa/Gregs.c hppa/Greg_states_iterate.c hppa/Gresume.c \ + hppa/Gstep.c +am__objects_11 = $(am__objects_2) hppa/regname.lo +am_libunwind_hppa_la_OBJECTS = $(am__objects_11) $(am__objects_4) \ + hppa/Gapply_reg_state.lo hppa/Gcreate_addr_space.lo \ + hppa/Gget_proc_info.lo hppa/Gget_save_loc.lo hppa/Gglobal.lo \ + hppa/Ginit.lo hppa/Ginit_local.lo hppa/Ginit_remote.lo \ + hppa/Gis_signal_frame.lo hppa/Gregs.lo \ + hppa/Greg_states_iterate.lo hppa/Gresume.lo hppa/Gstep.lo +libunwind_hppa_la_OBJECTS = $(am_libunwind_hppa_la_OBJECTS) +libunwind_hppa_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libunwind_hppa_la_LDFLAGS) $(LDFLAGS) \ + -o $@ +@ARCH_HPPA_TRUE@am_libunwind_hppa_la_rpath = -rpath $(libdir) +libunwind_ia64_la_DEPENDENCIES = libunwind-elf64.la \ + $(libunwind_libadd) +am__libunwind_ia64_la_SOURCES_DIST = os-freebsd.c os-hpux.c os-linux.c \ + dl-iterate-phdr.c os-qnx.c os-solaris.c mi/init.c \ + mi/flush_cache.c mi/mempool.c mi/strerror.c ia64/regname.c \ + mi/Gaddress_validator.c mi/Gdestroy_addr_space.c \ + mi/Gdyn-extract.c mi/Gdyn-remote.c \ + mi/Gfind_dynamic_proc_info.c mi/Gget_accessors.c \ + mi/Gget_fpreg.c mi/Gget_proc_info_by_ip.c mi/Gget_proc_name.c \ + mi/Gget_reg.c mi/Gis_plt_entry.c mi/Gput_dynamic_unwind_info.c \ + mi/Gset_cache_size.c mi/Gset_caching_policy.c mi/Gset_fpreg.c \ + mi/Gset_iterate_phdr_function.c mi/Gset_reg.c \ + mi/Gget_elf_filename.c ia64/Gapply_reg_state.c \ + ia64/Gcreate_addr_space.c ia64/Gfind_unwind_table.c \ + ia64/Gget_proc_info.c ia64/Gget_save_loc.c ia64/Gglobal.c \ + ia64/Ginit.c ia64/Ginit_local.c ia64/Ginit_remote.c \ + ia64/Ginstall_cursor.S ia64/Gis_signal_frame.c ia64/Gparser.c \ + ia64/Grbs.c ia64/Gregs.c ia64/Greg_states_iterate.c \ + ia64/Gresume.c ia64/Gscript.c ia64/Gstep.c ia64/Gtables.c +am__objects_12 = $(am__objects_2) ia64/regname.lo +am_libunwind_ia64_la_OBJECTS = $(am__objects_12) $(am__objects_4) \ + ia64/Gapply_reg_state.lo ia64/Gcreate_addr_space.lo \ + ia64/Gfind_unwind_table.lo ia64/Gget_proc_info.lo \ + ia64/Gget_save_loc.lo ia64/Gglobal.lo ia64/Ginit.lo \ + ia64/Ginit_local.lo ia64/Ginit_remote.lo \ + ia64/Ginstall_cursor.lo ia64/Gis_signal_frame.lo \ + ia64/Gparser.lo ia64/Grbs.lo ia64/Gregs.lo \ + ia64/Greg_states_iterate.lo ia64/Gresume.lo ia64/Gscript.lo \ + ia64/Gstep.lo ia64/Gtables.lo +libunwind_ia64_la_OBJECTS = $(am_libunwind_ia64_la_OBJECTS) +libunwind_ia64_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libunwind_ia64_la_LDFLAGS) $(LDFLAGS) \ + -o $@ +@ARCH_IA64_TRUE@am_libunwind_ia64_la_rpath = -rpath $(libdir) +libunwind_loongarch64_la_DEPENDENCIES = libunwind-dwarf-generic.la \ + libunwind-elf64.la $(libunwind_libadd) +am__libunwind_loongarch64_la_SOURCES_DIST = os-freebsd.c os-hpux.c \ + os-linux.c dl-iterate-phdr.c os-qnx.c os-solaris.c mi/init.c \ + mi/flush_cache.c mi/mempool.c mi/strerror.c \ + loongarch64/is_fpreg.c loongarch64/regname.c \ + mi/Gaddress_validator.c mi/Gdestroy_addr_space.c \ + mi/Gdyn-extract.c mi/Gdyn-remote.c \ + mi/Gfind_dynamic_proc_info.c mi/Gget_accessors.c \ + mi/Gget_fpreg.c mi/Gget_proc_info_by_ip.c mi/Gget_proc_name.c \ + mi/Gget_reg.c mi/Gis_plt_entry.c mi/Gput_dynamic_unwind_info.c \ + mi/Gset_cache_size.c mi/Gset_caching_policy.c mi/Gset_fpreg.c \ + mi/Gset_iterate_phdr_function.c mi/Gset_reg.c \ + mi/Gget_elf_filename.c loongarch64/Gapply_reg_state.c \ + loongarch64/Gcreate_addr_space.c loongarch64/Gget_proc_info.c \ + loongarch64/Gget_save_loc.c loongarch64/Gglobal.c \ + loongarch64/Ginit.c loongarch64/Ginit_local.c \ + loongarch64/Ginit_remote.c loongarch64/Gis_signal_frame.c \ + loongarch64/Gregs.c loongarch64/Greg_states_iterate.c \ + loongarch64/Gresume.c loongarch64/Gstep.c +am__objects_13 = $(am__objects_2) loongarch64/is_fpreg.lo \ + loongarch64/regname.lo +am_libunwind_loongarch64_la_OBJECTS = $(am__objects_13) \ + $(am__objects_4) loongarch64/Gapply_reg_state.lo \ + loongarch64/Gcreate_addr_space.lo \ + loongarch64/Gget_proc_info.lo loongarch64/Gget_save_loc.lo \ + loongarch64/Gglobal.lo loongarch64/Ginit.lo \ + loongarch64/Ginit_local.lo loongarch64/Ginit_remote.lo \ + loongarch64/Gis_signal_frame.lo loongarch64/Gregs.lo \ + loongarch64/Greg_states_iterate.lo loongarch64/Gresume.lo \ + loongarch64/Gstep.lo +libunwind_loongarch64_la_OBJECTS = \ + $(am_libunwind_loongarch64_la_OBJECTS) +libunwind_loongarch64_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libunwind_loongarch64_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@ARCH_LOONGARCH64_TRUE@am_libunwind_loongarch64_la_rpath = -rpath \ +@ARCH_LOONGARCH64_TRUE@ $(libdir) +libunwind_mips_la_DEPENDENCIES = libunwind-dwarf-generic.la \ + libunwind-elfxx.la $(libunwind_libadd) +am__libunwind_mips_la_SOURCES_DIST = os-freebsd.c os-hpux.c os-linux.c \ + dl-iterate-phdr.c os-qnx.c os-solaris.c mi/init.c \ + mi/flush_cache.c mi/mempool.c mi/strerror.c mips/is_fpreg.c \ + mips/regname.c mi/Gaddress_validator.c \ + mi/Gdestroy_addr_space.c mi/Gdyn-extract.c mi/Gdyn-remote.c \ + mi/Gfind_dynamic_proc_info.c mi/Gget_accessors.c \ + mi/Gget_fpreg.c mi/Gget_proc_info_by_ip.c mi/Gget_proc_name.c \ + mi/Gget_reg.c mi/Gis_plt_entry.c mi/Gput_dynamic_unwind_info.c \ + mi/Gset_cache_size.c mi/Gset_caching_policy.c mi/Gset_fpreg.c \ + mi/Gset_iterate_phdr_function.c mi/Gset_reg.c \ + mi/Gget_elf_filename.c mips/Gapply_reg_state.c \ + mips/Gcreate_addr_space.c mips/Gget_proc_info.c \ + mips/Gget_save_loc.c mips/Gglobal.c mips/Ginit.c \ + mips/Ginit_local.c mips/Ginit_remote.c mips/Gis_signal_frame.c \ + mips/Gregs.c mips/Greg_states_iterate.c mips/Gresume.c \ + mips/Gstep.c +am__objects_14 = $(am__objects_2) mips/is_fpreg.lo mips/regname.lo +am_libunwind_mips_la_OBJECTS = $(am__objects_14) $(am__objects_4) \ + mips/Gapply_reg_state.lo mips/Gcreate_addr_space.lo \ + mips/Gget_proc_info.lo mips/Gget_save_loc.lo mips/Gglobal.lo \ + mips/Ginit.lo mips/Ginit_local.lo mips/Ginit_remote.lo \ + mips/Gis_signal_frame.lo mips/Gregs.lo \ + mips/Greg_states_iterate.lo mips/Gresume.lo mips/Gstep.lo +libunwind_mips_la_OBJECTS = $(am_libunwind_mips_la_OBJECTS) +libunwind_mips_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libunwind_mips_la_LDFLAGS) $(LDFLAGS) \ + -o $@ +@ARCH_MIPS_TRUE@am_libunwind_mips_la_rpath = -rpath $(libdir) +libunwind_nto_la_DEPENDENCIES = libunwind-$(arch).la \ + $(libunwind_libadd) +am_libunwind_nto_la_OBJECTS = mi/init.lo nto/unw_nto_access_fpreg.lo \ + nto/unw_nto_access_mem.lo nto/unw_nto_accessors.lo \ + nto/unw_nto_access_reg.lo nto/unw_nto_create.lo \ + nto/unw_nto_destroy.lo nto/unw_nto_elf.lo \ + nto/unw_nto_find_proc_info.lo \ + nto/unw_nto_get_dyn_info_list_addr.lo \ + nto/unw_nto_get_proc_name.lo nto/unw_nto_get_elf_filename.lo \ + nto/unw_nto_put_unwind_info.lo nto/unw_nto_resume.lo +libunwind_nto_la_OBJECTS = $(am_libunwind_nto_la_OBJECTS) +@BUILD_NTO_TRUE@am_libunwind_nto_la_rpath = -rpath $(libdir) +libunwind_ppc32_la_DEPENDENCIES = libunwind-dwarf-generic.la \ + libunwind-elf32.la $(libunwind_libadd) +am__libunwind_ppc32_la_SOURCES_DIST = os-freebsd.c os-hpux.c \ + os-linux.c dl-iterate-phdr.c os-qnx.c os-solaris.c mi/init.c \ + mi/flush_cache.c mi/mempool.c mi/strerror.c \ + ppc32/get_func_addr.c ppc32/is_fpreg.c ppc32/regname.c \ + mi/Gaddress_validator.c mi/Gdestroy_addr_space.c \ + mi/Gdyn-extract.c mi/Gdyn-remote.c \ + mi/Gfind_dynamic_proc_info.c mi/Gget_accessors.c \ + mi/Gget_fpreg.c mi/Gget_proc_info_by_ip.c mi/Gget_proc_name.c \ + mi/Gget_reg.c mi/Gis_plt_entry.c mi/Gput_dynamic_unwind_info.c \ + mi/Gset_cache_size.c mi/Gset_caching_policy.c mi/Gset_fpreg.c \ + mi/Gset_iterate_phdr_function.c mi/Gset_reg.c \ + mi/Gget_elf_filename.c ppc/Gget_proc_info.c \ + ppc/Gget_save_loc.c ppc/Ginit_local.c ppc/Ginit_remote.c \ + ppc/Gis_signal_frame.c ppc32/Gapply_reg_state.c \ + ppc32/Gcreate_addr_space.c ppc32/Gglobal.c ppc32/Ginit.c \ + ppc32/Gregs.c ppc32/Greg_states_iterate.c ppc32/Gresume.c \ + ppc32/Gstep.c +am__objects_15 = $(am__objects_2) ppc32/get_func_addr.lo \ + ppc32/is_fpreg.lo ppc32/regname.lo +am__objects_16 = ppc/Gget_proc_info.lo ppc/Gget_save_loc.lo \ + ppc/Ginit_local.lo ppc/Ginit_remote.lo ppc/Gis_signal_frame.lo +am_libunwind_ppc32_la_OBJECTS = $(am__objects_15) $(am__objects_4) \ + $(am__objects_16) ppc32/Gapply_reg_state.lo \ + ppc32/Gcreate_addr_space.lo ppc32/Gglobal.lo ppc32/Ginit.lo \ + ppc32/Gregs.lo ppc32/Greg_states_iterate.lo ppc32/Gresume.lo \ + ppc32/Gstep.lo +libunwind_ppc32_la_OBJECTS = $(am_libunwind_ppc32_la_OBJECTS) +libunwind_ppc32_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libunwind_ppc32_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@ARCH_PPC32_TRUE@am_libunwind_ppc32_la_rpath = -rpath $(libdir) +libunwind_ppc64_la_DEPENDENCIES = libunwind-dwarf-generic.la \ + libunwind-elf64.la $(libunwind_libadd) +am__libunwind_ppc64_la_SOURCES_DIST = os-freebsd.c os-hpux.c \ + os-linux.c dl-iterate-phdr.c os-qnx.c os-solaris.c mi/init.c \ + mi/flush_cache.c mi/mempool.c mi/strerror.c \ + ppc64/get_func_addr.c ppc64/is_fpreg.c ppc64/regname.c \ + mi/Gaddress_validator.c mi/Gdestroy_addr_space.c \ + mi/Gdyn-extract.c mi/Gdyn-remote.c \ + mi/Gfind_dynamic_proc_info.c mi/Gget_accessors.c \ + mi/Gget_fpreg.c mi/Gget_proc_info_by_ip.c mi/Gget_proc_name.c \ + mi/Gget_reg.c mi/Gis_plt_entry.c mi/Gput_dynamic_unwind_info.c \ + mi/Gset_cache_size.c mi/Gset_caching_policy.c mi/Gset_fpreg.c \ + mi/Gset_iterate_phdr_function.c mi/Gset_reg.c \ + mi/Gget_elf_filename.c ppc/Gget_proc_info.c \ + ppc/Gget_save_loc.c ppc/Ginit_local.c ppc/Ginit_remote.c \ + ppc/Gis_signal_frame.c ppc64/Gapply_reg_state.c \ + ppc64/Gcreate_addr_space.c ppc64/Gglobal.c ppc64/Ginit.c \ + ppc64/Gregs.c ppc64/Greg_states_iterate.c ppc64/Gresume.c \ + ppc64/Gstep.c +am__objects_17 = $(am__objects_2) ppc64/get_func_addr.lo \ + ppc64/is_fpreg.lo ppc64/regname.lo +am_libunwind_ppc64_la_OBJECTS = $(am__objects_17) $(am__objects_4) \ + $(am__objects_16) ppc64/Gapply_reg_state.lo \ + ppc64/Gcreate_addr_space.lo ppc64/Gglobal.lo ppc64/Ginit.lo \ + ppc64/Gregs.lo ppc64/Greg_states_iterate.lo ppc64/Gresume.lo \ + ppc64/Gstep.lo +libunwind_ppc64_la_OBJECTS = $(am_libunwind_ppc64_la_OBJECTS) +libunwind_ppc64_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libunwind_ppc64_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@ARCH_PPC64_TRUE@am_libunwind_ppc64_la_rpath = -rpath $(libdir) +libunwind_ptrace_la_DEPENDENCIES = libunwind-$(arch).la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libunwind_ptrace_la_OBJECTS = mi/init.lo \ + ptrace/_UPT_access_fpreg.lo ptrace/_UPT_access_mem.lo \ + ptrace/_UPT_accessors.lo ptrace/_UPT_access_reg.lo \ + ptrace/_UPT_create.lo ptrace/_UPT_destroy.lo \ + ptrace/_UPT_elf.lo ptrace/_UPT_find_proc_info.lo \ + ptrace/_UPT_get_dyn_info_list_addr.lo \ + ptrace/_UPT_get_proc_name.lo ptrace/_UPT_get_elf_filename.lo \ + ptrace/_UPT_put_unwind_info.lo ptrace/_UPT_reg_offset.lo \ + ptrace/_UPT_resume.lo ptrace/_UPT_ptrauth_insn_mask.lo +libunwind_ptrace_la_OBJECTS = $(am_libunwind_ptrace_la_OBJECTS) +@BUILD_PTRACE_TRUE@am_libunwind_ptrace_la_rpath = -rpath $(libdir) +libunwind_riscv_la_DEPENDENCIES = libunwind-dwarf-generic.la \ + libunwind-elf64.la $(libunwind_libadd) +am__libunwind_riscv_la_SOURCES_DIST = os-freebsd.c os-hpux.c \ + os-linux.c dl-iterate-phdr.c os-qnx.c os-solaris.c mi/init.c \ + mi/flush_cache.c mi/mempool.c mi/strerror.c riscv/is_fpreg.c \ + riscv/regname.c mi/Gaddress_validator.c \ + mi/Gdestroy_addr_space.c mi/Gdyn-extract.c mi/Gdyn-remote.c \ + mi/Gfind_dynamic_proc_info.c mi/Gget_accessors.c \ + mi/Gget_fpreg.c mi/Gget_proc_info_by_ip.c mi/Gget_proc_name.c \ + mi/Gget_reg.c mi/Gis_plt_entry.c mi/Gput_dynamic_unwind_info.c \ + mi/Gset_cache_size.c mi/Gset_caching_policy.c mi/Gset_fpreg.c \ + mi/Gset_iterate_phdr_function.c mi/Gset_reg.c \ + mi/Gget_elf_filename.c riscv/Gapply_reg_state.c \ + riscv/Gcreate_addr_space.c riscv/Gget_proc_info.c \ + riscv/Gget_save_loc.c riscv/Gglobal.c riscv/Ginit.c \ + riscv/Ginit_local.c riscv/Ginit_remote.c \ + riscv/Gis_signal_frame.c riscv/Gregs.c \ + riscv/Greg_states_iterate.c riscv/Gresume.c riscv/Gstep.c +am__objects_18 = $(am__objects_2) riscv/is_fpreg.lo riscv/regname.lo +am_libunwind_riscv_la_OBJECTS = $(am__objects_18) $(am__objects_4) \ + riscv/Gapply_reg_state.lo riscv/Gcreate_addr_space.lo \ + riscv/Gget_proc_info.lo riscv/Gget_save_loc.lo \ + riscv/Gglobal.lo riscv/Ginit.lo riscv/Ginit_local.lo \ + riscv/Ginit_remote.lo riscv/Gis_signal_frame.lo riscv/Gregs.lo \ + riscv/Greg_states_iterate.lo riscv/Gresume.lo riscv/Gstep.lo +libunwind_riscv_la_OBJECTS = $(am_libunwind_riscv_la_OBJECTS) +libunwind_riscv_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libunwind_riscv_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@ARCH_RISCV_TRUE@am_libunwind_riscv_la_rpath = -rpath $(libdir) +libunwind_s390x_la_DEPENDENCIES = libunwind-dwarf-generic.la \ + libunwind-elf64.la $(libunwind_libadd) +am__libunwind_s390x_la_SOURCES_DIST = os-freebsd.c os-hpux.c \ + os-linux.c dl-iterate-phdr.c os-qnx.c os-solaris.c mi/init.c \ + mi/flush_cache.c mi/mempool.c mi/strerror.c s390x/is_fpreg.c \ + s390x/regname.c mi/Gaddress_validator.c \ + mi/Gdestroy_addr_space.c mi/Gdyn-extract.c mi/Gdyn-remote.c \ + mi/Gfind_dynamic_proc_info.c mi/Gget_accessors.c \ + mi/Gget_fpreg.c mi/Gget_proc_info_by_ip.c mi/Gget_proc_name.c \ + mi/Gget_reg.c mi/Gis_plt_entry.c mi/Gput_dynamic_unwind_info.c \ + mi/Gset_cache_size.c mi/Gset_caching_policy.c mi/Gset_fpreg.c \ + mi/Gset_iterate_phdr_function.c mi/Gset_reg.c \ + mi/Gget_elf_filename.c s390x/Gapply_reg_state.c \ + s390x/Gcreate_addr_space.c s390x/Gget_proc_info.c \ + s390x/Gget_save_loc.c s390x/Gglobal.c s390x/Ginit.c \ + s390x/Ginit_local.c s390x/Ginit_remote.c \ + s390x/Gis_signal_frame.c s390x/Gregs.c \ + s390x/Greg_states_iterate.c s390x/Gresume.c s390x/Gstep.c +am__objects_19 = $(am__objects_2) s390x/is_fpreg.lo s390x/regname.lo +am_libunwind_s390x_la_OBJECTS = $(am__objects_19) $(am__objects_4) \ + s390x/Gapply_reg_state.lo s390x/Gcreate_addr_space.lo \ + s390x/Gget_proc_info.lo s390x/Gget_save_loc.lo \ + s390x/Gglobal.lo s390x/Ginit.lo s390x/Ginit_local.lo \ + s390x/Ginit_remote.lo s390x/Gis_signal_frame.lo s390x/Gregs.lo \ + s390x/Greg_states_iterate.lo s390x/Gresume.lo s390x/Gstep.lo +libunwind_s390x_la_OBJECTS = $(am_libunwind_s390x_la_OBJECTS) +libunwind_s390x_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libunwind_s390x_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@ARCH_S390X_TRUE@am_libunwind_s390x_la_rpath = -rpath $(libdir) +libunwind_setjmp_la_DEPENDENCIES = $(libunwind_elf_libs) \ + libunwind-$(arch).la $(libunwind_libadd) +am__libunwind_setjmp_la_SOURCES_DIST = mi/init.c setjmp/longjmp.c \ + setjmp/siglongjmp.c aarch64/longjmp.S aarch64/siglongjmp.S \ + arm/siglongjmp.S hppa/siglongjmp.S ia64/longjmp.S \ + ia64/setjmp.S ia64/siglongjmp.S ia64/sigsetjmp.S \ + loongarch64/siglongjmp.S mips/siglongjmp.S ppc/longjmp.S \ + ppc/siglongjmp.S riscv/siglongjmp.S sh/siglongjmp.S \ + x86/longjmp.S x86/siglongjmp.S x86_64/longjmp.S \ + x86_64/siglongjmp.S +@ARCH_AARCH64_TRUE@am__objects_20 = aarch64/longjmp.lo \ +@ARCH_AARCH64_TRUE@ aarch64/siglongjmp.lo +@ARCH_ARM_TRUE@am__objects_21 = arm/siglongjmp.lo +@ARCH_HPPA_TRUE@am__objects_22 = hppa/siglongjmp.lo +@ARCH_IA64_TRUE@am__objects_23 = ia64/longjmp.lo ia64/setjmp.lo \ +@ARCH_IA64_TRUE@ ia64/siglongjmp.lo ia64/sigsetjmp.lo +@ARCH_LOONGARCH64_TRUE@am__objects_24 = loongarch64/siglongjmp.lo +@ARCH_MIPS_TRUE@am__objects_25 = mips/siglongjmp.lo +@ARCH_PPC32_TRUE@am__objects_26 = ppc/longjmp.lo ppc/siglongjmp.lo +@ARCH_PPC64_TRUE@am__objects_27 = ppc/longjmp.lo ppc/siglongjmp.lo +@ARCH_RISCV_TRUE@am__objects_28 = riscv/siglongjmp.lo +@ARCH_SH_TRUE@am__objects_29 = sh/siglongjmp.lo +@ARCH_X86_TRUE@am__objects_30 = x86/longjmp.lo x86/siglongjmp.lo +@ARCH_X86_64_TRUE@am__objects_31 = x86_64/longjmp.lo \ +@ARCH_X86_64_TRUE@ x86_64/siglongjmp.lo +am_libunwind_setjmp_la_OBJECTS = mi/init.lo setjmp/longjmp.lo \ + setjmp/siglongjmp.lo $(am__objects_20) $(am__objects_21) \ + $(am__objects_22) $(am__objects_23) $(am__objects_24) \ + $(am__objects_25) $(am__objects_26) $(am__objects_27) \ + $(am__objects_28) $(am__objects_29) $(am__objects_30) \ + $(am__objects_31) +libunwind_setjmp_la_OBJECTS = $(am_libunwind_setjmp_la_OBJECTS) +libunwind_setjmp_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libunwind_setjmp_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@BUILD_SETJMP_TRUE@am_libunwind_setjmp_la_rpath = -rpath $(libdir) +libunwind_sh_la_DEPENDENCIES = libunwind-dwarf-generic.la \ + libunwind-elf32.la $(libunwind_libadd) +am__libunwind_sh_la_SOURCES_DIST = os-freebsd.c os-hpux.c os-linux.c \ + dl-iterate-phdr.c os-qnx.c os-solaris.c mi/init.c \ + mi/flush_cache.c mi/mempool.c mi/strerror.c sh/is_fpreg.c \ + sh/regname.c mi/Gaddress_validator.c mi/Gdestroy_addr_space.c \ + mi/Gdyn-extract.c mi/Gdyn-remote.c \ + mi/Gfind_dynamic_proc_info.c mi/Gget_accessors.c \ + mi/Gget_fpreg.c mi/Gget_proc_info_by_ip.c mi/Gget_proc_name.c \ + mi/Gget_reg.c mi/Gis_plt_entry.c mi/Gput_dynamic_unwind_info.c \ + mi/Gset_cache_size.c mi/Gset_caching_policy.c mi/Gset_fpreg.c \ + mi/Gset_iterate_phdr_function.c mi/Gset_reg.c \ + mi/Gget_elf_filename.c sh/Gapply_reg_state.c \ + sh/Gcreate_addr_space.c sh/Gget_proc_info.c sh/Gget_save_loc.c \ + sh/Gglobal.c sh/Ginit.c sh/Ginit_local.c sh/Ginit_remote.c \ + sh/Gis_signal_frame.c sh/Gregs.c sh/Greg_states_iterate.c \ + sh/Gresume.c sh/Gstep.c +am__objects_32 = $(am__objects_2) sh/is_fpreg.lo sh/regname.lo +am_libunwind_sh_la_OBJECTS = $(am__objects_32) $(am__objects_4) \ + sh/Gapply_reg_state.lo sh/Gcreate_addr_space.lo \ + sh/Gget_proc_info.lo sh/Gget_save_loc.lo sh/Gglobal.lo \ + sh/Ginit.lo sh/Ginit_local.lo sh/Ginit_remote.lo \ + sh/Gis_signal_frame.lo sh/Gregs.lo sh/Greg_states_iterate.lo \ + sh/Gresume.lo sh/Gstep.lo +libunwind_sh_la_OBJECTS = $(am_libunwind_sh_la_OBJECTS) +libunwind_sh_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libunwind_sh_la_LDFLAGS) $(LDFLAGS) \ + -o $@ +@ARCH_SH_TRUE@am_libunwind_sh_la_rpath = -rpath $(libdir) +libunwind_x86_la_DEPENDENCIES = libunwind-dwarf-generic.la \ + libunwind-elf32.la $(libunwind_libadd) +am__libunwind_x86_la_SOURCES_DIST = os-freebsd.c os-hpux.c os-linux.c \ + dl-iterate-phdr.c os-qnx.c os-solaris.c mi/init.c \ + mi/flush_cache.c mi/mempool.c mi/strerror.c x86/is_fpreg.c \ + x86/regname.c x86/Gos-freebsd.c x86/Gos-linux.c \ + mi/Gaddress_validator.c mi/Gdestroy_addr_space.c \ + mi/Gdyn-extract.c mi/Gdyn-remote.c \ + mi/Gfind_dynamic_proc_info.c mi/Gget_accessors.c \ + mi/Gget_fpreg.c mi/Gget_proc_info_by_ip.c mi/Gget_proc_name.c \ + mi/Gget_reg.c mi/Gis_plt_entry.c mi/Gput_dynamic_unwind_info.c \ + mi/Gset_cache_size.c mi/Gset_caching_policy.c mi/Gset_fpreg.c \ + mi/Gset_iterate_phdr_function.c mi/Gset_reg.c \ + mi/Gget_elf_filename.c x86/Gapply_reg_state.c \ + x86/Gcreate_addr_space.c x86/Gget_proc_info.c \ + x86/Gget_save_loc.c x86/Gglobal.c x86/Ginit.c \ + x86/Ginit_local.c x86/Ginit_remote.c x86/Gregs.c \ + x86/Greg_states_iterate.c x86/Gresume.c x86/Gstep.c +am__objects_33 = $(am__objects_2) x86/is_fpreg.lo x86/regname.lo +@OS_FREEBSD_FALSE@@OS_LINUX_TRUE@am__objects_34 = x86/Gos-linux.lo +@OS_FREEBSD_TRUE@am__objects_34 = x86/Gos-freebsd.lo +am_libunwind_x86_la_OBJECTS = $(am__objects_33) $(am__objects_34) \ + $(am__objects_4) x86/Gapply_reg_state.lo \ + x86/Gcreate_addr_space.lo x86/Gget_proc_info.lo \ + x86/Gget_save_loc.lo x86/Gglobal.lo x86/Ginit.lo \ + x86/Ginit_local.lo x86/Ginit_remote.lo x86/Gregs.lo \ + x86/Greg_states_iterate.lo x86/Gresume.lo x86/Gstep.lo +libunwind_x86_la_OBJECTS = $(am_libunwind_x86_la_OBJECTS) +libunwind_x86_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libunwind_x86_la_LDFLAGS) $(LDFLAGS) \ + -o $@ +@ARCH_X86_TRUE@am_libunwind_x86_la_rpath = -rpath $(libdir) +libunwind_x86_64_la_DEPENDENCIES = libunwind-dwarf-generic.la \ + libunwind-elf64.la $(libunwind_libadd) +am__libunwind_x86_64_la_SOURCES_DIST = os-freebsd.c os-hpux.c \ + os-linux.c dl-iterate-phdr.c os-qnx.c os-solaris.c mi/init.c \ + mi/flush_cache.c mi/mempool.c mi/strerror.c x86_64/is_fpreg.c \ + x86_64/regname.c x86_64/Gos-freebsd.c x86_64/Gos-linux.c \ + x86_64/Gos-qnx.c x86_64/Gos-solaris.c mi/Gaddress_validator.c \ + mi/Gdestroy_addr_space.c mi/Gdyn-extract.c mi/Gdyn-remote.c \ + mi/Gfind_dynamic_proc_info.c mi/Gget_accessors.c \ + mi/Gget_fpreg.c mi/Gget_proc_info_by_ip.c mi/Gget_proc_name.c \ + mi/Gget_reg.c mi/Gis_plt_entry.c mi/Gput_dynamic_unwind_info.c \ + mi/Gset_cache_size.c mi/Gset_caching_policy.c mi/Gset_fpreg.c \ + mi/Gset_iterate_phdr_function.c mi/Gset_reg.c \ + mi/Gget_elf_filename.c x86_64/Gapply_reg_state.c \ + x86_64/Gcreate_addr_space.c x86_64/Gget_proc_info.c \ + x86_64/Gget_save_loc.c x86_64/Gglobal.c x86_64/Ginit.c \ + x86_64/Ginit_local.c x86_64/Ginit_remote.c x86_64/Gregs.c \ + x86_64/Greg_states_iterate.c x86_64/Gresume.c \ + x86_64/Gstash_frame.c x86_64/Gstep.c x86_64/Gtrace.c +am__objects_35 = $(am__objects_2) x86_64/is_fpreg.lo x86_64/regname.lo +@OS_FREEBSD_FALSE@@OS_LINUX_FALSE@@OS_QNX_FALSE@@OS_SOLARIS_TRUE@am__objects_36 = x86_64/Gos-solaris.lo +@OS_FREEBSD_FALSE@@OS_LINUX_FALSE@@OS_QNX_TRUE@am__objects_36 = x86_64/Gos-qnx.lo +@OS_FREEBSD_FALSE@@OS_LINUX_TRUE@am__objects_36 = x86_64/Gos-linux.lo +@OS_FREEBSD_TRUE@am__objects_36 = x86_64/Gos-freebsd.lo +am_libunwind_x86_64_la_OBJECTS = $(am__objects_35) $(am__objects_36) \ + $(am__objects_4) x86_64/Gapply_reg_state.lo \ + x86_64/Gcreate_addr_space.lo x86_64/Gget_proc_info.lo \ + x86_64/Gget_save_loc.lo x86_64/Gglobal.lo x86_64/Ginit.lo \ + x86_64/Ginit_local.lo x86_64/Ginit_remote.lo x86_64/Gregs.lo \ + x86_64/Greg_states_iterate.lo x86_64/Gresume.lo \ + x86_64/Gstash_frame.lo x86_64/Gstep.lo x86_64/Gtrace.lo +libunwind_x86_64_la_OBJECTS = $(am_libunwind_x86_64_la_OBJECTS) +libunwind_x86_64_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libunwind_x86_64_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@ARCH_X86_64_TRUE@am_libunwind_x86_64_la_rpath = -rpath $(libdir) +libunwind_la_DEPENDENCIES = $(am__append_26) $(libunwind_elf_libs) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am__libunwind_la_SOURCES_DIST = os-freebsd.c os-hpux.c os-linux.c \ + dl-iterate-phdr.c os-qnx.c os-solaris.c mi/init.c \ + mi/flush_cache.c mi/mempool.c mi/strerror.c aarch64/is_fpreg.c \ + aarch64/regname.c mi/_ReadULEB.c mi/_ReadSLEB.c mi/backtrace.c \ + mi/dyn-cancel.c mi/dyn-info-list.c mi/dyn-register.c \ + mi/Laddress_validator.c mi/Ldestroy_addr_space.c \ + mi/Ldyn-extract.c mi/Lfind_dynamic_proc_info.c \ + mi/Lget_accessors.c mi/Lget_fpreg.c mi/Lset_fpreg.c \ + mi/Lget_proc_info_by_ip.c mi/Lget_proc_name.c mi/Lget_reg.c \ + mi/Lis_plt_entry.c mi/Lput_dynamic_unwind_info.c \ + mi/Lset_cache_size.c mi/Lset_caching_policy.c \ + mi/Lset_iterate_phdr_function.c mi/Lset_reg.c \ + mi/Lget_elf_filename.c unwind/Backtrace.c \ + unwind/DeleteException.c unwind/FindEnclosingFunction.c \ + unwind/ForcedUnwind.c unwind/GetBSP.c unwind/GetCFA.c \ + unwind/GetDataRelBase.c unwind/GetGR.c unwind/GetIP.c \ + unwind/GetIPInfo.c unwind/GetLanguageSpecificData.c \ + unwind/GetRegionStart.c unwind/GetTextRelBase.c \ + unwind/RaiseException.c unwind/Resume.c \ + unwind/Resume_or_Rethrow.c unwind/SetGR.c unwind/SetIP.c \ + aarch64/Los-freebsd.c aarch64/setcontext.S aarch64/Los-linux.c \ + aarch64/Los-qnx.c aarch64/getcontext.S \ + aarch64/Lapply_reg_state.c aarch64/Lcreate_addr_space.c \ + aarch64/Lget_proc_info.c aarch64/Lget_save_loc.c \ + aarch64/Lglobal.c aarch64/Linit.c aarch64/Linit_local.c \ + aarch64/Linit_remote.c aarch64/Lis_signal_frame.c \ + aarch64/Lregs.c aarch64/Lreg_states_iterate.c \ + aarch64/Lresume.c aarch64/Lstash_frame.c aarch64/Lstep.c \ + aarch64/Ltrace.c aarch64/Lstrip_ptrauth_insn_mask.c \ + arm/is_fpreg.c arm/regname.c arm/Los-freebsd.c arm/Los-linux.c \ + arm/Los-other.c arm/getcontext.S arm/Lapply_reg_state.c \ + arm/Lcreate_addr_space.c arm/Lex_tables.c arm/Lget_proc_info.c \ + arm/Lget_save_loc.c arm/Lglobal.c arm/Linit.c \ + arm/Linit_local.c arm/Linit_remote.c arm/Lregs.c \ + arm/Lreg_states_iterate.c arm/Lresume.c arm/Lstash_frame.c \ + arm/Lstep.c arm/Ltrace.c hppa/regname.c hppa/getcontext.S \ + hppa/Lapply_reg_state.c hppa/Lcreate_addr_space.c \ + hppa/Lget_proc_info.c hppa/Lget_save_loc.c hppa/Lglobal.c \ + hppa/Linit.c hppa/Linit_local.c hppa/Linit_remote.c \ + hppa/Lis_signal_frame.c hppa/Lregs.c \ + hppa/Lreg_states_iterate.c hppa/Lresume.c hppa/Lstep.c \ + hppa/setcontext.S ia64/regname.c ia64/dyn_info_list.S \ + ia64/getcontext.S ia64/Lapply_reg_state.c \ + ia64/Lcreate_addr_space.c ia64/Lfind_unwind_table.c \ + ia64/Lget_proc_info.c ia64/Lget_save_loc.c ia64/Lglobal.c \ + ia64/Linit.c ia64/Linit_local.c ia64/Linit_remote.c \ + ia64/Linstall_cursor.S ia64/Lis_signal_frame.c ia64/Lparser.c \ + ia64/Lrbs.c ia64/Lregs.c ia64/Lreg_states_iterate.c \ + ia64/Lresume.c ia64/Lscript.c ia64/Lstep.c ia64/Ltables.c \ + loongarch64/is_fpreg.c loongarch64/regname.c \ + loongarch64/getcontext.S loongarch64/Lapply_reg_state.c \ + loongarch64/Lcreate_addr_space.c loongarch64/Lget_proc_info.c \ + loongarch64/Lget_save_loc.c loongarch64/Lglobal.c \ + loongarch64/Linit.c loongarch64/Linit_local.c \ + loongarch64/Linit_remote.c loongarch64/Lis_signal_frame.c \ + loongarch64/Lregs.c loongarch64/Lreg_states_iterate.c \ + loongarch64/Lresume.c loongarch64/Lstep.c mips/is_fpreg.c \ + mips/regname.c mips/getcontext.S mips/Lapply_reg_state.c \ + mips/Lcreate_addr_space.c mips/Lget_proc_info.c \ + mips/Lget_save_loc.c mips/Lglobal.c mips/Linit.c \ + mips/Linit_local.c mips/Linit_remote.c mips/Lis_signal_frame.c \ + mips/Lregs.c mips/Lreg_states_iterate.c mips/Lresume.c \ + mips/Lstep.c ppc32/get_func_addr.c ppc32/is_fpreg.c \ + ppc32/regname.c ppc/Lget_proc_info.c ppc/Lget_save_loc.c \ + ppc/Linit_local.c ppc/Linit_remote.c ppc/Lis_signal_frame.c \ + ppc32/Lapply_reg_state.c ppc32/Lcreate_addr_space.c \ + ppc32/Lglobal.c ppc32/Linit.c ppc32/Lregs.c \ + ppc32/Lreg_states_iterate.c ppc32/Lresume.c ppc32/Lstep.c \ + ppc64/get_func_addr.c ppc64/is_fpreg.c ppc64/regname.c \ + ppc64/Lapply_reg_state.c ppc64/Lcreate_addr_space.c \ + ppc64/Lglobal.c ppc64/Linit.c ppc64/Lregs.c \ + ppc64/Lreg_states_iterate.c ppc64/Lresume.c ppc64/Lstep.c \ + riscv/is_fpreg.c riscv/regname.c riscv/getcontext.S \ + riscv/Lapply_reg_state.c riscv/Lcreate_addr_space.c \ + riscv/Lget_proc_info.c riscv/Lget_save_loc.c riscv/Lglobal.c \ + riscv/Linit.c riscv/Linit_local.c riscv/Linit_remote.c \ + riscv/Lis_signal_frame.c riscv/Lregs.c \ + riscv/Lreg_states_iterate.c riscv/Lresume.c riscv/Lstep.c \ + riscv/setcontext.S s390x/is_fpreg.c s390x/regname.c \ + s390x/getcontext.S s390x/Lapply_reg_state.c \ + s390x/Lcreate_addr_space.c s390x/Lget_proc_info.c \ + s390x/Lget_save_loc.c s390x/Lglobal.c s390x/Linit.c \ + s390x/Linit_local.c s390x/Linit_remote.c \ + s390x/Lis_signal_frame.c s390x/Lregs.c \ + s390x/Lreg_states_iterate.c s390x/Lresume.c s390x/Lstep.c \ + s390x/setcontext.S sh/is_fpreg.c sh/regname.c \ + sh/Lapply_reg_state.c sh/Lcreate_addr_space.c \ + sh/Lget_proc_info.c sh/Lget_save_loc.c sh/Lglobal.c sh/Linit.c \ + sh/Linit_local.c sh/Linit_remote.c sh/Lis_signal_frame.c \ + sh/Lregs.c sh/Lreg_states_iterate.c sh/Lresume.c sh/Lstep.c \ + x86_64/is_fpreg.c x86_64/regname.c x86_64/Los-freebsd.c \ + x86_64/Los-linux.c x86_64/Los-qnx.c x86_64/Los-solaris.c \ + x86_64/getcontext.S x86_64/Lapply_reg_state.c \ + x86_64/Lcreate_addr_space.c x86_64/Lget_proc_info.c \ + x86_64/Lget_save_loc.c x86_64/Lglobal.c x86_64/Linit.c \ + x86_64/Linit_local.c x86_64/Linit_remote.c x86_64/Lregs.c \ + x86_64/Lreg_states_iterate.c x86_64/Lresume.c \ + x86_64/Lstash_frame.c x86_64/Lstep.c x86_64/Ltrace.c \ + x86_64/setcontext.S x86/is_fpreg.c x86/regname.c \ + x86/Los-freebsd.c x86/getcontext-freebsd.S x86/Los-linux.c \ + x86/getcontext-linux.S x86/Lapply_reg_state.c \ + x86/Lcreate_addr_space.c x86/Lget_proc_info.c \ + x86/Lget_save_loc.c x86/Lglobal.c x86/Linit.c \ + x86/Linit_local.c x86/Linit_remote.c x86/Lregs.c \ + x86/Lreg_states_iterate.c x86/Lresume.c x86/Lstep.c +@SUPPORT_CXX_EXCEPTIONS_TRUE@am__objects_37 = mi/_ReadULEB.lo \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ mi/_ReadSLEB.lo +@OS_LINUX_TRUE@am__objects_38 = $(am__objects_37) +am__objects_39 = $(am__objects_38) mi/backtrace.lo mi/dyn-cancel.lo \ + mi/dyn-info-list.lo mi/dyn-register.lo \ + mi/Laddress_validator.lo mi/Ldestroy_addr_space.lo \ + mi/Ldyn-extract.lo mi/Lfind_dynamic_proc_info.lo \ + mi/Lget_accessors.lo mi/Lget_fpreg.lo mi/Lset_fpreg.lo \ + mi/Lget_proc_info_by_ip.lo mi/Lget_proc_name.lo mi/Lget_reg.lo \ + mi/Lis_plt_entry.lo mi/Lput_dynamic_unwind_info.lo \ + mi/Lset_cache_size.lo mi/Lset_caching_policy.lo \ + mi/Lset_iterate_phdr_function.lo mi/Lset_reg.lo \ + mi/Lget_elf_filename.lo +@SUPPORT_CXX_EXCEPTIONS_TRUE@am__objects_40 = unwind/Backtrace.lo \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/DeleteException.lo \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/FindEnclosingFunction.lo \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/ForcedUnwind.lo \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/GetBSP.lo unwind/GetCFA.lo \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/GetDataRelBase.lo \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/GetGR.lo unwind/GetIP.lo \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/GetIPInfo.lo \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/GetLanguageSpecificData.lo \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/GetRegionStart.lo \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/GetTextRelBase.lo \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/RaiseException.lo \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/Resume.lo \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/Resume_or_Rethrow.lo \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/SetGR.lo unwind/SetIP.lo +am__objects_41 = $(am__objects_39) $(am__objects_40) +@OS_FREEBSD_FALSE@@OS_LINUX_FALSE@@OS_QNX_TRUE@am__objects_42 = aarch64/Los-qnx.lo +@OS_FREEBSD_FALSE@@OS_LINUX_TRUE@am__objects_42 = \ +@OS_FREEBSD_FALSE@@OS_LINUX_TRUE@ aarch64/Los-linux.lo +@OS_FREEBSD_TRUE@am__objects_42 = aarch64/Los-freebsd.lo \ +@OS_FREEBSD_TRUE@ aarch64/setcontext.lo +@OS_FREEBSD_FALSE@@OS_LINUX_FALSE@@OS_QNX_TRUE@am__objects_43 = arm/Los-other.lo +@OS_FREEBSD_FALSE@@OS_LINUX_TRUE@am__objects_43 = arm/Los-linux.lo +@OS_FREEBSD_TRUE@am__objects_43 = arm/Los-freebsd.lo +am__objects_44 = ppc/Lget_proc_info.lo ppc/Lget_save_loc.lo \ + ppc/Linit_local.lo ppc/Linit_remote.lo ppc/Lis_signal_frame.lo +@OS_FREEBSD_FALSE@@OS_LINUX_FALSE@@OS_QNX_FALSE@@OS_SOLARIS_TRUE@am__objects_45 = x86_64/Los-solaris.lo +@OS_FREEBSD_FALSE@@OS_LINUX_FALSE@@OS_QNX_TRUE@am__objects_45 = x86_64/Los-qnx.lo +@OS_FREEBSD_FALSE@@OS_LINUX_TRUE@am__objects_45 = x86_64/Los-linux.lo +@OS_FREEBSD_TRUE@am__objects_45 = x86_64/Los-freebsd.lo +@OS_FREEBSD_FALSE@@OS_LINUX_TRUE@am__objects_46 = x86/Los-linux.lo \ +@OS_FREEBSD_FALSE@@OS_LINUX_TRUE@ x86/getcontext-linux.lo +@OS_FREEBSD_TRUE@am__objects_46 = x86/Los-freebsd.lo \ +@OS_FREEBSD_TRUE@ x86/getcontext-freebsd.lo +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_FALSE@@ARCH_X86_TRUE@am_libunwind_la_OBJECTS = $(am__objects_33) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_FALSE@@ARCH_X86_TRUE@ $(am__objects_46) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_FALSE@@ARCH_X86_TRUE@ $(am__objects_41) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_FALSE@@ARCH_X86_TRUE@ x86/Lapply_reg_state.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_FALSE@@ARCH_X86_TRUE@ x86/Lcreate_addr_space.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_FALSE@@ARCH_X86_TRUE@ x86/Lget_proc_info.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_FALSE@@ARCH_X86_TRUE@ x86/Lget_save_loc.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_FALSE@@ARCH_X86_TRUE@ x86/Lglobal.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_FALSE@@ARCH_X86_TRUE@ x86/Linit.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_FALSE@@ARCH_X86_TRUE@ x86/Linit_local.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_FALSE@@ARCH_X86_TRUE@ x86/Linit_remote.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_FALSE@@ARCH_X86_TRUE@ x86/Lregs.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_FALSE@@ARCH_X86_TRUE@ x86/Lreg_states_iterate.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_FALSE@@ARCH_X86_TRUE@ x86/Lresume.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_FALSE@@ARCH_X86_TRUE@ x86/Lstep.lo +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_TRUE@am_libunwind_la_OBJECTS = $(am__objects_35) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_TRUE@ $(am__objects_45) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_TRUE@ $(am__objects_41) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_TRUE@ x86_64/getcontext.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_TRUE@ x86_64/Lapply_reg_state.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_TRUE@ x86_64/Lcreate_addr_space.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_TRUE@ x86_64/Lget_proc_info.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_TRUE@ x86_64/Lget_save_loc.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_TRUE@ x86_64/Lglobal.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_TRUE@ x86_64/Linit.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_TRUE@ x86_64/Linit_local.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_TRUE@ x86_64/Linit_remote.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_TRUE@ x86_64/Lregs.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_TRUE@ x86_64/Lreg_states_iterate.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_TRUE@ x86_64/Lresume.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_TRUE@ x86_64/Lstash_frame.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_TRUE@ x86_64/Lstep.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_TRUE@ x86_64/Ltrace.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_FALSE@@ARCH_X86_64_TRUE@ x86_64/setcontext.lo +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_TRUE@am_libunwind_la_OBJECTS = $(am__objects_32) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_TRUE@ $(am__objects_41) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_TRUE@ sh/Lapply_reg_state.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_TRUE@ sh/Lcreate_addr_space.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_TRUE@ sh/Lget_proc_info.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_TRUE@ sh/Lget_save_loc.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_TRUE@ sh/Lglobal.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_TRUE@ sh/Linit.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_TRUE@ sh/Linit_local.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_TRUE@ sh/Linit_remote.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_TRUE@ sh/Lis_signal_frame.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_TRUE@ sh/Lregs.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_TRUE@ sh/Lreg_states_iterate.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_TRUE@ sh/Lresume.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_FALSE@@ARCH_SH_TRUE@ sh/Lstep.lo +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_TRUE@am_libunwind_la_OBJECTS = $(am__objects_19) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_TRUE@ $(am__objects_41) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_TRUE@ s390x/getcontext.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_TRUE@ s390x/Lapply_reg_state.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_TRUE@ s390x/Lcreate_addr_space.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_TRUE@ s390x/Lget_proc_info.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_TRUE@ s390x/Lget_save_loc.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_TRUE@ s390x/Lglobal.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_TRUE@ s390x/Linit.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_TRUE@ s390x/Linit_local.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_TRUE@ s390x/Linit_remote.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_TRUE@ s390x/Lis_signal_frame.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_TRUE@ s390x/Lregs.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_TRUE@ s390x/Lreg_states_iterate.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_TRUE@ s390x/Lresume.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_TRUE@ s390x/Lstep.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_FALSE@@ARCH_S390X_TRUE@ s390x/setcontext.lo +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_TRUE@am_libunwind_la_OBJECTS = $(am__objects_18) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_TRUE@ $(am__objects_41) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_TRUE@ riscv/getcontext.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_TRUE@ riscv/Lapply_reg_state.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_TRUE@ riscv/Lcreate_addr_space.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_TRUE@ riscv/Lget_proc_info.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_TRUE@ riscv/Lget_save_loc.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_TRUE@ riscv/Lglobal.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_TRUE@ riscv/Linit.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_TRUE@ riscv/Linit_local.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_TRUE@ riscv/Linit_remote.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_TRUE@ riscv/Lis_signal_frame.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_TRUE@ riscv/Lregs.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_TRUE@ riscv/Lreg_states_iterate.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_TRUE@ riscv/Lresume.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_TRUE@ riscv/Lstep.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_FALSE@@ARCH_RISCV_TRUE@ riscv/setcontext.lo +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_TRUE@am_libunwind_la_OBJECTS = $(am__objects_17) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_TRUE@ $(am__objects_41) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_TRUE@ $(am__objects_44) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_TRUE@ ppc64/Lapply_reg_state.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_TRUE@ ppc64/Lcreate_addr_space.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_TRUE@ ppc64/Lglobal.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_TRUE@ ppc64/Linit.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_TRUE@ ppc64/Lregs.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_TRUE@ ppc64/Lreg_states_iterate.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_TRUE@ ppc64/Lresume.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_FALSE@@ARCH_PPC64_TRUE@ ppc64/Lstep.lo +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_TRUE@am_libunwind_la_OBJECTS = $(am__objects_15) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_TRUE@ $(am__objects_41) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_TRUE@ $(am__objects_44) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_TRUE@ ppc32/Lapply_reg_state.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_TRUE@ ppc32/Lcreate_addr_space.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_TRUE@ ppc32/Lglobal.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_TRUE@ ppc32/Linit.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_TRUE@ ppc32/Lregs.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_TRUE@ ppc32/Lreg_states_iterate.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_TRUE@ ppc32/Lresume.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_FALSE@@ARCH_PPC32_TRUE@ ppc32/Lstep.lo +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_TRUE@am_libunwind_la_OBJECTS = $(am__objects_14) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_TRUE@ $(am__objects_41) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_TRUE@ mips/getcontext.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_TRUE@ mips/Lapply_reg_state.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_TRUE@ mips/Lcreate_addr_space.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_TRUE@ mips/Lget_proc_info.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_TRUE@ mips/Lget_save_loc.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_TRUE@ mips/Lglobal.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_TRUE@ mips/Linit.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_TRUE@ mips/Linit_local.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_TRUE@ mips/Linit_remote.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_TRUE@ mips/Lis_signal_frame.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_TRUE@ mips/Lregs.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_TRUE@ mips/Lreg_states_iterate.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_TRUE@ mips/Lresume.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_FALSE@@ARCH_MIPS_TRUE@ mips/Lstep.lo +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_TRUE@am_libunwind_la_OBJECTS = $(am__objects_13) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_TRUE@ $(am__objects_41) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_TRUE@ loongarch64/getcontext.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_TRUE@ loongarch64/Lapply_reg_state.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_TRUE@ loongarch64/Lcreate_addr_space.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_TRUE@ loongarch64/Lget_proc_info.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_TRUE@ loongarch64/Lget_save_loc.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_TRUE@ loongarch64/Lglobal.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_TRUE@ loongarch64/Linit.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_TRUE@ loongarch64/Linit_local.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_TRUE@ loongarch64/Linit_remote.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_TRUE@ loongarch64/Lis_signal_frame.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_TRUE@ loongarch64/Lregs.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_TRUE@ loongarch64/Lreg_states_iterate.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_TRUE@ loongarch64/Lresume.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_FALSE@@ARCH_LOONGARCH64_TRUE@ loongarch64/Lstep.lo +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@am_libunwind_la_OBJECTS = $(am__objects_12) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ $(am__objects_41) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/dyn_info_list.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/getcontext.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/Lapply_reg_state.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/Lcreate_addr_space.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/Lfind_unwind_table.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/Lget_proc_info.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/Lget_save_loc.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/Lglobal.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/Linit.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/Linit_local.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/Linit_remote.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/Linstall_cursor.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/Lis_signal_frame.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/Lparser.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/Lrbs.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/Lregs.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/Lreg_states_iterate.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/Lresume.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/Lscript.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/Lstep.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_FALSE@@ARCH_IA64_TRUE@ ia64/Ltables.lo +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_TRUE@am_libunwind_la_OBJECTS = $(am__objects_11) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_TRUE@ $(am__objects_41) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_TRUE@ hppa/getcontext.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_TRUE@ hppa/Lapply_reg_state.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_TRUE@ hppa/Lcreate_addr_space.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_TRUE@ hppa/Lget_proc_info.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_TRUE@ hppa/Lget_save_loc.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_TRUE@ hppa/Lglobal.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_TRUE@ hppa/Linit.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_TRUE@ hppa/Linit_local.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_TRUE@ hppa/Linit_remote.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_TRUE@ hppa/Lis_signal_frame.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_TRUE@ hppa/Lregs.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_TRUE@ hppa/Lreg_states_iterate.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_TRUE@ hppa/Lresume.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_TRUE@ hppa/Lstep.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_FALSE@@ARCH_HPPA_TRUE@ hppa/setcontext.lo +@ARCH_AARCH64_FALSE@@ARCH_ARM_TRUE@am_libunwind_la_OBJECTS = \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_TRUE@ $(am__objects_6) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_TRUE@ $(am__objects_43) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_TRUE@ $(am__objects_41) \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_TRUE@ arm/getcontext.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_TRUE@ arm/Lapply_reg_state.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_TRUE@ arm/Lcreate_addr_space.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_TRUE@ arm/Lex_tables.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_TRUE@ arm/Lget_proc_info.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_TRUE@ arm/Lget_save_loc.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_TRUE@ arm/Lglobal.lo arm/Linit.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_TRUE@ arm/Linit_local.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_TRUE@ arm/Linit_remote.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_TRUE@ arm/Lregs.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_TRUE@ arm/Lreg_states_iterate.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_TRUE@ arm/Lresume.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_TRUE@ arm/Lstash_frame.lo \ +@ARCH_AARCH64_FALSE@@ARCH_ARM_TRUE@ arm/Lstep.lo arm/Ltrace.lo +@ARCH_AARCH64_TRUE@am_libunwind_la_OBJECTS = $(am__objects_3) \ +@ARCH_AARCH64_TRUE@ $(am__objects_41) $(am__objects_42) \ +@ARCH_AARCH64_TRUE@ aarch64/getcontext.lo \ +@ARCH_AARCH64_TRUE@ aarch64/Lapply_reg_state.lo \ +@ARCH_AARCH64_TRUE@ aarch64/Lcreate_addr_space.lo \ +@ARCH_AARCH64_TRUE@ aarch64/Lget_proc_info.lo \ +@ARCH_AARCH64_TRUE@ aarch64/Lget_save_loc.lo aarch64/Lglobal.lo \ +@ARCH_AARCH64_TRUE@ aarch64/Linit.lo aarch64/Linit_local.lo \ +@ARCH_AARCH64_TRUE@ aarch64/Linit_remote.lo \ +@ARCH_AARCH64_TRUE@ aarch64/Lis_signal_frame.lo \ +@ARCH_AARCH64_TRUE@ aarch64/Lregs.lo \ +@ARCH_AARCH64_TRUE@ aarch64/Lreg_states_iterate.lo \ +@ARCH_AARCH64_TRUE@ aarch64/Lresume.lo aarch64/Lstash_frame.lo \ +@ARCH_AARCH64_TRUE@ aarch64/Lstep.lo aarch64/Ltrace.lo \ +@ARCH_AARCH64_TRUE@ aarch64/Lstrip_ptrauth_insn_mask.lo +libunwind_la_OBJECTS = $(am_libunwind_la_OBJECTS) +libunwind_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libunwind_la_LDFLAGS) $(LDFLAGS) -o $@ +@REMOTE_ONLY_FALSE@am_libunwind_la_rpath = -rpath $(libdir) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/dl-iterate-phdr.Plo \ + ./$(DEPDIR)/elf32.Plo ./$(DEPDIR)/elf64.Plo \ + ./$(DEPDIR)/elfxx.Plo ./$(DEPDIR)/os-freebsd.Plo \ + ./$(DEPDIR)/os-hpux.Plo ./$(DEPDIR)/os-linux.Plo \ + ./$(DEPDIR)/os-qnx.Plo ./$(DEPDIR)/os-solaris.Plo \ + aarch64/$(DEPDIR)/Gapply_reg_state.Plo \ + aarch64/$(DEPDIR)/Gcreate_addr_space.Plo \ + aarch64/$(DEPDIR)/Gget_proc_info.Plo \ + aarch64/$(DEPDIR)/Gget_save_loc.Plo \ + aarch64/$(DEPDIR)/Gglobal.Plo aarch64/$(DEPDIR)/Ginit.Plo \ + aarch64/$(DEPDIR)/Ginit_local.Plo \ + aarch64/$(DEPDIR)/Ginit_remote.Plo \ + aarch64/$(DEPDIR)/Gis_signal_frame.Plo \ + aarch64/$(DEPDIR)/Gos-freebsd.Plo \ + aarch64/$(DEPDIR)/Gos-linux.Plo aarch64/$(DEPDIR)/Gos-qnx.Plo \ + aarch64/$(DEPDIR)/Greg_states_iterate.Plo \ + aarch64/$(DEPDIR)/Gregs.Plo aarch64/$(DEPDIR)/Gresume.Plo \ + aarch64/$(DEPDIR)/Gstash_frame.Plo aarch64/$(DEPDIR)/Gstep.Plo \ + aarch64/$(DEPDIR)/Gstrip_ptrauth_insn_mask.Plo \ + aarch64/$(DEPDIR)/Gtrace.Plo \ + aarch64/$(DEPDIR)/Lapply_reg_state.Plo \ + aarch64/$(DEPDIR)/Lcreate_addr_space.Plo \ + aarch64/$(DEPDIR)/Lget_proc_info.Plo \ + aarch64/$(DEPDIR)/Lget_save_loc.Plo \ + aarch64/$(DEPDIR)/Lglobal.Plo aarch64/$(DEPDIR)/Linit.Plo \ + aarch64/$(DEPDIR)/Linit_local.Plo \ + aarch64/$(DEPDIR)/Linit_remote.Plo \ + aarch64/$(DEPDIR)/Lis_signal_frame.Plo \ + aarch64/$(DEPDIR)/Los-freebsd.Plo \ + aarch64/$(DEPDIR)/Los-linux.Plo aarch64/$(DEPDIR)/Los-qnx.Plo \ + aarch64/$(DEPDIR)/Lreg_states_iterate.Plo \ + aarch64/$(DEPDIR)/Lregs.Plo aarch64/$(DEPDIR)/Lresume.Plo \ + aarch64/$(DEPDIR)/Lstash_frame.Plo aarch64/$(DEPDIR)/Lstep.Plo \ + aarch64/$(DEPDIR)/Lstrip_ptrauth_insn_mask.Plo \ + aarch64/$(DEPDIR)/Ltrace.Plo aarch64/$(DEPDIR)/getcontext.Plo \ + aarch64/$(DEPDIR)/is_fpreg.Plo aarch64/$(DEPDIR)/longjmp.Plo \ + aarch64/$(DEPDIR)/regname.Plo aarch64/$(DEPDIR)/setcontext.Plo \ + aarch64/$(DEPDIR)/siglongjmp.Plo \ + arm/$(DEPDIR)/Gapply_reg_state.Plo \ + arm/$(DEPDIR)/Gcreate_addr_space.Plo \ + arm/$(DEPDIR)/Gex_tables.Plo arm/$(DEPDIR)/Gget_proc_info.Plo \ + arm/$(DEPDIR)/Gget_save_loc.Plo arm/$(DEPDIR)/Gglobal.Plo \ + arm/$(DEPDIR)/Ginit.Plo arm/$(DEPDIR)/Ginit_local.Plo \ + arm/$(DEPDIR)/Ginit_remote.Plo arm/$(DEPDIR)/Gos-freebsd.Plo \ + arm/$(DEPDIR)/Gos-linux.Plo arm/$(DEPDIR)/Gos-other.Plo \ + arm/$(DEPDIR)/Greg_states_iterate.Plo arm/$(DEPDIR)/Gregs.Plo \ + arm/$(DEPDIR)/Gresume.Plo arm/$(DEPDIR)/Gstash_frame.Plo \ + arm/$(DEPDIR)/Gstep.Plo arm/$(DEPDIR)/Gtrace.Plo \ + arm/$(DEPDIR)/Lapply_reg_state.Plo \ + arm/$(DEPDIR)/Lcreate_addr_space.Plo \ + arm/$(DEPDIR)/Lex_tables.Plo arm/$(DEPDIR)/Lget_proc_info.Plo \ + arm/$(DEPDIR)/Lget_save_loc.Plo arm/$(DEPDIR)/Lglobal.Plo \ + arm/$(DEPDIR)/Linit.Plo arm/$(DEPDIR)/Linit_local.Plo \ + arm/$(DEPDIR)/Linit_remote.Plo arm/$(DEPDIR)/Los-freebsd.Plo \ + arm/$(DEPDIR)/Los-linux.Plo arm/$(DEPDIR)/Los-other.Plo \ + arm/$(DEPDIR)/Lreg_states_iterate.Plo arm/$(DEPDIR)/Lregs.Plo \ + arm/$(DEPDIR)/Lresume.Plo arm/$(DEPDIR)/Lstash_frame.Plo \ + arm/$(DEPDIR)/Lstep.Plo arm/$(DEPDIR)/Ltrace.Plo \ + arm/$(DEPDIR)/getcontext.Plo arm/$(DEPDIR)/is_fpreg.Plo \ + arm/$(DEPDIR)/regname.Plo arm/$(DEPDIR)/siglongjmp.Plo \ + coredump/$(DEPDIR)/_UCD_access_mem.Plo \ + coredump/$(DEPDIR)/_UCD_access_reg_freebsd.Plo \ + coredump/$(DEPDIR)/_UCD_access_reg_linux.Plo \ + coredump/$(DEPDIR)/_UCD_access_reg_qnx.Plo \ + coredump/$(DEPDIR)/_UCD_accessors.Plo \ + coredump/$(DEPDIR)/_UCD_corefile_elf.Plo \ + coredump/$(DEPDIR)/_UCD_create.Plo \ + coredump/$(DEPDIR)/_UCD_destroy.Plo \ + coredump/$(DEPDIR)/_UCD_elf_map_image.Plo \ + coredump/$(DEPDIR)/_UCD_find_proc_info.Plo \ + coredump/$(DEPDIR)/_UCD_get_elf_filename.Plo \ + coredump/$(DEPDIR)/_UCD_get_mapinfo_generic.Plo \ + coredump/$(DEPDIR)/_UCD_get_mapinfo_linux.Plo \ + coredump/$(DEPDIR)/_UCD_get_mapinfo_qnx.Plo \ + coredump/$(DEPDIR)/_UCD_get_proc_name.Plo \ + coredump/$(DEPDIR)/_UCD_get_threadinfo_prstatus.Plo \ + coredump/$(DEPDIR)/_UPT_access_fpreg.Plo \ + coredump/$(DEPDIR)/_UPT_elf.Plo \ + coredump/$(DEPDIR)/_UPT_get_dyn_info_list_addr.Plo \ + coredump/$(DEPDIR)/_UPT_put_unwind_info.Plo \ + coredump/$(DEPDIR)/_UPT_resume.Plo \ + coredump/$(DEPDIR)/ucd_file_table.Plo \ + dwarf/$(DEPDIR)/Gexpr.Plo dwarf/$(DEPDIR)/Gfde.Plo \ + dwarf/$(DEPDIR)/Gfind_proc_info-lsb.Plo \ + dwarf/$(DEPDIR)/Gfind_unwind_table.Plo \ + dwarf/$(DEPDIR)/Gget_proc_info_in_range.Plo \ + dwarf/$(DEPDIR)/Gparser.Plo dwarf/$(DEPDIR)/Gpe.Plo \ + dwarf/$(DEPDIR)/Lexpr.Plo dwarf/$(DEPDIR)/Lfde.Plo \ + dwarf/$(DEPDIR)/Lfind_proc_info-lsb.Plo \ + dwarf/$(DEPDIR)/Lfind_unwind_table.Plo \ + dwarf/$(DEPDIR)/Lget_proc_info_in_range.Plo \ + dwarf/$(DEPDIR)/Lparser.Plo dwarf/$(DEPDIR)/Lpe.Plo \ + dwarf/$(DEPDIR)/global.Plo hppa/$(DEPDIR)/Gapply_reg_state.Plo \ + hppa/$(DEPDIR)/Gcreate_addr_space.Plo \ + hppa/$(DEPDIR)/Gget_proc_info.Plo \ + hppa/$(DEPDIR)/Gget_save_loc.Plo hppa/$(DEPDIR)/Gglobal.Plo \ + hppa/$(DEPDIR)/Ginit.Plo hppa/$(DEPDIR)/Ginit_local.Plo \ + hppa/$(DEPDIR)/Ginit_remote.Plo \ + hppa/$(DEPDIR)/Gis_signal_frame.Plo \ + hppa/$(DEPDIR)/Greg_states_iterate.Plo \ + hppa/$(DEPDIR)/Gregs.Plo hppa/$(DEPDIR)/Gresume.Plo \ + hppa/$(DEPDIR)/Gstep.Plo hppa/$(DEPDIR)/Lapply_reg_state.Plo \ + hppa/$(DEPDIR)/Lcreate_addr_space.Plo \ + hppa/$(DEPDIR)/Lget_proc_info.Plo \ + hppa/$(DEPDIR)/Lget_save_loc.Plo hppa/$(DEPDIR)/Lglobal.Plo \ + hppa/$(DEPDIR)/Linit.Plo hppa/$(DEPDIR)/Linit_local.Plo \ + hppa/$(DEPDIR)/Linit_remote.Plo \ + hppa/$(DEPDIR)/Lis_signal_frame.Plo \ + hppa/$(DEPDIR)/Lreg_states_iterate.Plo \ + hppa/$(DEPDIR)/Lregs.Plo hppa/$(DEPDIR)/Lresume.Plo \ + hppa/$(DEPDIR)/Lstep.Plo hppa/$(DEPDIR)/getcontext.Plo \ + hppa/$(DEPDIR)/regname.Plo hppa/$(DEPDIR)/setcontext.Plo \ + hppa/$(DEPDIR)/siglongjmp.Plo \ + ia64/$(DEPDIR)/Gapply_reg_state.Plo \ + ia64/$(DEPDIR)/Gcreate_addr_space.Plo \ + ia64/$(DEPDIR)/Gfind_unwind_table.Plo \ + ia64/$(DEPDIR)/Gget_proc_info.Plo \ + ia64/$(DEPDIR)/Gget_save_loc.Plo ia64/$(DEPDIR)/Gglobal.Plo \ + ia64/$(DEPDIR)/Ginit.Plo ia64/$(DEPDIR)/Ginit_local.Plo \ + ia64/$(DEPDIR)/Ginit_remote.Plo \ + ia64/$(DEPDIR)/Ginstall_cursor.Plo \ + ia64/$(DEPDIR)/Gis_signal_frame.Plo ia64/$(DEPDIR)/Gparser.Plo \ + ia64/$(DEPDIR)/Grbs.Plo ia64/$(DEPDIR)/Greg_states_iterate.Plo \ + ia64/$(DEPDIR)/Gregs.Plo ia64/$(DEPDIR)/Gresume.Plo \ + ia64/$(DEPDIR)/Gscript.Plo ia64/$(DEPDIR)/Gstep.Plo \ + ia64/$(DEPDIR)/Gtables.Plo ia64/$(DEPDIR)/Lapply_reg_state.Plo \ + ia64/$(DEPDIR)/Lcreate_addr_space.Plo \ + ia64/$(DEPDIR)/Lfind_unwind_table.Plo \ + ia64/$(DEPDIR)/Lget_proc_info.Plo \ + ia64/$(DEPDIR)/Lget_save_loc.Plo ia64/$(DEPDIR)/Lglobal.Plo \ + ia64/$(DEPDIR)/Linit.Plo ia64/$(DEPDIR)/Linit_local.Plo \ + ia64/$(DEPDIR)/Linit_remote.Plo \ + ia64/$(DEPDIR)/Linstall_cursor.Plo \ + ia64/$(DEPDIR)/Lis_signal_frame.Plo ia64/$(DEPDIR)/Lparser.Plo \ + ia64/$(DEPDIR)/Lrbs.Plo ia64/$(DEPDIR)/Lreg_states_iterate.Plo \ + ia64/$(DEPDIR)/Lregs.Plo ia64/$(DEPDIR)/Lresume.Plo \ + ia64/$(DEPDIR)/Lscript.Plo ia64/$(DEPDIR)/Lstep.Plo \ + ia64/$(DEPDIR)/Ltables.Plo ia64/$(DEPDIR)/dyn_info_list.Plo \ + ia64/$(DEPDIR)/getcontext.Plo ia64/$(DEPDIR)/longjmp.Plo \ + ia64/$(DEPDIR)/regname.Plo ia64/$(DEPDIR)/setjmp.Plo \ + ia64/$(DEPDIR)/siglongjmp.Plo ia64/$(DEPDIR)/sigsetjmp.Plo \ + loongarch64/$(DEPDIR)/Gapply_reg_state.Plo \ + loongarch64/$(DEPDIR)/Gcreate_addr_space.Plo \ + loongarch64/$(DEPDIR)/Gget_proc_info.Plo \ + loongarch64/$(DEPDIR)/Gget_save_loc.Plo \ + loongarch64/$(DEPDIR)/Gglobal.Plo \ + loongarch64/$(DEPDIR)/Ginit.Plo \ + loongarch64/$(DEPDIR)/Ginit_local.Plo \ + loongarch64/$(DEPDIR)/Ginit_remote.Plo \ + loongarch64/$(DEPDIR)/Gis_signal_frame.Plo \ + loongarch64/$(DEPDIR)/Greg_states_iterate.Plo \ + loongarch64/$(DEPDIR)/Gregs.Plo \ + loongarch64/$(DEPDIR)/Gresume.Plo \ + loongarch64/$(DEPDIR)/Gstep.Plo \ + loongarch64/$(DEPDIR)/Lapply_reg_state.Plo \ + loongarch64/$(DEPDIR)/Lcreate_addr_space.Plo \ + loongarch64/$(DEPDIR)/Lget_proc_info.Plo \ + loongarch64/$(DEPDIR)/Lget_save_loc.Plo \ + loongarch64/$(DEPDIR)/Lglobal.Plo \ + loongarch64/$(DEPDIR)/Linit.Plo \ + loongarch64/$(DEPDIR)/Linit_local.Plo \ + loongarch64/$(DEPDIR)/Linit_remote.Plo \ + loongarch64/$(DEPDIR)/Lis_signal_frame.Plo \ + loongarch64/$(DEPDIR)/Lreg_states_iterate.Plo \ + loongarch64/$(DEPDIR)/Lregs.Plo \ + loongarch64/$(DEPDIR)/Lresume.Plo \ + loongarch64/$(DEPDIR)/Lstep.Plo \ + loongarch64/$(DEPDIR)/getcontext.Plo \ + loongarch64/$(DEPDIR)/is_fpreg.Plo \ + loongarch64/$(DEPDIR)/regname.Plo \ + loongarch64/$(DEPDIR)/siglongjmp.Plo \ + mi/$(DEPDIR)/Gaddress_validator.Plo \ + mi/$(DEPDIR)/Gdestroy_addr_space.Plo \ + mi/$(DEPDIR)/Gdyn-extract.Plo mi/$(DEPDIR)/Gdyn-remote.Plo \ + mi/$(DEPDIR)/Gfind_dynamic_proc_info.Plo \ + mi/$(DEPDIR)/Gget_accessors.Plo \ + mi/$(DEPDIR)/Gget_elf_filename.Plo mi/$(DEPDIR)/Gget_fpreg.Plo \ + mi/$(DEPDIR)/Gget_proc_info_by_ip.Plo \ + mi/$(DEPDIR)/Gget_proc_name.Plo mi/$(DEPDIR)/Gget_reg.Plo \ + mi/$(DEPDIR)/Gis_plt_entry.Plo \ + mi/$(DEPDIR)/Gput_dynamic_unwind_info.Plo \ + mi/$(DEPDIR)/Gset_cache_size.Plo \ + mi/$(DEPDIR)/Gset_caching_policy.Plo \ + mi/$(DEPDIR)/Gset_fpreg.Plo \ + mi/$(DEPDIR)/Gset_iterate_phdr_function.Plo \ + mi/$(DEPDIR)/Gset_reg.Plo mi/$(DEPDIR)/Laddress_validator.Plo \ + mi/$(DEPDIR)/Ldestroy_addr_space.Plo \ + mi/$(DEPDIR)/Ldyn-extract.Plo \ + mi/$(DEPDIR)/Lfind_dynamic_proc_info.Plo \ + mi/$(DEPDIR)/Lget_accessors.Plo \ + mi/$(DEPDIR)/Lget_elf_filename.Plo mi/$(DEPDIR)/Lget_fpreg.Plo \ + mi/$(DEPDIR)/Lget_proc_info_by_ip.Plo \ + mi/$(DEPDIR)/Lget_proc_name.Plo mi/$(DEPDIR)/Lget_reg.Plo \ + mi/$(DEPDIR)/Lis_plt_entry.Plo \ + mi/$(DEPDIR)/Lput_dynamic_unwind_info.Plo \ + mi/$(DEPDIR)/Lset_cache_size.Plo \ + mi/$(DEPDIR)/Lset_caching_policy.Plo \ + mi/$(DEPDIR)/Lset_fpreg.Plo \ + mi/$(DEPDIR)/Lset_iterate_phdr_function.Plo \ + mi/$(DEPDIR)/Lset_reg.Plo mi/$(DEPDIR)/_ReadSLEB.Plo \ + mi/$(DEPDIR)/_ReadULEB.Plo mi/$(DEPDIR)/backtrace.Plo \ + mi/$(DEPDIR)/dyn-cancel.Plo mi/$(DEPDIR)/dyn-info-list.Plo \ + mi/$(DEPDIR)/dyn-register.Plo mi/$(DEPDIR)/flush_cache.Plo \ + mi/$(DEPDIR)/init.Plo mi/$(DEPDIR)/mempool.Plo \ + mi/$(DEPDIR)/strerror.Plo mips/$(DEPDIR)/Gapply_reg_state.Plo \ + mips/$(DEPDIR)/Gcreate_addr_space.Plo \ + mips/$(DEPDIR)/Gget_proc_info.Plo \ + mips/$(DEPDIR)/Gget_save_loc.Plo mips/$(DEPDIR)/Gglobal.Plo \ + mips/$(DEPDIR)/Ginit.Plo mips/$(DEPDIR)/Ginit_local.Plo \ + mips/$(DEPDIR)/Ginit_remote.Plo \ + mips/$(DEPDIR)/Gis_signal_frame.Plo \ + mips/$(DEPDIR)/Greg_states_iterate.Plo \ + mips/$(DEPDIR)/Gregs.Plo mips/$(DEPDIR)/Gresume.Plo \ + mips/$(DEPDIR)/Gstep.Plo mips/$(DEPDIR)/Lapply_reg_state.Plo \ + mips/$(DEPDIR)/Lcreate_addr_space.Plo \ + mips/$(DEPDIR)/Lget_proc_info.Plo \ + mips/$(DEPDIR)/Lget_save_loc.Plo mips/$(DEPDIR)/Lglobal.Plo \ + mips/$(DEPDIR)/Linit.Plo mips/$(DEPDIR)/Linit_local.Plo \ + mips/$(DEPDIR)/Linit_remote.Plo \ + mips/$(DEPDIR)/Lis_signal_frame.Plo \ + mips/$(DEPDIR)/Lreg_states_iterate.Plo \ + mips/$(DEPDIR)/Lregs.Plo mips/$(DEPDIR)/Lresume.Plo \ + mips/$(DEPDIR)/Lstep.Plo mips/$(DEPDIR)/getcontext.Plo \ + mips/$(DEPDIR)/is_fpreg.Plo mips/$(DEPDIR)/regname.Plo \ + mips/$(DEPDIR)/siglongjmp.Plo \ + nto/$(DEPDIR)/unw_nto_access_fpreg.Plo \ + nto/$(DEPDIR)/unw_nto_access_mem.Plo \ + nto/$(DEPDIR)/unw_nto_access_reg.Plo \ + nto/$(DEPDIR)/unw_nto_accessors.Plo \ + nto/$(DEPDIR)/unw_nto_create.Plo \ + nto/$(DEPDIR)/unw_nto_destroy.Plo \ + nto/$(DEPDIR)/unw_nto_elf.Plo \ + nto/$(DEPDIR)/unw_nto_find_proc_info.Plo \ + nto/$(DEPDIR)/unw_nto_get_dyn_info_list_addr.Plo \ + nto/$(DEPDIR)/unw_nto_get_elf_filename.Plo \ + nto/$(DEPDIR)/unw_nto_get_proc_name.Plo \ + nto/$(DEPDIR)/unw_nto_put_unwind_info.Plo \ + nto/$(DEPDIR)/unw_nto_resume.Plo \ + ppc/$(DEPDIR)/Gget_proc_info.Plo \ + ppc/$(DEPDIR)/Gget_save_loc.Plo ppc/$(DEPDIR)/Ginit_local.Plo \ + ppc/$(DEPDIR)/Ginit_remote.Plo \ + ppc/$(DEPDIR)/Gis_signal_frame.Plo \ + ppc/$(DEPDIR)/Lget_proc_info.Plo \ + ppc/$(DEPDIR)/Lget_save_loc.Plo ppc/$(DEPDIR)/Linit_local.Plo \ + ppc/$(DEPDIR)/Linit_remote.Plo \ + ppc/$(DEPDIR)/Lis_signal_frame.Plo ppc/$(DEPDIR)/longjmp.Plo \ + ppc/$(DEPDIR)/siglongjmp.Plo \ + ppc32/$(DEPDIR)/Gapply_reg_state.Plo \ + ppc32/$(DEPDIR)/Gcreate_addr_space.Plo \ + ppc32/$(DEPDIR)/Gglobal.Plo ppc32/$(DEPDIR)/Ginit.Plo \ + ppc32/$(DEPDIR)/Greg_states_iterate.Plo \ + ppc32/$(DEPDIR)/Gregs.Plo ppc32/$(DEPDIR)/Gresume.Plo \ + ppc32/$(DEPDIR)/Gstep.Plo ppc32/$(DEPDIR)/Lapply_reg_state.Plo \ + ppc32/$(DEPDIR)/Lcreate_addr_space.Plo \ + ppc32/$(DEPDIR)/Lglobal.Plo ppc32/$(DEPDIR)/Linit.Plo \ + ppc32/$(DEPDIR)/Lreg_states_iterate.Plo \ + ppc32/$(DEPDIR)/Lregs.Plo ppc32/$(DEPDIR)/Lresume.Plo \ + ppc32/$(DEPDIR)/Lstep.Plo ppc32/$(DEPDIR)/get_func_addr.Plo \ + ppc32/$(DEPDIR)/is_fpreg.Plo ppc32/$(DEPDIR)/regname.Plo \ + ppc64/$(DEPDIR)/Gapply_reg_state.Plo \ + ppc64/$(DEPDIR)/Gcreate_addr_space.Plo \ + ppc64/$(DEPDIR)/Gglobal.Plo ppc64/$(DEPDIR)/Ginit.Plo \ + ppc64/$(DEPDIR)/Greg_states_iterate.Plo \ + ppc64/$(DEPDIR)/Gregs.Plo ppc64/$(DEPDIR)/Gresume.Plo \ + ppc64/$(DEPDIR)/Gstep.Plo ppc64/$(DEPDIR)/Lapply_reg_state.Plo \ + ppc64/$(DEPDIR)/Lcreate_addr_space.Plo \ + ppc64/$(DEPDIR)/Lglobal.Plo ppc64/$(DEPDIR)/Linit.Plo \ + ppc64/$(DEPDIR)/Lreg_states_iterate.Plo \ + ppc64/$(DEPDIR)/Lregs.Plo ppc64/$(DEPDIR)/Lresume.Plo \ + ppc64/$(DEPDIR)/Lstep.Plo ppc64/$(DEPDIR)/get_func_addr.Plo \ + ppc64/$(DEPDIR)/is_fpreg.Plo ppc64/$(DEPDIR)/regname.Plo \ + ptrace/$(DEPDIR)/_UPT_access_fpreg.Plo \ + ptrace/$(DEPDIR)/_UPT_access_mem.Plo \ + ptrace/$(DEPDIR)/_UPT_access_reg.Plo \ + ptrace/$(DEPDIR)/_UPT_accessors.Plo \ + ptrace/$(DEPDIR)/_UPT_create.Plo \ + ptrace/$(DEPDIR)/_UPT_destroy.Plo \ + ptrace/$(DEPDIR)/_UPT_elf.Plo \ + ptrace/$(DEPDIR)/_UPT_find_proc_info.Plo \ + ptrace/$(DEPDIR)/_UPT_get_dyn_info_list_addr.Plo \ + ptrace/$(DEPDIR)/_UPT_get_elf_filename.Plo \ + ptrace/$(DEPDIR)/_UPT_get_proc_name.Plo \ + ptrace/$(DEPDIR)/_UPT_ptrauth_insn_mask.Plo \ + ptrace/$(DEPDIR)/_UPT_put_unwind_info.Plo \ + ptrace/$(DEPDIR)/_UPT_reg_offset.Plo \ + ptrace/$(DEPDIR)/_UPT_resume.Plo \ + riscv/$(DEPDIR)/Gapply_reg_state.Plo \ + riscv/$(DEPDIR)/Gcreate_addr_space.Plo \ + riscv/$(DEPDIR)/Gget_proc_info.Plo \ + riscv/$(DEPDIR)/Gget_save_loc.Plo riscv/$(DEPDIR)/Gglobal.Plo \ + riscv/$(DEPDIR)/Ginit.Plo riscv/$(DEPDIR)/Ginit_local.Plo \ + riscv/$(DEPDIR)/Ginit_remote.Plo \ + riscv/$(DEPDIR)/Gis_signal_frame.Plo \ + riscv/$(DEPDIR)/Greg_states_iterate.Plo \ + riscv/$(DEPDIR)/Gregs.Plo riscv/$(DEPDIR)/Gresume.Plo \ + riscv/$(DEPDIR)/Gstep.Plo riscv/$(DEPDIR)/Lapply_reg_state.Plo \ + riscv/$(DEPDIR)/Lcreate_addr_space.Plo \ + riscv/$(DEPDIR)/Lget_proc_info.Plo \ + riscv/$(DEPDIR)/Lget_save_loc.Plo riscv/$(DEPDIR)/Lglobal.Plo \ + riscv/$(DEPDIR)/Linit.Plo riscv/$(DEPDIR)/Linit_local.Plo \ + riscv/$(DEPDIR)/Linit_remote.Plo \ + riscv/$(DEPDIR)/Lis_signal_frame.Plo \ + riscv/$(DEPDIR)/Lreg_states_iterate.Plo \ + riscv/$(DEPDIR)/Lregs.Plo riscv/$(DEPDIR)/Lresume.Plo \ + riscv/$(DEPDIR)/Lstep.Plo riscv/$(DEPDIR)/getcontext.Plo \ + riscv/$(DEPDIR)/is_fpreg.Plo riscv/$(DEPDIR)/regname.Plo \ + riscv/$(DEPDIR)/setcontext.Plo riscv/$(DEPDIR)/siglongjmp.Plo \ + s390x/$(DEPDIR)/Gapply_reg_state.Plo \ + s390x/$(DEPDIR)/Gcreate_addr_space.Plo \ + s390x/$(DEPDIR)/Gget_proc_info.Plo \ + s390x/$(DEPDIR)/Gget_save_loc.Plo s390x/$(DEPDIR)/Gglobal.Plo \ + s390x/$(DEPDIR)/Ginit.Plo s390x/$(DEPDIR)/Ginit_local.Plo \ + s390x/$(DEPDIR)/Ginit_remote.Plo \ + s390x/$(DEPDIR)/Gis_signal_frame.Plo \ + s390x/$(DEPDIR)/Greg_states_iterate.Plo \ + s390x/$(DEPDIR)/Gregs.Plo s390x/$(DEPDIR)/Gresume.Plo \ + s390x/$(DEPDIR)/Gstep.Plo s390x/$(DEPDIR)/Lapply_reg_state.Plo \ + s390x/$(DEPDIR)/Lcreate_addr_space.Plo \ + s390x/$(DEPDIR)/Lget_proc_info.Plo \ + s390x/$(DEPDIR)/Lget_save_loc.Plo s390x/$(DEPDIR)/Lglobal.Plo \ + s390x/$(DEPDIR)/Linit.Plo s390x/$(DEPDIR)/Linit_local.Plo \ + s390x/$(DEPDIR)/Linit_remote.Plo \ + s390x/$(DEPDIR)/Lis_signal_frame.Plo \ + s390x/$(DEPDIR)/Lreg_states_iterate.Plo \ + s390x/$(DEPDIR)/Lregs.Plo s390x/$(DEPDIR)/Lresume.Plo \ + s390x/$(DEPDIR)/Lstep.Plo s390x/$(DEPDIR)/getcontext.Plo \ + s390x/$(DEPDIR)/is_fpreg.Plo s390x/$(DEPDIR)/regname.Plo \ + s390x/$(DEPDIR)/setcontext.Plo setjmp/$(DEPDIR)/longjmp.Plo \ + setjmp/$(DEPDIR)/siglongjmp.Plo \ + sh/$(DEPDIR)/Gapply_reg_state.Plo \ + sh/$(DEPDIR)/Gcreate_addr_space.Plo \ + sh/$(DEPDIR)/Gget_proc_info.Plo sh/$(DEPDIR)/Gget_save_loc.Plo \ + sh/$(DEPDIR)/Gglobal.Plo sh/$(DEPDIR)/Ginit.Plo \ + sh/$(DEPDIR)/Ginit_local.Plo sh/$(DEPDIR)/Ginit_remote.Plo \ + sh/$(DEPDIR)/Gis_signal_frame.Plo \ + sh/$(DEPDIR)/Greg_states_iterate.Plo sh/$(DEPDIR)/Gregs.Plo \ + sh/$(DEPDIR)/Gresume.Plo sh/$(DEPDIR)/Gstep.Plo \ + sh/$(DEPDIR)/Lapply_reg_state.Plo \ + sh/$(DEPDIR)/Lcreate_addr_space.Plo \ + sh/$(DEPDIR)/Lget_proc_info.Plo sh/$(DEPDIR)/Lget_save_loc.Plo \ + sh/$(DEPDIR)/Lglobal.Plo sh/$(DEPDIR)/Linit.Plo \ + sh/$(DEPDIR)/Linit_local.Plo sh/$(DEPDIR)/Linit_remote.Plo \ + sh/$(DEPDIR)/Lis_signal_frame.Plo \ + sh/$(DEPDIR)/Lreg_states_iterate.Plo sh/$(DEPDIR)/Lregs.Plo \ + sh/$(DEPDIR)/Lresume.Plo sh/$(DEPDIR)/Lstep.Plo \ + sh/$(DEPDIR)/is_fpreg.Plo sh/$(DEPDIR)/regname.Plo \ + sh/$(DEPDIR)/siglongjmp.Plo unwind/$(DEPDIR)/Backtrace.Plo \ + unwind/$(DEPDIR)/DeleteException.Plo \ + unwind/$(DEPDIR)/FindEnclosingFunction.Plo \ + unwind/$(DEPDIR)/ForcedUnwind.Plo unwind/$(DEPDIR)/GetBSP.Plo \ + unwind/$(DEPDIR)/GetCFA.Plo \ + unwind/$(DEPDIR)/GetDataRelBase.Plo unwind/$(DEPDIR)/GetGR.Plo \ + unwind/$(DEPDIR)/GetIP.Plo unwind/$(DEPDIR)/GetIPInfo.Plo \ + unwind/$(DEPDIR)/GetLanguageSpecificData.Plo \ + unwind/$(DEPDIR)/GetRegionStart.Plo \ + unwind/$(DEPDIR)/GetTextRelBase.Plo \ + unwind/$(DEPDIR)/RaiseException.Plo \ + unwind/$(DEPDIR)/Resume.Plo \ + unwind/$(DEPDIR)/Resume_or_Rethrow.Plo \ + unwind/$(DEPDIR)/SetGR.Plo unwind/$(DEPDIR)/SetIP.Plo \ + x86/$(DEPDIR)/Gapply_reg_state.Plo \ + x86/$(DEPDIR)/Gcreate_addr_space.Plo \ + x86/$(DEPDIR)/Gget_proc_info.Plo \ + x86/$(DEPDIR)/Gget_save_loc.Plo x86/$(DEPDIR)/Gglobal.Plo \ + x86/$(DEPDIR)/Ginit.Plo x86/$(DEPDIR)/Ginit_local.Plo \ + x86/$(DEPDIR)/Ginit_remote.Plo x86/$(DEPDIR)/Gos-freebsd.Plo \ + x86/$(DEPDIR)/Gos-linux.Plo \ + x86/$(DEPDIR)/Greg_states_iterate.Plo x86/$(DEPDIR)/Gregs.Plo \ + x86/$(DEPDIR)/Gresume.Plo x86/$(DEPDIR)/Gstep.Plo \ + x86/$(DEPDIR)/Lapply_reg_state.Plo \ + x86/$(DEPDIR)/Lcreate_addr_space.Plo \ + x86/$(DEPDIR)/Lget_proc_info.Plo \ + x86/$(DEPDIR)/Lget_save_loc.Plo x86/$(DEPDIR)/Lglobal.Plo \ + x86/$(DEPDIR)/Linit.Plo x86/$(DEPDIR)/Linit_local.Plo \ + x86/$(DEPDIR)/Linit_remote.Plo x86/$(DEPDIR)/Los-freebsd.Plo \ + x86/$(DEPDIR)/Los-linux.Plo \ + x86/$(DEPDIR)/Lreg_states_iterate.Plo x86/$(DEPDIR)/Lregs.Plo \ + x86/$(DEPDIR)/Lresume.Plo x86/$(DEPDIR)/Lstep.Plo \ + x86/$(DEPDIR)/getcontext-freebsd.Plo \ + x86/$(DEPDIR)/getcontext-linux.Plo x86/$(DEPDIR)/is_fpreg.Plo \ + x86/$(DEPDIR)/longjmp.Plo x86/$(DEPDIR)/regname.Plo \ + x86/$(DEPDIR)/siglongjmp.Plo \ + x86_64/$(DEPDIR)/Gapply_reg_state.Plo \ + x86_64/$(DEPDIR)/Gcreate_addr_space.Plo \ + x86_64/$(DEPDIR)/Gget_proc_info.Plo \ + x86_64/$(DEPDIR)/Gget_save_loc.Plo \ + x86_64/$(DEPDIR)/Gglobal.Plo x86_64/$(DEPDIR)/Ginit.Plo \ + x86_64/$(DEPDIR)/Ginit_local.Plo \ + x86_64/$(DEPDIR)/Ginit_remote.Plo \ + x86_64/$(DEPDIR)/Gos-freebsd.Plo \ + x86_64/$(DEPDIR)/Gos-linux.Plo x86_64/$(DEPDIR)/Gos-qnx.Plo \ + x86_64/$(DEPDIR)/Gos-solaris.Plo \ + x86_64/$(DEPDIR)/Greg_states_iterate.Plo \ + x86_64/$(DEPDIR)/Gregs.Plo x86_64/$(DEPDIR)/Gresume.Plo \ + x86_64/$(DEPDIR)/Gstash_frame.Plo x86_64/$(DEPDIR)/Gstep.Plo \ + x86_64/$(DEPDIR)/Gtrace.Plo \ + x86_64/$(DEPDIR)/Lapply_reg_state.Plo \ + x86_64/$(DEPDIR)/Lcreate_addr_space.Plo \ + x86_64/$(DEPDIR)/Lget_proc_info.Plo \ + x86_64/$(DEPDIR)/Lget_save_loc.Plo \ + x86_64/$(DEPDIR)/Lglobal.Plo x86_64/$(DEPDIR)/Linit.Plo \ + x86_64/$(DEPDIR)/Linit_local.Plo \ + x86_64/$(DEPDIR)/Linit_remote.Plo \ + x86_64/$(DEPDIR)/Los-freebsd.Plo \ + x86_64/$(DEPDIR)/Los-linux.Plo x86_64/$(DEPDIR)/Los-qnx.Plo \ + x86_64/$(DEPDIR)/Los-solaris.Plo \ + x86_64/$(DEPDIR)/Lreg_states_iterate.Plo \ + x86_64/$(DEPDIR)/Lregs.Plo x86_64/$(DEPDIR)/Lresume.Plo \ + x86_64/$(DEPDIR)/Lstash_frame.Plo x86_64/$(DEPDIR)/Lstep.Plo \ + x86_64/$(DEPDIR)/Ltrace.Plo x86_64/$(DEPDIR)/getcontext.Plo \ + x86_64/$(DEPDIR)/is_fpreg.Plo x86_64/$(DEPDIR)/longjmp.Plo \ + x86_64/$(DEPDIR)/regname.Plo x86_64/$(DEPDIR)/setcontext.Plo \ + x86_64/$(DEPDIR)/siglongjmp.Plo +am__mv = mv -f +CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) +LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CCASFLAGS) $(CCASFLAGS) +AM_V_CPPAS = $(am__v_CPPAS_@AM_V@) +am__v_CPPAS_ = $(am__v_CPPAS_@AM_DEFAULT_V@) +am__v_CPPAS_0 = @echo " CPPAS " $@; +am__v_CPPAS_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libunwind_aarch64_la_SOURCES) $(libunwind_arm_la_SOURCES) \ + $(libunwind_coredump_la_SOURCES) \ + $(libunwind_dwarf_common_la_SOURCES) \ + $(libunwind_dwarf_generic_la_SOURCES) \ + $(libunwind_dwarf_local_la_SOURCES) \ + $(libunwind_elf32_la_SOURCES) $(libunwind_elf64_la_SOURCES) \ + $(libunwind_elfxx_la_SOURCES) $(libunwind_hppa_la_SOURCES) \ + $(libunwind_ia64_la_SOURCES) \ + $(libunwind_loongarch64_la_SOURCES) \ + $(libunwind_mips_la_SOURCES) $(libunwind_nto_la_SOURCES) \ + $(libunwind_ppc32_la_SOURCES) $(libunwind_ppc64_la_SOURCES) \ + $(libunwind_ptrace_la_SOURCES) $(libunwind_riscv_la_SOURCES) \ + $(libunwind_s390x_la_SOURCES) $(libunwind_setjmp_la_SOURCES) \ + $(libunwind_sh_la_SOURCES) $(libunwind_x86_la_SOURCES) \ + $(libunwind_x86_64_la_SOURCES) $(libunwind_la_SOURCES) +DIST_SOURCES = $(am__libunwind_aarch64_la_SOURCES_DIST) \ + $(am__libunwind_arm_la_SOURCES_DIST) \ + $(am__libunwind_coredump_la_SOURCES_DIST) \ + $(libunwind_dwarf_common_la_SOURCES) \ + $(libunwind_dwarf_generic_la_SOURCES) \ + $(libunwind_dwarf_local_la_SOURCES) \ + $(libunwind_elf32_la_SOURCES) $(libunwind_elf64_la_SOURCES) \ + $(libunwind_elfxx_la_SOURCES) \ + $(am__libunwind_hppa_la_SOURCES_DIST) \ + $(am__libunwind_ia64_la_SOURCES_DIST) \ + $(am__libunwind_loongarch64_la_SOURCES_DIST) \ + $(am__libunwind_mips_la_SOURCES_DIST) \ + $(libunwind_nto_la_SOURCES) \ + $(am__libunwind_ppc32_la_SOURCES_DIST) \ + $(am__libunwind_ppc64_la_SOURCES_DIST) \ + $(libunwind_ptrace_la_SOURCES) \ + $(am__libunwind_riscv_la_SOURCES_DIST) \ + $(am__libunwind_s390x_la_SOURCES_DIST) \ + $(am__libunwind_setjmp_la_SOURCES_DIST) \ + $(am__libunwind_sh_la_SOURCES_DIST) \ + $(am__libunwind_x86_la_SOURCES_DIST) \ + $(am__libunwind_x86_64_la_SOURCES_DIST) \ + $(am__libunwind_la_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DATA = $(pkgconfig_DATA) +HEADERS = $(noinst_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__DIST_COMMON = $(srcdir)/Makefile.in \ + $(srcdir)/libunwind-generic.pc.in $(top_srcdir)/config/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +ARCH = @ARCH@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BACKTRACELIB = @BACKTRACELIB@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLIB = @DLLIB@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LATEX2MAN = @LATEX2MAN@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_NOSTARTFILES = @LDFLAGS_NOSTARTFILES@ +LDFLAGS_STATIC_LIBCXA = @LDFLAGS_STATIC_LIBCXA@ +LIBLZMA = @LIBLZMA@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBZ = @LIBZ@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_EXTRA = @PKG_EXTRA@ +PKG_MAINTAINER = @PKG_MAINTAINER@ +PKG_MAJOR = @PKG_MAJOR@ +PKG_MINOR = @PKG_MINOR@ +PTHREADS_LIB = @PTHREADS_LIB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UNW_CRT_LDFLAGS = @UNW_CRT_LDFLAGS@ +UNW_CRT_LIBADD = @UNW_CRT_LIBADD@ +UNW_TESTDRIVER = @UNW_TESTDRIVER@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +arch = @arch@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_arch = @build_arch@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +enable_cxx_exceptions = @enable_cxx_exceptions@ +enable_debug_frame = @enable_debug_frame@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# Set the DSO versions +SOVERSION = 10:0:2 # See comments at end of file. +SETJMP_SO_VERSION = 0:0:0 +COREDUMP_SO_VERSION = 0:0:0 + +# +# Don't link with start-files since we don't use any constructors/destructors: +# +COMMON_SO_LDFLAGS = $(LDFLAGS_NOSTARTFILES) + +# +# Which libraries to build and install +# +# Order is important here. The names of the libraries need to end up in reverse +# dependency order for `make install` to do its job properly. +# +lib_LTLIBRARIES = $(am__append_1) $(am__append_2) $(am__append_3) \ + $(am__append_4) $(am__append_5) $(am__append_6) \ + $(am__append_7) $(am__append_8) $(am__append_9) \ + $(am__append_10) $(am__append_11) $(am__append_12) \ + $(am__append_13) $(am__append_14) $(am__append_15) \ + $(am__append_16) $(am__append_17) $(am__append_18) + +### libunwind-coredump: + +### libunwind-nto: + +### libunwind-ptrace: + +### libunwind-setjmp: + +### target AArch64: +# The list of files that go into libunwind and libunwind-aarch64: + +### target ARMv7: +# The list of files that go into libunwind and libunwind-arm: + +### target HP-PA: +# The list of files that go both into libunwind and libunwind-hppa: + +### target IA-64: +# The list of files that go both into libunwind and libunwind-ia64: + +### target LoongArch64: +# The list of files that go info libunwind and libunwind-loongarch64: + +### target MIPS: +# The list of files that go info libunwind and libunwind-mips: + +# The list of files that go both into libunwind and libunwind-ppc32: + +# The list of files that go both into libunwind and libunwind-ppc64: + +### target RISC-V: +# The list of files that go info libunwind and libunwind-riscv: + +### target s390x: +# The list of files that go both into libunwind and libunwind-s390x: + +### target Sh: +# The list of files that go into libunwind and libunwind-sh: + +### target x86: +# The list of files that go both into libunwind and libunwind-x86: + +### target x86_64: +# The list of files that go both into libunwind and libunwind-x86_64: +noinst_HEADERS = coredump/_UCD_internal.h coredump/_UCD_lib.h \ + coredump/ucd_file_table.h nto/unw_nto_internal.h \ + ptrace/_UPT_internal.h setjmp/setjmp_i.h os-linux.h elf32.h \ + elf64.h elfxx.h aarch64/init.h aarch64/ucontext_i.h \ + aarch64/unwind_i.h arm/init.h arm/offsets.h arm/unwind_i.h \ + hppa/init.h hppa/offsets.h hppa/unwind_i.h ia64/init.h \ + ia64/offsets.h ia64/regs.h ia64/ucontext_i.h \ + ia64/unwind_decoder.h ia64/unwind_i.h loongarch64/init.h \ + loongarch64/offsets.h loongarch64/unwind_i.h mips/init.h \ + mips/offsets.h mips/unwind_i.h ppc32/init.h ppc32/unwind_i.h \ + ppc32/ucontext_i.h ppc64/init.h ppc64/unwind_i.h \ + ppc64/ucontext_i.h riscv/asm.h riscv/init.h riscv/offsets.h \ + riscv/unwind_i.h s390x/init.h s390x/unwind_i.h sh/init.h \ + sh/offsets.h sh/unwind_i.h x86/init.h x86/offsets.h \ + x86/unwind_i.h x86_64/init.h x86_64/ucontext_i.h \ + x86_64/unwind_i.h unwind/unwind-internal.h +noinst_LTLIBRARIES = $(am__append_24) $(am__append_25) \ + $(libunwind_elf_libs) +@USE_ELF32_TRUE@libunwind_elf_libs = libunwind-elf32.la +@USE_ELF64_TRUE@libunwind_elf_libs = libunwind-elf64.la +@USE_ELFXX_TRUE@libunwind_elf_libs = libunwind-elfxx.la + +# If local unwinding is being built, link in the local unwinding functions +libunwind_libadd = $(am__append_19) + +### pkg-config: +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libunwind-generic.pc $(am__append_20) \ + $(am__append_21) $(am__append_22) $(am__append_23) +libunwind_coredump_la_SOURCES = coredump/_UCD_access_mem.c \ + coredump/_UCD_accessors.c coredump/_UCD_corefile_elf.c \ + coredump/_UCD_create.c coredump/_UCD_destroy.c \ + coredump/_UCD_elf_map_image.c coredump/ucd_file_table.c \ + coredump/_UCD_find_proc_info.c coredump/_UCD_get_proc_name.c \ + coredump/_UCD_get_elf_filename.c mi/init.c coredump/_UPT_elf.c \ + coredump/_UPT_access_fpreg.c \ + coredump/_UPT_get_dyn_info_list_addr.c \ + coredump/_UPT_put_unwind_info.c coredump/_UPT_resume.c \ + $(am__append_27) $(am__append_28) $(am__append_29) +libunwind_coredump_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(COREDUMP_SO_VERSION) + +libunwind_coredump_la_LIBADD = \ + libunwind-$(arch).la \ + $(LIBLZMA) $(LIBZ) + +libunwind_nto_la_SOURCES = \ + mi/init.c \ + nto/unw_nto_access_fpreg.c \ + nto/unw_nto_access_mem.c \ + nto/unw_nto_accessors.c \ + nto/unw_nto_access_reg.c \ + nto/unw_nto_create.c \ + nto/unw_nto_destroy.c \ + nto/unw_nto_elf.c \ + nto/unw_nto_find_proc_info.c \ + nto/unw_nto_get_dyn_info_list_addr.c \ + nto/unw_nto_get_proc_name.c \ + nto/unw_nto_get_elf_filename.c \ + nto/unw_nto_put_unwind_info.c \ + nto/unw_nto_resume.c + +libunwind_nto_la_LIBADD = \ + libunwind-$(arch).la \ + $(libunwind_libadd) + +libunwind_ptrace_la_SOURCES = \ + mi/init.c \ + ptrace/_UPT_access_fpreg.c \ + ptrace/_UPT_access_mem.c \ + ptrace/_UPT_accessors.c \ + ptrace/_UPT_access_reg.c \ + ptrace/_UPT_create.c \ + ptrace/_UPT_destroy.c \ + ptrace/_UPT_elf.c \ + ptrace/_UPT_find_proc_info.c \ + ptrace/_UPT_get_dyn_info_list_addr.c \ + ptrace/_UPT_get_proc_name.c \ + ptrace/_UPT_get_elf_filename.c \ + ptrace/_UPT_put_unwind_info.c \ + ptrace/_UPT_reg_offset.c \ + ptrace/_UPT_resume.c \ + ptrace/_UPT_ptrauth_insn_mask.c + +libunwind_ptrace_la_LIBADD = \ + libunwind-$(arch).la \ + $(LIBLZMA) $(LIBZ) + +libunwind_setjmp_la_SOURCES = mi/init.c setjmp/longjmp.c \ + setjmp/siglongjmp.c $(am__append_30) $(am__append_31) \ + $(am__append_32) $(am__append_33) $(am__append_34) \ + $(am__append_35) $(am__append_36) $(am__append_37) \ + $(am__append_38) $(am__append_39) $(am__append_40) \ + $(am__append_41) +libunwind_setjmp_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SETJMP_SO_VERSION) + +libunwind_setjmp_la_LIBADD = \ + $(libunwind_elf_libs) \ + libunwind-$(arch).la \ + $(libunwind_libadd) + + +### libunwind: +libunwind_la_LIBADD = $(am__append_26) $(libunwind_elf_libs) \ + $(UNW_CRT_LIBADD) $(LIBLZMA) $(LIBZ) + +# List of arch-independent files needed by both local-only and generic +# libraries: +libunwind_la_SOURCES_common = \ + $(libunwind_la_SOURCES_os) \ + mi/init.c \ + mi/flush_cache.c \ + mi/mempool.c \ + mi/strerror.c + + +# List of arch-independent files needed by generic library (libunwind-$ARCH): +libunwind_la_SOURCES_generic = \ + mi/Gaddress_validator.c \ + mi/Gdestroy_addr_space.c \ + mi/Gdyn-extract.c \ + mi/Gdyn-remote.c \ + mi/Gfind_dynamic_proc_info.c \ + mi/Gget_accessors.c \ + mi/Gget_fpreg.c \ + mi/Gget_proc_info_by_ip.c \ + mi/Gget_proc_name.c \ + mi/Gget_reg.c \ + mi/Gis_plt_entry.c \ + mi/Gput_dynamic_unwind_info.c \ + mi/Gset_cache_size.c \ + mi/Gset_caching_policy.c \ + mi/Gset_fpreg.c \ + mi/Gset_iterate_phdr_function.c \ + mi/Gset_reg.c \ + mi/Gget_elf_filename.c + +@SUPPORT_CXX_EXCEPTIONS_TRUE@libunwind_la_SOURCES_local_unwind = \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/Backtrace.c \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/DeleteException.c \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/FindEnclosingFunction.c \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/ForcedUnwind.c \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/GetBSP.c \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/GetCFA.c \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/GetDataRelBase.c \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/GetGR.c \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/GetIP.c \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/GetIPInfo.c \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/GetLanguageSpecificData.c \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/GetRegionStart.c \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/GetTextRelBase.c \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/RaiseException.c \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/Resume.c \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/Resume_or_Rethrow.c \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/SetGR.c \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ unwind/SetIP.c + + +# _ReadULEB()/_ReadSLEB() are needed for Intel C++ 8.0 compatibility +@SUPPORT_CXX_EXCEPTIONS_TRUE@libunwind_la_SOURCES_os_linux_local = \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ mi/_ReadULEB.c \ +@SUPPORT_CXX_EXCEPTIONS_TRUE@ mi/_ReadSLEB.c + + +# List of arch-independent files needed by local-only library (libunwind): +libunwind_la_SOURCES_local_nounwind = \ + $(libunwind_la_SOURCES_os_local) \ + mi/backtrace.c \ + mi/dyn-cancel.c \ + mi/dyn-info-list.c \ + mi/dyn-register.c \ + mi/Laddress_validator.c \ + mi/Ldestroy_addr_space.c \ + mi/Ldyn-extract.c \ + mi/Lfind_dynamic_proc_info.c \ + mi/Lget_accessors.c \ + mi/Lget_fpreg.c mi/Lset_fpreg.c \ + mi/Lget_proc_info_by_ip.c \ + mi/Lget_proc_name.c \ + mi/Lget_reg.c \ + mi/Lis_plt_entry.c \ + mi/Lput_dynamic_unwind_info.c \ + mi/Lset_cache_size.c \ + mi/Lset_caching_policy.c \ + mi/Lset_iterate_phdr_function.c \ + mi/Lset_reg.c \ + mi/Lget_elf_filename.c + +libunwind_la_SOURCES_local = \ + $(libunwind_la_SOURCES_local_nounwind) \ + $(libunwind_la_SOURCES_local_unwind) + +libunwind_dwarf_common_la_SOURCES = dwarf/global.c +libunwind_dwarf_local_la_SOURCES = \ + dwarf/Lexpr.c \ + dwarf/Lfde.c \ + dwarf/Lfind_proc_info-lsb.c \ + dwarf/Lfind_unwind_table.c \ + dwarf/Lget_proc_info_in_range.c \ + dwarf/Lparser.c \ + dwarf/Lpe.c + +libunwind_dwarf_local_la_LIBADD = libunwind-dwarf-common.la +libunwind_dwarf_generic_la_SOURCES = \ + dwarf/Gexpr.c \ + dwarf/Gfde.c \ + dwarf/Gfind_proc_info-lsb.c \ + dwarf/Gfind_unwind_table.c \ + dwarf/Gget_proc_info_in_range.c \ + dwarf/Gparser.c \ + dwarf/Gpe.c + +libunwind_dwarf_generic_la_LIBADD = libunwind-dwarf-common.la +libunwind_elf32_la_SOURCES = elf32.c +libunwind_elf64_la_SOURCES = elf64.c +libunwind_elfxx_la_SOURCES = elfxx.c +libunwind_elf32_la_LIBADD = $(LIBLZMA) $(LIBZ) +libunwind_elf64_la_LIBADD = $(LIBLZMA) $(LIBZ) +libunwind_elfxx_la_LIBADD = $(LIBLZMA) $(LIBZ) +@OS_FREEBSD_TRUE@libunwind_la_SOURCES_os = os-freebsd.c +@OS_HPUX_TRUE@libunwind_la_SOURCES_os = os-hpux.c +@OS_LINUX_TRUE@libunwind_la_SOURCES_os = os-linux.c dl-iterate-phdr.c +@OS_QNX_TRUE@libunwind_la_SOURCES_os = os-qnx.c +@OS_SOLARIS_TRUE@libunwind_la_SOURCES_os = os-solaris.c +@OS_HPUX_TRUE@libunwind_la_SOURCES_os_local = $(libunwind_la_SOURCES_os_hpux_local) +@OS_LINUX_TRUE@libunwind_la_SOURCES_os_local = $(libunwind_la_SOURCES_os_linux_local) +@OS_FREEBSD_TRUE@libunwind_la_SOURCES_aarch64_os = aarch64/Gos-freebsd.c +@OS_LINUX_TRUE@libunwind_la_SOURCES_aarch64_os = aarch64/Gos-linux.c +@OS_QNX_TRUE@libunwind_la_SOURCES_aarch64_os = aarch64/Gos-qnx.c +@OS_FREEBSD_TRUE@libunwind_la_SOURCES_aarch64_os_local = aarch64/Los-freebsd.c aarch64/setcontext.S +@OS_LINUX_TRUE@libunwind_la_SOURCES_aarch64_os_local = aarch64/Los-linux.c +@OS_QNX_TRUE@libunwind_la_SOURCES_aarch64_os_local = aarch64/Los-qnx.c +@OS_FREEBSD_TRUE@libunwind_la_SOURCES_arm_os = arm/Gos-freebsd.c +@OS_LINUX_TRUE@libunwind_la_SOURCES_arm_os = arm/Gos-linux.c +@OS_QNX_TRUE@libunwind_la_SOURCES_arm_os = arm/Gos-other.c +@OS_FREEBSD_TRUE@libunwind_la_SOURCES_arm_os_local = arm/Los-freebsd.c +@OS_LINUX_TRUE@libunwind_la_SOURCES_arm_os_local = arm/Los-linux.c +@OS_QNX_TRUE@libunwind_la_SOURCES_arm_os_local = arm/Los-other.c +@OS_FREEBSD_TRUE@libunwind_la_SOURCES_x86_os = x86/Gos-freebsd.c +@OS_LINUX_TRUE@libunwind_la_SOURCES_x86_os = x86/Gos-linux.c +@OS_FREEBSD_TRUE@libunwind_la_SOURCES_x86_os_local = x86/Los-freebsd.c x86/getcontext-freebsd.S +@OS_LINUX_TRUE@libunwind_la_SOURCES_x86_os_local = x86/Los-linux.c x86/getcontext-linux.S +@OS_FREEBSD_TRUE@libunwind_la_SOURCES_x86_64_os = x86_64/Gos-freebsd.c +@OS_LINUX_TRUE@libunwind_la_SOURCES_x86_64_os = x86_64/Gos-linux.c +@OS_QNX_TRUE@libunwind_la_SOURCES_x86_64_os = x86_64/Gos-qnx.c +@OS_SOLARIS_TRUE@libunwind_la_SOURCES_x86_64_os = x86_64/Gos-solaris.c +@OS_FREEBSD_TRUE@libunwind_la_SOURCES_x86_64_os_local = x86_64/Los-freebsd.c +@OS_LINUX_TRUE@libunwind_la_SOURCES_x86_64_os_local = x86_64/Los-linux.c +@OS_QNX_TRUE@libunwind_la_SOURCES_x86_64_os_local = x86_64/Los-qnx.c +@OS_SOLARIS_TRUE@libunwind_la_SOURCES_x86_64_os_local = x86_64/Los-solaris.c +libunwind_la_SOURCES_aarch64_common = \ + $(libunwind_la_SOURCES_common) \ + aarch64/is_fpreg.c \ + aarch64/regname.c + + +# The list of files that go into libunwind: +@ARCH_AARCH64_TRUE@libunwind_la_SOURCES = \ +@ARCH_AARCH64_TRUE@ $(libunwind_la_SOURCES_aarch64_common) \ +@ARCH_AARCH64_TRUE@ $(libunwind_la_SOURCES_local) \ +@ARCH_AARCH64_TRUE@ $(libunwind_la_SOURCES_aarch64_os_local) \ +@ARCH_AARCH64_TRUE@ aarch64/getcontext.S \ +@ARCH_AARCH64_TRUE@ aarch64/Lapply_reg_state.c \ +@ARCH_AARCH64_TRUE@ aarch64/Lcreate_addr_space.c \ +@ARCH_AARCH64_TRUE@ aarch64/Lget_proc_info.c \ +@ARCH_AARCH64_TRUE@ aarch64/Lget_save_loc.c \ +@ARCH_AARCH64_TRUE@ aarch64/Lglobal.c \ +@ARCH_AARCH64_TRUE@ aarch64/Linit.c \ +@ARCH_AARCH64_TRUE@ aarch64/Linit_local.c \ +@ARCH_AARCH64_TRUE@ aarch64/Linit_remote.c \ +@ARCH_AARCH64_TRUE@ aarch64/Lis_signal_frame.c \ +@ARCH_AARCH64_TRUE@ aarch64/Lregs.c \ +@ARCH_AARCH64_TRUE@ aarch64/Lreg_states_iterate.c \ +@ARCH_AARCH64_TRUE@ aarch64/Lresume.c \ +@ARCH_AARCH64_TRUE@ aarch64/Lstash_frame.c \ +@ARCH_AARCH64_TRUE@ aarch64/Lstep.c \ +@ARCH_AARCH64_TRUE@ aarch64/Ltrace.c \ +@ARCH_AARCH64_TRUE@ aarch64/Lstrip_ptrauth_insn_mask.c + + +# The list of files that go into libunwind: +@ARCH_ARM_TRUE@libunwind_la_SOURCES = \ +@ARCH_ARM_TRUE@ $(libunwind_la_SOURCES_arm_common) \ +@ARCH_ARM_TRUE@ $(libunwind_la_SOURCES_arm_os_local) \ +@ARCH_ARM_TRUE@ $(libunwind_la_SOURCES_local) \ +@ARCH_ARM_TRUE@ arm/getcontext.S \ +@ARCH_ARM_TRUE@ arm/Lapply_reg_state.c \ +@ARCH_ARM_TRUE@ arm/Lcreate_addr_space.c \ +@ARCH_ARM_TRUE@ arm/Lex_tables.c \ +@ARCH_ARM_TRUE@ arm/Lget_proc_info.c \ +@ARCH_ARM_TRUE@ arm/Lget_save_loc.c \ +@ARCH_ARM_TRUE@ arm/Lglobal.c arm/Linit.c \ +@ARCH_ARM_TRUE@ arm/Linit_local.c \ +@ARCH_ARM_TRUE@ arm/Linit_remote.c \ +@ARCH_ARM_TRUE@ arm/Lregs.c \ +@ARCH_ARM_TRUE@ arm/Lreg_states_iterate.c \ +@ARCH_ARM_TRUE@ arm/Lresume.c \ +@ARCH_ARM_TRUE@ arm/Lstash_frame.c \ +@ARCH_ARM_TRUE@ arm/Lstep.c \ +@ARCH_ARM_TRUE@ arm/Ltrace.c + + +# The list of files that go into libunwind: +@ARCH_HPPA_TRUE@libunwind_la_SOURCES = \ +@ARCH_HPPA_TRUE@ $(libunwind_la_SOURCES_hppa_common) \ +@ARCH_HPPA_TRUE@ $(libunwind_la_SOURCES_local) \ +@ARCH_HPPA_TRUE@ hppa/getcontext.S \ +@ARCH_HPPA_TRUE@ hppa/Lapply_reg_state.c \ +@ARCH_HPPA_TRUE@ hppa/Lcreate_addr_space.c \ +@ARCH_HPPA_TRUE@ hppa/Lget_proc_info.c \ +@ARCH_HPPA_TRUE@ hppa/Lget_save_loc.c \ +@ARCH_HPPA_TRUE@ hppa/Lglobal.c \ +@ARCH_HPPA_TRUE@ hppa/Linit.c \ +@ARCH_HPPA_TRUE@ hppa/Linit_local.c \ +@ARCH_HPPA_TRUE@ hppa/Linit_remote.c \ +@ARCH_HPPA_TRUE@ hppa/Lis_signal_frame.c \ +@ARCH_HPPA_TRUE@ hppa/Lregs.c \ +@ARCH_HPPA_TRUE@ hppa/Lreg_states_iterate.c \ +@ARCH_HPPA_TRUE@ hppa/Lresume.c \ +@ARCH_HPPA_TRUE@ hppa/Lstep.c \ +@ARCH_HPPA_TRUE@ hppa/setcontext.S + + +# The list of files that go into libunwind: +@ARCH_IA64_TRUE@libunwind_la_SOURCES = \ +@ARCH_IA64_TRUE@ $(libunwind_la_SOURCES_ia64_common) \ +@ARCH_IA64_TRUE@ $(libunwind_la_SOURCES_local) \ +@ARCH_IA64_TRUE@ ia64/dyn_info_list.S \ +@ARCH_IA64_TRUE@ ia64/getcontext.S \ +@ARCH_IA64_TRUE@ ia64/Lapply_reg_state.c \ +@ARCH_IA64_TRUE@ ia64/Lcreate_addr_space.c \ +@ARCH_IA64_TRUE@ ia64/Lfind_unwind_table.c \ +@ARCH_IA64_TRUE@ ia64/Lget_proc_info.c \ +@ARCH_IA64_TRUE@ ia64/Lget_save_loc.c \ +@ARCH_IA64_TRUE@ ia64/Lglobal.c \ +@ARCH_IA64_TRUE@ ia64/Linit.c \ +@ARCH_IA64_TRUE@ ia64/Linit_local.c \ +@ARCH_IA64_TRUE@ ia64/Linit_remote.c \ +@ARCH_IA64_TRUE@ ia64/Linstall_cursor.S \ +@ARCH_IA64_TRUE@ ia64/Lis_signal_frame.c \ +@ARCH_IA64_TRUE@ ia64/Lparser.c \ +@ARCH_IA64_TRUE@ ia64/Lrbs.c \ +@ARCH_IA64_TRUE@ ia64/Lregs.c \ +@ARCH_IA64_TRUE@ ia64/Lreg_states_iterate.c \ +@ARCH_IA64_TRUE@ ia64/Lresume.c \ +@ARCH_IA64_TRUE@ ia64/Lscript.c \ +@ARCH_IA64_TRUE@ ia64/Lstep.c \ +@ARCH_IA64_TRUE@ ia64/Ltables.c + + +# The list of files that go into libunwind: +@ARCH_LOONGARCH64_TRUE@libunwind_la_SOURCES = \ +@ARCH_LOONGARCH64_TRUE@ $(libunwind_la_SOURCES_loongarch64_common) \ +@ARCH_LOONGARCH64_TRUE@ $(libunwind_la_SOURCES_local) \ +@ARCH_LOONGARCH64_TRUE@ loongarch64/getcontext.S \ +@ARCH_LOONGARCH64_TRUE@ loongarch64/Lapply_reg_state.c \ +@ARCH_LOONGARCH64_TRUE@ loongarch64/Lcreate_addr_space.c \ +@ARCH_LOONGARCH64_TRUE@ loongarch64/Lget_proc_info.c \ +@ARCH_LOONGARCH64_TRUE@ loongarch64/Lget_save_loc.c \ +@ARCH_LOONGARCH64_TRUE@ loongarch64/Lglobal.c \ +@ARCH_LOONGARCH64_TRUE@ loongarch64/Linit.c \ +@ARCH_LOONGARCH64_TRUE@ loongarch64/Linit_local.c \ +@ARCH_LOONGARCH64_TRUE@ loongarch64/Linit_remote.c \ +@ARCH_LOONGARCH64_TRUE@ loongarch64/Lis_signal_frame.c \ +@ARCH_LOONGARCH64_TRUE@ loongarch64/Lregs.c \ +@ARCH_LOONGARCH64_TRUE@ loongarch64/Lreg_states_iterate.c \ +@ARCH_LOONGARCH64_TRUE@ loongarch64/Lresume.c \ +@ARCH_LOONGARCH64_TRUE@ loongarch64/Lstep.c + + +# The list of files that go into libunwind: +@ARCH_MIPS_TRUE@libunwind_la_SOURCES = \ +@ARCH_MIPS_TRUE@ $(libunwind_la_SOURCES_mips_common) \ +@ARCH_MIPS_TRUE@ $(libunwind_la_SOURCES_local) \ +@ARCH_MIPS_TRUE@ mips/getcontext.S \ +@ARCH_MIPS_TRUE@ mips/Lapply_reg_state.c \ +@ARCH_MIPS_TRUE@ mips/Lcreate_addr_space.c \ +@ARCH_MIPS_TRUE@ mips/Lget_proc_info.c \ +@ARCH_MIPS_TRUE@ mips/Lget_save_loc.c \ +@ARCH_MIPS_TRUE@ mips/Lglobal.c \ +@ARCH_MIPS_TRUE@ mips/Linit.c \ +@ARCH_MIPS_TRUE@ mips/Linit_local.c \ +@ARCH_MIPS_TRUE@ mips/Linit_remote.c \ +@ARCH_MIPS_TRUE@ mips/Lis_signal_frame.c \ +@ARCH_MIPS_TRUE@ mips/Lregs.c \ +@ARCH_MIPS_TRUE@ mips/Lreg_states_iterate.c \ +@ARCH_MIPS_TRUE@ mips/Lresume.c \ +@ARCH_MIPS_TRUE@ mips/Lstep.c + + +# The list of files that go into libunwind: +@ARCH_PPC32_TRUE@libunwind_la_SOURCES = \ +@ARCH_PPC32_TRUE@ $(libunwind_la_SOURCES_ppc32_common) \ +@ARCH_PPC32_TRUE@ $(libunwind_la_SOURCES_local) \ +@ARCH_PPC32_TRUE@ $(libunwind_la_SOURCES_ppc) \ +@ARCH_PPC32_TRUE@ ppc32/Lapply_reg_state.c \ +@ARCH_PPC32_TRUE@ ppc32/Lcreate_addr_space.c \ +@ARCH_PPC32_TRUE@ ppc32/Lglobal.c \ +@ARCH_PPC32_TRUE@ ppc32/Linit.c \ +@ARCH_PPC32_TRUE@ ppc32/Lregs.c \ +@ARCH_PPC32_TRUE@ ppc32/Lreg_states_iterate.c \ +@ARCH_PPC32_TRUE@ ppc32/Lresume.c \ +@ARCH_PPC32_TRUE@ ppc32/Lstep.c + + +# The list of files that go into libunwind: +@ARCH_PPC64_TRUE@libunwind_la_SOURCES = \ +@ARCH_PPC64_TRUE@ $(libunwind_la_SOURCES_ppc64_common) \ +@ARCH_PPC64_TRUE@ $(libunwind_la_SOURCES_local) \ +@ARCH_PPC64_TRUE@ $(libunwind_la_SOURCES_ppc) \ +@ARCH_PPC64_TRUE@ ppc64/Lapply_reg_state.c \ +@ARCH_PPC64_TRUE@ ppc64/Lcreate_addr_space.c \ +@ARCH_PPC64_TRUE@ ppc64/Lglobal.c \ +@ARCH_PPC64_TRUE@ ppc64/Linit.c \ +@ARCH_PPC64_TRUE@ ppc64/Lregs.c \ +@ARCH_PPC64_TRUE@ ppc64/Lreg_states_iterate.c \ +@ARCH_PPC64_TRUE@ ppc64/Lresume.c \ +@ARCH_PPC64_TRUE@ ppc64/Lstep.c + + +# The list of files that go into libunwind: +@ARCH_RISCV_TRUE@libunwind_la_SOURCES = \ +@ARCH_RISCV_TRUE@ $(libunwind_la_SOURCES_riscv_common) \ +@ARCH_RISCV_TRUE@ $(libunwind_la_SOURCES_local) \ +@ARCH_RISCV_TRUE@ riscv/getcontext.S \ +@ARCH_RISCV_TRUE@ riscv/Lapply_reg_state.c \ +@ARCH_RISCV_TRUE@ riscv/Lcreate_addr_space.c \ +@ARCH_RISCV_TRUE@ riscv/Lget_proc_info.c \ +@ARCH_RISCV_TRUE@ riscv/Lget_save_loc.c \ +@ARCH_RISCV_TRUE@ riscv/Lglobal.c \ +@ARCH_RISCV_TRUE@ riscv/Linit.c \ +@ARCH_RISCV_TRUE@ riscv/Linit_local.c \ +@ARCH_RISCV_TRUE@ riscv/Linit_remote.c \ +@ARCH_RISCV_TRUE@ riscv/Lis_signal_frame.c \ +@ARCH_RISCV_TRUE@ riscv/Lregs.c \ +@ARCH_RISCV_TRUE@ riscv/Lreg_states_iterate.c \ +@ARCH_RISCV_TRUE@ riscv/Lresume.c \ +@ARCH_RISCV_TRUE@ riscv/Lstep.c \ +@ARCH_RISCV_TRUE@ riscv/setcontext.S + + +# The list of files that go into libunwind: +@ARCH_S390X_TRUE@libunwind_la_SOURCES = \ +@ARCH_S390X_TRUE@ $(libunwind_la_SOURCES_s390x_common) \ +@ARCH_S390X_TRUE@ $(libunwind_la_SOURCES_local) \ +@ARCH_S390X_TRUE@ s390x/getcontext.S \ +@ARCH_S390X_TRUE@ s390x/Lapply_reg_state.c \ +@ARCH_S390X_TRUE@ s390x/Lcreate_addr_space.c \ +@ARCH_S390X_TRUE@ s390x/Lget_proc_info.c \ +@ARCH_S390X_TRUE@ s390x/Lget_save_loc.c \ +@ARCH_S390X_TRUE@ s390x/Lglobal.c \ +@ARCH_S390X_TRUE@ s390x/Linit.c \ +@ARCH_S390X_TRUE@ s390x/Linit_local.c \ +@ARCH_S390X_TRUE@ s390x/Linit_remote.c \ +@ARCH_S390X_TRUE@ s390x/Lis_signal_frame.c \ +@ARCH_S390X_TRUE@ s390x/Lregs.c \ +@ARCH_S390X_TRUE@ s390x/Lreg_states_iterate.c \ +@ARCH_S390X_TRUE@ s390x/Lresume.c \ +@ARCH_S390X_TRUE@ s390x/Lstep.c \ +@ARCH_S390X_TRUE@ s390x/setcontext.S + + +# The list of files that go into libunwind: +@ARCH_SH_TRUE@libunwind_la_SOURCES = \ +@ARCH_SH_TRUE@ $(libunwind_la_SOURCES_sh_common) \ +@ARCH_SH_TRUE@ $(libunwind_la_SOURCES_local) \ +@ARCH_SH_TRUE@ sh/Lapply_reg_state.c \ +@ARCH_SH_TRUE@ sh/Lcreate_addr_space.c \ +@ARCH_SH_TRUE@ sh/Lget_proc_info.c \ +@ARCH_SH_TRUE@ sh/Lget_save_loc.c \ +@ARCH_SH_TRUE@ sh/Lglobal.c \ +@ARCH_SH_TRUE@ sh/Linit.c \ +@ARCH_SH_TRUE@ sh/Linit_local.c \ +@ARCH_SH_TRUE@ sh/Linit_remote.c \ +@ARCH_SH_TRUE@ sh/Lis_signal_frame.c \ +@ARCH_SH_TRUE@ sh/Lregs.c \ +@ARCH_SH_TRUE@ sh/Lreg_states_iterate.c \ +@ARCH_SH_TRUE@ sh/Lresume.c \ +@ARCH_SH_TRUE@ sh/Lstep.c + + +# The list of files that go into libunwind: +@ARCH_X86_64_TRUE@libunwind_la_SOURCES = \ +@ARCH_X86_64_TRUE@ $(libunwind_la_SOURCES_x86_64_common) \ +@ARCH_X86_64_TRUE@ $(libunwind_la_SOURCES_x86_64_os_local)\ +@ARCH_X86_64_TRUE@ $(libunwind_la_SOURCES_local) \ +@ARCH_X86_64_TRUE@ x86_64/getcontext.S \ +@ARCH_X86_64_TRUE@ x86_64/Lapply_reg_state.c \ +@ARCH_X86_64_TRUE@ x86_64/Lcreate_addr_space.c \ +@ARCH_X86_64_TRUE@ x86_64/Lget_proc_info.c \ +@ARCH_X86_64_TRUE@ x86_64/Lget_save_loc.c \ +@ARCH_X86_64_TRUE@ x86_64/Lglobal.c \ +@ARCH_X86_64_TRUE@ x86_64/Linit.c \ +@ARCH_X86_64_TRUE@ x86_64/Linit_local.c \ +@ARCH_X86_64_TRUE@ x86_64/Linit_remote.c \ +@ARCH_X86_64_TRUE@ x86_64/Lregs.c \ +@ARCH_X86_64_TRUE@ x86_64/Lreg_states_iterate.c \ +@ARCH_X86_64_TRUE@ x86_64/Lresume.c \ +@ARCH_X86_64_TRUE@ x86_64/Lstash_frame.c \ +@ARCH_X86_64_TRUE@ x86_64/Lstep.c \ +@ARCH_X86_64_TRUE@ x86_64/Ltrace.c \ +@ARCH_X86_64_TRUE@ x86_64/setcontext.S + + +# The list of files that go into libunwind: +@ARCH_X86_TRUE@libunwind_la_SOURCES = \ +@ARCH_X86_TRUE@ $(libunwind_la_SOURCES_x86_common) \ +@ARCH_X86_TRUE@ $(libunwind_la_SOURCES_x86_os_local) \ +@ARCH_X86_TRUE@ $(libunwind_la_SOURCES_local) \ +@ARCH_X86_TRUE@ x86/Lapply_reg_state.c \ +@ARCH_X86_TRUE@ x86/Lcreate_addr_space.c \ +@ARCH_X86_TRUE@ x86/Lget_proc_info.c \ +@ARCH_X86_TRUE@ x86/Lget_save_loc.c \ +@ARCH_X86_TRUE@ x86/Lglobal.c \ +@ARCH_X86_TRUE@ x86/Linit.c \ +@ARCH_X86_TRUE@ x86/Linit_local.c \ +@ARCH_X86_TRUE@ x86/Linit_remote.c \ +@ARCH_X86_TRUE@ x86/Lregs.c \ +@ARCH_X86_TRUE@ x86/Lreg_states_iterate.c \ +@ARCH_X86_TRUE@ x86/Lresume.c \ +@ARCH_X86_TRUE@ x86/Lstep.c + +libunwind_aarch64_la_SOURCES = \ + $(libunwind_la_SOURCES_aarch64_common) \ + $(libunwind_la_SOURCES_generic) \ + $(libunwind_la_SOURCES_aarch64_os) \ + aarch64/Gapply_reg_state.c \ + aarch64/Gcreate_addr_space.c \ + aarch64/Gget_proc_info.c \ + aarch64/Gget_save_loc.c \ + aarch64/Gglobal.c \ + aarch64/Ginit.c \ + aarch64/Ginit_local.c \ + aarch64/Ginit_remote.c \ + aarch64/Gis_signal_frame.c \ + aarch64/Gregs.c \ + aarch64/Greg_states_iterate.c \ + aarch64/Gresume.c \ + aarch64/Gstash_frame.c \ + aarch64/Gstep.c \ + aarch64/Gtrace.c \ + aarch64/Gstrip_ptrauth_insn_mask.c + +libunwind_aarch64_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) + +libunwind_aarch64_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf64.la \ + $(libunwind_libadd) + +libunwind_la_SOURCES_arm_common = \ + $(libunwind_la_SOURCES_common) \ + arm/is_fpreg.c arm/regname.c + + +# The list of files that go into libunwind-arm: +libunwind_arm_la_SOURCES = \ + $(libunwind_la_SOURCES_arm_common) \ + $(libunwind_la_SOURCES_arm_os) \ + $(libunwind_la_SOURCES_generic) \ + arm/Gapply_reg_state.c \ + arm/Gcreate_addr_space.c \ + arm/Gex_tables.c \ + arm/Gget_proc_info.c \ + arm/Gget_save_loc.c \ + arm/Gglobal.c \ + arm/Ginit.c \ + arm/Ginit_local.c \ + arm/Ginit_remote.c \ + arm/Gregs.c \ + arm/Greg_states_iterate.c \ + arm/Gresume.c \ + arm/Gstash_frame.c \ + arm/Gstep.c \ + arm/Gtrace.c + +libunwind_arm_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) + +libunwind_arm_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf32.la \ + $(libunwind_libadd) + +libunwind_la_SOURCES_hppa_common = \ + $(libunwind_la_SOURCES_common) \ + hppa/regname.c + + +# The list of files that go into libunwind-hppa: +libunwind_hppa_la_SOURCES = \ + $(libunwind_la_SOURCES_hppa_common) \ + $(libunwind_la_SOURCES_generic) \ + hppa/Gapply_reg_state.c \ + hppa/Gcreate_addr_space.c \ + hppa/Gget_proc_info.c \ + hppa/Gget_save_loc.c \ + hppa/Gglobal.c \ + hppa/Ginit.c \ + hppa/Ginit_local.c \ + hppa/Ginit_remote.c \ + hppa/Gis_signal_frame.c \ + hppa/Gregs.c \ + hppa/Greg_states_iterate.c \ + hppa/Gresume.c \ + hppa/Gstep.c + +libunwind_hppa_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) + +libunwind_hppa_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf32.la \ + $(libunwind_libadd) + +libunwind_la_SOURCES_ia64_common = \ + $(libunwind_la_SOURCES_common) \ + ia64/regname.c + +libunwind_la_EXTRAS_ia64 = \ + ia64/mk_cursor_i \ + ia64/mk_Gcursor_i.c \ + ia64/mk_Lcursor_i.c + +@ARCH_IA64_TRUE@BUILT_SOURCES = Gcursor_i.h Lcursor_i.h + +# The list of files that go into libunwind-ia64: +libunwind_ia64_la_SOURCES = \ + $(libunwind_la_SOURCES_ia64_common) \ + $(libunwind_la_SOURCES_generic) \ + ia64/Gapply_reg_state.c \ + ia64/Gcreate_addr_space.c \ + ia64/Gfind_unwind_table.c \ + ia64/Gget_proc_info.c \ + ia64/Gget_save_loc.c \ + ia64/Gglobal.c \ + ia64/Ginit.c \ + ia64/Ginit_local.c \ + ia64/Ginit_remote.c \ + ia64/Ginstall_cursor.S \ + ia64/Gis_signal_frame.c \ + ia64/Gparser.c \ + ia64/Grbs.c \ + ia64/Gregs.c \ + ia64/Greg_states_iterate.c \ + ia64/Gresume.c \ + ia64/Gscript.c \ + ia64/Gstep.c \ + ia64/Gtables.c + +libunwind_ia64_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) + +libunwind_ia64_la_LIBADD = \ + libunwind-elf64.la \ + $(libunwind_libadd) + +libunwind_la_SOURCES_loongarch64_common = \ + $(libunwind_la_SOURCES_common) \ + loongarch64/is_fpreg.c \ + loongarch64/regname.c + +libunwind_loongarch64_la_SOURCES = \ + $(libunwind_la_SOURCES_loongarch64_common) \ + $(libunwind_la_SOURCES_generic) \ + loongarch64/Gapply_reg_state.c \ + loongarch64/Gcreate_addr_space.c \ + loongarch64/Gget_proc_info.c \ + loongarch64/Gget_save_loc.c \ + loongarch64/Gglobal.c \ + loongarch64/Ginit.c \ + loongarch64/Ginit_local.c \ + loongarch64/Ginit_remote.c \ + loongarch64/Gis_signal_frame.c \ + loongarch64/Gregs.c \ + loongarch64/Greg_states_iterate.c \ + loongarch64/Gresume.c \ + loongarch64/Gstep.c + +libunwind_loongarch64_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) + +libunwind_loongarch64_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf64.la \ + $(libunwind_libadd) + +libunwind_la_SOURCES_mips_common = \ + $(libunwind_la_SOURCES_common) \ + mips/is_fpreg.c \ + mips/regname.c + +libunwind_mips_la_SOURCES = \ + $(libunwind_la_SOURCES_mips_common) \ + $(libunwind_la_SOURCES_generic) \ + mips/Gapply_reg_state.c \ + mips/Gcreate_addr_space.c \ + mips/Gget_proc_info.c \ + mips/Gget_save_loc.c \ + mips/Gglobal.c \ + mips/Ginit.c \ + mips/Ginit_local.c \ + mips/Ginit_remote.c \ + mips/Gis_signal_frame.c \ + mips/Gregs.c \ + mips/Greg_states_iterate.c \ + mips/Gresume.c \ + mips/Gstep.c + +libunwind_mips_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) + +libunwind_mips_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elfxx.la \ + $(libunwind_libadd) + + +### target PowerPC: +# The list of local files that go to Power 64 and 32: +libunwind_la_SOURCES_ppc = \ + ppc/Lget_proc_info.c \ + ppc/Lget_save_loc.c \ + ppc/Linit_local.c \ + ppc/Linit_remote.c \ + ppc/Lis_signal_frame.c + + +# The list of generic files that go to Power 64 and 32: +libunwind_ppc_la_SOURCES_ppc_generic = \ + ppc/Gget_proc_info.c \ + ppc/Gget_save_loc.c \ + ppc/Ginit_local.c \ + ppc/Ginit_remote.c \ + ppc/Gis_signal_frame.c + +libunwind_la_SOURCES_ppc32_common = \ + $(libunwind_la_SOURCES_common) \ + ppc32/get_func_addr.c \ + ppc32/is_fpreg.c \ + ppc32/regname.c + + +# The list of files that go into libunwind-ppc32: +libunwind_ppc32_la_SOURCES = \ + $(libunwind_la_SOURCES_ppc32_common) \ + $(libunwind_la_SOURCES_generic) \ + $(libunwind_ppc_la_SOURCES_ppc_generic)\ + ppc32/Gapply_reg_state.c \ + ppc32/Gcreate_addr_space.c \ + ppc32/Gglobal.c \ + ppc32/Ginit.c \ + ppc32/Gregs.c \ + ppc32/Greg_states_iterate.c \ + ppc32/Gresume.c \ + ppc32/Gstep.c + +libunwind_ppc32_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) + +libunwind_ppc32_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf32.la \ + $(libunwind_libadd) + +libunwind_la_SOURCES_ppc64_common = \ + $(libunwind_la_SOURCES_common) \ + ppc64/get_func_addr.c \ + ppc64/is_fpreg.c \ + ppc64/regname.c + + +# The list of files that go into libunwind-ppc64: +libunwind_ppc64_la_SOURCES = \ + $(libunwind_la_SOURCES_ppc64_common) \ + $(libunwind_la_SOURCES_generic) \ + $(libunwind_ppc_la_SOURCES_ppc_generic)\ + ppc64/Gapply_reg_state.c \ + ppc64/Gcreate_addr_space.c \ + ppc64/Gglobal.c \ + ppc64/Ginit.c \ + ppc64/Gregs.c \ + ppc64/Greg_states_iterate.c \ + ppc64/Gresume.c \ + ppc64/Gstep.c + +libunwind_ppc64_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) + +libunwind_ppc64_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf64.la \ + $(libunwind_libadd) + +libunwind_la_SOURCES_riscv_common = \ + $(libunwind_la_SOURCES_common) \ + riscv/is_fpreg.c \ + riscv/regname.c + +libunwind_riscv_la_SOURCES = \ + $(libunwind_la_SOURCES_riscv_common) \ + $(libunwind_la_SOURCES_generic) \ + riscv/Gapply_reg_state.c \ + riscv/Gcreate_addr_space.c \ + riscv/Gget_proc_info.c \ + riscv/Gget_save_loc.c \ + riscv/Gglobal.c \ + riscv/Ginit.c \ + riscv/Ginit_local.c \ + riscv/Ginit_remote.c \ + riscv/Gis_signal_frame.c \ + riscv/Gregs.c \ + riscv/Greg_states_iterate.c \ + riscv/Gresume.c \ + riscv/Gstep.c + +libunwind_riscv_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) + +libunwind_riscv_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf64.la \ + $(libunwind_libadd) + +libunwind_la_SOURCES_s390x_common = \ + $(libunwind_la_SOURCES_common) \ + s390x/is_fpreg.c \ + s390x/regname.c + + +# The list of files that go into libunwind-s390x: +libunwind_s390x_la_SOURCES = \ + $(libunwind_la_SOURCES_s390x_common) \ + $(libunwind_la_SOURCES_generic) \ + s390x/Gapply_reg_state.c \ + s390x/Gcreate_addr_space.c \ + s390x/Gget_proc_info.c \ + s390x/Gget_save_loc.c \ + s390x/Gglobal.c \ + s390x/Ginit.c \ + s390x/Ginit_local.c \ + s390x/Ginit_remote.c \ + s390x/Gis_signal_frame.c \ + s390x/Gregs.c \ + s390x/Greg_states_iterate.c \ + s390x/Gresume.c \ + s390x/Gstep.c + +libunwind_s390x_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) + +libunwind_s390x_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf64.la \ + $(libunwind_libadd) + +libunwind_la_SOURCES_sh_common = \ + $(libunwind_la_SOURCES_common) \ + sh/is_fpreg.c \ + sh/regname.c + +libunwind_sh_la_SOURCES = \ + $(libunwind_la_SOURCES_sh_common) \ + $(libunwind_la_SOURCES_generic) \ + sh/Gapply_reg_state.c \ + sh/Gcreate_addr_space.c \ + sh/Gget_proc_info.c \ + sh/Gget_save_loc.c \ + sh/Gglobal.c \ + sh/Ginit.c \ + sh/Ginit_local.c \ + sh/Ginit_remote.c \ + sh/Gis_signal_frame.c \ + sh/Gregs.c \ + sh/Greg_states_iterate.c \ + sh/Gresume.c \ + sh/Gstep.c + +libunwind_sh_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) + +libunwind_sh_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf32.la \ + $(libunwind_libadd) + +libunwind_la_SOURCES_x86_common = \ + $(libunwind_la_SOURCES_common) \ + x86/is_fpreg.c \ + x86/regname.c + + +# The list of files that go into libunwind-x86: +libunwind_x86_la_SOURCES = \ + $(libunwind_la_SOURCES_x86_common) \ + $(libunwind_la_SOURCES_x86_os) \ + $(libunwind_la_SOURCES_generic) \ + x86/Gapply_reg_state.c \ + x86/Gcreate_addr_space.c \ + x86/Gget_proc_info.c \ + x86/Gget_save_loc.c \ + x86/Gglobal.c \ + x86/Ginit.c \ + x86/Ginit_local.c \ + x86/Ginit_remote.c \ + x86/Gregs.c \ + x86/Greg_states_iterate.c \ + x86/Gresume.c \ + x86/Gstep.c + +libunwind_x86_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) + +libunwind_x86_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf32.la \ + $(libunwind_libadd) + +libunwind_la_SOURCES_x86_64_common = \ + $(libunwind_la_SOURCES_common) \ + x86_64/is_fpreg.c \ + x86_64/regname.c + + +# The list of files that go into libunwind-x86_64: +libunwind_x86_64_la_SOURCES = \ + $(libunwind_la_SOURCES_x86_64_common) \ + $(libunwind_la_SOURCES_x86_64_os) \ + $(libunwind_la_SOURCES_generic) \ + x86_64/Gapply_reg_state.c \ + x86_64/Gcreate_addr_space.c \ + x86_64/Gget_proc_info.c \ + x86_64/Gget_save_loc.c \ + x86_64/Gglobal.c \ + x86_64/Ginit.c \ + x86_64/Ginit_local.c \ + x86_64/Ginit_remote.c \ + x86_64/Gregs.c \ + x86_64/Greg_states_iterate.c \ + x86_64/Gresume.c \ + x86_64/Gstash_frame.c \ + x86_64/Gstep.c \ + x86_64/Gtrace.c + +libunwind_x86_64_la_LDFLAGS = \ + $(COMMON_SO_LDFLAGS) \ + -version-info $(SOVERSION) + +libunwind_x86_64_la_LIBADD = \ + libunwind-dwarf-generic.la \ + libunwind-elf64.la \ + $(libunwind_libadd) + + +# +# Don't link with standard libraries, because those may mention +# libunwind already. +# +libunwind_la_LDFLAGS = $(COMMON_SO_LDFLAGS) \ + $(UNW_CRT_LDFLAGS) \ + $(LDFLAGS_STATIC_LIBCXA) \ + -version-info $(SOVERSION) + +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/tdep-$(arch) -I. +AM_CCASFLAGS = $(AM_CPPFLAGS) +EXTRA_DIST = $(libunwind_la_EXTRAS_ia64) +MAINTAINERCLEANFILES = Makefile.in +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .S .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +libunwind-generic.pc: $(top_builddir)/config.status $(srcdir)/libunwind-generic.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +mi/$(am__dirstamp): + @$(MKDIR_P) mi + @: > mi/$(am__dirstamp) +mi/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) mi/$(DEPDIR) + @: > mi/$(DEPDIR)/$(am__dirstamp) +mi/init.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/flush_cache.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/mempool.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/strerror.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +aarch64/$(am__dirstamp): + @$(MKDIR_P) aarch64 + @: > aarch64/$(am__dirstamp) +aarch64/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) aarch64/$(DEPDIR) + @: > aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/is_fpreg.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/regname.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +mi/Gaddress_validator.lo: mi/$(am__dirstamp) \ + mi/$(DEPDIR)/$(am__dirstamp) +mi/Gdestroy_addr_space.lo: mi/$(am__dirstamp) \ + mi/$(DEPDIR)/$(am__dirstamp) +mi/Gdyn-extract.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/Gdyn-remote.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/Gfind_dynamic_proc_info.lo: mi/$(am__dirstamp) \ + mi/$(DEPDIR)/$(am__dirstamp) +mi/Gget_accessors.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/Gget_fpreg.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/Gget_proc_info_by_ip.lo: mi/$(am__dirstamp) \ + mi/$(DEPDIR)/$(am__dirstamp) +mi/Gget_proc_name.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/Gget_reg.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/Gis_plt_entry.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/Gput_dynamic_unwind_info.lo: mi/$(am__dirstamp) \ + mi/$(DEPDIR)/$(am__dirstamp) +mi/Gset_cache_size.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/Gset_caching_policy.lo: mi/$(am__dirstamp) \ + mi/$(DEPDIR)/$(am__dirstamp) +mi/Gset_fpreg.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/Gset_iterate_phdr_function.lo: mi/$(am__dirstamp) \ + mi/$(DEPDIR)/$(am__dirstamp) +mi/Gset_reg.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/Gget_elf_filename.lo: mi/$(am__dirstamp) \ + mi/$(DEPDIR)/$(am__dirstamp) +aarch64/Gos-freebsd.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Gos-linux.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Gos-qnx.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Gapply_reg_state.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Gcreate_addr_space.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Gget_proc_info.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Gget_save_loc.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Gglobal.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Ginit.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Ginit_local.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Ginit_remote.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Gis_signal_frame.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Gregs.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Greg_states_iterate.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Gresume.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Gstash_frame.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Gstep.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Gtrace.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Gstrip_ptrauth_insn_mask.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) + +libunwind-aarch64.la: $(libunwind_aarch64_la_OBJECTS) $(libunwind_aarch64_la_DEPENDENCIES) $(EXTRA_libunwind_aarch64_la_DEPENDENCIES) + $(AM_V_CCLD)$(libunwind_aarch64_la_LINK) $(am_libunwind_aarch64_la_rpath) $(libunwind_aarch64_la_OBJECTS) $(libunwind_aarch64_la_LIBADD) $(LIBS) +arm/$(am__dirstamp): + @$(MKDIR_P) arm + @: > arm/$(am__dirstamp) +arm/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) arm/$(DEPDIR) + @: > arm/$(DEPDIR)/$(am__dirstamp) +arm/is_fpreg.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/regname.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Gos-freebsd.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Gos-linux.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Gos-other.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Gapply_reg_state.lo: arm/$(am__dirstamp) \ + arm/$(DEPDIR)/$(am__dirstamp) +arm/Gcreate_addr_space.lo: arm/$(am__dirstamp) \ + arm/$(DEPDIR)/$(am__dirstamp) +arm/Gex_tables.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Gget_proc_info.lo: arm/$(am__dirstamp) \ + arm/$(DEPDIR)/$(am__dirstamp) +arm/Gget_save_loc.lo: arm/$(am__dirstamp) \ + arm/$(DEPDIR)/$(am__dirstamp) +arm/Gglobal.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Ginit.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Ginit_local.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Ginit_remote.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Gregs.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Greg_states_iterate.lo: arm/$(am__dirstamp) \ + arm/$(DEPDIR)/$(am__dirstamp) +arm/Gresume.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Gstash_frame.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Gstep.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Gtrace.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) + +libunwind-arm.la: $(libunwind_arm_la_OBJECTS) $(libunwind_arm_la_DEPENDENCIES) $(EXTRA_libunwind_arm_la_DEPENDENCIES) + $(AM_V_CCLD)$(libunwind_arm_la_LINK) $(am_libunwind_arm_la_rpath) $(libunwind_arm_la_OBJECTS) $(libunwind_arm_la_LIBADD) $(LIBS) +coredump/$(am__dirstamp): + @$(MKDIR_P) coredump + @: > coredump/$(am__dirstamp) +coredump/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) coredump/$(DEPDIR) + @: > coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UCD_access_mem.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UCD_accessors.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UCD_corefile_elf.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UCD_create.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UCD_destroy.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UCD_elf_map_image.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/ucd_file_table.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UCD_find_proc_info.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UCD_get_proc_name.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UCD_get_elf_filename.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UPT_elf.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UPT_access_fpreg.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UPT_get_dyn_info_list_addr.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UPT_put_unwind_info.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UPT_resume.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UCD_access_reg_linux.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UCD_get_threadinfo_prstatus.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UCD_get_mapinfo_linux.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UCD_access_reg_freebsd.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UCD_get_mapinfo_generic.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UCD_access_reg_qnx.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) +coredump/_UCD_get_mapinfo_qnx.lo: coredump/$(am__dirstamp) \ + coredump/$(DEPDIR)/$(am__dirstamp) + +libunwind-coredump.la: $(libunwind_coredump_la_OBJECTS) $(libunwind_coredump_la_DEPENDENCIES) $(EXTRA_libunwind_coredump_la_DEPENDENCIES) + $(AM_V_CCLD)$(libunwind_coredump_la_LINK) $(am_libunwind_coredump_la_rpath) $(libunwind_coredump_la_OBJECTS) $(libunwind_coredump_la_LIBADD) $(LIBS) +dwarf/$(am__dirstamp): + @$(MKDIR_P) dwarf + @: > dwarf/$(am__dirstamp) +dwarf/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) dwarf/$(DEPDIR) + @: > dwarf/$(DEPDIR)/$(am__dirstamp) +dwarf/global.lo: dwarf/$(am__dirstamp) dwarf/$(DEPDIR)/$(am__dirstamp) + +libunwind-dwarf-common.la: $(libunwind_dwarf_common_la_OBJECTS) $(libunwind_dwarf_common_la_DEPENDENCIES) $(EXTRA_libunwind_dwarf_common_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libunwind_dwarf_common_la_rpath) $(libunwind_dwarf_common_la_OBJECTS) $(libunwind_dwarf_common_la_LIBADD) $(LIBS) +dwarf/Gexpr.lo: dwarf/$(am__dirstamp) dwarf/$(DEPDIR)/$(am__dirstamp) +dwarf/Gfde.lo: dwarf/$(am__dirstamp) dwarf/$(DEPDIR)/$(am__dirstamp) +dwarf/Gfind_proc_info-lsb.lo: dwarf/$(am__dirstamp) \ + dwarf/$(DEPDIR)/$(am__dirstamp) +dwarf/Gfind_unwind_table.lo: dwarf/$(am__dirstamp) \ + dwarf/$(DEPDIR)/$(am__dirstamp) +dwarf/Gget_proc_info_in_range.lo: dwarf/$(am__dirstamp) \ + dwarf/$(DEPDIR)/$(am__dirstamp) +dwarf/Gparser.lo: dwarf/$(am__dirstamp) \ + dwarf/$(DEPDIR)/$(am__dirstamp) +dwarf/Gpe.lo: dwarf/$(am__dirstamp) dwarf/$(DEPDIR)/$(am__dirstamp) + +libunwind-dwarf-generic.la: $(libunwind_dwarf_generic_la_OBJECTS) $(libunwind_dwarf_generic_la_DEPENDENCIES) $(EXTRA_libunwind_dwarf_generic_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libunwind_dwarf_generic_la_rpath) $(libunwind_dwarf_generic_la_OBJECTS) $(libunwind_dwarf_generic_la_LIBADD) $(LIBS) +dwarf/Lexpr.lo: dwarf/$(am__dirstamp) dwarf/$(DEPDIR)/$(am__dirstamp) +dwarf/Lfde.lo: dwarf/$(am__dirstamp) dwarf/$(DEPDIR)/$(am__dirstamp) +dwarf/Lfind_proc_info-lsb.lo: dwarf/$(am__dirstamp) \ + dwarf/$(DEPDIR)/$(am__dirstamp) +dwarf/Lfind_unwind_table.lo: dwarf/$(am__dirstamp) \ + dwarf/$(DEPDIR)/$(am__dirstamp) +dwarf/Lget_proc_info_in_range.lo: dwarf/$(am__dirstamp) \ + dwarf/$(DEPDIR)/$(am__dirstamp) +dwarf/Lparser.lo: dwarf/$(am__dirstamp) \ + dwarf/$(DEPDIR)/$(am__dirstamp) +dwarf/Lpe.lo: dwarf/$(am__dirstamp) dwarf/$(DEPDIR)/$(am__dirstamp) + +libunwind-dwarf-local.la: $(libunwind_dwarf_local_la_OBJECTS) $(libunwind_dwarf_local_la_DEPENDENCIES) $(EXTRA_libunwind_dwarf_local_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libunwind_dwarf_local_la_rpath) $(libunwind_dwarf_local_la_OBJECTS) $(libunwind_dwarf_local_la_LIBADD) $(LIBS) + +libunwind-elf32.la: $(libunwind_elf32_la_OBJECTS) $(libunwind_elf32_la_DEPENDENCIES) $(EXTRA_libunwind_elf32_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libunwind_elf32_la_rpath) $(libunwind_elf32_la_OBJECTS) $(libunwind_elf32_la_LIBADD) $(LIBS) + +libunwind-elf64.la: $(libunwind_elf64_la_OBJECTS) $(libunwind_elf64_la_DEPENDENCIES) $(EXTRA_libunwind_elf64_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libunwind_elf64_la_rpath) $(libunwind_elf64_la_OBJECTS) $(libunwind_elf64_la_LIBADD) $(LIBS) + +libunwind-elfxx.la: $(libunwind_elfxx_la_OBJECTS) $(libunwind_elfxx_la_DEPENDENCIES) $(EXTRA_libunwind_elfxx_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libunwind_elfxx_la_rpath) $(libunwind_elfxx_la_OBJECTS) $(libunwind_elfxx_la_LIBADD) $(LIBS) +hppa/$(am__dirstamp): + @$(MKDIR_P) hppa + @: > hppa/$(am__dirstamp) +hppa/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) hppa/$(DEPDIR) + @: > hppa/$(DEPDIR)/$(am__dirstamp) +hppa/regname.lo: hppa/$(am__dirstamp) hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Gapply_reg_state.lo: hppa/$(am__dirstamp) \ + hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Gcreate_addr_space.lo: hppa/$(am__dirstamp) \ + hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Gget_proc_info.lo: hppa/$(am__dirstamp) \ + hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Gget_save_loc.lo: hppa/$(am__dirstamp) \ + hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Gglobal.lo: hppa/$(am__dirstamp) hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Ginit.lo: hppa/$(am__dirstamp) hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Ginit_local.lo: hppa/$(am__dirstamp) \ + hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Ginit_remote.lo: hppa/$(am__dirstamp) \ + hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Gis_signal_frame.lo: hppa/$(am__dirstamp) \ + hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Gregs.lo: hppa/$(am__dirstamp) hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Greg_states_iterate.lo: hppa/$(am__dirstamp) \ + hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Gresume.lo: hppa/$(am__dirstamp) hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Gstep.lo: hppa/$(am__dirstamp) hppa/$(DEPDIR)/$(am__dirstamp) + +libunwind-hppa.la: $(libunwind_hppa_la_OBJECTS) $(libunwind_hppa_la_DEPENDENCIES) $(EXTRA_libunwind_hppa_la_DEPENDENCIES) + $(AM_V_CCLD)$(libunwind_hppa_la_LINK) $(am_libunwind_hppa_la_rpath) $(libunwind_hppa_la_OBJECTS) $(libunwind_hppa_la_LIBADD) $(LIBS) +ia64/$(am__dirstamp): + @$(MKDIR_P) ia64 + @: > ia64/$(am__dirstamp) +ia64/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) ia64/$(DEPDIR) + @: > ia64/$(DEPDIR)/$(am__dirstamp) +ia64/regname.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Gapply_reg_state.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Gcreate_addr_space.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Gfind_unwind_table.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Gget_proc_info.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Gget_save_loc.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Gglobal.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Ginit.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Ginit_local.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Ginit_remote.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Ginstall_cursor.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Gis_signal_frame.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Gparser.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Grbs.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Gregs.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Greg_states_iterate.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Gresume.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Gscript.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Gstep.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Gtables.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) + +libunwind-ia64.la: $(libunwind_ia64_la_OBJECTS) $(libunwind_ia64_la_DEPENDENCIES) $(EXTRA_libunwind_ia64_la_DEPENDENCIES) + $(AM_V_CCLD)$(libunwind_ia64_la_LINK) $(am_libunwind_ia64_la_rpath) $(libunwind_ia64_la_OBJECTS) $(libunwind_ia64_la_LIBADD) $(LIBS) +loongarch64/$(am__dirstamp): + @$(MKDIR_P) loongarch64 + @: > loongarch64/$(am__dirstamp) +loongarch64/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) loongarch64/$(DEPDIR) + @: > loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/is_fpreg.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/regname.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Gapply_reg_state.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Gcreate_addr_space.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Gget_proc_info.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Gget_save_loc.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Gglobal.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Ginit.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Ginit_local.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Ginit_remote.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Gis_signal_frame.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Gregs.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Greg_states_iterate.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Gresume.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Gstep.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) + +libunwind-loongarch64.la: $(libunwind_loongarch64_la_OBJECTS) $(libunwind_loongarch64_la_DEPENDENCIES) $(EXTRA_libunwind_loongarch64_la_DEPENDENCIES) + $(AM_V_CCLD)$(libunwind_loongarch64_la_LINK) $(am_libunwind_loongarch64_la_rpath) $(libunwind_loongarch64_la_OBJECTS) $(libunwind_loongarch64_la_LIBADD) $(LIBS) +mips/$(am__dirstamp): + @$(MKDIR_P) mips + @: > mips/$(am__dirstamp) +mips/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) mips/$(DEPDIR) + @: > mips/$(DEPDIR)/$(am__dirstamp) +mips/is_fpreg.lo: mips/$(am__dirstamp) mips/$(DEPDIR)/$(am__dirstamp) +mips/regname.lo: mips/$(am__dirstamp) mips/$(DEPDIR)/$(am__dirstamp) +mips/Gapply_reg_state.lo: mips/$(am__dirstamp) \ + mips/$(DEPDIR)/$(am__dirstamp) +mips/Gcreate_addr_space.lo: mips/$(am__dirstamp) \ + mips/$(DEPDIR)/$(am__dirstamp) +mips/Gget_proc_info.lo: mips/$(am__dirstamp) \ + mips/$(DEPDIR)/$(am__dirstamp) +mips/Gget_save_loc.lo: mips/$(am__dirstamp) \ + mips/$(DEPDIR)/$(am__dirstamp) +mips/Gglobal.lo: mips/$(am__dirstamp) mips/$(DEPDIR)/$(am__dirstamp) +mips/Ginit.lo: mips/$(am__dirstamp) mips/$(DEPDIR)/$(am__dirstamp) +mips/Ginit_local.lo: mips/$(am__dirstamp) \ + mips/$(DEPDIR)/$(am__dirstamp) +mips/Ginit_remote.lo: mips/$(am__dirstamp) \ + mips/$(DEPDIR)/$(am__dirstamp) +mips/Gis_signal_frame.lo: mips/$(am__dirstamp) \ + mips/$(DEPDIR)/$(am__dirstamp) +mips/Gregs.lo: mips/$(am__dirstamp) mips/$(DEPDIR)/$(am__dirstamp) +mips/Greg_states_iterate.lo: mips/$(am__dirstamp) \ + mips/$(DEPDIR)/$(am__dirstamp) +mips/Gresume.lo: mips/$(am__dirstamp) mips/$(DEPDIR)/$(am__dirstamp) +mips/Gstep.lo: mips/$(am__dirstamp) mips/$(DEPDIR)/$(am__dirstamp) + +libunwind-mips.la: $(libunwind_mips_la_OBJECTS) $(libunwind_mips_la_DEPENDENCIES) $(EXTRA_libunwind_mips_la_DEPENDENCIES) + $(AM_V_CCLD)$(libunwind_mips_la_LINK) $(am_libunwind_mips_la_rpath) $(libunwind_mips_la_OBJECTS) $(libunwind_mips_la_LIBADD) $(LIBS) +nto/$(am__dirstamp): + @$(MKDIR_P) nto + @: > nto/$(am__dirstamp) +nto/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) nto/$(DEPDIR) + @: > nto/$(DEPDIR)/$(am__dirstamp) +nto/unw_nto_access_fpreg.lo: nto/$(am__dirstamp) \ + nto/$(DEPDIR)/$(am__dirstamp) +nto/unw_nto_access_mem.lo: nto/$(am__dirstamp) \ + nto/$(DEPDIR)/$(am__dirstamp) +nto/unw_nto_accessors.lo: nto/$(am__dirstamp) \ + nto/$(DEPDIR)/$(am__dirstamp) +nto/unw_nto_access_reg.lo: nto/$(am__dirstamp) \ + nto/$(DEPDIR)/$(am__dirstamp) +nto/unw_nto_create.lo: nto/$(am__dirstamp) \ + nto/$(DEPDIR)/$(am__dirstamp) +nto/unw_nto_destroy.lo: nto/$(am__dirstamp) \ + nto/$(DEPDIR)/$(am__dirstamp) +nto/unw_nto_elf.lo: nto/$(am__dirstamp) nto/$(DEPDIR)/$(am__dirstamp) +nto/unw_nto_find_proc_info.lo: nto/$(am__dirstamp) \ + nto/$(DEPDIR)/$(am__dirstamp) +nto/unw_nto_get_dyn_info_list_addr.lo: nto/$(am__dirstamp) \ + nto/$(DEPDIR)/$(am__dirstamp) +nto/unw_nto_get_proc_name.lo: nto/$(am__dirstamp) \ + nto/$(DEPDIR)/$(am__dirstamp) +nto/unw_nto_get_elf_filename.lo: nto/$(am__dirstamp) \ + nto/$(DEPDIR)/$(am__dirstamp) +nto/unw_nto_put_unwind_info.lo: nto/$(am__dirstamp) \ + nto/$(DEPDIR)/$(am__dirstamp) +nto/unw_nto_resume.lo: nto/$(am__dirstamp) \ + nto/$(DEPDIR)/$(am__dirstamp) + +libunwind-nto.la: $(libunwind_nto_la_OBJECTS) $(libunwind_nto_la_DEPENDENCIES) $(EXTRA_libunwind_nto_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libunwind_nto_la_rpath) $(libunwind_nto_la_OBJECTS) $(libunwind_nto_la_LIBADD) $(LIBS) +ppc32/$(am__dirstamp): + @$(MKDIR_P) ppc32 + @: > ppc32/$(am__dirstamp) +ppc32/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) ppc32/$(DEPDIR) + @: > ppc32/$(DEPDIR)/$(am__dirstamp) +ppc32/get_func_addr.lo: ppc32/$(am__dirstamp) \ + ppc32/$(DEPDIR)/$(am__dirstamp) +ppc32/is_fpreg.lo: ppc32/$(am__dirstamp) \ + ppc32/$(DEPDIR)/$(am__dirstamp) +ppc32/regname.lo: ppc32/$(am__dirstamp) \ + ppc32/$(DEPDIR)/$(am__dirstamp) +ppc/$(am__dirstamp): + @$(MKDIR_P) ppc + @: > ppc/$(am__dirstamp) +ppc/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) ppc/$(DEPDIR) + @: > ppc/$(DEPDIR)/$(am__dirstamp) +ppc/Gget_proc_info.lo: ppc/$(am__dirstamp) \ + ppc/$(DEPDIR)/$(am__dirstamp) +ppc/Gget_save_loc.lo: ppc/$(am__dirstamp) \ + ppc/$(DEPDIR)/$(am__dirstamp) +ppc/Ginit_local.lo: ppc/$(am__dirstamp) ppc/$(DEPDIR)/$(am__dirstamp) +ppc/Ginit_remote.lo: ppc/$(am__dirstamp) ppc/$(DEPDIR)/$(am__dirstamp) +ppc/Gis_signal_frame.lo: ppc/$(am__dirstamp) \ + ppc/$(DEPDIR)/$(am__dirstamp) +ppc32/Gapply_reg_state.lo: ppc32/$(am__dirstamp) \ + ppc32/$(DEPDIR)/$(am__dirstamp) +ppc32/Gcreate_addr_space.lo: ppc32/$(am__dirstamp) \ + ppc32/$(DEPDIR)/$(am__dirstamp) +ppc32/Gglobal.lo: ppc32/$(am__dirstamp) \ + ppc32/$(DEPDIR)/$(am__dirstamp) +ppc32/Ginit.lo: ppc32/$(am__dirstamp) ppc32/$(DEPDIR)/$(am__dirstamp) +ppc32/Gregs.lo: ppc32/$(am__dirstamp) ppc32/$(DEPDIR)/$(am__dirstamp) +ppc32/Greg_states_iterate.lo: ppc32/$(am__dirstamp) \ + ppc32/$(DEPDIR)/$(am__dirstamp) +ppc32/Gresume.lo: ppc32/$(am__dirstamp) \ + ppc32/$(DEPDIR)/$(am__dirstamp) +ppc32/Gstep.lo: ppc32/$(am__dirstamp) ppc32/$(DEPDIR)/$(am__dirstamp) + +libunwind-ppc32.la: $(libunwind_ppc32_la_OBJECTS) $(libunwind_ppc32_la_DEPENDENCIES) $(EXTRA_libunwind_ppc32_la_DEPENDENCIES) + $(AM_V_CCLD)$(libunwind_ppc32_la_LINK) $(am_libunwind_ppc32_la_rpath) $(libunwind_ppc32_la_OBJECTS) $(libunwind_ppc32_la_LIBADD) $(LIBS) +ppc64/$(am__dirstamp): + @$(MKDIR_P) ppc64 + @: > ppc64/$(am__dirstamp) +ppc64/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) ppc64/$(DEPDIR) + @: > ppc64/$(DEPDIR)/$(am__dirstamp) +ppc64/get_func_addr.lo: ppc64/$(am__dirstamp) \ + ppc64/$(DEPDIR)/$(am__dirstamp) +ppc64/is_fpreg.lo: ppc64/$(am__dirstamp) \ + ppc64/$(DEPDIR)/$(am__dirstamp) +ppc64/regname.lo: ppc64/$(am__dirstamp) \ + ppc64/$(DEPDIR)/$(am__dirstamp) +ppc64/Gapply_reg_state.lo: ppc64/$(am__dirstamp) \ + ppc64/$(DEPDIR)/$(am__dirstamp) +ppc64/Gcreate_addr_space.lo: ppc64/$(am__dirstamp) \ + ppc64/$(DEPDIR)/$(am__dirstamp) +ppc64/Gglobal.lo: ppc64/$(am__dirstamp) \ + ppc64/$(DEPDIR)/$(am__dirstamp) +ppc64/Ginit.lo: ppc64/$(am__dirstamp) ppc64/$(DEPDIR)/$(am__dirstamp) +ppc64/Gregs.lo: ppc64/$(am__dirstamp) ppc64/$(DEPDIR)/$(am__dirstamp) +ppc64/Greg_states_iterate.lo: ppc64/$(am__dirstamp) \ + ppc64/$(DEPDIR)/$(am__dirstamp) +ppc64/Gresume.lo: ppc64/$(am__dirstamp) \ + ppc64/$(DEPDIR)/$(am__dirstamp) +ppc64/Gstep.lo: ppc64/$(am__dirstamp) ppc64/$(DEPDIR)/$(am__dirstamp) + +libunwind-ppc64.la: $(libunwind_ppc64_la_OBJECTS) $(libunwind_ppc64_la_DEPENDENCIES) $(EXTRA_libunwind_ppc64_la_DEPENDENCIES) + $(AM_V_CCLD)$(libunwind_ppc64_la_LINK) $(am_libunwind_ppc64_la_rpath) $(libunwind_ppc64_la_OBJECTS) $(libunwind_ppc64_la_LIBADD) $(LIBS) +ptrace/$(am__dirstamp): + @$(MKDIR_P) ptrace + @: > ptrace/$(am__dirstamp) +ptrace/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) ptrace/$(DEPDIR) + @: > ptrace/$(DEPDIR)/$(am__dirstamp) +ptrace/_UPT_access_fpreg.lo: ptrace/$(am__dirstamp) \ + ptrace/$(DEPDIR)/$(am__dirstamp) +ptrace/_UPT_access_mem.lo: ptrace/$(am__dirstamp) \ + ptrace/$(DEPDIR)/$(am__dirstamp) +ptrace/_UPT_accessors.lo: ptrace/$(am__dirstamp) \ + ptrace/$(DEPDIR)/$(am__dirstamp) +ptrace/_UPT_access_reg.lo: ptrace/$(am__dirstamp) \ + ptrace/$(DEPDIR)/$(am__dirstamp) +ptrace/_UPT_create.lo: ptrace/$(am__dirstamp) \ + ptrace/$(DEPDIR)/$(am__dirstamp) +ptrace/_UPT_destroy.lo: ptrace/$(am__dirstamp) \ + ptrace/$(DEPDIR)/$(am__dirstamp) +ptrace/_UPT_elf.lo: ptrace/$(am__dirstamp) \ + ptrace/$(DEPDIR)/$(am__dirstamp) +ptrace/_UPT_find_proc_info.lo: ptrace/$(am__dirstamp) \ + ptrace/$(DEPDIR)/$(am__dirstamp) +ptrace/_UPT_get_dyn_info_list_addr.lo: ptrace/$(am__dirstamp) \ + ptrace/$(DEPDIR)/$(am__dirstamp) +ptrace/_UPT_get_proc_name.lo: ptrace/$(am__dirstamp) \ + ptrace/$(DEPDIR)/$(am__dirstamp) +ptrace/_UPT_get_elf_filename.lo: ptrace/$(am__dirstamp) \ + ptrace/$(DEPDIR)/$(am__dirstamp) +ptrace/_UPT_put_unwind_info.lo: ptrace/$(am__dirstamp) \ + ptrace/$(DEPDIR)/$(am__dirstamp) +ptrace/_UPT_reg_offset.lo: ptrace/$(am__dirstamp) \ + ptrace/$(DEPDIR)/$(am__dirstamp) +ptrace/_UPT_resume.lo: ptrace/$(am__dirstamp) \ + ptrace/$(DEPDIR)/$(am__dirstamp) +ptrace/_UPT_ptrauth_insn_mask.lo: ptrace/$(am__dirstamp) \ + ptrace/$(DEPDIR)/$(am__dirstamp) + +libunwind-ptrace.la: $(libunwind_ptrace_la_OBJECTS) $(libunwind_ptrace_la_DEPENDENCIES) $(EXTRA_libunwind_ptrace_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libunwind_ptrace_la_rpath) $(libunwind_ptrace_la_OBJECTS) $(libunwind_ptrace_la_LIBADD) $(LIBS) +riscv/$(am__dirstamp): + @$(MKDIR_P) riscv + @: > riscv/$(am__dirstamp) +riscv/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) riscv/$(DEPDIR) + @: > riscv/$(DEPDIR)/$(am__dirstamp) +riscv/is_fpreg.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/regname.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Gapply_reg_state.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Gcreate_addr_space.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Gget_proc_info.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Gget_save_loc.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Gglobal.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Ginit.lo: riscv/$(am__dirstamp) riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Ginit_local.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Ginit_remote.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Gis_signal_frame.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Gregs.lo: riscv/$(am__dirstamp) riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Greg_states_iterate.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Gresume.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Gstep.lo: riscv/$(am__dirstamp) riscv/$(DEPDIR)/$(am__dirstamp) + +libunwind-riscv.la: $(libunwind_riscv_la_OBJECTS) $(libunwind_riscv_la_DEPENDENCIES) $(EXTRA_libunwind_riscv_la_DEPENDENCIES) + $(AM_V_CCLD)$(libunwind_riscv_la_LINK) $(am_libunwind_riscv_la_rpath) $(libunwind_riscv_la_OBJECTS) $(libunwind_riscv_la_LIBADD) $(LIBS) +s390x/$(am__dirstamp): + @$(MKDIR_P) s390x + @: > s390x/$(am__dirstamp) +s390x/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) s390x/$(DEPDIR) + @: > s390x/$(DEPDIR)/$(am__dirstamp) +s390x/is_fpreg.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/regname.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Gapply_reg_state.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Gcreate_addr_space.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Gget_proc_info.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Gget_save_loc.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Gglobal.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Ginit.lo: s390x/$(am__dirstamp) s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Ginit_local.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Ginit_remote.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Gis_signal_frame.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Gregs.lo: s390x/$(am__dirstamp) s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Greg_states_iterate.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Gresume.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Gstep.lo: s390x/$(am__dirstamp) s390x/$(DEPDIR)/$(am__dirstamp) + +libunwind-s390x.la: $(libunwind_s390x_la_OBJECTS) $(libunwind_s390x_la_DEPENDENCIES) $(EXTRA_libunwind_s390x_la_DEPENDENCIES) + $(AM_V_CCLD)$(libunwind_s390x_la_LINK) $(am_libunwind_s390x_la_rpath) $(libunwind_s390x_la_OBJECTS) $(libunwind_s390x_la_LIBADD) $(LIBS) +setjmp/$(am__dirstamp): + @$(MKDIR_P) setjmp + @: > setjmp/$(am__dirstamp) +setjmp/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) setjmp/$(DEPDIR) + @: > setjmp/$(DEPDIR)/$(am__dirstamp) +setjmp/longjmp.lo: setjmp/$(am__dirstamp) \ + setjmp/$(DEPDIR)/$(am__dirstamp) +setjmp/siglongjmp.lo: setjmp/$(am__dirstamp) \ + setjmp/$(DEPDIR)/$(am__dirstamp) +aarch64/longjmp.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/siglongjmp.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +arm/siglongjmp.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +hppa/siglongjmp.lo: hppa/$(am__dirstamp) \ + hppa/$(DEPDIR)/$(am__dirstamp) +ia64/longjmp.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +ia64/setjmp.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +ia64/siglongjmp.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/sigsetjmp.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +loongarch64/siglongjmp.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +mips/siglongjmp.lo: mips/$(am__dirstamp) \ + mips/$(DEPDIR)/$(am__dirstamp) +ppc/longjmp.lo: ppc/$(am__dirstamp) ppc/$(DEPDIR)/$(am__dirstamp) +ppc/siglongjmp.lo: ppc/$(am__dirstamp) ppc/$(DEPDIR)/$(am__dirstamp) +riscv/siglongjmp.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +sh/$(am__dirstamp): + @$(MKDIR_P) sh + @: > sh/$(am__dirstamp) +sh/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) sh/$(DEPDIR) + @: > sh/$(DEPDIR)/$(am__dirstamp) +sh/siglongjmp.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) +x86/$(am__dirstamp): + @$(MKDIR_P) x86 + @: > x86/$(am__dirstamp) +x86/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) x86/$(DEPDIR) + @: > x86/$(DEPDIR)/$(am__dirstamp) +x86/longjmp.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) +x86/siglongjmp.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) +x86_64/$(am__dirstamp): + @$(MKDIR_P) x86_64 + @: > x86_64/$(am__dirstamp) +x86_64/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) x86_64/$(DEPDIR) + @: > x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/longjmp.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/siglongjmp.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) + +libunwind-setjmp.la: $(libunwind_setjmp_la_OBJECTS) $(libunwind_setjmp_la_DEPENDENCIES) $(EXTRA_libunwind_setjmp_la_DEPENDENCIES) + $(AM_V_CCLD)$(libunwind_setjmp_la_LINK) $(am_libunwind_setjmp_la_rpath) $(libunwind_setjmp_la_OBJECTS) $(libunwind_setjmp_la_LIBADD) $(LIBS) +sh/is_fpreg.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) +sh/regname.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) +sh/Gapply_reg_state.lo: sh/$(am__dirstamp) \ + sh/$(DEPDIR)/$(am__dirstamp) +sh/Gcreate_addr_space.lo: sh/$(am__dirstamp) \ + sh/$(DEPDIR)/$(am__dirstamp) +sh/Gget_proc_info.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) +sh/Gget_save_loc.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) +sh/Gglobal.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) +sh/Ginit.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) +sh/Ginit_local.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) +sh/Ginit_remote.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) +sh/Gis_signal_frame.lo: sh/$(am__dirstamp) \ + sh/$(DEPDIR)/$(am__dirstamp) +sh/Gregs.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) +sh/Greg_states_iterate.lo: sh/$(am__dirstamp) \ + sh/$(DEPDIR)/$(am__dirstamp) +sh/Gresume.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) +sh/Gstep.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) + +libunwind-sh.la: $(libunwind_sh_la_OBJECTS) $(libunwind_sh_la_DEPENDENCIES) $(EXTRA_libunwind_sh_la_DEPENDENCIES) + $(AM_V_CCLD)$(libunwind_sh_la_LINK) $(am_libunwind_sh_la_rpath) $(libunwind_sh_la_OBJECTS) $(libunwind_sh_la_LIBADD) $(LIBS) +x86/is_fpreg.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) +x86/regname.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) +x86/Gos-freebsd.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) +x86/Gos-linux.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) +x86/Gapply_reg_state.lo: x86/$(am__dirstamp) \ + x86/$(DEPDIR)/$(am__dirstamp) +x86/Gcreate_addr_space.lo: x86/$(am__dirstamp) \ + x86/$(DEPDIR)/$(am__dirstamp) +x86/Gget_proc_info.lo: x86/$(am__dirstamp) \ + x86/$(DEPDIR)/$(am__dirstamp) +x86/Gget_save_loc.lo: x86/$(am__dirstamp) \ + x86/$(DEPDIR)/$(am__dirstamp) +x86/Gglobal.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) +x86/Ginit.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) +x86/Ginit_local.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) +x86/Ginit_remote.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) +x86/Gregs.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) +x86/Greg_states_iterate.lo: x86/$(am__dirstamp) \ + x86/$(DEPDIR)/$(am__dirstamp) +x86/Gresume.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) +x86/Gstep.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) + +libunwind-x86.la: $(libunwind_x86_la_OBJECTS) $(libunwind_x86_la_DEPENDENCIES) $(EXTRA_libunwind_x86_la_DEPENDENCIES) + $(AM_V_CCLD)$(libunwind_x86_la_LINK) $(am_libunwind_x86_la_rpath) $(libunwind_x86_la_OBJECTS) $(libunwind_x86_la_LIBADD) $(LIBS) +x86_64/is_fpreg.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/regname.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Gos-freebsd.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Gos-linux.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Gos-qnx.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Gos-solaris.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Gapply_reg_state.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Gcreate_addr_space.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Gget_proc_info.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Gget_save_loc.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Gglobal.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Ginit.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Ginit_local.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Ginit_remote.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Gregs.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Greg_states_iterate.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Gresume.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Gstash_frame.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Gstep.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Gtrace.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) + +libunwind-x86_64.la: $(libunwind_x86_64_la_OBJECTS) $(libunwind_x86_64_la_DEPENDENCIES) $(EXTRA_libunwind_x86_64_la_DEPENDENCIES) + $(AM_V_CCLD)$(libunwind_x86_64_la_LINK) $(am_libunwind_x86_64_la_rpath) $(libunwind_x86_64_la_OBJECTS) $(libunwind_x86_64_la_LIBADD) $(LIBS) +mi/_ReadULEB.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/_ReadSLEB.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/backtrace.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/dyn-cancel.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/dyn-info-list.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/dyn-register.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/Laddress_validator.lo: mi/$(am__dirstamp) \ + mi/$(DEPDIR)/$(am__dirstamp) +mi/Ldestroy_addr_space.lo: mi/$(am__dirstamp) \ + mi/$(DEPDIR)/$(am__dirstamp) +mi/Ldyn-extract.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/Lfind_dynamic_proc_info.lo: mi/$(am__dirstamp) \ + mi/$(DEPDIR)/$(am__dirstamp) +mi/Lget_accessors.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/Lget_fpreg.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/Lset_fpreg.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/Lget_proc_info_by_ip.lo: mi/$(am__dirstamp) \ + mi/$(DEPDIR)/$(am__dirstamp) +mi/Lget_proc_name.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/Lget_reg.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/Lis_plt_entry.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/Lput_dynamic_unwind_info.lo: mi/$(am__dirstamp) \ + mi/$(DEPDIR)/$(am__dirstamp) +mi/Lset_cache_size.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/Lset_caching_policy.lo: mi/$(am__dirstamp) \ + mi/$(DEPDIR)/$(am__dirstamp) +mi/Lset_iterate_phdr_function.lo: mi/$(am__dirstamp) \ + mi/$(DEPDIR)/$(am__dirstamp) +mi/Lset_reg.lo: mi/$(am__dirstamp) mi/$(DEPDIR)/$(am__dirstamp) +mi/Lget_elf_filename.lo: mi/$(am__dirstamp) \ + mi/$(DEPDIR)/$(am__dirstamp) +unwind/$(am__dirstamp): + @$(MKDIR_P) unwind + @: > unwind/$(am__dirstamp) +unwind/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) unwind/$(DEPDIR) + @: > unwind/$(DEPDIR)/$(am__dirstamp) +unwind/Backtrace.lo: unwind/$(am__dirstamp) \ + unwind/$(DEPDIR)/$(am__dirstamp) +unwind/DeleteException.lo: unwind/$(am__dirstamp) \ + unwind/$(DEPDIR)/$(am__dirstamp) +unwind/FindEnclosingFunction.lo: unwind/$(am__dirstamp) \ + unwind/$(DEPDIR)/$(am__dirstamp) +unwind/ForcedUnwind.lo: unwind/$(am__dirstamp) \ + unwind/$(DEPDIR)/$(am__dirstamp) +unwind/GetBSP.lo: unwind/$(am__dirstamp) \ + unwind/$(DEPDIR)/$(am__dirstamp) +unwind/GetCFA.lo: unwind/$(am__dirstamp) \ + unwind/$(DEPDIR)/$(am__dirstamp) +unwind/GetDataRelBase.lo: unwind/$(am__dirstamp) \ + unwind/$(DEPDIR)/$(am__dirstamp) +unwind/GetGR.lo: unwind/$(am__dirstamp) \ + unwind/$(DEPDIR)/$(am__dirstamp) +unwind/GetIP.lo: unwind/$(am__dirstamp) \ + unwind/$(DEPDIR)/$(am__dirstamp) +unwind/GetIPInfo.lo: unwind/$(am__dirstamp) \ + unwind/$(DEPDIR)/$(am__dirstamp) +unwind/GetLanguageSpecificData.lo: unwind/$(am__dirstamp) \ + unwind/$(DEPDIR)/$(am__dirstamp) +unwind/GetRegionStart.lo: unwind/$(am__dirstamp) \ + unwind/$(DEPDIR)/$(am__dirstamp) +unwind/GetTextRelBase.lo: unwind/$(am__dirstamp) \ + unwind/$(DEPDIR)/$(am__dirstamp) +unwind/RaiseException.lo: unwind/$(am__dirstamp) \ + unwind/$(DEPDIR)/$(am__dirstamp) +unwind/Resume.lo: unwind/$(am__dirstamp) \ + unwind/$(DEPDIR)/$(am__dirstamp) +unwind/Resume_or_Rethrow.lo: unwind/$(am__dirstamp) \ + unwind/$(DEPDIR)/$(am__dirstamp) +unwind/SetGR.lo: unwind/$(am__dirstamp) \ + unwind/$(DEPDIR)/$(am__dirstamp) +unwind/SetIP.lo: unwind/$(am__dirstamp) \ + unwind/$(DEPDIR)/$(am__dirstamp) +aarch64/Los-freebsd.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/setcontext.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Los-linux.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Los-qnx.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/getcontext.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Lapply_reg_state.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Lcreate_addr_space.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Lget_proc_info.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Lget_save_loc.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Lglobal.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Linit.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Linit_local.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Linit_remote.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Lis_signal_frame.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Lregs.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Lreg_states_iterate.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Lresume.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Lstash_frame.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Lstep.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Ltrace.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +aarch64/Lstrip_ptrauth_insn_mask.lo: aarch64/$(am__dirstamp) \ + aarch64/$(DEPDIR)/$(am__dirstamp) +arm/Los-freebsd.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Los-linux.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Los-other.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/getcontext.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Lapply_reg_state.lo: arm/$(am__dirstamp) \ + arm/$(DEPDIR)/$(am__dirstamp) +arm/Lcreate_addr_space.lo: arm/$(am__dirstamp) \ + arm/$(DEPDIR)/$(am__dirstamp) +arm/Lex_tables.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Lget_proc_info.lo: arm/$(am__dirstamp) \ + arm/$(DEPDIR)/$(am__dirstamp) +arm/Lget_save_loc.lo: arm/$(am__dirstamp) \ + arm/$(DEPDIR)/$(am__dirstamp) +arm/Lglobal.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Linit.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Linit_local.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Linit_remote.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Lregs.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Lreg_states_iterate.lo: arm/$(am__dirstamp) \ + arm/$(DEPDIR)/$(am__dirstamp) +arm/Lresume.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Lstash_frame.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Lstep.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +arm/Ltrace.lo: arm/$(am__dirstamp) arm/$(DEPDIR)/$(am__dirstamp) +hppa/getcontext.lo: hppa/$(am__dirstamp) \ + hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Lapply_reg_state.lo: hppa/$(am__dirstamp) \ + hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Lcreate_addr_space.lo: hppa/$(am__dirstamp) \ + hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Lget_proc_info.lo: hppa/$(am__dirstamp) \ + hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Lget_save_loc.lo: hppa/$(am__dirstamp) \ + hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Lglobal.lo: hppa/$(am__dirstamp) hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Linit.lo: hppa/$(am__dirstamp) hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Linit_local.lo: hppa/$(am__dirstamp) \ + hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Linit_remote.lo: hppa/$(am__dirstamp) \ + hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Lis_signal_frame.lo: hppa/$(am__dirstamp) \ + hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Lregs.lo: hppa/$(am__dirstamp) hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Lreg_states_iterate.lo: hppa/$(am__dirstamp) \ + hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Lresume.lo: hppa/$(am__dirstamp) hppa/$(DEPDIR)/$(am__dirstamp) +hppa/Lstep.lo: hppa/$(am__dirstamp) hppa/$(DEPDIR)/$(am__dirstamp) +hppa/setcontext.lo: hppa/$(am__dirstamp) \ + hppa/$(DEPDIR)/$(am__dirstamp) +ia64/dyn_info_list.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/getcontext.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Lapply_reg_state.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Lcreate_addr_space.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Lfind_unwind_table.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Lget_proc_info.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Lget_save_loc.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Lglobal.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Linit.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Linit_local.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Linit_remote.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Linstall_cursor.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Lis_signal_frame.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Lparser.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Lrbs.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Lregs.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Lreg_states_iterate.lo: ia64/$(am__dirstamp) \ + ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Lresume.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Lscript.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Lstep.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +ia64/Ltables.lo: ia64/$(am__dirstamp) ia64/$(DEPDIR)/$(am__dirstamp) +loongarch64/getcontext.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Lapply_reg_state.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Lcreate_addr_space.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Lget_proc_info.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Lget_save_loc.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Lglobal.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Linit.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Linit_local.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Linit_remote.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Lis_signal_frame.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Lregs.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Lreg_states_iterate.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Lresume.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +loongarch64/Lstep.lo: loongarch64/$(am__dirstamp) \ + loongarch64/$(DEPDIR)/$(am__dirstamp) +mips/getcontext.lo: mips/$(am__dirstamp) \ + mips/$(DEPDIR)/$(am__dirstamp) +mips/Lapply_reg_state.lo: mips/$(am__dirstamp) \ + mips/$(DEPDIR)/$(am__dirstamp) +mips/Lcreate_addr_space.lo: mips/$(am__dirstamp) \ + mips/$(DEPDIR)/$(am__dirstamp) +mips/Lget_proc_info.lo: mips/$(am__dirstamp) \ + mips/$(DEPDIR)/$(am__dirstamp) +mips/Lget_save_loc.lo: mips/$(am__dirstamp) \ + mips/$(DEPDIR)/$(am__dirstamp) +mips/Lglobal.lo: mips/$(am__dirstamp) mips/$(DEPDIR)/$(am__dirstamp) +mips/Linit.lo: mips/$(am__dirstamp) mips/$(DEPDIR)/$(am__dirstamp) +mips/Linit_local.lo: mips/$(am__dirstamp) \ + mips/$(DEPDIR)/$(am__dirstamp) +mips/Linit_remote.lo: mips/$(am__dirstamp) \ + mips/$(DEPDIR)/$(am__dirstamp) +mips/Lis_signal_frame.lo: mips/$(am__dirstamp) \ + mips/$(DEPDIR)/$(am__dirstamp) +mips/Lregs.lo: mips/$(am__dirstamp) mips/$(DEPDIR)/$(am__dirstamp) +mips/Lreg_states_iterate.lo: mips/$(am__dirstamp) \ + mips/$(DEPDIR)/$(am__dirstamp) +mips/Lresume.lo: mips/$(am__dirstamp) mips/$(DEPDIR)/$(am__dirstamp) +mips/Lstep.lo: mips/$(am__dirstamp) mips/$(DEPDIR)/$(am__dirstamp) +ppc/Lget_proc_info.lo: ppc/$(am__dirstamp) \ + ppc/$(DEPDIR)/$(am__dirstamp) +ppc/Lget_save_loc.lo: ppc/$(am__dirstamp) \ + ppc/$(DEPDIR)/$(am__dirstamp) +ppc/Linit_local.lo: ppc/$(am__dirstamp) ppc/$(DEPDIR)/$(am__dirstamp) +ppc/Linit_remote.lo: ppc/$(am__dirstamp) ppc/$(DEPDIR)/$(am__dirstamp) +ppc/Lis_signal_frame.lo: ppc/$(am__dirstamp) \ + ppc/$(DEPDIR)/$(am__dirstamp) +ppc32/Lapply_reg_state.lo: ppc32/$(am__dirstamp) \ + ppc32/$(DEPDIR)/$(am__dirstamp) +ppc32/Lcreate_addr_space.lo: ppc32/$(am__dirstamp) \ + ppc32/$(DEPDIR)/$(am__dirstamp) +ppc32/Lglobal.lo: ppc32/$(am__dirstamp) \ + ppc32/$(DEPDIR)/$(am__dirstamp) +ppc32/Linit.lo: ppc32/$(am__dirstamp) ppc32/$(DEPDIR)/$(am__dirstamp) +ppc32/Lregs.lo: ppc32/$(am__dirstamp) ppc32/$(DEPDIR)/$(am__dirstamp) +ppc32/Lreg_states_iterate.lo: ppc32/$(am__dirstamp) \ + ppc32/$(DEPDIR)/$(am__dirstamp) +ppc32/Lresume.lo: ppc32/$(am__dirstamp) \ + ppc32/$(DEPDIR)/$(am__dirstamp) +ppc32/Lstep.lo: ppc32/$(am__dirstamp) ppc32/$(DEPDIR)/$(am__dirstamp) +ppc64/Lapply_reg_state.lo: ppc64/$(am__dirstamp) \ + ppc64/$(DEPDIR)/$(am__dirstamp) +ppc64/Lcreate_addr_space.lo: ppc64/$(am__dirstamp) \ + ppc64/$(DEPDIR)/$(am__dirstamp) +ppc64/Lglobal.lo: ppc64/$(am__dirstamp) \ + ppc64/$(DEPDIR)/$(am__dirstamp) +ppc64/Linit.lo: ppc64/$(am__dirstamp) ppc64/$(DEPDIR)/$(am__dirstamp) +ppc64/Lregs.lo: ppc64/$(am__dirstamp) ppc64/$(DEPDIR)/$(am__dirstamp) +ppc64/Lreg_states_iterate.lo: ppc64/$(am__dirstamp) \ + ppc64/$(DEPDIR)/$(am__dirstamp) +ppc64/Lresume.lo: ppc64/$(am__dirstamp) \ + ppc64/$(DEPDIR)/$(am__dirstamp) +ppc64/Lstep.lo: ppc64/$(am__dirstamp) ppc64/$(DEPDIR)/$(am__dirstamp) +riscv/getcontext.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Lapply_reg_state.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Lcreate_addr_space.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Lget_proc_info.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Lget_save_loc.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Lglobal.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Linit.lo: riscv/$(am__dirstamp) riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Linit_local.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Linit_remote.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Lis_signal_frame.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Lregs.lo: riscv/$(am__dirstamp) riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Lreg_states_iterate.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Lresume.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +riscv/Lstep.lo: riscv/$(am__dirstamp) riscv/$(DEPDIR)/$(am__dirstamp) +riscv/setcontext.lo: riscv/$(am__dirstamp) \ + riscv/$(DEPDIR)/$(am__dirstamp) +s390x/getcontext.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Lapply_reg_state.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Lcreate_addr_space.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Lget_proc_info.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Lget_save_loc.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Lglobal.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Linit.lo: s390x/$(am__dirstamp) s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Linit_local.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Linit_remote.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Lis_signal_frame.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Lregs.lo: s390x/$(am__dirstamp) s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Lreg_states_iterate.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Lresume.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +s390x/Lstep.lo: s390x/$(am__dirstamp) s390x/$(DEPDIR)/$(am__dirstamp) +s390x/setcontext.lo: s390x/$(am__dirstamp) \ + s390x/$(DEPDIR)/$(am__dirstamp) +sh/Lapply_reg_state.lo: sh/$(am__dirstamp) \ + sh/$(DEPDIR)/$(am__dirstamp) +sh/Lcreate_addr_space.lo: sh/$(am__dirstamp) \ + sh/$(DEPDIR)/$(am__dirstamp) +sh/Lget_proc_info.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) +sh/Lget_save_loc.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) +sh/Lglobal.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) +sh/Linit.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) +sh/Linit_local.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) +sh/Linit_remote.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) +sh/Lis_signal_frame.lo: sh/$(am__dirstamp) \ + sh/$(DEPDIR)/$(am__dirstamp) +sh/Lregs.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) +sh/Lreg_states_iterate.lo: sh/$(am__dirstamp) \ + sh/$(DEPDIR)/$(am__dirstamp) +sh/Lresume.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) +sh/Lstep.lo: sh/$(am__dirstamp) sh/$(DEPDIR)/$(am__dirstamp) +x86_64/Los-freebsd.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Los-linux.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Los-qnx.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Los-solaris.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/getcontext.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Lapply_reg_state.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Lcreate_addr_space.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Lget_proc_info.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Lget_save_loc.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Lglobal.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Linit.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Linit_local.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Linit_remote.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Lregs.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Lreg_states_iterate.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Lresume.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Lstash_frame.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Lstep.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/Ltrace.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86_64/setcontext.lo: x86_64/$(am__dirstamp) \ + x86_64/$(DEPDIR)/$(am__dirstamp) +x86/Los-freebsd.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) +x86/getcontext-freebsd.lo: x86/$(am__dirstamp) \ + x86/$(DEPDIR)/$(am__dirstamp) +x86/Los-linux.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) +x86/getcontext-linux.lo: x86/$(am__dirstamp) \ + x86/$(DEPDIR)/$(am__dirstamp) +x86/Lapply_reg_state.lo: x86/$(am__dirstamp) \ + x86/$(DEPDIR)/$(am__dirstamp) +x86/Lcreate_addr_space.lo: x86/$(am__dirstamp) \ + x86/$(DEPDIR)/$(am__dirstamp) +x86/Lget_proc_info.lo: x86/$(am__dirstamp) \ + x86/$(DEPDIR)/$(am__dirstamp) +x86/Lget_save_loc.lo: x86/$(am__dirstamp) \ + x86/$(DEPDIR)/$(am__dirstamp) +x86/Lglobal.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) +x86/Linit.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) +x86/Linit_local.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) +x86/Linit_remote.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) +x86/Lregs.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) +x86/Lreg_states_iterate.lo: x86/$(am__dirstamp) \ + x86/$(DEPDIR)/$(am__dirstamp) +x86/Lresume.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) +x86/Lstep.lo: x86/$(am__dirstamp) x86/$(DEPDIR)/$(am__dirstamp) + +libunwind.la: $(libunwind_la_OBJECTS) $(libunwind_la_DEPENDENCIES) $(EXTRA_libunwind_la_DEPENDENCIES) + $(AM_V_CCLD)$(libunwind_la_LINK) $(am_libunwind_la_rpath) $(libunwind_la_OBJECTS) $(libunwind_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f aarch64/*.$(OBJEXT) + -rm -f aarch64/*.lo + -rm -f arm/*.$(OBJEXT) + -rm -f arm/*.lo + -rm -f coredump/*.$(OBJEXT) + -rm -f coredump/*.lo + -rm -f dwarf/*.$(OBJEXT) + -rm -f dwarf/*.lo + -rm -f hppa/*.$(OBJEXT) + -rm -f hppa/*.lo + -rm -f ia64/*.$(OBJEXT) + -rm -f ia64/*.lo + -rm -f loongarch64/*.$(OBJEXT) + -rm -f loongarch64/*.lo + -rm -f mi/*.$(OBJEXT) + -rm -f mi/*.lo + -rm -f mips/*.$(OBJEXT) + -rm -f mips/*.lo + -rm -f nto/*.$(OBJEXT) + -rm -f nto/*.lo + -rm -f ppc/*.$(OBJEXT) + -rm -f ppc/*.lo + -rm -f ppc32/*.$(OBJEXT) + -rm -f ppc32/*.lo + -rm -f ppc64/*.$(OBJEXT) + -rm -f ppc64/*.lo + -rm -f ptrace/*.$(OBJEXT) + -rm -f ptrace/*.lo + -rm -f riscv/*.$(OBJEXT) + -rm -f riscv/*.lo + -rm -f s390x/*.$(OBJEXT) + -rm -f s390x/*.lo + -rm -f setjmp/*.$(OBJEXT) + -rm -f setjmp/*.lo + -rm -f sh/*.$(OBJEXT) + -rm -f sh/*.lo + -rm -f unwind/*.$(OBJEXT) + -rm -f unwind/*.lo + -rm -f x86/*.$(OBJEXT) + -rm -f x86/*.lo + -rm -f x86_64/*.$(OBJEXT) + -rm -f x86_64/*.lo + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dl-iterate-phdr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elfxx.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os-freebsd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os-hpux.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os-linux.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os-qnx.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os-solaris.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Gapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Gcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Gget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Gget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Gglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Ginit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Ginit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Ginit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Gis_signal_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Gos-freebsd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Gos-linux.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Gos-qnx.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Greg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Gregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Gresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Gstash_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Gstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Gstrip_ptrauth_insn_mask.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Gtrace.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Lapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Lcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Lget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Lget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Lglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Linit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Linit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Linit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Lis_signal_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Los-freebsd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Los-linux.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Los-qnx.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Lreg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Lregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Lresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Lstash_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Lstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Lstrip_ptrauth_insn_mask.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/Ltrace.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/getcontext.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/is_fpreg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/longjmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/regname.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/setcontext.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@aarch64/$(DEPDIR)/siglongjmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Gapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Gcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Gex_tables.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Gget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Gget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Gglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Ginit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Ginit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Ginit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Gos-freebsd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Gos-linux.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Gos-other.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Greg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Gregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Gresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Gstash_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Gstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Gtrace.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Lapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Lcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Lex_tables.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Lget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Lget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Lglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Linit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Linit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Linit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Los-freebsd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Los-linux.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Los-other.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Lreg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Lregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Lresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Lstash_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Lstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/Ltrace.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/getcontext.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/is_fpreg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/regname.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@arm/$(DEPDIR)/siglongjmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UCD_access_mem.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UCD_access_reg_freebsd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UCD_access_reg_linux.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UCD_access_reg_qnx.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UCD_accessors.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UCD_corefile_elf.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UCD_create.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UCD_destroy.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UCD_elf_map_image.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UCD_find_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UCD_get_elf_filename.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UCD_get_mapinfo_generic.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UCD_get_mapinfo_linux.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UCD_get_mapinfo_qnx.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UCD_get_proc_name.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UCD_get_threadinfo_prstatus.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UPT_access_fpreg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UPT_elf.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UPT_get_dyn_info_list_addr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UPT_put_unwind_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/_UPT_resume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@coredump/$(DEPDIR)/ucd_file_table.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dwarf/$(DEPDIR)/Gexpr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dwarf/$(DEPDIR)/Gfde.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dwarf/$(DEPDIR)/Gfind_proc_info-lsb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dwarf/$(DEPDIR)/Gfind_unwind_table.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dwarf/$(DEPDIR)/Gget_proc_info_in_range.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dwarf/$(DEPDIR)/Gparser.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dwarf/$(DEPDIR)/Gpe.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dwarf/$(DEPDIR)/Lexpr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dwarf/$(DEPDIR)/Lfde.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dwarf/$(DEPDIR)/Lfind_proc_info-lsb.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dwarf/$(DEPDIR)/Lfind_unwind_table.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dwarf/$(DEPDIR)/Lget_proc_info_in_range.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dwarf/$(DEPDIR)/Lparser.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dwarf/$(DEPDIR)/Lpe.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@dwarf/$(DEPDIR)/global.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Gapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Gcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Gget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Gget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Gglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Ginit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Ginit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Ginit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Gis_signal_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Greg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Gregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Gresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Gstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Lapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Lcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Lget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Lget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Lglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Linit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Linit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Linit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Lis_signal_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Lreg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Lregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Lresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/Lstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/getcontext.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/regname.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/setcontext.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@hppa/$(DEPDIR)/siglongjmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Gapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Gcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Gfind_unwind_table.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Gget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Gget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Gglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Ginit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Ginit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Ginit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Ginstall_cursor.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Gis_signal_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Gparser.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Grbs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Greg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Gregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Gresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Gscript.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Gstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Gtables.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Lapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Lcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Lfind_unwind_table.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Lget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Lget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Lglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Linit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Linit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Linit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Linstall_cursor.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Lis_signal_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Lparser.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Lrbs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Lreg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Lregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Lresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Lscript.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Lstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/Ltables.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/dyn_info_list.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/getcontext.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/longjmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/regname.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/setjmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/siglongjmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ia64/$(DEPDIR)/sigsetjmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Gapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Gcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Gget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Gget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Gglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Ginit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Ginit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Ginit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Gis_signal_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Greg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Gregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Gresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Gstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Lapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Lcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Lget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Lget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Lglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Linit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Linit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Linit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Lis_signal_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Lreg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Lregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Lresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/Lstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/getcontext.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/is_fpreg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/regname.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@loongarch64/$(DEPDIR)/siglongjmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Gaddress_validator.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Gdestroy_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Gdyn-extract.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Gdyn-remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Gfind_dynamic_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Gget_accessors.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Gget_elf_filename.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Gget_fpreg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Gget_proc_info_by_ip.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Gget_proc_name.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Gget_reg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Gis_plt_entry.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Gput_dynamic_unwind_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Gset_cache_size.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Gset_caching_policy.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Gset_fpreg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Gset_iterate_phdr_function.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Gset_reg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Laddress_validator.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Ldestroy_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Ldyn-extract.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Lfind_dynamic_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Lget_accessors.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Lget_elf_filename.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Lget_fpreg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Lget_proc_info_by_ip.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Lget_proc_name.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Lget_reg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Lis_plt_entry.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Lput_dynamic_unwind_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Lset_cache_size.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Lset_caching_policy.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Lset_fpreg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Lset_iterate_phdr_function.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/Lset_reg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/_ReadSLEB.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/_ReadULEB.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/backtrace.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/dyn-cancel.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/dyn-info-list.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/dyn-register.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/flush_cache.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/init.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/mempool.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mi/$(DEPDIR)/strerror.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Gapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Gcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Gget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Gget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Gglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Ginit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Ginit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Ginit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Gis_signal_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Greg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Gregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Gresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Gstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Lapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Lcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Lget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Lget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Lglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Linit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Linit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Linit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Lis_signal_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Lreg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Lregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Lresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/Lstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/getcontext.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/is_fpreg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/regname.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@mips/$(DEPDIR)/siglongjmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@nto/$(DEPDIR)/unw_nto_access_fpreg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@nto/$(DEPDIR)/unw_nto_access_mem.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@nto/$(DEPDIR)/unw_nto_access_reg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@nto/$(DEPDIR)/unw_nto_accessors.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@nto/$(DEPDIR)/unw_nto_create.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@nto/$(DEPDIR)/unw_nto_destroy.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@nto/$(DEPDIR)/unw_nto_elf.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@nto/$(DEPDIR)/unw_nto_find_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@nto/$(DEPDIR)/unw_nto_get_dyn_info_list_addr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@nto/$(DEPDIR)/unw_nto_get_elf_filename.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@nto/$(DEPDIR)/unw_nto_get_proc_name.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@nto/$(DEPDIR)/unw_nto_put_unwind_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@nto/$(DEPDIR)/unw_nto_resume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc/$(DEPDIR)/Gget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc/$(DEPDIR)/Gget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc/$(DEPDIR)/Ginit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc/$(DEPDIR)/Ginit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc/$(DEPDIR)/Gis_signal_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc/$(DEPDIR)/Lget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc/$(DEPDIR)/Lget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc/$(DEPDIR)/Linit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc/$(DEPDIR)/Linit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc/$(DEPDIR)/Lis_signal_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc/$(DEPDIR)/longjmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc/$(DEPDIR)/siglongjmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc32/$(DEPDIR)/Gapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc32/$(DEPDIR)/Gcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc32/$(DEPDIR)/Gglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc32/$(DEPDIR)/Ginit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc32/$(DEPDIR)/Greg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc32/$(DEPDIR)/Gregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc32/$(DEPDIR)/Gresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc32/$(DEPDIR)/Gstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc32/$(DEPDIR)/Lapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc32/$(DEPDIR)/Lcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc32/$(DEPDIR)/Lglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc32/$(DEPDIR)/Linit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc32/$(DEPDIR)/Lreg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc32/$(DEPDIR)/Lregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc32/$(DEPDIR)/Lresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc32/$(DEPDIR)/Lstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc32/$(DEPDIR)/get_func_addr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc32/$(DEPDIR)/is_fpreg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc32/$(DEPDIR)/regname.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc64/$(DEPDIR)/Gapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc64/$(DEPDIR)/Gcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc64/$(DEPDIR)/Gglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc64/$(DEPDIR)/Ginit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc64/$(DEPDIR)/Greg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc64/$(DEPDIR)/Gregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc64/$(DEPDIR)/Gresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc64/$(DEPDIR)/Gstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc64/$(DEPDIR)/Lapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc64/$(DEPDIR)/Lcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc64/$(DEPDIR)/Lglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc64/$(DEPDIR)/Linit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc64/$(DEPDIR)/Lreg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc64/$(DEPDIR)/Lregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc64/$(DEPDIR)/Lresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc64/$(DEPDIR)/Lstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc64/$(DEPDIR)/get_func_addr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc64/$(DEPDIR)/is_fpreg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ppc64/$(DEPDIR)/regname.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ptrace/$(DEPDIR)/_UPT_access_fpreg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ptrace/$(DEPDIR)/_UPT_access_mem.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ptrace/$(DEPDIR)/_UPT_access_reg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ptrace/$(DEPDIR)/_UPT_accessors.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ptrace/$(DEPDIR)/_UPT_create.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ptrace/$(DEPDIR)/_UPT_destroy.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ptrace/$(DEPDIR)/_UPT_elf.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ptrace/$(DEPDIR)/_UPT_find_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ptrace/$(DEPDIR)/_UPT_get_dyn_info_list_addr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ptrace/$(DEPDIR)/_UPT_get_elf_filename.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ptrace/$(DEPDIR)/_UPT_get_proc_name.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ptrace/$(DEPDIR)/_UPT_ptrauth_insn_mask.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ptrace/$(DEPDIR)/_UPT_put_unwind_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ptrace/$(DEPDIR)/_UPT_reg_offset.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@ptrace/$(DEPDIR)/_UPT_resume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Gapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Gcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Gget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Gget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Gglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Ginit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Ginit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Ginit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Gis_signal_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Greg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Gregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Gresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Gstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Lapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Lcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Lget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Lget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Lglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Linit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Linit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Linit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Lis_signal_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Lreg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Lregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Lresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/Lstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/getcontext.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/is_fpreg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/regname.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/setcontext.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@riscv/$(DEPDIR)/siglongjmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Gapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Gcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Gget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Gget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Gglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Ginit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Ginit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Ginit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Gis_signal_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Greg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Gregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Gresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Gstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Lapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Lcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Lget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Lget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Lglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Linit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Linit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Linit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Lis_signal_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Lreg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Lregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Lresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/Lstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/getcontext.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/is_fpreg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/regname.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@s390x/$(DEPDIR)/setcontext.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@setjmp/$(DEPDIR)/longjmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@setjmp/$(DEPDIR)/siglongjmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Gapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Gcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Gget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Gget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Gglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Ginit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Ginit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Ginit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Gis_signal_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Greg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Gregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Gresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Gstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Lapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Lcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Lget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Lget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Lglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Linit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Linit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Linit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Lis_signal_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Lreg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Lregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Lresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/Lstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/is_fpreg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/regname.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sh/$(DEPDIR)/siglongjmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unwind/$(DEPDIR)/Backtrace.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unwind/$(DEPDIR)/DeleteException.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unwind/$(DEPDIR)/FindEnclosingFunction.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unwind/$(DEPDIR)/ForcedUnwind.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unwind/$(DEPDIR)/GetBSP.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unwind/$(DEPDIR)/GetCFA.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unwind/$(DEPDIR)/GetDataRelBase.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unwind/$(DEPDIR)/GetGR.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unwind/$(DEPDIR)/GetIP.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unwind/$(DEPDIR)/GetIPInfo.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unwind/$(DEPDIR)/GetLanguageSpecificData.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unwind/$(DEPDIR)/GetRegionStart.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unwind/$(DEPDIR)/GetTextRelBase.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unwind/$(DEPDIR)/RaiseException.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unwind/$(DEPDIR)/Resume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unwind/$(DEPDIR)/Resume_or_Rethrow.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unwind/$(DEPDIR)/SetGR.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@unwind/$(DEPDIR)/SetIP.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Gapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Gcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Gget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Gget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Gglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Ginit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Ginit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Ginit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Gos-freebsd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Gos-linux.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Greg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Gregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Gresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Gstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Lapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Lcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Lget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Lget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Lglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Linit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Linit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Linit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Los-freebsd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Los-linux.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Lreg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Lregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Lresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/Lstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/getcontext-freebsd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/getcontext-linux.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/is_fpreg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/longjmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/regname.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86/$(DEPDIR)/siglongjmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Gapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Gcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Gget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Gget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Gglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Ginit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Ginit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Ginit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Gos-freebsd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Gos-linux.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Gos-qnx.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Gos-solaris.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Greg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Gregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Gresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Gstash_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Gstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Gtrace.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Lapply_reg_state.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Lcreate_addr_space.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Lget_proc_info.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Lget_save_loc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Lglobal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Linit.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Linit_local.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Linit_remote.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Los-freebsd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Los-linux.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Los-qnx.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Los-solaris.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Lreg_states_iterate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Lregs.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Lresume.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Lstash_frame.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Lstep.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/Ltrace.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/getcontext.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/is_fpreg.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/longjmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/regname.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/setcontext.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@x86_64/$(DEPDIR)/siglongjmp.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.S.o: +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ $< + +.S.obj: +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.S.lo: +@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCCAS_TRUE@ $(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LTCPPASCOMPILE) -c -o $@ $< + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + -rm -rf aarch64/.libs aarch64/_libs + -rm -rf arm/.libs arm/_libs + -rm -rf coredump/.libs coredump/_libs + -rm -rf dwarf/.libs dwarf/_libs + -rm -rf hppa/.libs hppa/_libs + -rm -rf ia64/.libs ia64/_libs + -rm -rf loongarch64/.libs loongarch64/_libs + -rm -rf mi/.libs mi/_libs + -rm -rf mips/.libs mips/_libs + -rm -rf nto/.libs nto/_libs + -rm -rf ppc/.libs ppc/_libs + -rm -rf ppc32/.libs ppc32/_libs + -rm -rf ppc64/.libs ppc64/_libs + -rm -rf ptrace/.libs ptrace/_libs + -rm -rf riscv/.libs riscv/_libs + -rm -rf s390x/.libs s390x/_libs + -rm -rf setjmp/.libs setjmp/_libs + -rm -rf sh/.libs sh/_libs + -rm -rf unwind/.libs unwind/_libs + -rm -rf x86/.libs x86/_libs + -rm -rf x86_64/.libs x86_64/_libs +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f aarch64/$(DEPDIR)/$(am__dirstamp) + -rm -f aarch64/$(am__dirstamp) + -rm -f arm/$(DEPDIR)/$(am__dirstamp) + -rm -f arm/$(am__dirstamp) + -rm -f coredump/$(DEPDIR)/$(am__dirstamp) + -rm -f coredump/$(am__dirstamp) + -rm -f dwarf/$(DEPDIR)/$(am__dirstamp) + -rm -f dwarf/$(am__dirstamp) + -rm -f hppa/$(DEPDIR)/$(am__dirstamp) + -rm -f hppa/$(am__dirstamp) + -rm -f ia64/$(DEPDIR)/$(am__dirstamp) + -rm -f ia64/$(am__dirstamp) + -rm -f loongarch64/$(DEPDIR)/$(am__dirstamp) + -rm -f loongarch64/$(am__dirstamp) + -rm -f mi/$(DEPDIR)/$(am__dirstamp) + -rm -f mi/$(am__dirstamp) + -rm -f mips/$(DEPDIR)/$(am__dirstamp) + -rm -f mips/$(am__dirstamp) + -rm -f nto/$(DEPDIR)/$(am__dirstamp) + -rm -f nto/$(am__dirstamp) + -rm -f ppc/$(DEPDIR)/$(am__dirstamp) + -rm -f ppc/$(am__dirstamp) + -rm -f ppc32/$(DEPDIR)/$(am__dirstamp) + -rm -f ppc32/$(am__dirstamp) + -rm -f ppc64/$(DEPDIR)/$(am__dirstamp) + -rm -f ppc64/$(am__dirstamp) + -rm -f ptrace/$(DEPDIR)/$(am__dirstamp) + -rm -f ptrace/$(am__dirstamp) + -rm -f riscv/$(DEPDIR)/$(am__dirstamp) + -rm -f riscv/$(am__dirstamp) + -rm -f s390x/$(DEPDIR)/$(am__dirstamp) + -rm -f s390x/$(am__dirstamp) + -rm -f setjmp/$(DEPDIR)/$(am__dirstamp) + -rm -f setjmp/$(am__dirstamp) + -rm -f sh/$(DEPDIR)/$(am__dirstamp) + -rm -f sh/$(am__dirstamp) + -rm -f unwind/$(DEPDIR)/$(am__dirstamp) + -rm -f unwind/$(am__dirstamp) + -rm -f x86/$(DEPDIR)/$(am__dirstamp) + -rm -f x86/$(am__dirstamp) + -rm -f x86_64/$(DEPDIR)/$(am__dirstamp) + -rm -f x86_64/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-noinstLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/dl-iterate-phdr.Plo + -rm -f ./$(DEPDIR)/elf32.Plo + -rm -f ./$(DEPDIR)/elf64.Plo + -rm -f ./$(DEPDIR)/elfxx.Plo + -rm -f ./$(DEPDIR)/os-freebsd.Plo + -rm -f ./$(DEPDIR)/os-hpux.Plo + -rm -f ./$(DEPDIR)/os-linux.Plo + -rm -f ./$(DEPDIR)/os-qnx.Plo + -rm -f ./$(DEPDIR)/os-solaris.Plo + -rm -f aarch64/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f aarch64/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f aarch64/$(DEPDIR)/Gget_proc_info.Plo + -rm -f aarch64/$(DEPDIR)/Gget_save_loc.Plo + -rm -f aarch64/$(DEPDIR)/Gglobal.Plo + -rm -f aarch64/$(DEPDIR)/Ginit.Plo + -rm -f aarch64/$(DEPDIR)/Ginit_local.Plo + -rm -f aarch64/$(DEPDIR)/Ginit_remote.Plo + -rm -f aarch64/$(DEPDIR)/Gis_signal_frame.Plo + -rm -f aarch64/$(DEPDIR)/Gos-freebsd.Plo + -rm -f aarch64/$(DEPDIR)/Gos-linux.Plo + -rm -f aarch64/$(DEPDIR)/Gos-qnx.Plo + -rm -f aarch64/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f aarch64/$(DEPDIR)/Gregs.Plo + -rm -f aarch64/$(DEPDIR)/Gresume.Plo + -rm -f aarch64/$(DEPDIR)/Gstash_frame.Plo + -rm -f aarch64/$(DEPDIR)/Gstep.Plo + -rm -f aarch64/$(DEPDIR)/Gstrip_ptrauth_insn_mask.Plo + -rm -f aarch64/$(DEPDIR)/Gtrace.Plo + -rm -f aarch64/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f aarch64/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f aarch64/$(DEPDIR)/Lget_proc_info.Plo + -rm -f aarch64/$(DEPDIR)/Lget_save_loc.Plo + -rm -f aarch64/$(DEPDIR)/Lglobal.Plo + -rm -f aarch64/$(DEPDIR)/Linit.Plo + -rm -f aarch64/$(DEPDIR)/Linit_local.Plo + -rm -f aarch64/$(DEPDIR)/Linit_remote.Plo + -rm -f aarch64/$(DEPDIR)/Lis_signal_frame.Plo + -rm -f aarch64/$(DEPDIR)/Los-freebsd.Plo + -rm -f aarch64/$(DEPDIR)/Los-linux.Plo + -rm -f aarch64/$(DEPDIR)/Los-qnx.Plo + -rm -f aarch64/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f aarch64/$(DEPDIR)/Lregs.Plo + -rm -f aarch64/$(DEPDIR)/Lresume.Plo + -rm -f aarch64/$(DEPDIR)/Lstash_frame.Plo + -rm -f aarch64/$(DEPDIR)/Lstep.Plo + -rm -f aarch64/$(DEPDIR)/Lstrip_ptrauth_insn_mask.Plo + -rm -f aarch64/$(DEPDIR)/Ltrace.Plo + -rm -f aarch64/$(DEPDIR)/getcontext.Plo + -rm -f aarch64/$(DEPDIR)/is_fpreg.Plo + -rm -f aarch64/$(DEPDIR)/longjmp.Plo + -rm -f aarch64/$(DEPDIR)/regname.Plo + -rm -f aarch64/$(DEPDIR)/setcontext.Plo + -rm -f aarch64/$(DEPDIR)/siglongjmp.Plo + -rm -f arm/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f arm/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f arm/$(DEPDIR)/Gex_tables.Plo + -rm -f arm/$(DEPDIR)/Gget_proc_info.Plo + -rm -f arm/$(DEPDIR)/Gget_save_loc.Plo + -rm -f arm/$(DEPDIR)/Gglobal.Plo + -rm -f arm/$(DEPDIR)/Ginit.Plo + -rm -f arm/$(DEPDIR)/Ginit_local.Plo + -rm -f arm/$(DEPDIR)/Ginit_remote.Plo + -rm -f arm/$(DEPDIR)/Gos-freebsd.Plo + -rm -f arm/$(DEPDIR)/Gos-linux.Plo + -rm -f arm/$(DEPDIR)/Gos-other.Plo + -rm -f arm/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f arm/$(DEPDIR)/Gregs.Plo + -rm -f arm/$(DEPDIR)/Gresume.Plo + -rm -f arm/$(DEPDIR)/Gstash_frame.Plo + -rm -f arm/$(DEPDIR)/Gstep.Plo + -rm -f arm/$(DEPDIR)/Gtrace.Plo + -rm -f arm/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f arm/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f arm/$(DEPDIR)/Lex_tables.Plo + -rm -f arm/$(DEPDIR)/Lget_proc_info.Plo + -rm -f arm/$(DEPDIR)/Lget_save_loc.Plo + -rm -f arm/$(DEPDIR)/Lglobal.Plo + -rm -f arm/$(DEPDIR)/Linit.Plo + -rm -f arm/$(DEPDIR)/Linit_local.Plo + -rm -f arm/$(DEPDIR)/Linit_remote.Plo + -rm -f arm/$(DEPDIR)/Los-freebsd.Plo + -rm -f arm/$(DEPDIR)/Los-linux.Plo + -rm -f arm/$(DEPDIR)/Los-other.Plo + -rm -f arm/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f arm/$(DEPDIR)/Lregs.Plo + -rm -f arm/$(DEPDIR)/Lresume.Plo + -rm -f arm/$(DEPDIR)/Lstash_frame.Plo + -rm -f arm/$(DEPDIR)/Lstep.Plo + -rm -f arm/$(DEPDIR)/Ltrace.Plo + -rm -f arm/$(DEPDIR)/getcontext.Plo + -rm -f arm/$(DEPDIR)/is_fpreg.Plo + -rm -f arm/$(DEPDIR)/regname.Plo + -rm -f arm/$(DEPDIR)/siglongjmp.Plo + -rm -f coredump/$(DEPDIR)/_UCD_access_mem.Plo + -rm -f coredump/$(DEPDIR)/_UCD_access_reg_freebsd.Plo + -rm -f coredump/$(DEPDIR)/_UCD_access_reg_linux.Plo + -rm -f coredump/$(DEPDIR)/_UCD_access_reg_qnx.Plo + -rm -f coredump/$(DEPDIR)/_UCD_accessors.Plo + -rm -f coredump/$(DEPDIR)/_UCD_corefile_elf.Plo + -rm -f coredump/$(DEPDIR)/_UCD_create.Plo + -rm -f coredump/$(DEPDIR)/_UCD_destroy.Plo + -rm -f coredump/$(DEPDIR)/_UCD_elf_map_image.Plo + -rm -f coredump/$(DEPDIR)/_UCD_find_proc_info.Plo + -rm -f coredump/$(DEPDIR)/_UCD_get_elf_filename.Plo + -rm -f coredump/$(DEPDIR)/_UCD_get_mapinfo_generic.Plo + -rm -f coredump/$(DEPDIR)/_UCD_get_mapinfo_linux.Plo + -rm -f coredump/$(DEPDIR)/_UCD_get_mapinfo_qnx.Plo + -rm -f coredump/$(DEPDIR)/_UCD_get_proc_name.Plo + -rm -f coredump/$(DEPDIR)/_UCD_get_threadinfo_prstatus.Plo + -rm -f coredump/$(DEPDIR)/_UPT_access_fpreg.Plo + -rm -f coredump/$(DEPDIR)/_UPT_elf.Plo + -rm -f coredump/$(DEPDIR)/_UPT_get_dyn_info_list_addr.Plo + -rm -f coredump/$(DEPDIR)/_UPT_put_unwind_info.Plo + -rm -f coredump/$(DEPDIR)/_UPT_resume.Plo + -rm -f coredump/$(DEPDIR)/ucd_file_table.Plo + -rm -f dwarf/$(DEPDIR)/Gexpr.Plo + -rm -f dwarf/$(DEPDIR)/Gfde.Plo + -rm -f dwarf/$(DEPDIR)/Gfind_proc_info-lsb.Plo + -rm -f dwarf/$(DEPDIR)/Gfind_unwind_table.Plo + -rm -f dwarf/$(DEPDIR)/Gget_proc_info_in_range.Plo + -rm -f dwarf/$(DEPDIR)/Gparser.Plo + -rm -f dwarf/$(DEPDIR)/Gpe.Plo + -rm -f dwarf/$(DEPDIR)/Lexpr.Plo + -rm -f dwarf/$(DEPDIR)/Lfde.Plo + -rm -f dwarf/$(DEPDIR)/Lfind_proc_info-lsb.Plo + -rm -f dwarf/$(DEPDIR)/Lfind_unwind_table.Plo + -rm -f dwarf/$(DEPDIR)/Lget_proc_info_in_range.Plo + -rm -f dwarf/$(DEPDIR)/Lparser.Plo + -rm -f dwarf/$(DEPDIR)/Lpe.Plo + -rm -f dwarf/$(DEPDIR)/global.Plo + -rm -f hppa/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f hppa/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f hppa/$(DEPDIR)/Gget_proc_info.Plo + -rm -f hppa/$(DEPDIR)/Gget_save_loc.Plo + -rm -f hppa/$(DEPDIR)/Gglobal.Plo + -rm -f hppa/$(DEPDIR)/Ginit.Plo + -rm -f hppa/$(DEPDIR)/Ginit_local.Plo + -rm -f hppa/$(DEPDIR)/Ginit_remote.Plo + -rm -f hppa/$(DEPDIR)/Gis_signal_frame.Plo + -rm -f hppa/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f hppa/$(DEPDIR)/Gregs.Plo + -rm -f hppa/$(DEPDIR)/Gresume.Plo + -rm -f hppa/$(DEPDIR)/Gstep.Plo + -rm -f hppa/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f hppa/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f hppa/$(DEPDIR)/Lget_proc_info.Plo + -rm -f hppa/$(DEPDIR)/Lget_save_loc.Plo + -rm -f hppa/$(DEPDIR)/Lglobal.Plo + -rm -f hppa/$(DEPDIR)/Linit.Plo + -rm -f hppa/$(DEPDIR)/Linit_local.Plo + -rm -f hppa/$(DEPDIR)/Linit_remote.Plo + -rm -f hppa/$(DEPDIR)/Lis_signal_frame.Plo + -rm -f hppa/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f hppa/$(DEPDIR)/Lregs.Plo + -rm -f hppa/$(DEPDIR)/Lresume.Plo + -rm -f hppa/$(DEPDIR)/Lstep.Plo + -rm -f hppa/$(DEPDIR)/getcontext.Plo + -rm -f hppa/$(DEPDIR)/regname.Plo + -rm -f hppa/$(DEPDIR)/setcontext.Plo + -rm -f hppa/$(DEPDIR)/siglongjmp.Plo + -rm -f ia64/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f ia64/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f ia64/$(DEPDIR)/Gfind_unwind_table.Plo + -rm -f ia64/$(DEPDIR)/Gget_proc_info.Plo + -rm -f ia64/$(DEPDIR)/Gget_save_loc.Plo + -rm -f ia64/$(DEPDIR)/Gglobal.Plo + -rm -f ia64/$(DEPDIR)/Ginit.Plo + -rm -f ia64/$(DEPDIR)/Ginit_local.Plo + -rm -f ia64/$(DEPDIR)/Ginit_remote.Plo + -rm -f ia64/$(DEPDIR)/Ginstall_cursor.Plo + -rm -f ia64/$(DEPDIR)/Gis_signal_frame.Plo + -rm -f ia64/$(DEPDIR)/Gparser.Plo + -rm -f ia64/$(DEPDIR)/Grbs.Plo + -rm -f ia64/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f ia64/$(DEPDIR)/Gregs.Plo + -rm -f ia64/$(DEPDIR)/Gresume.Plo + -rm -f ia64/$(DEPDIR)/Gscript.Plo + -rm -f ia64/$(DEPDIR)/Gstep.Plo + -rm -f ia64/$(DEPDIR)/Gtables.Plo + -rm -f ia64/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f ia64/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f ia64/$(DEPDIR)/Lfind_unwind_table.Plo + -rm -f ia64/$(DEPDIR)/Lget_proc_info.Plo + -rm -f ia64/$(DEPDIR)/Lget_save_loc.Plo + -rm -f ia64/$(DEPDIR)/Lglobal.Plo + -rm -f ia64/$(DEPDIR)/Linit.Plo + -rm -f ia64/$(DEPDIR)/Linit_local.Plo + -rm -f ia64/$(DEPDIR)/Linit_remote.Plo + -rm -f ia64/$(DEPDIR)/Linstall_cursor.Plo + -rm -f ia64/$(DEPDIR)/Lis_signal_frame.Plo + -rm -f ia64/$(DEPDIR)/Lparser.Plo + -rm -f ia64/$(DEPDIR)/Lrbs.Plo + -rm -f ia64/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f ia64/$(DEPDIR)/Lregs.Plo + -rm -f ia64/$(DEPDIR)/Lresume.Plo + -rm -f ia64/$(DEPDIR)/Lscript.Plo + -rm -f ia64/$(DEPDIR)/Lstep.Plo + -rm -f ia64/$(DEPDIR)/Ltables.Plo + -rm -f ia64/$(DEPDIR)/dyn_info_list.Plo + -rm -f ia64/$(DEPDIR)/getcontext.Plo + -rm -f ia64/$(DEPDIR)/longjmp.Plo + -rm -f ia64/$(DEPDIR)/regname.Plo + -rm -f ia64/$(DEPDIR)/setjmp.Plo + -rm -f ia64/$(DEPDIR)/siglongjmp.Plo + -rm -f ia64/$(DEPDIR)/sigsetjmp.Plo + -rm -f loongarch64/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f loongarch64/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f loongarch64/$(DEPDIR)/Gget_proc_info.Plo + -rm -f loongarch64/$(DEPDIR)/Gget_save_loc.Plo + -rm -f loongarch64/$(DEPDIR)/Gglobal.Plo + -rm -f loongarch64/$(DEPDIR)/Ginit.Plo + -rm -f loongarch64/$(DEPDIR)/Ginit_local.Plo + -rm -f loongarch64/$(DEPDIR)/Ginit_remote.Plo + -rm -f loongarch64/$(DEPDIR)/Gis_signal_frame.Plo + -rm -f loongarch64/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f loongarch64/$(DEPDIR)/Gregs.Plo + -rm -f loongarch64/$(DEPDIR)/Gresume.Plo + -rm -f loongarch64/$(DEPDIR)/Gstep.Plo + -rm -f loongarch64/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f loongarch64/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f loongarch64/$(DEPDIR)/Lget_proc_info.Plo + -rm -f loongarch64/$(DEPDIR)/Lget_save_loc.Plo + -rm -f loongarch64/$(DEPDIR)/Lglobal.Plo + -rm -f loongarch64/$(DEPDIR)/Linit.Plo + -rm -f loongarch64/$(DEPDIR)/Linit_local.Plo + -rm -f loongarch64/$(DEPDIR)/Linit_remote.Plo + -rm -f loongarch64/$(DEPDIR)/Lis_signal_frame.Plo + -rm -f loongarch64/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f loongarch64/$(DEPDIR)/Lregs.Plo + -rm -f loongarch64/$(DEPDIR)/Lresume.Plo + -rm -f loongarch64/$(DEPDIR)/Lstep.Plo + -rm -f loongarch64/$(DEPDIR)/getcontext.Plo + -rm -f loongarch64/$(DEPDIR)/is_fpreg.Plo + -rm -f loongarch64/$(DEPDIR)/regname.Plo + -rm -f loongarch64/$(DEPDIR)/siglongjmp.Plo + -rm -f mi/$(DEPDIR)/Gaddress_validator.Plo + -rm -f mi/$(DEPDIR)/Gdestroy_addr_space.Plo + -rm -f mi/$(DEPDIR)/Gdyn-extract.Plo + -rm -f mi/$(DEPDIR)/Gdyn-remote.Plo + -rm -f mi/$(DEPDIR)/Gfind_dynamic_proc_info.Plo + -rm -f mi/$(DEPDIR)/Gget_accessors.Plo + -rm -f mi/$(DEPDIR)/Gget_elf_filename.Plo + -rm -f mi/$(DEPDIR)/Gget_fpreg.Plo + -rm -f mi/$(DEPDIR)/Gget_proc_info_by_ip.Plo + -rm -f mi/$(DEPDIR)/Gget_proc_name.Plo + -rm -f mi/$(DEPDIR)/Gget_reg.Plo + -rm -f mi/$(DEPDIR)/Gis_plt_entry.Plo + -rm -f mi/$(DEPDIR)/Gput_dynamic_unwind_info.Plo + -rm -f mi/$(DEPDIR)/Gset_cache_size.Plo + -rm -f mi/$(DEPDIR)/Gset_caching_policy.Plo + -rm -f mi/$(DEPDIR)/Gset_fpreg.Plo + -rm -f mi/$(DEPDIR)/Gset_iterate_phdr_function.Plo + -rm -f mi/$(DEPDIR)/Gset_reg.Plo + -rm -f mi/$(DEPDIR)/Laddress_validator.Plo + -rm -f mi/$(DEPDIR)/Ldestroy_addr_space.Plo + -rm -f mi/$(DEPDIR)/Ldyn-extract.Plo + -rm -f mi/$(DEPDIR)/Lfind_dynamic_proc_info.Plo + -rm -f mi/$(DEPDIR)/Lget_accessors.Plo + -rm -f mi/$(DEPDIR)/Lget_elf_filename.Plo + -rm -f mi/$(DEPDIR)/Lget_fpreg.Plo + -rm -f mi/$(DEPDIR)/Lget_proc_info_by_ip.Plo + -rm -f mi/$(DEPDIR)/Lget_proc_name.Plo + -rm -f mi/$(DEPDIR)/Lget_reg.Plo + -rm -f mi/$(DEPDIR)/Lis_plt_entry.Plo + -rm -f mi/$(DEPDIR)/Lput_dynamic_unwind_info.Plo + -rm -f mi/$(DEPDIR)/Lset_cache_size.Plo + -rm -f mi/$(DEPDIR)/Lset_caching_policy.Plo + -rm -f mi/$(DEPDIR)/Lset_fpreg.Plo + -rm -f mi/$(DEPDIR)/Lset_iterate_phdr_function.Plo + -rm -f mi/$(DEPDIR)/Lset_reg.Plo + -rm -f mi/$(DEPDIR)/_ReadSLEB.Plo + -rm -f mi/$(DEPDIR)/_ReadULEB.Plo + -rm -f mi/$(DEPDIR)/backtrace.Plo + -rm -f mi/$(DEPDIR)/dyn-cancel.Plo + -rm -f mi/$(DEPDIR)/dyn-info-list.Plo + -rm -f mi/$(DEPDIR)/dyn-register.Plo + -rm -f mi/$(DEPDIR)/flush_cache.Plo + -rm -f mi/$(DEPDIR)/init.Plo + -rm -f mi/$(DEPDIR)/mempool.Plo + -rm -f mi/$(DEPDIR)/strerror.Plo + -rm -f mips/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f mips/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f mips/$(DEPDIR)/Gget_proc_info.Plo + -rm -f mips/$(DEPDIR)/Gget_save_loc.Plo + -rm -f mips/$(DEPDIR)/Gglobal.Plo + -rm -f mips/$(DEPDIR)/Ginit.Plo + -rm -f mips/$(DEPDIR)/Ginit_local.Plo + -rm -f mips/$(DEPDIR)/Ginit_remote.Plo + -rm -f mips/$(DEPDIR)/Gis_signal_frame.Plo + -rm -f mips/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f mips/$(DEPDIR)/Gregs.Plo + -rm -f mips/$(DEPDIR)/Gresume.Plo + -rm -f mips/$(DEPDIR)/Gstep.Plo + -rm -f mips/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f mips/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f mips/$(DEPDIR)/Lget_proc_info.Plo + -rm -f mips/$(DEPDIR)/Lget_save_loc.Plo + -rm -f mips/$(DEPDIR)/Lglobal.Plo + -rm -f mips/$(DEPDIR)/Linit.Plo + -rm -f mips/$(DEPDIR)/Linit_local.Plo + -rm -f mips/$(DEPDIR)/Linit_remote.Plo + -rm -f mips/$(DEPDIR)/Lis_signal_frame.Plo + -rm -f mips/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f mips/$(DEPDIR)/Lregs.Plo + -rm -f mips/$(DEPDIR)/Lresume.Plo + -rm -f mips/$(DEPDIR)/Lstep.Plo + -rm -f mips/$(DEPDIR)/getcontext.Plo + -rm -f mips/$(DEPDIR)/is_fpreg.Plo + -rm -f mips/$(DEPDIR)/regname.Plo + -rm -f mips/$(DEPDIR)/siglongjmp.Plo + -rm -f nto/$(DEPDIR)/unw_nto_access_fpreg.Plo + -rm -f nto/$(DEPDIR)/unw_nto_access_mem.Plo + -rm -f nto/$(DEPDIR)/unw_nto_access_reg.Plo + -rm -f nto/$(DEPDIR)/unw_nto_accessors.Plo + -rm -f nto/$(DEPDIR)/unw_nto_create.Plo + -rm -f nto/$(DEPDIR)/unw_nto_destroy.Plo + -rm -f nto/$(DEPDIR)/unw_nto_elf.Plo + -rm -f nto/$(DEPDIR)/unw_nto_find_proc_info.Plo + -rm -f nto/$(DEPDIR)/unw_nto_get_dyn_info_list_addr.Plo + -rm -f nto/$(DEPDIR)/unw_nto_get_elf_filename.Plo + -rm -f nto/$(DEPDIR)/unw_nto_get_proc_name.Plo + -rm -f nto/$(DEPDIR)/unw_nto_put_unwind_info.Plo + -rm -f nto/$(DEPDIR)/unw_nto_resume.Plo + -rm -f ppc/$(DEPDIR)/Gget_proc_info.Plo + -rm -f ppc/$(DEPDIR)/Gget_save_loc.Plo + -rm -f ppc/$(DEPDIR)/Ginit_local.Plo + -rm -f ppc/$(DEPDIR)/Ginit_remote.Plo + -rm -f ppc/$(DEPDIR)/Gis_signal_frame.Plo + -rm -f ppc/$(DEPDIR)/Lget_proc_info.Plo + -rm -f ppc/$(DEPDIR)/Lget_save_loc.Plo + -rm -f ppc/$(DEPDIR)/Linit_local.Plo + -rm -f ppc/$(DEPDIR)/Linit_remote.Plo + -rm -f ppc/$(DEPDIR)/Lis_signal_frame.Plo + -rm -f ppc/$(DEPDIR)/longjmp.Plo + -rm -f ppc/$(DEPDIR)/siglongjmp.Plo + -rm -f ppc32/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f ppc32/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f ppc32/$(DEPDIR)/Gglobal.Plo + -rm -f ppc32/$(DEPDIR)/Ginit.Plo + -rm -f ppc32/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f ppc32/$(DEPDIR)/Gregs.Plo + -rm -f ppc32/$(DEPDIR)/Gresume.Plo + -rm -f ppc32/$(DEPDIR)/Gstep.Plo + -rm -f ppc32/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f ppc32/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f ppc32/$(DEPDIR)/Lglobal.Plo + -rm -f ppc32/$(DEPDIR)/Linit.Plo + -rm -f ppc32/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f ppc32/$(DEPDIR)/Lregs.Plo + -rm -f ppc32/$(DEPDIR)/Lresume.Plo + -rm -f ppc32/$(DEPDIR)/Lstep.Plo + -rm -f ppc32/$(DEPDIR)/get_func_addr.Plo + -rm -f ppc32/$(DEPDIR)/is_fpreg.Plo + -rm -f ppc32/$(DEPDIR)/regname.Plo + -rm -f ppc64/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f ppc64/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f ppc64/$(DEPDIR)/Gglobal.Plo + -rm -f ppc64/$(DEPDIR)/Ginit.Plo + -rm -f ppc64/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f ppc64/$(DEPDIR)/Gregs.Plo + -rm -f ppc64/$(DEPDIR)/Gresume.Plo + -rm -f ppc64/$(DEPDIR)/Gstep.Plo + -rm -f ppc64/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f ppc64/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f ppc64/$(DEPDIR)/Lglobal.Plo + -rm -f ppc64/$(DEPDIR)/Linit.Plo + -rm -f ppc64/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f ppc64/$(DEPDIR)/Lregs.Plo + -rm -f ppc64/$(DEPDIR)/Lresume.Plo + -rm -f ppc64/$(DEPDIR)/Lstep.Plo + -rm -f ppc64/$(DEPDIR)/get_func_addr.Plo + -rm -f ppc64/$(DEPDIR)/is_fpreg.Plo + -rm -f ppc64/$(DEPDIR)/regname.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_access_fpreg.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_access_mem.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_access_reg.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_accessors.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_create.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_destroy.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_elf.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_find_proc_info.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_get_dyn_info_list_addr.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_get_elf_filename.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_get_proc_name.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_ptrauth_insn_mask.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_put_unwind_info.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_reg_offset.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_resume.Plo + -rm -f riscv/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f riscv/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f riscv/$(DEPDIR)/Gget_proc_info.Plo + -rm -f riscv/$(DEPDIR)/Gget_save_loc.Plo + -rm -f riscv/$(DEPDIR)/Gglobal.Plo + -rm -f riscv/$(DEPDIR)/Ginit.Plo + -rm -f riscv/$(DEPDIR)/Ginit_local.Plo + -rm -f riscv/$(DEPDIR)/Ginit_remote.Plo + -rm -f riscv/$(DEPDIR)/Gis_signal_frame.Plo + -rm -f riscv/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f riscv/$(DEPDIR)/Gregs.Plo + -rm -f riscv/$(DEPDIR)/Gresume.Plo + -rm -f riscv/$(DEPDIR)/Gstep.Plo + -rm -f riscv/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f riscv/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f riscv/$(DEPDIR)/Lget_proc_info.Plo + -rm -f riscv/$(DEPDIR)/Lget_save_loc.Plo + -rm -f riscv/$(DEPDIR)/Lglobal.Plo + -rm -f riscv/$(DEPDIR)/Linit.Plo + -rm -f riscv/$(DEPDIR)/Linit_local.Plo + -rm -f riscv/$(DEPDIR)/Linit_remote.Plo + -rm -f riscv/$(DEPDIR)/Lis_signal_frame.Plo + -rm -f riscv/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f riscv/$(DEPDIR)/Lregs.Plo + -rm -f riscv/$(DEPDIR)/Lresume.Plo + -rm -f riscv/$(DEPDIR)/Lstep.Plo + -rm -f riscv/$(DEPDIR)/getcontext.Plo + -rm -f riscv/$(DEPDIR)/is_fpreg.Plo + -rm -f riscv/$(DEPDIR)/regname.Plo + -rm -f riscv/$(DEPDIR)/setcontext.Plo + -rm -f riscv/$(DEPDIR)/siglongjmp.Plo + -rm -f s390x/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f s390x/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f s390x/$(DEPDIR)/Gget_proc_info.Plo + -rm -f s390x/$(DEPDIR)/Gget_save_loc.Plo + -rm -f s390x/$(DEPDIR)/Gglobal.Plo + -rm -f s390x/$(DEPDIR)/Ginit.Plo + -rm -f s390x/$(DEPDIR)/Ginit_local.Plo + -rm -f s390x/$(DEPDIR)/Ginit_remote.Plo + -rm -f s390x/$(DEPDIR)/Gis_signal_frame.Plo + -rm -f s390x/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f s390x/$(DEPDIR)/Gregs.Plo + -rm -f s390x/$(DEPDIR)/Gresume.Plo + -rm -f s390x/$(DEPDIR)/Gstep.Plo + -rm -f s390x/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f s390x/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f s390x/$(DEPDIR)/Lget_proc_info.Plo + -rm -f s390x/$(DEPDIR)/Lget_save_loc.Plo + -rm -f s390x/$(DEPDIR)/Lglobal.Plo + -rm -f s390x/$(DEPDIR)/Linit.Plo + -rm -f s390x/$(DEPDIR)/Linit_local.Plo + -rm -f s390x/$(DEPDIR)/Linit_remote.Plo + -rm -f s390x/$(DEPDIR)/Lis_signal_frame.Plo + -rm -f s390x/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f s390x/$(DEPDIR)/Lregs.Plo + -rm -f s390x/$(DEPDIR)/Lresume.Plo + -rm -f s390x/$(DEPDIR)/Lstep.Plo + -rm -f s390x/$(DEPDIR)/getcontext.Plo + -rm -f s390x/$(DEPDIR)/is_fpreg.Plo + -rm -f s390x/$(DEPDIR)/regname.Plo + -rm -f s390x/$(DEPDIR)/setcontext.Plo + -rm -f setjmp/$(DEPDIR)/longjmp.Plo + -rm -f setjmp/$(DEPDIR)/siglongjmp.Plo + -rm -f sh/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f sh/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f sh/$(DEPDIR)/Gget_proc_info.Plo + -rm -f sh/$(DEPDIR)/Gget_save_loc.Plo + -rm -f sh/$(DEPDIR)/Gglobal.Plo + -rm -f sh/$(DEPDIR)/Ginit.Plo + -rm -f sh/$(DEPDIR)/Ginit_local.Plo + -rm -f sh/$(DEPDIR)/Ginit_remote.Plo + -rm -f sh/$(DEPDIR)/Gis_signal_frame.Plo + -rm -f sh/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f sh/$(DEPDIR)/Gregs.Plo + -rm -f sh/$(DEPDIR)/Gresume.Plo + -rm -f sh/$(DEPDIR)/Gstep.Plo + -rm -f sh/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f sh/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f sh/$(DEPDIR)/Lget_proc_info.Plo + -rm -f sh/$(DEPDIR)/Lget_save_loc.Plo + -rm -f sh/$(DEPDIR)/Lglobal.Plo + -rm -f sh/$(DEPDIR)/Linit.Plo + -rm -f sh/$(DEPDIR)/Linit_local.Plo + -rm -f sh/$(DEPDIR)/Linit_remote.Plo + -rm -f sh/$(DEPDIR)/Lis_signal_frame.Plo + -rm -f sh/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f sh/$(DEPDIR)/Lregs.Plo + -rm -f sh/$(DEPDIR)/Lresume.Plo + -rm -f sh/$(DEPDIR)/Lstep.Plo + -rm -f sh/$(DEPDIR)/is_fpreg.Plo + -rm -f sh/$(DEPDIR)/regname.Plo + -rm -f sh/$(DEPDIR)/siglongjmp.Plo + -rm -f unwind/$(DEPDIR)/Backtrace.Plo + -rm -f unwind/$(DEPDIR)/DeleteException.Plo + -rm -f unwind/$(DEPDIR)/FindEnclosingFunction.Plo + -rm -f unwind/$(DEPDIR)/ForcedUnwind.Plo + -rm -f unwind/$(DEPDIR)/GetBSP.Plo + -rm -f unwind/$(DEPDIR)/GetCFA.Plo + -rm -f unwind/$(DEPDIR)/GetDataRelBase.Plo + -rm -f unwind/$(DEPDIR)/GetGR.Plo + -rm -f unwind/$(DEPDIR)/GetIP.Plo + -rm -f unwind/$(DEPDIR)/GetIPInfo.Plo + -rm -f unwind/$(DEPDIR)/GetLanguageSpecificData.Plo + -rm -f unwind/$(DEPDIR)/GetRegionStart.Plo + -rm -f unwind/$(DEPDIR)/GetTextRelBase.Plo + -rm -f unwind/$(DEPDIR)/RaiseException.Plo + -rm -f unwind/$(DEPDIR)/Resume.Plo + -rm -f unwind/$(DEPDIR)/Resume_or_Rethrow.Plo + -rm -f unwind/$(DEPDIR)/SetGR.Plo + -rm -f unwind/$(DEPDIR)/SetIP.Plo + -rm -f x86/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f x86/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f x86/$(DEPDIR)/Gget_proc_info.Plo + -rm -f x86/$(DEPDIR)/Gget_save_loc.Plo + -rm -f x86/$(DEPDIR)/Gglobal.Plo + -rm -f x86/$(DEPDIR)/Ginit.Plo + -rm -f x86/$(DEPDIR)/Ginit_local.Plo + -rm -f x86/$(DEPDIR)/Ginit_remote.Plo + -rm -f x86/$(DEPDIR)/Gos-freebsd.Plo + -rm -f x86/$(DEPDIR)/Gos-linux.Plo + -rm -f x86/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f x86/$(DEPDIR)/Gregs.Plo + -rm -f x86/$(DEPDIR)/Gresume.Plo + -rm -f x86/$(DEPDIR)/Gstep.Plo + -rm -f x86/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f x86/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f x86/$(DEPDIR)/Lget_proc_info.Plo + -rm -f x86/$(DEPDIR)/Lget_save_loc.Plo + -rm -f x86/$(DEPDIR)/Lglobal.Plo + -rm -f x86/$(DEPDIR)/Linit.Plo + -rm -f x86/$(DEPDIR)/Linit_local.Plo + -rm -f x86/$(DEPDIR)/Linit_remote.Plo + -rm -f x86/$(DEPDIR)/Los-freebsd.Plo + -rm -f x86/$(DEPDIR)/Los-linux.Plo + -rm -f x86/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f x86/$(DEPDIR)/Lregs.Plo + -rm -f x86/$(DEPDIR)/Lresume.Plo + -rm -f x86/$(DEPDIR)/Lstep.Plo + -rm -f x86/$(DEPDIR)/getcontext-freebsd.Plo + -rm -f x86/$(DEPDIR)/getcontext-linux.Plo + -rm -f x86/$(DEPDIR)/is_fpreg.Plo + -rm -f x86/$(DEPDIR)/longjmp.Plo + -rm -f x86/$(DEPDIR)/regname.Plo + -rm -f x86/$(DEPDIR)/siglongjmp.Plo + -rm -f x86_64/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f x86_64/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f x86_64/$(DEPDIR)/Gget_proc_info.Plo + -rm -f x86_64/$(DEPDIR)/Gget_save_loc.Plo + -rm -f x86_64/$(DEPDIR)/Gglobal.Plo + -rm -f x86_64/$(DEPDIR)/Ginit.Plo + -rm -f x86_64/$(DEPDIR)/Ginit_local.Plo + -rm -f x86_64/$(DEPDIR)/Ginit_remote.Plo + -rm -f x86_64/$(DEPDIR)/Gos-freebsd.Plo + -rm -f x86_64/$(DEPDIR)/Gos-linux.Plo + -rm -f x86_64/$(DEPDIR)/Gos-qnx.Plo + -rm -f x86_64/$(DEPDIR)/Gos-solaris.Plo + -rm -f x86_64/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f x86_64/$(DEPDIR)/Gregs.Plo + -rm -f x86_64/$(DEPDIR)/Gresume.Plo + -rm -f x86_64/$(DEPDIR)/Gstash_frame.Plo + -rm -f x86_64/$(DEPDIR)/Gstep.Plo + -rm -f x86_64/$(DEPDIR)/Gtrace.Plo + -rm -f x86_64/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f x86_64/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f x86_64/$(DEPDIR)/Lget_proc_info.Plo + -rm -f x86_64/$(DEPDIR)/Lget_save_loc.Plo + -rm -f x86_64/$(DEPDIR)/Lglobal.Plo + -rm -f x86_64/$(DEPDIR)/Linit.Plo + -rm -f x86_64/$(DEPDIR)/Linit_local.Plo + -rm -f x86_64/$(DEPDIR)/Linit_remote.Plo + -rm -f x86_64/$(DEPDIR)/Los-freebsd.Plo + -rm -f x86_64/$(DEPDIR)/Los-linux.Plo + -rm -f x86_64/$(DEPDIR)/Los-qnx.Plo + -rm -f x86_64/$(DEPDIR)/Los-solaris.Plo + -rm -f x86_64/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f x86_64/$(DEPDIR)/Lregs.Plo + -rm -f x86_64/$(DEPDIR)/Lresume.Plo + -rm -f x86_64/$(DEPDIR)/Lstash_frame.Plo + -rm -f x86_64/$(DEPDIR)/Lstep.Plo + -rm -f x86_64/$(DEPDIR)/Ltrace.Plo + -rm -f x86_64/$(DEPDIR)/getcontext.Plo + -rm -f x86_64/$(DEPDIR)/is_fpreg.Plo + -rm -f x86_64/$(DEPDIR)/longjmp.Plo + -rm -f x86_64/$(DEPDIR)/regname.Plo + -rm -f x86_64/$(DEPDIR)/setcontext.Plo + -rm -f x86_64/$(DEPDIR)/siglongjmp.Plo + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-pkgconfigDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/dl-iterate-phdr.Plo + -rm -f ./$(DEPDIR)/elf32.Plo + -rm -f ./$(DEPDIR)/elf64.Plo + -rm -f ./$(DEPDIR)/elfxx.Plo + -rm -f ./$(DEPDIR)/os-freebsd.Plo + -rm -f ./$(DEPDIR)/os-hpux.Plo + -rm -f ./$(DEPDIR)/os-linux.Plo + -rm -f ./$(DEPDIR)/os-qnx.Plo + -rm -f ./$(DEPDIR)/os-solaris.Plo + -rm -f aarch64/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f aarch64/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f aarch64/$(DEPDIR)/Gget_proc_info.Plo + -rm -f aarch64/$(DEPDIR)/Gget_save_loc.Plo + -rm -f aarch64/$(DEPDIR)/Gglobal.Plo + -rm -f aarch64/$(DEPDIR)/Ginit.Plo + -rm -f aarch64/$(DEPDIR)/Ginit_local.Plo + -rm -f aarch64/$(DEPDIR)/Ginit_remote.Plo + -rm -f aarch64/$(DEPDIR)/Gis_signal_frame.Plo + -rm -f aarch64/$(DEPDIR)/Gos-freebsd.Plo + -rm -f aarch64/$(DEPDIR)/Gos-linux.Plo + -rm -f aarch64/$(DEPDIR)/Gos-qnx.Plo + -rm -f aarch64/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f aarch64/$(DEPDIR)/Gregs.Plo + -rm -f aarch64/$(DEPDIR)/Gresume.Plo + -rm -f aarch64/$(DEPDIR)/Gstash_frame.Plo + -rm -f aarch64/$(DEPDIR)/Gstep.Plo + -rm -f aarch64/$(DEPDIR)/Gstrip_ptrauth_insn_mask.Plo + -rm -f aarch64/$(DEPDIR)/Gtrace.Plo + -rm -f aarch64/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f aarch64/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f aarch64/$(DEPDIR)/Lget_proc_info.Plo + -rm -f aarch64/$(DEPDIR)/Lget_save_loc.Plo + -rm -f aarch64/$(DEPDIR)/Lglobal.Plo + -rm -f aarch64/$(DEPDIR)/Linit.Plo + -rm -f aarch64/$(DEPDIR)/Linit_local.Plo + -rm -f aarch64/$(DEPDIR)/Linit_remote.Plo + -rm -f aarch64/$(DEPDIR)/Lis_signal_frame.Plo + -rm -f aarch64/$(DEPDIR)/Los-freebsd.Plo + -rm -f aarch64/$(DEPDIR)/Los-linux.Plo + -rm -f aarch64/$(DEPDIR)/Los-qnx.Plo + -rm -f aarch64/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f aarch64/$(DEPDIR)/Lregs.Plo + -rm -f aarch64/$(DEPDIR)/Lresume.Plo + -rm -f aarch64/$(DEPDIR)/Lstash_frame.Plo + -rm -f aarch64/$(DEPDIR)/Lstep.Plo + -rm -f aarch64/$(DEPDIR)/Lstrip_ptrauth_insn_mask.Plo + -rm -f aarch64/$(DEPDIR)/Ltrace.Plo + -rm -f aarch64/$(DEPDIR)/getcontext.Plo + -rm -f aarch64/$(DEPDIR)/is_fpreg.Plo + -rm -f aarch64/$(DEPDIR)/longjmp.Plo + -rm -f aarch64/$(DEPDIR)/regname.Plo + -rm -f aarch64/$(DEPDIR)/setcontext.Plo + -rm -f aarch64/$(DEPDIR)/siglongjmp.Plo + -rm -f arm/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f arm/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f arm/$(DEPDIR)/Gex_tables.Plo + -rm -f arm/$(DEPDIR)/Gget_proc_info.Plo + -rm -f arm/$(DEPDIR)/Gget_save_loc.Plo + -rm -f arm/$(DEPDIR)/Gglobal.Plo + -rm -f arm/$(DEPDIR)/Ginit.Plo + -rm -f arm/$(DEPDIR)/Ginit_local.Plo + -rm -f arm/$(DEPDIR)/Ginit_remote.Plo + -rm -f arm/$(DEPDIR)/Gos-freebsd.Plo + -rm -f arm/$(DEPDIR)/Gos-linux.Plo + -rm -f arm/$(DEPDIR)/Gos-other.Plo + -rm -f arm/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f arm/$(DEPDIR)/Gregs.Plo + -rm -f arm/$(DEPDIR)/Gresume.Plo + -rm -f arm/$(DEPDIR)/Gstash_frame.Plo + -rm -f arm/$(DEPDIR)/Gstep.Plo + -rm -f arm/$(DEPDIR)/Gtrace.Plo + -rm -f arm/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f arm/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f arm/$(DEPDIR)/Lex_tables.Plo + -rm -f arm/$(DEPDIR)/Lget_proc_info.Plo + -rm -f arm/$(DEPDIR)/Lget_save_loc.Plo + -rm -f arm/$(DEPDIR)/Lglobal.Plo + -rm -f arm/$(DEPDIR)/Linit.Plo + -rm -f arm/$(DEPDIR)/Linit_local.Plo + -rm -f arm/$(DEPDIR)/Linit_remote.Plo + -rm -f arm/$(DEPDIR)/Los-freebsd.Plo + -rm -f arm/$(DEPDIR)/Los-linux.Plo + -rm -f arm/$(DEPDIR)/Los-other.Plo + -rm -f arm/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f arm/$(DEPDIR)/Lregs.Plo + -rm -f arm/$(DEPDIR)/Lresume.Plo + -rm -f arm/$(DEPDIR)/Lstash_frame.Plo + -rm -f arm/$(DEPDIR)/Lstep.Plo + -rm -f arm/$(DEPDIR)/Ltrace.Plo + -rm -f arm/$(DEPDIR)/getcontext.Plo + -rm -f arm/$(DEPDIR)/is_fpreg.Plo + -rm -f arm/$(DEPDIR)/regname.Plo + -rm -f arm/$(DEPDIR)/siglongjmp.Plo + -rm -f coredump/$(DEPDIR)/_UCD_access_mem.Plo + -rm -f coredump/$(DEPDIR)/_UCD_access_reg_freebsd.Plo + -rm -f coredump/$(DEPDIR)/_UCD_access_reg_linux.Plo + -rm -f coredump/$(DEPDIR)/_UCD_access_reg_qnx.Plo + -rm -f coredump/$(DEPDIR)/_UCD_accessors.Plo + -rm -f coredump/$(DEPDIR)/_UCD_corefile_elf.Plo + -rm -f coredump/$(DEPDIR)/_UCD_create.Plo + -rm -f coredump/$(DEPDIR)/_UCD_destroy.Plo + -rm -f coredump/$(DEPDIR)/_UCD_elf_map_image.Plo + -rm -f coredump/$(DEPDIR)/_UCD_find_proc_info.Plo + -rm -f coredump/$(DEPDIR)/_UCD_get_elf_filename.Plo + -rm -f coredump/$(DEPDIR)/_UCD_get_mapinfo_generic.Plo + -rm -f coredump/$(DEPDIR)/_UCD_get_mapinfo_linux.Plo + -rm -f coredump/$(DEPDIR)/_UCD_get_mapinfo_qnx.Plo + -rm -f coredump/$(DEPDIR)/_UCD_get_proc_name.Plo + -rm -f coredump/$(DEPDIR)/_UCD_get_threadinfo_prstatus.Plo + -rm -f coredump/$(DEPDIR)/_UPT_access_fpreg.Plo + -rm -f coredump/$(DEPDIR)/_UPT_elf.Plo + -rm -f coredump/$(DEPDIR)/_UPT_get_dyn_info_list_addr.Plo + -rm -f coredump/$(DEPDIR)/_UPT_put_unwind_info.Plo + -rm -f coredump/$(DEPDIR)/_UPT_resume.Plo + -rm -f coredump/$(DEPDIR)/ucd_file_table.Plo + -rm -f dwarf/$(DEPDIR)/Gexpr.Plo + -rm -f dwarf/$(DEPDIR)/Gfde.Plo + -rm -f dwarf/$(DEPDIR)/Gfind_proc_info-lsb.Plo + -rm -f dwarf/$(DEPDIR)/Gfind_unwind_table.Plo + -rm -f dwarf/$(DEPDIR)/Gget_proc_info_in_range.Plo + -rm -f dwarf/$(DEPDIR)/Gparser.Plo + -rm -f dwarf/$(DEPDIR)/Gpe.Plo + -rm -f dwarf/$(DEPDIR)/Lexpr.Plo + -rm -f dwarf/$(DEPDIR)/Lfde.Plo + -rm -f dwarf/$(DEPDIR)/Lfind_proc_info-lsb.Plo + -rm -f dwarf/$(DEPDIR)/Lfind_unwind_table.Plo + -rm -f dwarf/$(DEPDIR)/Lget_proc_info_in_range.Plo + -rm -f dwarf/$(DEPDIR)/Lparser.Plo + -rm -f dwarf/$(DEPDIR)/Lpe.Plo + -rm -f dwarf/$(DEPDIR)/global.Plo + -rm -f hppa/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f hppa/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f hppa/$(DEPDIR)/Gget_proc_info.Plo + -rm -f hppa/$(DEPDIR)/Gget_save_loc.Plo + -rm -f hppa/$(DEPDIR)/Gglobal.Plo + -rm -f hppa/$(DEPDIR)/Ginit.Plo + -rm -f hppa/$(DEPDIR)/Ginit_local.Plo + -rm -f hppa/$(DEPDIR)/Ginit_remote.Plo + -rm -f hppa/$(DEPDIR)/Gis_signal_frame.Plo + -rm -f hppa/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f hppa/$(DEPDIR)/Gregs.Plo + -rm -f hppa/$(DEPDIR)/Gresume.Plo + -rm -f hppa/$(DEPDIR)/Gstep.Plo + -rm -f hppa/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f hppa/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f hppa/$(DEPDIR)/Lget_proc_info.Plo + -rm -f hppa/$(DEPDIR)/Lget_save_loc.Plo + -rm -f hppa/$(DEPDIR)/Lglobal.Plo + -rm -f hppa/$(DEPDIR)/Linit.Plo + -rm -f hppa/$(DEPDIR)/Linit_local.Plo + -rm -f hppa/$(DEPDIR)/Linit_remote.Plo + -rm -f hppa/$(DEPDIR)/Lis_signal_frame.Plo + -rm -f hppa/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f hppa/$(DEPDIR)/Lregs.Plo + -rm -f hppa/$(DEPDIR)/Lresume.Plo + -rm -f hppa/$(DEPDIR)/Lstep.Plo + -rm -f hppa/$(DEPDIR)/getcontext.Plo + -rm -f hppa/$(DEPDIR)/regname.Plo + -rm -f hppa/$(DEPDIR)/setcontext.Plo + -rm -f hppa/$(DEPDIR)/siglongjmp.Plo + -rm -f ia64/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f ia64/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f ia64/$(DEPDIR)/Gfind_unwind_table.Plo + -rm -f ia64/$(DEPDIR)/Gget_proc_info.Plo + -rm -f ia64/$(DEPDIR)/Gget_save_loc.Plo + -rm -f ia64/$(DEPDIR)/Gglobal.Plo + -rm -f ia64/$(DEPDIR)/Ginit.Plo + -rm -f ia64/$(DEPDIR)/Ginit_local.Plo + -rm -f ia64/$(DEPDIR)/Ginit_remote.Plo + -rm -f ia64/$(DEPDIR)/Ginstall_cursor.Plo + -rm -f ia64/$(DEPDIR)/Gis_signal_frame.Plo + -rm -f ia64/$(DEPDIR)/Gparser.Plo + -rm -f ia64/$(DEPDIR)/Grbs.Plo + -rm -f ia64/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f ia64/$(DEPDIR)/Gregs.Plo + -rm -f ia64/$(DEPDIR)/Gresume.Plo + -rm -f ia64/$(DEPDIR)/Gscript.Plo + -rm -f ia64/$(DEPDIR)/Gstep.Plo + -rm -f ia64/$(DEPDIR)/Gtables.Plo + -rm -f ia64/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f ia64/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f ia64/$(DEPDIR)/Lfind_unwind_table.Plo + -rm -f ia64/$(DEPDIR)/Lget_proc_info.Plo + -rm -f ia64/$(DEPDIR)/Lget_save_loc.Plo + -rm -f ia64/$(DEPDIR)/Lglobal.Plo + -rm -f ia64/$(DEPDIR)/Linit.Plo + -rm -f ia64/$(DEPDIR)/Linit_local.Plo + -rm -f ia64/$(DEPDIR)/Linit_remote.Plo + -rm -f ia64/$(DEPDIR)/Linstall_cursor.Plo + -rm -f ia64/$(DEPDIR)/Lis_signal_frame.Plo + -rm -f ia64/$(DEPDIR)/Lparser.Plo + -rm -f ia64/$(DEPDIR)/Lrbs.Plo + -rm -f ia64/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f ia64/$(DEPDIR)/Lregs.Plo + -rm -f ia64/$(DEPDIR)/Lresume.Plo + -rm -f ia64/$(DEPDIR)/Lscript.Plo + -rm -f ia64/$(DEPDIR)/Lstep.Plo + -rm -f ia64/$(DEPDIR)/Ltables.Plo + -rm -f ia64/$(DEPDIR)/dyn_info_list.Plo + -rm -f ia64/$(DEPDIR)/getcontext.Plo + -rm -f ia64/$(DEPDIR)/longjmp.Plo + -rm -f ia64/$(DEPDIR)/regname.Plo + -rm -f ia64/$(DEPDIR)/setjmp.Plo + -rm -f ia64/$(DEPDIR)/siglongjmp.Plo + -rm -f ia64/$(DEPDIR)/sigsetjmp.Plo + -rm -f loongarch64/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f loongarch64/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f loongarch64/$(DEPDIR)/Gget_proc_info.Plo + -rm -f loongarch64/$(DEPDIR)/Gget_save_loc.Plo + -rm -f loongarch64/$(DEPDIR)/Gglobal.Plo + -rm -f loongarch64/$(DEPDIR)/Ginit.Plo + -rm -f loongarch64/$(DEPDIR)/Ginit_local.Plo + -rm -f loongarch64/$(DEPDIR)/Ginit_remote.Plo + -rm -f loongarch64/$(DEPDIR)/Gis_signal_frame.Plo + -rm -f loongarch64/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f loongarch64/$(DEPDIR)/Gregs.Plo + -rm -f loongarch64/$(DEPDIR)/Gresume.Plo + -rm -f loongarch64/$(DEPDIR)/Gstep.Plo + -rm -f loongarch64/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f loongarch64/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f loongarch64/$(DEPDIR)/Lget_proc_info.Plo + -rm -f loongarch64/$(DEPDIR)/Lget_save_loc.Plo + -rm -f loongarch64/$(DEPDIR)/Lglobal.Plo + -rm -f loongarch64/$(DEPDIR)/Linit.Plo + -rm -f loongarch64/$(DEPDIR)/Linit_local.Plo + -rm -f loongarch64/$(DEPDIR)/Linit_remote.Plo + -rm -f loongarch64/$(DEPDIR)/Lis_signal_frame.Plo + -rm -f loongarch64/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f loongarch64/$(DEPDIR)/Lregs.Plo + -rm -f loongarch64/$(DEPDIR)/Lresume.Plo + -rm -f loongarch64/$(DEPDIR)/Lstep.Plo + -rm -f loongarch64/$(DEPDIR)/getcontext.Plo + -rm -f loongarch64/$(DEPDIR)/is_fpreg.Plo + -rm -f loongarch64/$(DEPDIR)/regname.Plo + -rm -f loongarch64/$(DEPDIR)/siglongjmp.Plo + -rm -f mi/$(DEPDIR)/Gaddress_validator.Plo + -rm -f mi/$(DEPDIR)/Gdestroy_addr_space.Plo + -rm -f mi/$(DEPDIR)/Gdyn-extract.Plo + -rm -f mi/$(DEPDIR)/Gdyn-remote.Plo + -rm -f mi/$(DEPDIR)/Gfind_dynamic_proc_info.Plo + -rm -f mi/$(DEPDIR)/Gget_accessors.Plo + -rm -f mi/$(DEPDIR)/Gget_elf_filename.Plo + -rm -f mi/$(DEPDIR)/Gget_fpreg.Plo + -rm -f mi/$(DEPDIR)/Gget_proc_info_by_ip.Plo + -rm -f mi/$(DEPDIR)/Gget_proc_name.Plo + -rm -f mi/$(DEPDIR)/Gget_reg.Plo + -rm -f mi/$(DEPDIR)/Gis_plt_entry.Plo + -rm -f mi/$(DEPDIR)/Gput_dynamic_unwind_info.Plo + -rm -f mi/$(DEPDIR)/Gset_cache_size.Plo + -rm -f mi/$(DEPDIR)/Gset_caching_policy.Plo + -rm -f mi/$(DEPDIR)/Gset_fpreg.Plo + -rm -f mi/$(DEPDIR)/Gset_iterate_phdr_function.Plo + -rm -f mi/$(DEPDIR)/Gset_reg.Plo + -rm -f mi/$(DEPDIR)/Laddress_validator.Plo + -rm -f mi/$(DEPDIR)/Ldestroy_addr_space.Plo + -rm -f mi/$(DEPDIR)/Ldyn-extract.Plo + -rm -f mi/$(DEPDIR)/Lfind_dynamic_proc_info.Plo + -rm -f mi/$(DEPDIR)/Lget_accessors.Plo + -rm -f mi/$(DEPDIR)/Lget_elf_filename.Plo + -rm -f mi/$(DEPDIR)/Lget_fpreg.Plo + -rm -f mi/$(DEPDIR)/Lget_proc_info_by_ip.Plo + -rm -f mi/$(DEPDIR)/Lget_proc_name.Plo + -rm -f mi/$(DEPDIR)/Lget_reg.Plo + -rm -f mi/$(DEPDIR)/Lis_plt_entry.Plo + -rm -f mi/$(DEPDIR)/Lput_dynamic_unwind_info.Plo + -rm -f mi/$(DEPDIR)/Lset_cache_size.Plo + -rm -f mi/$(DEPDIR)/Lset_caching_policy.Plo + -rm -f mi/$(DEPDIR)/Lset_fpreg.Plo + -rm -f mi/$(DEPDIR)/Lset_iterate_phdr_function.Plo + -rm -f mi/$(DEPDIR)/Lset_reg.Plo + -rm -f mi/$(DEPDIR)/_ReadSLEB.Plo + -rm -f mi/$(DEPDIR)/_ReadULEB.Plo + -rm -f mi/$(DEPDIR)/backtrace.Plo + -rm -f mi/$(DEPDIR)/dyn-cancel.Plo + -rm -f mi/$(DEPDIR)/dyn-info-list.Plo + -rm -f mi/$(DEPDIR)/dyn-register.Plo + -rm -f mi/$(DEPDIR)/flush_cache.Plo + -rm -f mi/$(DEPDIR)/init.Plo + -rm -f mi/$(DEPDIR)/mempool.Plo + -rm -f mi/$(DEPDIR)/strerror.Plo + -rm -f mips/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f mips/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f mips/$(DEPDIR)/Gget_proc_info.Plo + -rm -f mips/$(DEPDIR)/Gget_save_loc.Plo + -rm -f mips/$(DEPDIR)/Gglobal.Plo + -rm -f mips/$(DEPDIR)/Ginit.Plo + -rm -f mips/$(DEPDIR)/Ginit_local.Plo + -rm -f mips/$(DEPDIR)/Ginit_remote.Plo + -rm -f mips/$(DEPDIR)/Gis_signal_frame.Plo + -rm -f mips/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f mips/$(DEPDIR)/Gregs.Plo + -rm -f mips/$(DEPDIR)/Gresume.Plo + -rm -f mips/$(DEPDIR)/Gstep.Plo + -rm -f mips/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f mips/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f mips/$(DEPDIR)/Lget_proc_info.Plo + -rm -f mips/$(DEPDIR)/Lget_save_loc.Plo + -rm -f mips/$(DEPDIR)/Lglobal.Plo + -rm -f mips/$(DEPDIR)/Linit.Plo + -rm -f mips/$(DEPDIR)/Linit_local.Plo + -rm -f mips/$(DEPDIR)/Linit_remote.Plo + -rm -f mips/$(DEPDIR)/Lis_signal_frame.Plo + -rm -f mips/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f mips/$(DEPDIR)/Lregs.Plo + -rm -f mips/$(DEPDIR)/Lresume.Plo + -rm -f mips/$(DEPDIR)/Lstep.Plo + -rm -f mips/$(DEPDIR)/getcontext.Plo + -rm -f mips/$(DEPDIR)/is_fpreg.Plo + -rm -f mips/$(DEPDIR)/regname.Plo + -rm -f mips/$(DEPDIR)/siglongjmp.Plo + -rm -f nto/$(DEPDIR)/unw_nto_access_fpreg.Plo + -rm -f nto/$(DEPDIR)/unw_nto_access_mem.Plo + -rm -f nto/$(DEPDIR)/unw_nto_access_reg.Plo + -rm -f nto/$(DEPDIR)/unw_nto_accessors.Plo + -rm -f nto/$(DEPDIR)/unw_nto_create.Plo + -rm -f nto/$(DEPDIR)/unw_nto_destroy.Plo + -rm -f nto/$(DEPDIR)/unw_nto_elf.Plo + -rm -f nto/$(DEPDIR)/unw_nto_find_proc_info.Plo + -rm -f nto/$(DEPDIR)/unw_nto_get_dyn_info_list_addr.Plo + -rm -f nto/$(DEPDIR)/unw_nto_get_elf_filename.Plo + -rm -f nto/$(DEPDIR)/unw_nto_get_proc_name.Plo + -rm -f nto/$(DEPDIR)/unw_nto_put_unwind_info.Plo + -rm -f nto/$(DEPDIR)/unw_nto_resume.Plo + -rm -f ppc/$(DEPDIR)/Gget_proc_info.Plo + -rm -f ppc/$(DEPDIR)/Gget_save_loc.Plo + -rm -f ppc/$(DEPDIR)/Ginit_local.Plo + -rm -f ppc/$(DEPDIR)/Ginit_remote.Plo + -rm -f ppc/$(DEPDIR)/Gis_signal_frame.Plo + -rm -f ppc/$(DEPDIR)/Lget_proc_info.Plo + -rm -f ppc/$(DEPDIR)/Lget_save_loc.Plo + -rm -f ppc/$(DEPDIR)/Linit_local.Plo + -rm -f ppc/$(DEPDIR)/Linit_remote.Plo + -rm -f ppc/$(DEPDIR)/Lis_signal_frame.Plo + -rm -f ppc/$(DEPDIR)/longjmp.Plo + -rm -f ppc/$(DEPDIR)/siglongjmp.Plo + -rm -f ppc32/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f ppc32/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f ppc32/$(DEPDIR)/Gglobal.Plo + -rm -f ppc32/$(DEPDIR)/Ginit.Plo + -rm -f ppc32/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f ppc32/$(DEPDIR)/Gregs.Plo + -rm -f ppc32/$(DEPDIR)/Gresume.Plo + -rm -f ppc32/$(DEPDIR)/Gstep.Plo + -rm -f ppc32/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f ppc32/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f ppc32/$(DEPDIR)/Lglobal.Plo + -rm -f ppc32/$(DEPDIR)/Linit.Plo + -rm -f ppc32/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f ppc32/$(DEPDIR)/Lregs.Plo + -rm -f ppc32/$(DEPDIR)/Lresume.Plo + -rm -f ppc32/$(DEPDIR)/Lstep.Plo + -rm -f ppc32/$(DEPDIR)/get_func_addr.Plo + -rm -f ppc32/$(DEPDIR)/is_fpreg.Plo + -rm -f ppc32/$(DEPDIR)/regname.Plo + -rm -f ppc64/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f ppc64/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f ppc64/$(DEPDIR)/Gglobal.Plo + -rm -f ppc64/$(DEPDIR)/Ginit.Plo + -rm -f ppc64/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f ppc64/$(DEPDIR)/Gregs.Plo + -rm -f ppc64/$(DEPDIR)/Gresume.Plo + -rm -f ppc64/$(DEPDIR)/Gstep.Plo + -rm -f ppc64/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f ppc64/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f ppc64/$(DEPDIR)/Lglobal.Plo + -rm -f ppc64/$(DEPDIR)/Linit.Plo + -rm -f ppc64/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f ppc64/$(DEPDIR)/Lregs.Plo + -rm -f ppc64/$(DEPDIR)/Lresume.Plo + -rm -f ppc64/$(DEPDIR)/Lstep.Plo + -rm -f ppc64/$(DEPDIR)/get_func_addr.Plo + -rm -f ppc64/$(DEPDIR)/is_fpreg.Plo + -rm -f ppc64/$(DEPDIR)/regname.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_access_fpreg.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_access_mem.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_access_reg.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_accessors.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_create.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_destroy.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_elf.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_find_proc_info.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_get_dyn_info_list_addr.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_get_elf_filename.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_get_proc_name.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_ptrauth_insn_mask.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_put_unwind_info.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_reg_offset.Plo + -rm -f ptrace/$(DEPDIR)/_UPT_resume.Plo + -rm -f riscv/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f riscv/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f riscv/$(DEPDIR)/Gget_proc_info.Plo + -rm -f riscv/$(DEPDIR)/Gget_save_loc.Plo + -rm -f riscv/$(DEPDIR)/Gglobal.Plo + -rm -f riscv/$(DEPDIR)/Ginit.Plo + -rm -f riscv/$(DEPDIR)/Ginit_local.Plo + -rm -f riscv/$(DEPDIR)/Ginit_remote.Plo + -rm -f riscv/$(DEPDIR)/Gis_signal_frame.Plo + -rm -f riscv/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f riscv/$(DEPDIR)/Gregs.Plo + -rm -f riscv/$(DEPDIR)/Gresume.Plo + -rm -f riscv/$(DEPDIR)/Gstep.Plo + -rm -f riscv/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f riscv/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f riscv/$(DEPDIR)/Lget_proc_info.Plo + -rm -f riscv/$(DEPDIR)/Lget_save_loc.Plo + -rm -f riscv/$(DEPDIR)/Lglobal.Plo + -rm -f riscv/$(DEPDIR)/Linit.Plo + -rm -f riscv/$(DEPDIR)/Linit_local.Plo + -rm -f riscv/$(DEPDIR)/Linit_remote.Plo + -rm -f riscv/$(DEPDIR)/Lis_signal_frame.Plo + -rm -f riscv/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f riscv/$(DEPDIR)/Lregs.Plo + -rm -f riscv/$(DEPDIR)/Lresume.Plo + -rm -f riscv/$(DEPDIR)/Lstep.Plo + -rm -f riscv/$(DEPDIR)/getcontext.Plo + -rm -f riscv/$(DEPDIR)/is_fpreg.Plo + -rm -f riscv/$(DEPDIR)/regname.Plo + -rm -f riscv/$(DEPDIR)/setcontext.Plo + -rm -f riscv/$(DEPDIR)/siglongjmp.Plo + -rm -f s390x/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f s390x/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f s390x/$(DEPDIR)/Gget_proc_info.Plo + -rm -f s390x/$(DEPDIR)/Gget_save_loc.Plo + -rm -f s390x/$(DEPDIR)/Gglobal.Plo + -rm -f s390x/$(DEPDIR)/Ginit.Plo + -rm -f s390x/$(DEPDIR)/Ginit_local.Plo + -rm -f s390x/$(DEPDIR)/Ginit_remote.Plo + -rm -f s390x/$(DEPDIR)/Gis_signal_frame.Plo + -rm -f s390x/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f s390x/$(DEPDIR)/Gregs.Plo + -rm -f s390x/$(DEPDIR)/Gresume.Plo + -rm -f s390x/$(DEPDIR)/Gstep.Plo + -rm -f s390x/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f s390x/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f s390x/$(DEPDIR)/Lget_proc_info.Plo + -rm -f s390x/$(DEPDIR)/Lget_save_loc.Plo + -rm -f s390x/$(DEPDIR)/Lglobal.Plo + -rm -f s390x/$(DEPDIR)/Linit.Plo + -rm -f s390x/$(DEPDIR)/Linit_local.Plo + -rm -f s390x/$(DEPDIR)/Linit_remote.Plo + -rm -f s390x/$(DEPDIR)/Lis_signal_frame.Plo + -rm -f s390x/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f s390x/$(DEPDIR)/Lregs.Plo + -rm -f s390x/$(DEPDIR)/Lresume.Plo + -rm -f s390x/$(DEPDIR)/Lstep.Plo + -rm -f s390x/$(DEPDIR)/getcontext.Plo + -rm -f s390x/$(DEPDIR)/is_fpreg.Plo + -rm -f s390x/$(DEPDIR)/regname.Plo + -rm -f s390x/$(DEPDIR)/setcontext.Plo + -rm -f setjmp/$(DEPDIR)/longjmp.Plo + -rm -f setjmp/$(DEPDIR)/siglongjmp.Plo + -rm -f sh/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f sh/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f sh/$(DEPDIR)/Gget_proc_info.Plo + -rm -f sh/$(DEPDIR)/Gget_save_loc.Plo + -rm -f sh/$(DEPDIR)/Gglobal.Plo + -rm -f sh/$(DEPDIR)/Ginit.Plo + -rm -f sh/$(DEPDIR)/Ginit_local.Plo + -rm -f sh/$(DEPDIR)/Ginit_remote.Plo + -rm -f sh/$(DEPDIR)/Gis_signal_frame.Plo + -rm -f sh/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f sh/$(DEPDIR)/Gregs.Plo + -rm -f sh/$(DEPDIR)/Gresume.Plo + -rm -f sh/$(DEPDIR)/Gstep.Plo + -rm -f sh/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f sh/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f sh/$(DEPDIR)/Lget_proc_info.Plo + -rm -f sh/$(DEPDIR)/Lget_save_loc.Plo + -rm -f sh/$(DEPDIR)/Lglobal.Plo + -rm -f sh/$(DEPDIR)/Linit.Plo + -rm -f sh/$(DEPDIR)/Linit_local.Plo + -rm -f sh/$(DEPDIR)/Linit_remote.Plo + -rm -f sh/$(DEPDIR)/Lis_signal_frame.Plo + -rm -f sh/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f sh/$(DEPDIR)/Lregs.Plo + -rm -f sh/$(DEPDIR)/Lresume.Plo + -rm -f sh/$(DEPDIR)/Lstep.Plo + -rm -f sh/$(DEPDIR)/is_fpreg.Plo + -rm -f sh/$(DEPDIR)/regname.Plo + -rm -f sh/$(DEPDIR)/siglongjmp.Plo + -rm -f unwind/$(DEPDIR)/Backtrace.Plo + -rm -f unwind/$(DEPDIR)/DeleteException.Plo + -rm -f unwind/$(DEPDIR)/FindEnclosingFunction.Plo + -rm -f unwind/$(DEPDIR)/ForcedUnwind.Plo + -rm -f unwind/$(DEPDIR)/GetBSP.Plo + -rm -f unwind/$(DEPDIR)/GetCFA.Plo + -rm -f unwind/$(DEPDIR)/GetDataRelBase.Plo + -rm -f unwind/$(DEPDIR)/GetGR.Plo + -rm -f unwind/$(DEPDIR)/GetIP.Plo + -rm -f unwind/$(DEPDIR)/GetIPInfo.Plo + -rm -f unwind/$(DEPDIR)/GetLanguageSpecificData.Plo + -rm -f unwind/$(DEPDIR)/GetRegionStart.Plo + -rm -f unwind/$(DEPDIR)/GetTextRelBase.Plo + -rm -f unwind/$(DEPDIR)/RaiseException.Plo + -rm -f unwind/$(DEPDIR)/Resume.Plo + -rm -f unwind/$(DEPDIR)/Resume_or_Rethrow.Plo + -rm -f unwind/$(DEPDIR)/SetGR.Plo + -rm -f unwind/$(DEPDIR)/SetIP.Plo + -rm -f x86/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f x86/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f x86/$(DEPDIR)/Gget_proc_info.Plo + -rm -f x86/$(DEPDIR)/Gget_save_loc.Plo + -rm -f x86/$(DEPDIR)/Gglobal.Plo + -rm -f x86/$(DEPDIR)/Ginit.Plo + -rm -f x86/$(DEPDIR)/Ginit_local.Plo + -rm -f x86/$(DEPDIR)/Ginit_remote.Plo + -rm -f x86/$(DEPDIR)/Gos-freebsd.Plo + -rm -f x86/$(DEPDIR)/Gos-linux.Plo + -rm -f x86/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f x86/$(DEPDIR)/Gregs.Plo + -rm -f x86/$(DEPDIR)/Gresume.Plo + -rm -f x86/$(DEPDIR)/Gstep.Plo + -rm -f x86/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f x86/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f x86/$(DEPDIR)/Lget_proc_info.Plo + -rm -f x86/$(DEPDIR)/Lget_save_loc.Plo + -rm -f x86/$(DEPDIR)/Lglobal.Plo + -rm -f x86/$(DEPDIR)/Linit.Plo + -rm -f x86/$(DEPDIR)/Linit_local.Plo + -rm -f x86/$(DEPDIR)/Linit_remote.Plo + -rm -f x86/$(DEPDIR)/Los-freebsd.Plo + -rm -f x86/$(DEPDIR)/Los-linux.Plo + -rm -f x86/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f x86/$(DEPDIR)/Lregs.Plo + -rm -f x86/$(DEPDIR)/Lresume.Plo + -rm -f x86/$(DEPDIR)/Lstep.Plo + -rm -f x86/$(DEPDIR)/getcontext-freebsd.Plo + -rm -f x86/$(DEPDIR)/getcontext-linux.Plo + -rm -f x86/$(DEPDIR)/is_fpreg.Plo + -rm -f x86/$(DEPDIR)/longjmp.Plo + -rm -f x86/$(DEPDIR)/regname.Plo + -rm -f x86/$(DEPDIR)/siglongjmp.Plo + -rm -f x86_64/$(DEPDIR)/Gapply_reg_state.Plo + -rm -f x86_64/$(DEPDIR)/Gcreate_addr_space.Plo + -rm -f x86_64/$(DEPDIR)/Gget_proc_info.Plo + -rm -f x86_64/$(DEPDIR)/Gget_save_loc.Plo + -rm -f x86_64/$(DEPDIR)/Gglobal.Plo + -rm -f x86_64/$(DEPDIR)/Ginit.Plo + -rm -f x86_64/$(DEPDIR)/Ginit_local.Plo + -rm -f x86_64/$(DEPDIR)/Ginit_remote.Plo + -rm -f x86_64/$(DEPDIR)/Gos-freebsd.Plo + -rm -f x86_64/$(DEPDIR)/Gos-linux.Plo + -rm -f x86_64/$(DEPDIR)/Gos-qnx.Plo + -rm -f x86_64/$(DEPDIR)/Gos-solaris.Plo + -rm -f x86_64/$(DEPDIR)/Greg_states_iterate.Plo + -rm -f x86_64/$(DEPDIR)/Gregs.Plo + -rm -f x86_64/$(DEPDIR)/Gresume.Plo + -rm -f x86_64/$(DEPDIR)/Gstash_frame.Plo + -rm -f x86_64/$(DEPDIR)/Gstep.Plo + -rm -f x86_64/$(DEPDIR)/Gtrace.Plo + -rm -f x86_64/$(DEPDIR)/Lapply_reg_state.Plo + -rm -f x86_64/$(DEPDIR)/Lcreate_addr_space.Plo + -rm -f x86_64/$(DEPDIR)/Lget_proc_info.Plo + -rm -f x86_64/$(DEPDIR)/Lget_save_loc.Plo + -rm -f x86_64/$(DEPDIR)/Lglobal.Plo + -rm -f x86_64/$(DEPDIR)/Linit.Plo + -rm -f x86_64/$(DEPDIR)/Linit_local.Plo + -rm -f x86_64/$(DEPDIR)/Linit_remote.Plo + -rm -f x86_64/$(DEPDIR)/Los-freebsd.Plo + -rm -f x86_64/$(DEPDIR)/Los-linux.Plo + -rm -f x86_64/$(DEPDIR)/Los-qnx.Plo + -rm -f x86_64/$(DEPDIR)/Los-solaris.Plo + -rm -f x86_64/$(DEPDIR)/Lreg_states_iterate.Plo + -rm -f x86_64/$(DEPDIR)/Lregs.Plo + -rm -f x86_64/$(DEPDIR)/Lresume.Plo + -rm -f x86_64/$(DEPDIR)/Lstash_frame.Plo + -rm -f x86_64/$(DEPDIR)/Lstep.Plo + -rm -f x86_64/$(DEPDIR)/Ltrace.Plo + -rm -f x86_64/$(DEPDIR)/getcontext.Plo + -rm -f x86_64/$(DEPDIR)/is_fpreg.Plo + -rm -f x86_64/$(DEPDIR)/longjmp.Plo + -rm -f x86_64/$(DEPDIR)/regname.Plo + -rm -f x86_64/$(DEPDIR)/setcontext.Plo + -rm -f x86_64/$(DEPDIR)/siglongjmp.Plo + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgconfigDATA + +.MAKE: all check install install-am install-exec install-exec-am \ + install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-exec-hook \ + install-html install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-pkgconfigDATA install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \ + uninstall-pkgconfigDATA + +.PRECIOUS: Makefile + +@ARCH_IA64_TRUE@mk_Gcursor_i.s: $(srcdir)/ia64/mk_Gcursor_i.c +@ARCH_IA64_TRUE@ $(COMPILE) -S "$(srcdir)/ia64/mk_Gcursor_i.c" -o mk_Gcursor_i.s +@ARCH_IA64_TRUE@mk_Lcursor_i.s: $(srcdir)/ia64/mk_Lcursor_i.c +@ARCH_IA64_TRUE@ $(COMPILE) -S "$(srcdir)/ia64/mk_Lcursor_i.c" -o mk_Lcursor_i.s +@ARCH_IA64_TRUE@Gcursor_i.h: mk_Gcursor_i.s +@ARCH_IA64_TRUE@ "$(srcdir)/ia64/mk_cursor_i" mk_Gcursor_i.s > Gcursor_i.h +@ARCH_IA64_TRUE@Lcursor_i.h: mk_Lcursor_i.s +@ARCH_IA64_TRUE@ "$(srcdir)/ia64/mk_cursor_i" mk_Lcursor_i.s > Lcursor_i.h + +@REMOTE_ONLY_TRUE@install-exec-hook: +# Nothing to do here.... +# +# This is not ideal, but I know of no other way to install an +# alias for a library. For the shared version, we have to do +# a file check before creating the link, because it isn't going +# to be there if the user configured with --disable-shared. +# +@REMOTE_ONLY_FALSE@install-exec-hook: +@REMOTE_ONLY_FALSE@ if test -f $(DESTDIR)$(libdir)/libunwind-$(arch).a; then \ +@REMOTE_ONLY_FALSE@ cd $(DESTDIR)$(libdir) && $(LN_S) -f libunwind-$(arch).a libunwind-generic.a; \ +@REMOTE_ONLY_FALSE@ fi +@REMOTE_ONLY_FALSE@ if test -f $(DESTDIR)$(libdir)/libunwind-$(arch).so; then \ +@REMOTE_ONLY_FALSE@ cd $(DESTDIR)$(libdir) && $(LN_S) -f libunwind-$(arch).so \ +@REMOTE_ONLY_FALSE@ libunwind-generic.so; \ +@REMOTE_ONLY_FALSE@ fi + +# The -version-info flag accepts an argument of the form +# `current[:revision[:age]]'. So, passing `-version-info 3:12:1' sets +# current to 3, revision to 12, and age to 1. + +# If either revision or age are omitted, they default to 0. Also note +# that age must be less than or equal to the current interface number. + +# Here are a set of rules to help you update your library version +# information: + +# 1. Start with version information of `0:0:0' for each libtool +# library. + +# 2. Update the version information only immediately before a public +# release of your software. More frequent updates are unnecessary, +# and only guarantee that the current interface number gets larger +# faster. + +# 3. If the library source code has changed at all since the last +# update, then increment revision (`c:r:a' becomes `c:r+1:a'). + +# 4. If any interfaces have been added, removed, or changed since the +# last update, increment current, and set revision to 0. + +# 5. If any interfaces have been added since the last public release, +# then increment age. + +# 6. If any interfaces have been removed since the last public +# release, then set age to 0. + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/vendor/libunwind/src/aarch64/Gapply_reg_state.c b/vendor/libunwind/src/aarch64/Gapply_reg_state.c new file mode 100644 index 0000000000..82f056da67 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Gapply_reg_state.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +int +unw_apply_reg_state (unw_cursor_t *cursor, + void *reg_states_data) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_apply_reg_state (&c->dwarf, (dwarf_reg_state_t *)reg_states_data); +} diff --git a/vendor/libunwind/src/aarch64/Gcreate_addr_space.c b/vendor/libunwind/src/aarch64/Gcreate_addr_space.c new file mode 100644 index 0000000000..ac2b85e2f7 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Gcreate_addr_space.c @@ -0,0 +1,59 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2012 Tommi Rantala + Copyright (C) 2013 Linaro Limited + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include +#include + +#include "unwind_i.h" + +unw_addr_space_t +unw_create_addr_space (unw_accessors_t *a, int byte_order) +{ +#ifdef UNW_LOCAL_ONLY + return NULL; +#else + unw_addr_space_t as; + + /* AArch64 supports little-endian and big-endian. */ + if (byte_order != 0 && byte_order_is_valid(byte_order) == 0) + return NULL; + + as = malloc (sizeof (*as)); + if (!as) + return NULL; + + memset (as, 0, sizeof (*as)); + + as->acc = *a; + + /* Default to little-endian for AArch64. */ + if (byte_order == 0 || byte_order == UNW_LITTLE_ENDIAN) + as->big_endian = 0; + else + as->big_endian = 1; + + return as; +#endif +} diff --git a/vendor/libunwind/src/aarch64/Gget_proc_info.c b/vendor/libunwind/src/aarch64/Gget_proc_info.c new file mode 100644 index 0000000000..c363d2405d --- /dev/null +++ b/vendor/libunwind/src/aarch64/Gget_proc_info.c @@ -0,0 +1,39 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +int +unw_get_proc_info (unw_cursor_t *cursor, unw_proc_info_t *pi) +{ + struct cursor *c = (struct cursor *) cursor; + int ret; + + ret = dwarf_make_proc_info (&c->dwarf); + if (ret < 0) + return ret; + + *pi = c->dwarf.pi; + return 0; +} diff --git a/vendor/libunwind/src/aarch64/Gget_save_loc.c b/vendor/libunwind/src/aarch64/Gget_save_loc.c new file mode 100644 index 0000000000..86bbbd03d1 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Gget_save_loc.c @@ -0,0 +1,100 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2012 Tommi Rantala + Copyright (C) 2013 Linaro Limited + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +int +unw_get_save_loc (unw_cursor_t *cursor, int reg, unw_save_loc_t *sloc) +{ + struct cursor *c = (struct cursor *) cursor; + dwarf_loc_t loc; + + switch (reg) + { + case UNW_AARCH64_X0: + case UNW_AARCH64_X1: + case UNW_AARCH64_X2: + case UNW_AARCH64_X3: + case UNW_AARCH64_X4: + case UNW_AARCH64_X5: + case UNW_AARCH64_X6: + case UNW_AARCH64_X7: + case UNW_AARCH64_X8: + case UNW_AARCH64_X9: + case UNW_AARCH64_X10: + case UNW_AARCH64_X11: + case UNW_AARCH64_X12: + case UNW_AARCH64_X13: + case UNW_AARCH64_X14: + case UNW_AARCH64_X15: + case UNW_AARCH64_X16: + case UNW_AARCH64_X17: + case UNW_AARCH64_X18: + case UNW_AARCH64_X19: + case UNW_AARCH64_X20: + case UNW_AARCH64_X21: + case UNW_AARCH64_X22: + case UNW_AARCH64_X23: + case UNW_AARCH64_X24: + case UNW_AARCH64_X25: + case UNW_AARCH64_X26: + case UNW_AARCH64_X27: + case UNW_AARCH64_X28: + case UNW_AARCH64_X29: + case UNW_AARCH64_X30: + case UNW_AARCH64_SP: + case UNW_AARCH64_PC: + case UNW_AARCH64_PSTATE: + loc = c->dwarf.loc[reg]; + break; + + default: + loc = DWARF_NULL_LOC; /* default to "not saved" */ + break; + } + + memset (sloc, 0, sizeof (*sloc)); + + if (DWARF_IS_NULL_LOC (loc)) + { + sloc->type = UNW_SLT_NONE; + return 0; + } + +#if !defined(UNW_LOCAL_ONLY) + if (DWARF_IS_REG_LOC (loc)) + { + sloc->type = UNW_SLT_REG; + sloc->u.regnum = DWARF_GET_LOC (loc); + } + else +#endif + { + sloc->type = UNW_SLT_MEMORY; + sloc->u.addr = DWARF_GET_LOC (loc); + } + return 0; +} diff --git a/vendor/libunwind/src/aarch64/Gglobal.c b/vendor/libunwind/src/aarch64/Gglobal.c new file mode 100644 index 0000000000..854b54914d --- /dev/null +++ b/vendor/libunwind/src/aarch64/Gglobal.c @@ -0,0 +1,57 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2012 Tommi Rantala + Copyright (C) 2013 Linaro Limited + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" +#include "dwarf_i.h" + +HIDDEN define_lock (aarch64_lock); +HIDDEN atomic_bool tdep_init_done = 0; + +HIDDEN void +tdep_init (void) +{ + intrmask_t saved_mask; + + sigfillset (&unwi_full_mask); + + lock_acquire (&aarch64_lock, saved_mask); + { + if (atomic_load(&tdep_init_done)) + /* another thread else beat us to it... */ + goto out; + + mi_init (); + + dwarf_init (); + +#ifndef UNW_REMOTE_ONLY + aarch64_local_addr_space_init (); +#endif + atomic_store(&tdep_init_done, 1); /* signal that we're initialized... */ + } + out: + lock_release (&aarch64_lock, saved_mask); +} diff --git a/vendor/libunwind/src/aarch64/Ginit.c b/vendor/libunwind/src/aarch64/Ginit.c new file mode 100644 index 0000000000..6986dbb61a --- /dev/null +++ b/vendor/libunwind/src/aarch64/Ginit.c @@ -0,0 +1,258 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2012 Tommi Rantala + Copyright (C) 2013 Linaro Limited + Copyright 2022 Blackberry Limited + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include +#include +#include +#include +#include + +#include "unwind_i.h" + +#ifdef UNW_REMOTE_ONLY + +/* unw_local_addr_space is a NULL pointer in this case. */ +unw_addr_space_t unw_local_addr_space; + +#else /* !UNW_REMOTE_ONLY */ + +static struct unw_addr_space local_addr_space; + +unw_addr_space_t unw_local_addr_space = &local_addr_space; + +static inline void * +uc_addr (unw_context_t *uc, int reg) +{ + if (reg == UNW_AARCH64_VG) + { + /* + * Support for saving the vector length in the context needs to be + * added to get_context() for this path to work. + */ + Debug(1, "Accessing VG register from context is not supported\n"); + return NULL; + } +#ifdef __FreeBSD__ + if (reg >= UNW_AARCH64_X0 && reg < UNW_AARCH64_X30) + return &uc->uc_mcontext.mc_gpregs.gp_x[reg]; + else if (reg == UNW_AARCH64_X30) + return &uc->uc_mcontext.mc_gpregs.gp_lr; + else if (reg == UNW_AARCH64_SP) + return &uc->uc_mcontext.mc_gpregs.gp_sp; + else if (reg == UNW_AARCH64_PC) + return &uc->uc_mcontext.mc_gpregs.gp_elr; + else if (reg >= UNW_AARCH64_V0 && reg <= UNW_AARCH64_V31) + return &uc->uc_mcontext.mc_fpregs.fp_q[reg - UNW_AARCH64_V0]; + else + return NULL; +#elif defined(__QNX__) + if (reg >= UNW_AARCH64_X0 && reg <= UNW_AARCH64_X30) + return &uc->uc_mcontext.cpu.gpr[reg]; + else if (reg == UNW_AARCH64_SP) + return &AARCH64_GET_REGSP(&uc->uc_mcontext.cpu); + else if (reg == UNW_AARCH64_PC) + return &AARCH64_GET_REGIP(&uc->uc_mcontext.cpu); + else if (reg >= UNW_AARCH64_V0 && reg <= UNW_AARCH64_V31) + return &uc->uc_mcontext.fpu.reg[reg - UNW_AARCH64_V0]; + else + return NULL; +# else /* !__FreeBSD && ! __QNX__ */ + if (reg >= UNW_AARCH64_X0 && reg <= UNW_AARCH64_X30) + return &uc->uc_mcontext.regs[reg]; + else if (reg == UNW_AARCH64_SP) + return &uc->uc_mcontext.sp; + else if (reg == UNW_AARCH64_PC) + return &uc->uc_mcontext.pc; + else if (reg >= UNW_AARCH64_V0 && reg <= UNW_AARCH64_V31) + return &GET_FPCTX(uc)->vregs[reg - UNW_AARCH64_V0]; + else + return NULL; +#endif /* __FreeBSD__ */ +} + +# ifdef UNW_LOCAL_ONLY + +HIDDEN void * +tdep_uc_addr (unw_context_t *uc, int reg) +{ + return uc_addr (uc, reg); +} + +# endif /* UNW_LOCAL_ONLY */ + +static void +put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg) +{ + /* it's a no-op */ +} + +static int +get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) +{ +#ifndef UNW_LOCAL_ONLY +# pragma weak _U_dyn_info_list_addr + if (!_U_dyn_info_list_addr) + return -UNW_ENOINFO; +#endif + // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. + *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; +} + + +static int +access_mem (unw_addr_space_t as, unw_word_t addr, unw_word_t *val, int write, + void *arg) +{ + if (unlikely (write)) + { + Debug (16, "mem[%lx] <- %lx\n", addr, *val); + memcpy ((void *) addr, val, sizeof(unw_word_t)); + } + else + { + /* validate address */ + const struct cursor *c = (const struct cursor *)arg; + if (likely (c != NULL) && unlikely (c->validate) + && unlikely (!unw_address_is_valid (addr, sizeof(unw_word_t)))) { + Debug (16, "mem[%016lx] -> invalid\n", addr); + return -1; + } + memcpy (val, (void *) addr, sizeof(unw_word_t)); + Debug (16, "mem[%lx] -> %lx\n", addr, *val); + } + return 0; +} + +static int +access_reg (unw_addr_space_t as, unw_regnum_t reg, unw_word_t *val, int write, + void *arg) +{ + unw_word_t *addr; + unw_context_t *uc = ((struct cursor *)arg)->uc; + + if (unw_is_fpreg (reg)) + goto badreg; + + if (!(addr = uc_addr (uc, reg))) + goto badreg; + + if (write) + { + memcpy ((void *) addr, val, sizeof(unw_word_t)); + Debug (12, "%s <- %lx\n", unw_regname (reg), *val); + } + else + { + memcpy (val, (void *) addr, sizeof(unw_word_t)); + Debug (12, "%s -> %lx\n", unw_regname (reg), *val); + } + return 0; + + badreg: + Debug (1, "bad register number %u\n", reg); + return -UNW_EBADREG; +} + +static int +access_fpreg (unw_addr_space_t as, unw_regnum_t reg, unw_fpreg_t *val, + int write, void *arg) +{ + unw_context_t *uc = ((struct cursor *)arg)->uc; + unw_fpreg_t *addr; + + if (!unw_is_fpreg (reg)) + goto badreg; + + if (!(addr = uc_addr (uc, reg))) + goto badreg; + + if (write) + { + Debug (12, "%s <- %08lx.%08lx.%08lx\n", unw_regname (reg), + ((long *)val)[0], ((long *)val)[1], ((long *)val)[2]); + *(unw_fpreg_t *) addr = *val; + } + else + { + *val = *(unw_fpreg_t *) addr; + Debug (12, "%s -> %08lx.%08lx.%08lx\n", unw_regname (reg), + ((long *)val)[0], ((long *)val)[1], ((long *)val)[2]); + } + return 0; + + badreg: + Debug (1, "bad register number %u\n", reg); + /* attempt to access a non-preserved register */ + return -UNW_EBADREG; +} + +static int +get_static_proc_name (unw_addr_space_t as, unw_word_t ip, + char *buf, size_t buf_len, unw_word_t *offp, + void *arg) +{ + return _Uelf64_get_proc_name (as, getpid (), ip, buf, buf_len, offp); +} + +static unw_word_t empty_ptrauth_mask(unw_addr_space_t addr_space_unused, void *as_arg_unused) +{ + return 0; +} + +static int +get_static_elf_filename (unw_addr_space_t as, unw_word_t ip, char *buf, size_t buf_len, unw_word_t *offp, void *arg) +{ + return _Uelf64_get_elf_filename(as, getpid(), ip, buf, buf_len, offp); +} + +HIDDEN void +aarch64_local_addr_space_init (void) +{ + memset (&local_addr_space, 0, sizeof (local_addr_space)); +#ifndef UNW_REMOTE_ONLY +# if defined(HAVE_DL_ITERATE_PHDR) + local_addr_space.iterate_phdr_function = dl_iterate_phdr; +# endif +#endif + local_addr_space.caching_policy = UNWI_DEFAULT_CACHING_POLICY; + local_addr_space.acc.find_proc_info = dwarf_find_proc_info; + local_addr_space.acc.put_unwind_info = put_unwind_info; + local_addr_space.acc.get_dyn_info_list_addr = get_dyn_info_list_addr; + local_addr_space.acc.access_mem = access_mem; + local_addr_space.acc.access_reg = access_reg; + local_addr_space.acc.access_fpreg = access_fpreg; + local_addr_space.acc.resume = aarch64_local_resume; + local_addr_space.acc.get_proc_name = get_static_proc_name; + local_addr_space.acc.get_elf_filename = get_static_elf_filename; + local_addr_space.acc.ptrauth_insn_mask = empty_ptrauth_mask; + local_addr_space.big_endian = target_is_big_endian(); + unw_flush_cache (&local_addr_space, 0, 0); +} + +#endif /* !UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/src/aarch64/Ginit_local.c b/vendor/libunwind/src/aarch64/Ginit_local.c new file mode 100644 index 0000000000..5bd6c8ae81 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Ginit_local.c @@ -0,0 +1,80 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2011-2013 Linaro Limited + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" +#include "init.h" + +#ifdef UNW_REMOTE_ONLY + +int +unw_init_local (unw_cursor_t *cursor, unw_context_t *uc) +{ + return -UNW_EINVAL; +} + +#else /* !UNW_REMOTE_ONLY */ + +static int +unw_init_local_common (unw_cursor_t *cursor, unw_context_t *uc, unsigned use_prev_instr) +{ + struct cursor *c = (struct cursor *) cursor; + + if (!atomic_load(&tdep_init_done)) + tdep_init (); + + Debug (1, "(cursor=%p)\n", c); + + c->dwarf.as = unw_local_addr_space; + c->dwarf.as_arg = c; + c->uc = uc; + c->validate = 0; + + return common_init (c, use_prev_instr); +} + +int +unw_init_local (unw_cursor_t *cursor, unw_context_t *uc) +{ + return unw_init_local_common(cursor, uc, 1); +} + +int +unw_init_local2 (unw_cursor_t *cursor, unw_context_t *uc, int flag) +{ + if (!flag) + { + return unw_init_local_common(cursor, uc, 1); + } + else if (flag == UNW_INIT_SIGNAL_FRAME) + { + return unw_init_local_common(cursor, uc, 0); + } + else + { + return -UNW_EINVAL; + } +} + +#endif /* !UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/src/aarch64/Ginit_remote.c b/vendor/libunwind/src/aarch64/Ginit_remote.c new file mode 100644 index 0000000000..e300173ca4 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Ginit_remote.c @@ -0,0 +1,54 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "init.h" +#include "unwind_i.h" + +int +unw_init_remote (unw_cursor_t *cursor, unw_addr_space_t as, void *as_arg) +{ +#ifdef UNW_LOCAL_ONLY + return -UNW_EINVAL; +#else /* !UNW_LOCAL_ONLY */ + struct cursor *c = (struct cursor *) cursor; + + if (!atomic_load(&tdep_init_done)) + tdep_init (); + + Debug (1, "(cursor=%p)\n", c); + + c->dwarf.as = as; + if (as == unw_local_addr_space) + { + c->dwarf.as_arg = c; + c->uc = as_arg; + } + else + { + c->dwarf.as_arg = as_arg; + c->uc = 0; + } + return common_init (c, 0); +#endif /* !UNW_LOCAL_ONLY */ +} diff --git a/vendor/libunwind/src/aarch64/Gis_signal_frame.c b/vendor/libunwind/src/aarch64/Gis_signal_frame.c new file mode 100644 index 0000000000..ace0e16614 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Gis_signal_frame.c @@ -0,0 +1,110 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2012 Tommi Rantala + Copyright (C) 2013 Linaro Limited + Copyright 2022-2023 Blackberry Limited. + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +#if defined(__linux__) +/* + * The restorer stub will always have the form: + * + * d2801168 movz x8, #0x8b + * d4000001 svc #0x0 + */ +# define SIGNAL_RETURN 0xd4000001d2801168 +#elif defined(__FreeBSD__) +/* + * The restorer stub will always have the form: + * + * 910003e0 mov x0, sp + * 91014000 add x0, x0, #SF_UC + * d2803428 mov x8, #SYS_sigreturn + * d4000001 svc 0 + */ +# define SIGNAL_RETURN 0x91014000910003e0 +#elif defined(__QNX__) +/* + * The restorer stub will always have the form: + * + * f9400260 ldr x0, [x19] + * d63f0060 blr x3 + * aa1303e0 mov x0, x19 + * 14xxxxxx b SignalReturn@plt + */ +# define SIGNAL_RETURN 0x14000000aa1303e0 +# define HANDLER_CALL 0xd63f0060f9400260 +#endif + +int +unw_is_signal_frame (unw_cursor_t *cursor) +{ +#if defined(__linux__) || defined(__FreeBSD__) || defined(__QNX__) + struct cursor *c = (struct cursor *) cursor; + unw_word_t w0, ip; + unw_addr_space_t as; + unw_accessors_t *a; + void *arg; + int ret; + + as = c->dwarf.as; + a = unw_get_accessors_int (as); + arg = c->dwarf.as_arg; + + ip = c->dwarf.ip; + + ret = (*a->access_mem) (as, ip, &w0, 0, arg); + if (ret < 0) + return ret; + + if ((w0 & SIGNAL_RETURN) != SIGNAL_RETURN) + return 0; +#if defined(__FreeBSD__) + ip += 8; + /* + */ + ret = (*a->access_mem) (as, ip, &w0, 0, arg); + if (ret < 0) + return ret; + if (w0 != 0xd4000001d2803428) + return 0; +#elif defined(__QNX__) + unw_word_t w1 = 0; + ret = (*a->access_mem) (as, ip-sizeof(w1), &w1, 0, arg); + if (ret < 0) + return ret; + + if ((w1 & HANDLER_CALL) != HANDLER_CALL) + { + return 0; + } + +#endif + + return 1; + +#else + return -UNW_ENOINFO; +#endif +} diff --git a/vendor/libunwind/src/aarch64/Gos-freebsd.c b/vendor/libunwind/src/aarch64/Gos-freebsd.c new file mode 100644 index 0000000000..f92fe8ee11 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Gos-freebsd.c @@ -0,0 +1,76 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2023 Dmitry Chagin + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include + +#include +#include +#include + +#include + +#include "unwind_i.h" +#include "ucontext_i.h" + +#ifndef UNW_REMOTE_ONLY + +#define setcontext UNW_ARCH_OBJ(setcontext) +extern NORETURN void setcontext(ucontext_t *); + +HIDDEN int +aarch64_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg) +{ + struct cursor *c = (struct cursor *) cursor; + + /* + * XXX. Due to incorrectly handled cfi_signal_frame directive + * (it should mark current function, not a frame above) + * temporarily use unw_is_signal_frame to detect signal trampoline. + */ + if (unw_is_signal_frame (cursor)) + { + ucontext_t *uc = (ucontext_t *)(c->sigcontext_sp + offsetof(struct sigframe, sf_uc)); + + if (c->dwarf.eh_valid_mask & 0x1) + uc->uc_mcontext.mc_gpregs.gp_x[0] = c->dwarf.eh_args[0]; + if (c->dwarf.eh_valid_mask & 0x2) + uc->uc_mcontext.mc_gpregs.gp_x[1] = c->dwarf.eh_args[1]; + if (c->dwarf.eh_valid_mask & 0x4) + uc->uc_mcontext.mc_gpregs.gp_x[2] = c->dwarf.eh_args[2]; + + Debug (8, "resuming at ip=%llx via sigreturn(%p)\n", + (unsigned long long) c->sigcontext_pc, uc); + sigreturn(uc); + abort(); + } + else + { + setcontext(c->uc); + } + + unreachable(); + return -UNW_EINVAL; +} + +#endif /* !UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/src/aarch64/Gos-linux.c b/vendor/libunwind/src/aarch64/Gos-linux.c new file mode 100644 index 0000000000..1e49496238 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Gos-linux.c @@ -0,0 +1,156 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2011-2013 Linaro Limited + Copyright (C) 2012 Tommi Rantala + Copyright 2024 Stephen M. Webb + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +#ifndef UNW_REMOTE_ONLY + +/* Magic constants generated from gen-offsets.c */ +#define SC_R0_OFF "8" +#define SC_R2_OFF "24" +#define SC_R18_OFF "152" +#define SC_R20_OFF "168" +#define SC_R22_OFF "184" +#define SC_R24_OFF "200" +#define SC_R26_OFF "216" +#define SC_R28_OFF "232" +#define SC_R30_OFF "248" + +#define FP_R08_OFF "80" +#define FP_R09_OFF "88" +#define FP_R10_OFF "96" +#define FP_R11_OFF "104" +#define FP_R12_OFF "112" +#define FP_R13_OFF "120" +#define FP_R14_OFF "128" +#define FP_R15_OFF "136" + +#define SC_SP_OFF "0x100" + +HIDDEN int +aarch64_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg) +{ + struct cursor *c = (struct cursor *) cursor; + unw_context_t *uc = c->uc; + + if (c->sigcontext_format == AARCH64_SCF_NONE) + { + + /* + * This is effectively the old POSIX setcontext(). + * + * This inline asm is broken up to use local scratch registers for the + * uc_mcontext.regs and FPCTX base addresses because newer versions of GCC + * and clang barf on too many constraints (gh-702) when the C array + * elements are used directly. + * + * Clobbers aren't required for the inline asm because they just convince + * the compiler to save those registers and they never get restored + * becauise the asm ends with a plain ol' ret. + */ + register void* uc_mcontext __asm__ ("x5") = (void*) &uc->uc_mcontext; + register void* fpctx __asm__ ("x4") = (void*) GET_FPCTX(uc); + + /* Since there are no signals involved here we restore EH and non scratch + registers only. */ + __asm__ __volatile__ ( + "ldp x0, x1, [x5, " SC_R0_OFF "]\n\t" + "ldp x2, x3, [x5, " SC_R2_OFF "]\n\t" + "ldp x18, x19, [x5, " SC_R18_OFF "]\n\t" + "ldp x20, x21, [x5, " SC_R20_OFF "]\n\t" + "ldp x22, x23, [x5, " SC_R22_OFF "]\n\t" + "ldp x24, x25, [x5, " SC_R24_OFF "]\n\t" + "ldp x26, x27, [x5, " SC_R26_OFF "]\n\t" + "ldp x28, x29, [x5, " SC_R28_OFF "]\n\t" + "ldr x30, [x5, " SC_R30_OFF "]\n\t" + "ldr d8, [x4, " FP_R08_OFF "]\n\t" + "ldr d9, [x4, " FP_R09_OFF "]\n\t" + "ldr d10, [x4, " FP_R10_OFF "]\n\t" + "ldr d11, [x4, " FP_R11_OFF "]\n\t" + "ldr d12, [x4, " FP_R12_OFF "]\n\t" + "ldr d13, [x4, " FP_R13_OFF "]\n\t" + "ldr d14, [x4, " FP_R14_OFF "]\n\t" + "ldr d15, [x4, " FP_R15_OFF "]\n\t" + "ldr x5, [x5, " SC_SP_OFF "]\n\t" + "mov sp, x5\n\t" + "ret\n" + : + : [uc_mcontext] "r"(uc_mcontext), + [fpctx] "r"(fpctx) + ); + } + else + { + struct sigcontext *sc = (struct sigcontext *) c->sigcontext_addr; + + if (c->dwarf.eh_valid_mask & 0x1) sc->regs[0] = c->dwarf.eh_args[0]; + if (c->dwarf.eh_valid_mask & 0x2) sc->regs[1] = c->dwarf.eh_args[1]; + if (c->dwarf.eh_valid_mask & 0x4) sc->regs[2] = c->dwarf.eh_args[2]; + if (c->dwarf.eh_valid_mask & 0x8) sc->regs[3] = c->dwarf.eh_args[3]; + + sc->regs[4] = uc->uc_mcontext.regs[4]; + sc->regs[5] = uc->uc_mcontext.regs[5]; + sc->regs[6] = uc->uc_mcontext.regs[6]; + sc->regs[7] = uc->uc_mcontext.regs[7]; + sc->regs[8] = uc->uc_mcontext.regs[8]; + sc->regs[9] = uc->uc_mcontext.regs[9]; + sc->regs[10] = uc->uc_mcontext.regs[10]; + sc->regs[11] = uc->uc_mcontext.regs[11]; + sc->regs[12] = uc->uc_mcontext.regs[12]; + sc->regs[13] = uc->uc_mcontext.regs[13]; + sc->regs[14] = uc->uc_mcontext.regs[14]; + sc->regs[15] = uc->uc_mcontext.regs[15]; + sc->regs[16] = uc->uc_mcontext.regs[16]; + sc->regs[17] = uc->uc_mcontext.regs[17]; + sc->regs[18] = uc->uc_mcontext.regs[18]; + sc->regs[19] = uc->uc_mcontext.regs[19]; + sc->regs[20] = uc->uc_mcontext.regs[20]; + sc->regs[21] = uc->uc_mcontext.regs[21]; + sc->regs[22] = uc->uc_mcontext.regs[22]; + sc->regs[23] = uc->uc_mcontext.regs[23]; + sc->regs[24] = uc->uc_mcontext.regs[24]; + sc->regs[25] = uc->uc_mcontext.regs[25]; + sc->regs[26] = uc->uc_mcontext.regs[26]; + sc->regs[27] = uc->uc_mcontext.regs[27]; + sc->regs[28] = uc->uc_mcontext.regs[28]; + sc->regs[29] = uc->uc_mcontext.regs[29]; + sc->regs[30] = uc->uc_mcontext.regs[30]; + sc->sp = uc->uc_mcontext.sp; + sc->pc = uc->uc_mcontext.pc; + sc->pstate = uc->uc_mcontext.pstate; + + __asm__ __volatile__ ( + "mov sp, %0\n" + "ret %1\n" + : : "r" (c->sigcontext_sp), "r" (c->sigcontext_pc) + ); + } + unreachable(); + return -UNW_EINVAL; +} + +#endif /* !UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/src/aarch64/Gos-qnx.c b/vendor/libunwind/src/aarch64/Gos-qnx.c new file mode 100644 index 0000000000..756d346bed --- /dev/null +++ b/vendor/libunwind/src/aarch64/Gos-qnx.c @@ -0,0 +1,35 @@ +/* libunwind - a platform-independent unwind library + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +#ifndef UNW_REMOTE_ONLY + +HIDDEN int +aarch64_local_resume (unw_addr_space_t as UNUSED, unw_cursor_t *cursor UNUSED, + void *arg UNUSED) +{ + return -UNW_EINVAL; +} + +#endif /* !UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/src/aarch64/Greg_states_iterate.c b/vendor/libunwind/src/aarch64/Greg_states_iterate.c new file mode 100644 index 0000000000..a17dc1b561 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Greg_states_iterate.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +int +unw_reg_states_iterate (unw_cursor_t *cursor, + unw_reg_states_callback cb, void *token) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_reg_states_iterate (&c->dwarf, cb, token); +} diff --git a/vendor/libunwind/src/aarch64/Gregs.c b/vendor/libunwind/src/aarch64/Gregs.c new file mode 100644 index 0000000000..68faafec15 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Gregs.c @@ -0,0 +1,164 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2012 Tommi Rantala + Copyright (C) 2013 Linaro Limited + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "dwarf_i.h" +#include "unwind_i.h" + +HIDDEN int +tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, + int write) +{ + dwarf_loc_t loc = DWARF_NULL_LOC; + unsigned int mask; + + switch (reg) + { + case UNW_AARCH64_X0: + case UNW_AARCH64_X1: + case UNW_AARCH64_X2: + case UNW_AARCH64_X3: + mask = 1 << reg; + if (write) + { + c->dwarf.eh_args[reg] = *valp; + c->dwarf.eh_valid_mask |= mask; + return 0; + } + else if ((c->dwarf.eh_valid_mask & mask) != 0) + { + *valp = c->dwarf.eh_args[reg]; + return 0; + } + else + loc = c->dwarf.loc[reg]; + break; + + case UNW_AARCH64_X30: + if (write) + c->dwarf.ip = *valp; /* update the IP cache */ + case UNW_AARCH64_X4: + case UNW_AARCH64_X5: + case UNW_AARCH64_X6: + case UNW_AARCH64_X7: + case UNW_AARCH64_X8: + case UNW_AARCH64_X9: + case UNW_AARCH64_X10: + case UNW_AARCH64_X11: + case UNW_AARCH64_X12: + case UNW_AARCH64_X13: + case UNW_AARCH64_X14: + case UNW_AARCH64_X15: + case UNW_AARCH64_X16: + case UNW_AARCH64_X17: + case UNW_AARCH64_X18: + case UNW_AARCH64_X19: + case UNW_AARCH64_X20: + case UNW_AARCH64_X21: + case UNW_AARCH64_X22: + case UNW_AARCH64_X23: + case UNW_AARCH64_X24: + case UNW_AARCH64_X25: + case UNW_AARCH64_X26: + case UNW_AARCH64_X27: + case UNW_AARCH64_X28: + case UNW_AARCH64_X29: + case UNW_AARCH64_PC: + case UNW_AARCH64_PSTATE: + loc = c->dwarf.loc[reg]; + break; + case UNW_AARCH64_RA_SIGN_STATE: + Debug (1, "Reading from ra sign state not supported: %u\n", reg); + return -UNW_EBADREG; + + case UNW_AARCH64_VG: + if (write) + { + Debug (1, "Writing to VG pseudo register not supported\n"); + return -UNW_EBADREG; + } + + if (DWARF_IS_REG_LOC(c->dwarf.loc[reg])) + loc = c->dwarf.loc[reg]; + else + { + unw_addr_space_t as = c->dwarf.as; + unw_accessors_t *a = unw_get_accessors_int (as); + void *arg = c->dwarf.as_arg; + unw_word_t addr = DWARF_GET_LOC (c->dwarf.loc[reg]); + uint16_t val16; + + /* + * If it's a memory location it means it must be in the signal context + * and it's saved as VL rather than VG so it needs to be scaled. + * + * linux/Documentation/arm64/sve.rst: + * * Vector length (VL) = size of a Z-register in bytes + * + * https://github.com/ARM-software/abi-aa/blob/main/aadwarf64/aadwarf64.rst: + * * Vector granule (VG) = Size in bits of the SVE vector registers + * in the current call frame divided by 64. + */ + int ret = dwarf_readu16 (as, a, &addr, &val16, arg); + if (!ret) + *valp = (val16 * 8) / 64; + return ret; + } + break; + + case UNW_AARCH64_SP: + if (write) + return -UNW_EREADONLYREG; + *valp = c->dwarf.cfa; + return 0; + + default: + Debug (1, "bad register number %u\n", reg); + return -UNW_EBADREG; + } + + if (write) + return dwarf_put (&c->dwarf, loc, *valp); + else + { + int ret = dwarf_get (&c->dwarf, loc, valp); + if (reg == UNW_AARCH64_X30) + { + *valp = tdep_strip_ptrauth_insn_mask((unw_cursor_t*)c, *valp); + } + return ret; + } +} + +HIDDEN int +tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, unw_fpreg_t *valp, + int write) +{ + dwarf_loc_t loc = c->dwarf.loc[reg]; + if (write) + return dwarf_putfp (&c->dwarf, loc, *valp); + else + return dwarf_getfp (&c->dwarf, loc, valp); +} diff --git a/vendor/libunwind/src/aarch64/Gresume.c b/vendor/libunwind/src/aarch64/Gresume.c new file mode 100644 index 0000000000..bad2f60c73 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Gresume.c @@ -0,0 +1,75 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2011-2013 Linaro Limited + Copyright (C) 2012 Tommi Rantala + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +static inline void +establish_machine_state (struct cursor *c) +{ + unw_addr_space_t as = c->dwarf.as; + void *arg = c->dwarf.as_arg; + unw_fpreg_t fpval; + unw_word_t val; + int reg; + + Debug (8, "copying out cursor state\n"); + + for (reg = 0; reg <= UNW_AARCH64_RA_SIGN_STATE; ++reg) + { + Debug (16, "copying %s %d\n", unw_regname (reg), reg); + if (tdep_access_reg (c, reg, &val, 0) >= 0) + as->acc.access_reg (as, reg, &val, 1, arg); + } + for (reg = UNW_AARCH64_V0; reg <= UNW_AARCH64_V31; ++reg) + { + Debug (16, "copying %s %d\n", unw_regname (reg), reg); + if (tdep_access_fpreg (c, reg, &fpval, 0) >= 0) + as->acc.access_fpreg (as, reg, &fpval, 1, arg); + } +} + +int +unw_resume (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + + Debug (1, "(cursor=%p)\n", c); + + if (!c->dwarf.ip) + { + /* This can happen easily when the frame-chain gets truncated + due to bad or missing unwind-info. */ + Debug (1, "refusing to resume execution at address 0\n"); + return -UNW_EINVAL; + } + +Debug(1, "==smw> before establish_machine_state\n"); + establish_machine_state (c); + +Debug(1, "==smw> before acc.resume\n"); + return (*c->dwarf.as->acc.resume) (c->dwarf.as, (unw_cursor_t *) c, + c->dwarf.as_arg); +} diff --git a/vendor/libunwind/src/aarch64/Gstash_frame.c b/vendor/libunwind/src/aarch64/Gstash_frame.c new file mode 100644 index 0000000000..c6f370a442 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Gstash_frame.c @@ -0,0 +1,98 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2010, 2011 by FERMI NATIONAL ACCELERATOR LABORATORY + Copyright (C) 2014 CERN and Aalto University + Contributed by Filip Nyback + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +HIDDEN void +tdep_stash_frame (struct dwarf_cursor *d, struct dwarf_reg_state *rs) +{ + struct cursor *c = (struct cursor *) dwarf_to_cursor (d); + unw_tdep_frame_t *f = &c->frame_info; + + Debug (4, "ip=0x%lx cfa=0x%lx type %d cfa [where=%d val=%ld] cfaoff=%ld" + " ra=0x%lx fp [where=%d val=%ld @0x%lx] lr [where=%d val=%ld @0x%lx] " + "sp [where=%d val=%ld @0x%lx]\n", + d->ip, d->cfa, f->frame_type, + rs->reg.where[DWARF_CFA_REG_COLUMN], + rs->reg.val[DWARF_CFA_REG_COLUMN], + rs->reg.val[DWARF_CFA_OFF_COLUMN], + DWARF_GET_LOC(d->loc[rs->ret_addr_column]), + rs->reg.where[FP], rs->reg.val[FP], DWARF_GET_LOC(d->loc[FP]), + rs->reg.where[LR], rs->reg.val[LR], DWARF_GET_LOC(d->loc[LR]), + rs->reg.where[SP], rs->reg.val[SP], DWARF_GET_LOC(d->loc[SP])); + + /* A standard frame is defined as: + - CFA is register-relative offset off FP or SP; + - Return address is saved in LR; + - FP is unsaved or saved at CFA+offset, offset != -1; + - LR is unsaved or saved at CFA+offset, offset != -1; + - SP is unsaved or saved at CFA+offset, offset != -1. */ + if (f->frame_type == UNW_AARCH64_FRAME_OTHER + && (rs->reg.where[DWARF_CFA_REG_COLUMN] == DWARF_WHERE_REG) + && (rs->reg.val[DWARF_CFA_REG_COLUMN] == FP + || rs->reg.val[DWARF_CFA_REG_COLUMN] == SP) + && labs(rs->reg.val[DWARF_CFA_OFF_COLUMN]) < (1 << 29) + && rs->ret_addr_column == LR + && (rs->reg.where[FP] == DWARF_WHERE_UNDEF + || rs->reg.where[FP] == DWARF_WHERE_SAME + || rs->reg.where[FP] == DWARF_WHERE_CFA + || (rs->reg.where[FP] == DWARF_WHERE_CFAREL + && labs(rs->reg.val[FP]) < (1 << 29) + && rs->reg.val[FP]+1 != 0)) + && (rs->reg.where[LR] == DWARF_WHERE_UNDEF + || rs->reg.where[LR] == DWARF_WHERE_SAME + || rs->reg.where[LR] == DWARF_WHERE_CFA + || (rs->reg.where[LR] == DWARF_WHERE_CFAREL + && labs(rs->reg.val[LR]) < (1 << 29) + && rs->reg.val[LR]+1 != 0)) + && (rs->reg.where[SP] == DWARF_WHERE_UNDEF + || rs->reg.where[SP] == DWARF_WHERE_SAME + || rs->reg.where[SP] == DWARF_WHERE_CFA + || (rs->reg.where[SP] == DWARF_WHERE_CFAREL + && labs(rs->reg.val[SP]) < (1 << 29) + && rs->reg.val[SP]+1 != 0))) + { + /* Save information for a standard frame. */ + f->frame_type = UNW_AARCH64_FRAME_STANDARD; + f->cfa_reg_sp = (rs->reg.val[DWARF_CFA_REG_COLUMN] == SP); + f->cfa_reg_offset = rs->reg.val[DWARF_CFA_OFF_COLUMN]; + if (rs->reg.where[FP] == DWARF_WHERE_CFAREL) + f->fp_cfa_offset = rs->reg.val[FP]; + if (rs->reg.where[LR] == DWARF_WHERE_CFAREL) + f->lr_cfa_offset = rs->reg.val[LR]; + if (rs->reg.where[SP] == DWARF_WHERE_CFAREL) + f->sp_cfa_offset = rs->reg.val[SP]; + if (rs->reg.where[FP] == DWARF_WHERE_CFA) + f->fp_cfa_offset = 0; + if (rs->reg.where[LR] == DWARF_WHERE_CFA) + f->lr_cfa_offset = 0; + if (rs->reg.where[SP] == DWARF_WHERE_CFA) + f->sp_cfa_offset = 0; + Debug (4, " standard frame\n"); + } + else + Debug (4, " unusual frame\n"); +} diff --git a/vendor/libunwind/src/aarch64/Gstep.c b/vendor/libunwind/src/aarch64/Gstep.c new file mode 100644 index 0000000000..6725b1ed3e --- /dev/null +++ b/vendor/libunwind/src/aarch64/Gstep.c @@ -0,0 +1,799 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2011-2013 Linaro Limited + Copyright (C) 2012 Tommi Rantala + Copyright 2022,2024 Blackberry Limited. + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "dwarf_i.h" +#include "ucontext_i.h" +#include "unwind_i.h" + +static const int WSIZE = sizeof (unw_word_t); + +/* Recognise PLT entries such as: + 40ddf0: b0000570 adrp x16, 4ba000 <_GLOBAL_OFFSET_TABLE_+0x2a8> + 40ddf4: f9433611 ldr x17, [x16,#1640] + 40ddf8: 9119a210 add x16, x16, #0x668 + 40ddfc: d61f0220 br x17 + + \note The current implementation only supports little endian modes. +*/ +static int +_is_plt_entry (struct dwarf_cursor *c) +{ + unw_word_t w0 = 0, w1 = 0; + unw_accessors_t *a; + + if (c->as->big_endian) + { + return 0; + } + + /* + A PLT (Procedure Linkage Table) is used by the dynamic linker to map the + relative address of a position independent function call onto the real + address of the function. If we attempt to unwind from any instruction + inside the PLT, and the PLT is missing DWARF unwind information, then + conventional unwinding will fail because although the function has been + "called" we have not yet entered the prologue and set-up the stack frame. + + This code looks to see if the instruction is anywhere within a "recognised" + PLT entry (note that the IP could be anywhere within the PLT, so we have to + examine nearby instructions). + */ + + struct instruction_entry + { + uint32_t pattern; + uint32_t mask; + } instructions[4] = + { + // aarch64 + {0x90000010,0x9f00001f}, // adrp + {0xf9400211,0xffc003ff}, // ldr + {0x91000210,0xff8003ff}, // add + {0xd61f0220,0xffffffff}, // br + }; + + a = unw_get_accessors (c->as); + if ((*a->access_mem) (c->as, c->ip, &w0, 0, c->as_arg) < 0) + { + return 0; + } + + /* + NB: the following code is endian sensitive! + + The current implementation is for little-endian modes, big-endian modes + will see the first instruction in the high bits of w0, and the second + instruction in the low bits of w0. Some tweaks will be needed to read from + the correct part of the word to support big endian modes. + */ + if ((w0 & instructions[0].mask) == instructions[0].pattern && + ((w0>>32) & instructions[1].mask) == instructions[1].pattern) + { + if ((*a->access_mem) (c->as, c->ip+8, &w1, 0, c->as_arg) >= 0 && + (w1 & instructions[2].mask) == instructions[2].pattern && + ((w1>>32) & instructions[3].mask) == instructions[3].pattern) + { + return 1; + } + else + { + return 0; + } + } + else if ((w0 & instructions[2].mask) == instructions[2].pattern && + ((w0>>32) & instructions[3].mask) == instructions[3].pattern) + { + w1 = w0; + if ((*a->access_mem) (c->as, c->ip-8, &w0, 0, c->as_arg) >= 0 && + (w0 & instructions[0].mask) == instructions[0].pattern && + ((w0>>32) & instructions[1].mask) == instructions[1].pattern) + { + return 1; + } + else + { + return 0; + } + } + else if ((w0 & instructions[1].mask) == instructions[1].pattern && + ((w0>>32) & instructions[2].mask) == instructions[2].pattern) + { + if ((*a->access_mem) (c->as, c->ip-4, &w0, 0, c->as_arg) < 0 || + (*a->access_mem) (c->as, c->ip+4, &w1, 0, c->as_arg) < 0) + { + return 0; + } + } + else if ((w0 & instructions[3].mask) == instructions[3].pattern) + { + if ((*a->access_mem) (c->as, c->ip-12, &w0, 0, c->as_arg) < 0 || + (*a->access_mem) (c->as, c->ip-4, &w1, 0, c->as_arg) < 0) + { + return 0; + } + } + + if ((w0 & instructions[0].mask) == instructions[0].pattern && + ((w0>>32) & instructions[1].mask) == instructions[1].pattern && + (w1 & instructions[2].mask) == instructions[2].pattern && + ((w1>>32) & instructions[3].mask) == instructions[3].pattern) + { + return 1; + } + else + { + return 0; + } +} + +int +unw_is_plt_entry (unw_cursor_t *uc) +{ + return _is_plt_entry (&((struct cursor *)uc)->dwarf); +} + +typedef enum frame_record_location + { + NONE, /* frame record creation has not been detected, use LR */ + AT_SP_OFFSET, /* frame record creation has been detected, but FP + update not detected */ + AT_FP, /* frame record creation and FP update detected */ + } frame_record_location_t; + +typedef struct frame_state + { + frame_record_location_t loc; + int32_t offset; + } frame_state_t; + +/* Recognise when a frame record storing FP+LR has been created and whether FP + has been updated to point to the frame record. For example: + 4183d4: a9bd7bfd stp x29, x30, [sp,#-48]! <= FP+LR stored + 4183d8: d2800005 mov x5, #0x0 + 4183dc: d2800004 mov x4, #0x0 + 4183e0: 910003fd mov x29, sp <= FP updated + 4183e4: a90153f3 stp x19, x20, [sp,#16] + ... + 418444: a94153f3 ldp x19, x20, [sp,#16] + 418448: f94013f5 ldr x21, [sp,#32] + 41844c: a8c37bfd ldp x29, x30, [sp],#48 <= FP+LR retrieved + 418450: d65f03c0 ret +*/ +static frame_state_t +get_frame_state (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + unw_accessors_t *a = unw_get_accessors (c->dwarf.as); + unw_word_t w, start_ip, ip, offp; + frame_state_t fs; + fs.loc = NONE; + fs.offset = 0; + + /* PLT entries do not create frame records */ + if (_is_plt_entry (&c->dwarf)) + return fs; + + /* Use get_proc_name to find start_ip of procedure */ + char name[128]; + if (((*a->get_proc_name) (c->dwarf.as, c->dwarf.ip, name, sizeof(name), &offp, c->dwarf.as_arg)) != 0) + return fs; + + start_ip = c->dwarf.ip - offp; + + /* Check for frame record instructions since the start of the procedure (start_ip). + * access_mem reads WSIZE bytes, so two instructions are checked in each iteration + */ + for (ip = start_ip; ip < c->dwarf.ip; ip += WSIZE) + { + if ((*a->access_mem) (c->dwarf.as, ip, &w, 0, c->dwarf.as_arg) < 0) + return fs; + + if (fs.loc == NONE) + { + /* Check that a 64-bit store pair (STP) instruction storing FP and LR + has been executed, which would indicate that a frame record has been + created and that the LR value is saved therein. + + From the ARM Architecture Reference Manual (ARMv8), the format of the + 64-bit STP instruction is + + | 10 | 101 | 0 | 0XX | 0 | imm7 | Rt2 | Rn | Rt | + + where X can be 0/1 above to indicate the instruction variant (post- + index, pre-index or signed offset). imm7 is a 7-bit signed immediate + offset. The following should be asserted for this check + + Rt2 == LR (x30) => 0b11110 + Rn == SP (x31) => 0b11111 + Rt == FP (x29) => 0b11101. + + Hence the bitmask should be constructed to assert that the instruction + is + + | 10 | 101 | 0 | 0XX | 0 | XXXXXXX | 11110 | 11111 | 11101 | + + So using a bitmask of 0xfe407fff, the masked instruction would be + 0xa8007bfd */ + if ((((w & 0xfe407fff00000000) == 0xa8007bfd00000000) && (c->dwarf.ip > ip + 4)) + || (((w & 0x00000000fe407fff) == 0x00000000a8007bfd) && (c->dwarf.ip > ip))) + { + fs.loc = AT_SP_OFFSET; + + /* If the signed offset variant of the STP instruction is detected, + the frame record may not be currently pointed to by SP. Extract + the offset from the STP instruction. + + From the ARM Architecture Reference Manual (ARMv8), the format of + the signed offset variant of the 64-bit STP instruction is + + | 10 | 101 | 0 | 010 | 0 | imm7 | Rt2 | Rn | Rt | + + Hence the bitmask should be constructed to assert that the + instruction is + + | 10 | 101 | 0 | 010 | 0 | XXXXXXX | 11110 | 11111 | 11101 | + + So using a bitmask of 0xffc07fff, the masked instruction would + be 0xa9007bdf. The offset value is (imm7 * 8) */ + if (((w & 0xffc07fff00000000) == 0xa9007bfd00000000) && (c->dwarf.ip > ip + 4)) + { + int32_t abs_offset = (w & 0x001f800000000000) >> 47; + fs.offset = ((w & 0x0020000000000000)? -abs_offset : abs_offset) * 8; + } + else if (((w & 0x00000000ffc07fff) == 0x00000000a9007bfd) && (c->dwarf.ip > ip)) + { + int32_t abs_offset = (w & 0x00000000001f8000) >> 15; + fs.offset = ((w & 0x0000000000200000)? -abs_offset : abs_offset) * 8; + } + else + fs.offset = 0; + + Debug (4, "ip=0x%lx => frame record stored at SP+0x%x\n", ip, fs.offset); + } + } + + if (fs.loc == AT_SP_OFFSET) + { + /* If the STP instruction has been executed, but not the instruction + to update FP, then the SP (with offset) should be used to find the + frame record, otherwise the FP should be used as there are no + guarantees that the SP is pointing to the frame record after the FP + has been updated. + + Two methods for updating the FP have been seen in practice. The + first is a MOV instruction. From the ARM Architecture Reference + Manual (ARMv8), the 64-bit MOV (to/from SP) instruction to update + FP (x29) is 0x910003fd. + + The second is an ADD instruction taking SP and FP as the source and + destination registers, respectively. From the ARM Architecture + Reference Manual (ARMv8), the 64-bit ADD (immediate) instruction is + + | 1 | 0 | 0 | 10001 | shift | imm12 | Rn | Rd | + + where the values of shift and imm12 are irrelevant for this check. + The following should be asserted + + Rn == SP (x31) => 0b11111 + Rd == FP (x29) => 0b11101. + + Hence the bitmask should be constructed to assert that the instruction + is + + | 1 | 0 | 0 | 10001 | XX | XXXXXXXXXXXX | 11111 | 11101 | + + So using a bitmask of 0xff0003ff, the masked instruction would be + 0x910003fd. + + Since the MOV instruction is an alias for ADD, it is sufficient to + only check for the latter case. */ + if ((((w & 0xff0003ff00000000) == 0x910003fd00000000) && (c->dwarf.ip > ip + 4)) + || (((w & 0x00000000ff0003ff) == 0x00000000910003fd) && (c->dwarf.ip > ip))) + { + fs.loc = AT_FP; + fs.offset = 0; + + Debug (4, "ip=0x%lx => frame record stored at FP\n", ip); + } + } + else if (fs.loc == AT_FP) + { + /* Check that a 64-bit load pair (LDP) instruction to restore FP and LR has been + executed, which would indicate that a branch or return instruction is about to + be executed and that FP is pointing to the caller's frame record instead. The + LR should be examined for the return address. In this case, the RA must have + already been authenticated. + + From the ARM Architecture Reference Manual (ARMv8), the format of the 64-bit + LDP instruction is + + | 10 | 101 | 0 | 0XX | 1 | imm7 | Rt2 | Rn | Rt | + + where X can be 0/1 above to indicate the instruction variant (post-index, pre- + index or signed offset). imm7 is a 7-bit signed immediate offset, which is + irrelevant for this check. However, the following should be asserted + + Rt2 == LR (x30) => 0b11110 + Rn == SP (x31) => 0b11111 + Rt == FP (x29) => 0b11101. + + Hence the bitmask should be constructed to assert that the instruction is + + | 10 | 101 | 0 | 0XX | 1 | XXXXXXX | 11110 | 11111 | 11101 | + + So using a bitmask of 0xfe407fff, the masked instruction would be 0xa8407bfd */ + if ((((w & 0xfe407fff00000000) == 0xa8407bfd00000000) && (c->dwarf.ip > ip + 4)) + || (((w & 0x00000000fe407fff) == 0x00000000a8407bfd) && (c->dwarf.ip > ip))) + { + fs.loc = NONE; + fs.offset = 0; + + Debug (4, "ip=0x%lx => frame record has been loaded, use LR\n", ip); + } + } + } + + Debug (3, "[start_ip = 0x%lx, ip=0x%lx) => loc = %d, offset = %d\n", + start_ip, c->dwarf.ip, fs.loc, fs.offset); + + return fs; +} + +#if defined __QNX__ +/* + * QNX kernel call have neither CFI nor save frame pointer, + * 00000000000549e8 : + * 549e8: cb0203e2 neg x2, x2 + * 549ec: 52800168 mov w8, #0xb // #11 + * 549f0: d4000a21 svc #0x51 + * 549f4: d65f03c0 ret + * 549f8: cb0003e0 neg x0, x0 + * 549fc: d65f03c0 ret + * + * From disassemble, QNX kernel call have mov followed by svc, and may with some + * neg instructions at beginning. + * 1. find procedure's ip start,end start + * 2. search mov,svc from begin, skip any neg instructions + */ +static bool is_neg_instr(uint32_t instr) +{ + /* 64bit register Xd */ + return ((instr & 0xffe003e0) == 0xcb0003e0); +} + +/* QNX use w8 to pass kernel call number */ +static bool is_mov_w8_instr(uint32_t instr) +{ + /* movz 32bit register Wd */ + return ((instr & 0xffe00008) == 0x52800008); +} + +static bool is_svc_instr(uint32_t instr) +{ + return instr == 0xd4000a21; +} + +static bool +is_qnx_kercall(struct dwarf_cursor *c) +{ + unw_word_t w0; + unw_accessors_t *a; + int ret; + unw_word_t proc_start_ip; + unw_word_t proc_end_ip; + + a = unw_get_accessors_int (c->as); + if (c->as->big_endian || !a->get_proc_ip_range) + { + return false; + } + + ret = (*a->get_proc_ip_range) (c->as, c->ip, &proc_start_ip, &proc_end_ip, c->as_arg); + if (ret < 0) + { + Debug (2, "ip=0x%lx get proc ip range fail, ret = %d\n", c->ip, ret); + return false; + } + + unw_word_t ip = proc_start_ip; + while ((ip < proc_end_ip) && (ip + 8 < proc_end_ip)) + { + if ((*a->access_mem) (c->as, ip, &w0, 0, c->as_arg) < 0) + { + Debug (14, "access_mem ip=0x%lx fail\n", ip); + return false; + } + + uint32_t low32 = w0 & 0xffffffff; + uint32_t high32 = w0 >> 32; + + if (is_mov_w8_instr(low32) && is_svc_instr(high32)) + { + return true; + } + if (is_neg_instr(low32) && is_neg_instr(high32)) + { + ip += 8; + } + else if (is_neg_instr(low32) && is_mov_w8_instr(high32)) + { + ip += 4; + } + else + { + return false; + } + } + + return false; +} +#endif + +/* + * Save the location of VL (vector length) from the signal frame to the VG (vector + * granule) register if it exists, otherwise do nothing. If there is an error, + * the location is also not modified. + */ +#if defined __linux__ +static int +get_sve_vl_signal_loc (struct dwarf_cursor* dwarf, unw_word_t sc_addr) +{ + uint32_t size; + unw_addr_space_t as = dwarf->as; + unw_accessors_t *a = unw_get_accessors_int (as); + void *arg = dwarf->as_arg; + unw_word_t res_addr = sc_addr + LINUX_SC_RESERVED_OFF; + + /* + * Max possible size of reserved section is 4096. Jump by size of each record + * until the SVE signal context section is found. + */ + for(unw_word_t section_off = 0; section_off < 4096; section_off += size) + { + uint32_t magic; + int ret; + unw_word_t item_addr = res_addr + section_off + LINUX_SC_RESERVED_MAGIC_OFF; + if ((ret = dwarf_readu32(as, a, &item_addr, &magic, arg)) < 0) + return ret; + item_addr = res_addr + section_off + LINUX_SC_RESERVED_SIZE_OFF; + if ((ret = dwarf_readu32(as, a, &item_addr, &size, arg)) < 0) + return ret; + + switch(magic) + { + case 0: + /* End marker, size must be 0 */ + return size ? -UNW_EUNSPEC : 1; + + /* Magic number marking the SVE context section */ + case 0x53564501: + /* Must be big enough so that the 16 bit VL value can be accessed */ + if (size < LINUX_SC_RESERVED_SVE_VL_OFF + 2) + return -UNW_EUNSPEC; + dwarf->loc[UNW_AARCH64_VG] = DWARF_MEM_LOC(c->dwarf, res_addr + section_off + + LINUX_SC_RESERVED_SVE_VL_OFF); + return 1; + + default: + /* Don't care about any of the other sections */ + break; + } + } + return 1; +} +#else +static int +get_sve_vl_signal_loc (struct dwarf_cursor* dwarf, unw_word_t sc_addr) +{ + return 1; +} +#endif + +static int +aarch64_handle_signal_frame (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + int i, ret; + unw_word_t sp_addr = c->dwarf.cfa; + unw_word_t sc_addr; + + ret = unw_is_signal_frame (cursor); + if (ret > 0) + { + c->sigcontext_format = SCF_FORMAT; +#if defined(__QNXNTO__) + /* + * The QNX signal trampoline receives a pointer to a _sighandler_info + * struct in r19, which it breaks apart and passes the relevant args to + * the signal handler in r0, r1, and r2 folowing the ARM AAPCS64 + * convention, regardless of whether SA_SIGINFO is specified in sa_flags. + * Since r0-2 are not preserved registers, their value is + * lost by the time the unwinder gets here, but r19 is preserved so it + * should still be valid. If full DWARF unwinding has happened. + */ + unw_word_t x19; + ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_X19], &x19); + if ((ret < 0) || (x19 == 0UL)) + { + return -UNW_EUNSPEC; + } + + ret = dwarf_get (&c->dwarf, + DWARF_MEM_LOC (c->dwarf, x19 + SI_UCONTEXT_OFF), + &sc_addr); + if (ret < 0) + { + return -UNW_EUNSPEC; + } + + sc_addr += UC_MCONTEXT_OFF; +#else + /* + * For non-QNX OSes the mcontext is expected to be on the signal stack, + */ + sc_addr = sp_addr + sizeof (siginfo_t) + UC_MCONTEXT_OFF; +#endif + } + else + return -UNW_EUNSPEC; + + /* Save the SP and PC to be able to return execution at this point + later in time (unw_resume). */ + c->sigcontext_sp = c->dwarf.cfa; + c->sigcontext_pc = c->dwarf.ip; + + c->sigcontext_addr = sc_addr; + c->frame_info.frame_type = UNW_AARCH64_FRAME_SIGRETURN; + c->frame_info.cfa_reg_offset = sc_addr - sp_addr; + + for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) + c->dwarf.loc[i] = DWARF_NULL_LOC; + + /* Update the dwarf cursor. + Set the location of the registers to the corresponding addresses of the + uc_mcontext / sigcontext structure contents. */ + c->dwarf.loc[UNW_AARCH64_X0] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF); + c->dwarf.loc[UNW_AARCH64_X1] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 1); + c->dwarf.loc[UNW_AARCH64_X2] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 2); + c->dwarf.loc[UNW_AARCH64_X3] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 3); + c->dwarf.loc[UNW_AARCH64_X4] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 4); + c->dwarf.loc[UNW_AARCH64_X5] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 5); + c->dwarf.loc[UNW_AARCH64_X6] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 6); + c->dwarf.loc[UNW_AARCH64_X7] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 7); + c->dwarf.loc[UNW_AARCH64_X8] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 8); + c->dwarf.loc[UNW_AARCH64_X9] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 9); + c->dwarf.loc[UNW_AARCH64_X10] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 10); + c->dwarf.loc[UNW_AARCH64_X11] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 11); + c->dwarf.loc[UNW_AARCH64_X12] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 12); + c->dwarf.loc[UNW_AARCH64_X13] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 13); + c->dwarf.loc[UNW_AARCH64_X14] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 14); + c->dwarf.loc[UNW_AARCH64_X15] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 15); + c->dwarf.loc[UNW_AARCH64_X16] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 16); + c->dwarf.loc[UNW_AARCH64_X17] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 17); + c->dwarf.loc[UNW_AARCH64_X18] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 18); + c->dwarf.loc[UNW_AARCH64_X19] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 19); + c->dwarf.loc[UNW_AARCH64_X20] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 20); + c->dwarf.loc[UNW_AARCH64_X21] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 21); + c->dwarf.loc[UNW_AARCH64_X22] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 22); + c->dwarf.loc[UNW_AARCH64_X23] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 23); + c->dwarf.loc[UNW_AARCH64_X24] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 24); + c->dwarf.loc[UNW_AARCH64_X25] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 25); + c->dwarf.loc[UNW_AARCH64_X26] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 26); + c->dwarf.loc[UNW_AARCH64_X27] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 27); + c->dwarf.loc[UNW_AARCH64_X28] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_GPR_OFF + 8 * 28); + c->dwarf.loc[UNW_AARCH64_X29] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_X29_OFF); + c->dwarf.loc[UNW_AARCH64_X30] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_X30_OFF); + c->dwarf.loc[UNW_AARCH64_SP] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_SP_OFF); + c->dwarf.loc[UNW_AARCH64_PC] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_PC_OFF); + c->dwarf.loc[UNW_AARCH64_PSTATE] = DWARF_MEM_LOC (c->dwarf, sc_addr + SC_PSTATE_OFF); + c->dwarf.loc[UNW_AARCH64_VG] = DWARF_NULL_LOC; + + /* Set SP/CFA and PC/IP. */ + dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_SP], &c->dwarf.cfa); + dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_PC], &c->dwarf.ip); + + c->dwarf.pi_valid = 0; + c->dwarf.use_prev_instr = 0; + + return get_sve_vl_signal_loc (&c->dwarf, sc_addr); +} + +int +unw_step (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + int validate = c->validate; + unw_word_t fp = 0; + int ret; + + Debug (1, "(cursor=%p, ip=0x%016lx, cfa=0x%016lx))\n", + c, c->dwarf.ip, c->dwarf.cfa); + + /* Validate all addresses before dereferencing. */ + c->validate = 1; + + /* Check if this is a signal frame. */ + ret = unw_is_signal_frame (cursor); + Debug(1, "unw_is_signal_frame()=%d\n", ret); + if (ret > 0) + return aarch64_handle_signal_frame (cursor); + else if (unlikely (ret < 0)) + { + /* IP points to non-mapped memory. */ + /* This is probably SIGBUS. */ + /* Try to load LR in IP to recover. */ + Debug(1, "Invalid address found in the call stack: 0x%lx\n", c->dwarf.ip); + dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_X30], &c->dwarf.ip); + } + + /* Try DWARF-based unwinding... */ + c->sigcontext_format = AARCH64_SCF_NONE; + ret = dwarf_step (&c->dwarf); + Debug(1, "dwarf_step()=%d\n", ret); + + /* Restore default memory validation state */ + c->validate = validate; + + if (unlikely (ret == -UNW_ESTOPUNWIND)) + return ret; + + if (likely (ret > 0)) + { + ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_X29], &fp); + if (ret == 0 && fp == 0) + { + /* Procedure Call Standard for the ARM 64-bit Architecture (AArch64) + * specifies that the end of the frame record chain is indicated by + * the address zero in the address for the previous frame. + */ + c->dwarf.ip = 0; + Debug (2, "NULL frame pointer X29 loc, returning 0\n"); + return 0; + } + } + + if (unlikely (ret < 0)) + { + /* DWARF failed. */ + + /* + * We could get here because of missing/bad unwind information. + * Validate all addresses before dereferencing. + */ + if (c->dwarf.as == unw_local_addr_space) + { + c->validate = 1; + } + + if (_is_plt_entry (&c->dwarf)) + { + Debug (2, "found plt entry\n"); + c->frame_info.frame_type = UNW_AARCH64_FRAME_STANDARD; + } +#if defined __QNX__ + else if (is_qnx_kercall(&c->dwarf)) + { + Debug (2, "found qnx kernel call, fallback to use link register\n"); + c->frame_info.frame_type = UNW_AARCH64_FRAME_GUESSED; + } +#endif + else + { + /* Try use frame record. */ + c->frame_info.frame_type = UNW_AARCH64_FRAME_GUESSED; + } + + frame_state_t fs = get_frame_state(cursor); + + /* Prefer using frame record. The LR value is stored at an offset of + 8 into the frame record. */ + if (fs.loc != NONE) + { + if (fs.loc == AT_FP) + { + /* X29 points to frame record. */ + ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_X29], &fp); + if (unlikely (ret == 0)) + { + if (fp == 0) + { + /* Procedure Call Standard for the ARM 64-bit Architecture (AArch64) + * specifies that the end of the frame record chain is indicated by + * the address zero in the address for the previous frame. + */ + c->dwarf.ip = 0; + Debug (2, "NULL frame pointer X29 loc, returning 0\n"); + return 0; + } + } + + for (int i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) + c->dwarf.loc[i] = DWARF_NULL_LOC; + + /* Frame record holds X29 and X30 values. */ + c->dwarf.loc[UNW_AARCH64_X29] = DWARF_MEM_LOC (c->dwarf, fp); + c->dwarf.loc[UNW_AARCH64_X30] = DWARF_MEM_LOC (c->dwarf, fp + 8); + } + else + { + /* Frame record stored but not pointed to by X29, use SP. */ + unw_word_t sp; + ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_SP], &sp); + if (ret < 0) + return ret; + + for (int i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) + c->dwarf.loc[i] = DWARF_NULL_LOC; + + c->frame_info.cfa_reg_offset = fs.offset; + c->frame_info.cfa_reg_sp = 1; + + c->dwarf.loc[UNW_AARCH64_X29] = DWARF_MEM_LOC (c->dwarf, sp + fs.offset); + c->dwarf.loc[UNW_AARCH64_X30] = DWARF_MEM_LOC (c->dwarf, sp + fs.offset + 8); + } + + c->dwarf.loc[UNW_AARCH64_PC] = c->dwarf.loc[UNW_AARCH64_X30]; + + /* Set SP/CFA and PC/IP. */ + ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_X29], &c->dwarf.cfa); + if (ret < 0) + return ret; + ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_PC], &c->dwarf.ip); + if (ret == 0) + { + ret = 1; + } + Debug (2, "fallback, CFA = 0x%016lx, IP = 0x%016lx returning %d\n", + c->dwarf.cfa, c->dwarf.ip, ret); + return ret; + } + + /* No frame record, fallback to link register (X30). */ + c->frame_info.cfa_reg_offset = 0; + c->frame_info.cfa_reg_sp = 0; + c->frame_info.fp_cfa_offset = -1; + c->frame_info.lr_cfa_offset = -1; + c->frame_info.sp_cfa_offset = -1; + c->dwarf.loc[UNW_AARCH64_PC] = c->dwarf.loc[UNW_AARCH64_X30]; + c->dwarf.loc[UNW_AARCH64_X30] = DWARF_NULL_LOC; + if (!DWARF_IS_NULL_LOC (c->dwarf.loc[UNW_AARCH64_PC])) + { + ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_PC], &c->dwarf.ip); + if (ret < 0) + { + Debug (2, "failed to get pc from link register: %d\n", ret); + return ret; + } + Debug (2, "link register (x30) = 0x%016lx\n", c->dwarf.ip); + ret = 1; + } + else + c->dwarf.ip = 0; + } + + return (c->dwarf.ip == 0) ? 0 : 1; +} diff --git a/vendor/libunwind/src/aarch64/Gstrip_ptrauth_insn_mask.c b/vendor/libunwind/src/aarch64/Gstrip_ptrauth_insn_mask.c new file mode 100644 index 0000000000..5405a392a8 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Gstrip_ptrauth_insn_mask.c @@ -0,0 +1,81 @@ +/* libunwind - a platform-independent unwind library + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +static unw_word_t aarch64_strip_pac_remote (unw_accessors_t *a, unw_addr_space_t as, void *arg, unw_word_t old_ip) +{ + if (a->ptrauth_insn_mask) + { + unw_word_t ip, insn_mask; + + insn_mask = a->ptrauth_insn_mask (as, arg); + ip = old_ip & (~insn_mask); + + Debug (15, "stripping pac from address, before: %lx, after: %lx\n", old_ip, ip); + return ip; + } + else + { + Debug (15, "return address %lx might be signed, but no means to obtain mask\n", old_ip); + return old_ip; + } +} + +static unw_word_t aarch64_strip_pac_local (unw_word_t in_addr) +{ + unw_word_t out_addr = in_addr; + +#if defined(__aarch64__) && !defined(UNW_REMOTE_ONLY) + // Strip the PAC with XPACLRI instruction + register unsigned long long x30 __asm__("x30") = in_addr; + __asm__("hint 0x7" : "+r" (x30)); + out_addr = x30; +#endif + + return out_addr; +} + +HIDDEN unw_word_t tdep_strip_ptrauth_insn_mask (unw_cursor_t *cursor, unw_word_t ip) +{ + struct cursor *c = (struct cursor *) cursor; + struct dwarf_cursor *d = &c->dwarf; + unw_addr_space_t as = d->as; + void *as_arg = d->as_arg; + unw_accessors_t *a; + unw_word_t stripped; + + if (as != unw_local_addr_space) + { + a = unw_get_accessors_int (as); + stripped = aarch64_strip_pac_remote (a, as, as_arg, ip); + } + else + { + stripped = aarch64_strip_pac_local (ip); + } + + Debug (16, "stripped PAC; oldip=0x%lx ip=0x%lx\n", ip, stripped); + + return stripped; +} diff --git a/vendor/libunwind/src/aarch64/Gtrace.c b/vendor/libunwind/src/aarch64/Gtrace.c new file mode 100644 index 0000000000..59d46f247d --- /dev/null +++ b/vendor/libunwind/src/aarch64/Gtrace.c @@ -0,0 +1,583 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2010, 2011 by FERMI NATIONAL ACCELERATOR LABORATORY + Copyright (C) 2014 CERN and Aalto University + Contributed by Filip Nyback + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" +#include "ucontext_i.h" +#include +#include + +#pragma weak pthread_once +#pragma weak pthread_key_create +#pragma weak pthread_getspecific +#pragma weak pthread_setspecific + +/* Initial hash table size. Table expands by 2 bits (times four). */ +#define HASH_MIN_BITS 14 + +typedef struct +{ + unw_tdep_frame_t *frames; + size_t log_size; + size_t used; + size_t dtor_count; /* Counts how many times our destructor has already + been called. */ +} unw_trace_cache_t; + +static const unw_tdep_frame_t empty_frame = { 0, UNW_AARCH64_FRAME_OTHER, -1, -1, 0, -1, -1, -1 }; +static define_lock (trace_init_lock); +static pthread_once_t trace_cache_once = PTHREAD_ONCE_INIT; +static sig_atomic_t trace_cache_once_happen; +static pthread_key_t trace_cache_key; +static struct mempool trace_cache_pool; +static _Thread_local unw_trace_cache_t *tls_cache; +static _Thread_local int tls_cache_destroyed; + +/* Free memory for a thread's trace cache. */ +static void +trace_cache_free (void *arg) +{ + unw_trace_cache_t *cache = arg; + if (++cache->dtor_count < PTHREAD_DESTRUCTOR_ITERATIONS) + { + /* Not yet our turn to get destroyed. Re-install ourselves into the key. */ + pthread_setspecific(trace_cache_key, cache); + Debug(5, "delayed freeing cache %p (%zx to go)\n", cache, + PTHREAD_DESTRUCTOR_ITERATIONS - cache->dtor_count); + return; + } + tls_cache_destroyed = 1; + tls_cache = NULL; + mi_munmap (cache->frames, (1u << cache->log_size) * sizeof(unw_tdep_frame_t)); + mempool_free (&trace_cache_pool, cache); + Debug(5, "freed cache %p\n", cache); +} + +/* Initialise frame tracing for threaded use. */ +static void +trace_cache_init_once (void) +{ + pthread_key_create (&trace_cache_key, &trace_cache_free); + mempool_init (&trace_cache_pool, sizeof (unw_trace_cache_t), 0); + trace_cache_once_happen = 1; +} + +static unw_tdep_frame_t * +trace_cache_buckets (size_t n) +{ + unw_tdep_frame_t *frames; + size_t i; + + GET_MEMORY(frames, n * sizeof (unw_tdep_frame_t)); + if (likely(frames != NULL)) + for (i = 0; i < n; ++i) + frames[i] = empty_frame; + + return frames; +} + +/* Allocate and initialise hash table for frame cache lookups. + Returns the cache initialised with (1u << HASH_LOW_BITS) hash + buckets, or NULL if there was a memory allocation problem. */ +static unw_trace_cache_t * +trace_cache_create (void) +{ + unw_trace_cache_t *cache; + + if (tls_cache_destroyed) + { + /* The current thread is in the process of exiting. Don't recreate + cache, as we wouldn't have another chance to free it. */ + Debug(5, "refusing to reallocate cache: " + "thread-locals are being deallocated\n"); + return NULL; + } + + if (! (cache = mempool_alloc(&trace_cache_pool))) + { + Debug(5, "failed to allocate cache\n"); + return NULL; + } + + if (! (cache->frames = trace_cache_buckets(1u << HASH_MIN_BITS))) + { + Debug(5, "failed to allocate buckets\n"); + mempool_free(&trace_cache_pool, cache); + return NULL; + } + + cache->log_size = HASH_MIN_BITS; + cache->used = 0; + cache->dtor_count = 0; + tls_cache_destroyed = 0; /* Paranoia: should already be 0. */ + Debug(5, "allocated cache %p\n", cache); + return cache; +} + +/* Expand the hash table in the frame cache if possible. This always + quadruples the hash size, and clears all previous frame entries. */ +static int +trace_cache_expand (unw_trace_cache_t *cache) +{ + size_t old_size = (1u << cache->log_size); + size_t new_log_size = cache->log_size + 2; + unw_tdep_frame_t *new_frames = trace_cache_buckets (1u << new_log_size); + + if (unlikely(! new_frames)) + { + Debug(5, "failed to expand cache to 2^%lu buckets\n", new_log_size); + return -UNW_ENOMEM; + } + + Debug(5, "expanded cache from 2^%lu to 2^%lu buckets\n", cache->log_size, new_log_size); + mi_munmap(cache->frames, old_size * sizeof(unw_tdep_frame_t)); + cache->frames = new_frames; + cache->log_size = new_log_size; + cache->used = 0; + return 0; +} + +static unw_trace_cache_t * +trace_cache_get_unthreaded (void) +{ + unw_trace_cache_t *cache; + intrmask_t saved_mask; + static unw_trace_cache_t *global_cache = NULL; + lock_acquire (&trace_init_lock, saved_mask); + if (! global_cache) + { + mempool_init (&trace_cache_pool, sizeof (unw_trace_cache_t), 0); + global_cache = trace_cache_create (); + } + cache = global_cache; + lock_release (&trace_init_lock, saved_mask); + Debug(5, "using cache %p\n", cache); + return cache; +} + +/* Get the frame cache for the current thread. Create it if there is none. */ +static unw_trace_cache_t * +trace_cache_get (void) +{ + unw_trace_cache_t *cache; + if (likely (pthread_once != NULL)) + { + pthread_once(&trace_cache_once, &trace_cache_init_once); + if (!trace_cache_once_happen) + { + return trace_cache_get_unthreaded(); + } + if (! (cache = tls_cache)) + { + cache = trace_cache_create(); + pthread_setspecific(trace_cache_key, cache); + tls_cache = cache; + } + Debug(5, "using cache %p\n", cache); + return cache; + } + else + { + return trace_cache_get_unthreaded(); + } +} + +/* Initialise frame properties for address cache slot F at address + PC using current CFA, FP and SP values. Modifies CURSOR to + that location, performs one unw_step(), and fills F with what + was discovered about the location. Returns F. + + FIXME: This probably should tell DWARF handling to never evaluate + or use registers other than FP, SP and PC in case there is + highly unusual unwind info which uses these creatively. */ +static unw_tdep_frame_t * +trace_init_addr (unw_tdep_frame_t *f, + unw_cursor_t *cursor, + unw_word_t cfa, + unw_word_t pc, + unw_word_t fp, + unw_word_t sp) +{ + struct cursor *c = (struct cursor *) cursor; + struct dwarf_cursor *d = &c->dwarf; + int ret = -UNW_EINVAL; + + /* Initialise frame properties: unknown, not last. */ + f->virtual_address = pc; + f->frame_type = UNW_AARCH64_FRAME_OTHER; + f->last_frame = 0; + f->cfa_reg_sp = -1; + f->cfa_reg_offset = 0; + f->fp_cfa_offset = -1; + f->lr_cfa_offset = -1; + f->sp_cfa_offset = -1; + + /* Reinitialise cursor to this instruction - but undo next/prev PC + adjustment because unw_step will redo it - and force PC, FP and + SP into register locations (=~ ucontext we keep), then set + their desired values. Then perform the step. */ + d->ip = pc + d->use_prev_instr; + d->cfa = cfa; + d->loc[UNW_AARCH64_X29] = DWARF_REG_LOC (d, UNW_AARCH64_X29); + d->loc[UNW_AARCH64_SP] = DWARF_REG_LOC (d, UNW_AARCH64_SP); + d->loc[UNW_AARCH64_PC] = DWARF_REG_LOC (d, UNW_AARCH64_PC); + c->frame_info = *f; + +#if defined(__QNXNTO__) + /** + * Without slow DWARF unwinding the signal context gets lost, so skip. + */ + if (unw_is_signal_frame (cursor)) + { + f->frame_type = UNW_AARCH64_FRAME_SIGRETURN; + f->last_frame = -1; + return f; + } +#endif + + if (likely(dwarf_put (d, d->loc[UNW_AARCH64_X29], fp) >= 0) + && likely(dwarf_put (d, d->loc[UNW_AARCH64_SP], sp) >= 0) + && likely(dwarf_put (d, d->loc[UNW_AARCH64_PC], pc) >= 0) + && likely((ret = unw_step (cursor)) >= 0)) + *f = c->frame_info; + + /* If unw_step() stopped voluntarily, remember that, even if it + otherwise could not determine anything useful. This avoids + failing trace if we hit frames without unwind info, which is + common for the outermost frame (CRT stuff) on many systems. + This avoids failing trace in very common circumstances; failing + to unw_step() loop wouldn't produce any better result. */ + if (ret == 0) + f->last_frame = -1; + + Debug (3, "frame va %lx type %d last %d cfa %s+%d fp @ cfa%+d lr @ cfa%+d sp @ cfa%+d\n", + f->virtual_address, f->frame_type, f->last_frame, + f->cfa_reg_sp ? "sp" : "fp", f->cfa_reg_offset, + f->fp_cfa_offset, f->lr_cfa_offset, f->sp_cfa_offset); + + return f; +} + +/* Look up and if necessary fill in frame attributes for address PC + in CACHE using current CFA, FP and SP values. Uses CURSOR to + perform any unwind steps necessary to fill the cache. Returns the + frame cache slot which describes RIP. */ +static unw_tdep_frame_t * +trace_lookup (unw_cursor_t *cursor, + unw_trace_cache_t *cache, + unw_word_t cfa, + unw_word_t pc, + unw_word_t fp, + unw_word_t sp) +{ + /* First look up for previously cached information using cache as + linear probing hash table with probe step of 1. Majority of + lookups should be completed within few steps, but it is very + important the hash table does not fill up, or performance falls + off the cliff. */ + uint64_t i, addr; + uint64_t cache_size = 1u << cache->log_size; + uint64_t slot = ((pc * 0x9e3779b97f4a7c16) >> 43) & (cache_size-1); + unw_tdep_frame_t *frame; + + for (i = 0; i < 16; ++i) + { + frame = &cache->frames[slot]; + addr = frame->virtual_address; + + /* Return if we found the address. */ + if (likely(addr == pc)) + { + Debug (4, "found address after %ld steps\n", i); + return frame; + } + + /* If slot is empty, reuse it. */ + if (likely(! addr)) + break; + + /* Linear probe to next slot candidate, step = 1. */ + if (++slot >= cache_size) + slot -= cache_size; + } + + /* If we collided after 16 steps, or if the hash is more than half + full, force the hash to expand. Fill the selected slot, whether + it's free or collides. Note that hash expansion drops previous + contents; further lookups will refill the hash. */ + Debug (4, "updating slot %lu after %ld steps, replacing 0x%lx\n", slot, i, addr); + if (unlikely(addr || cache->used >= cache_size / 2)) + { + if (unlikely(trace_cache_expand (cache) < 0)) + return NULL; + + cache_size = 1u << cache->log_size; + slot = ((pc * 0x9e3779b97f4a7c16) >> 43) & (cache_size-1); + frame = &cache->frames[slot]; + addr = frame->virtual_address; + } + + if (! addr) + ++cache->used; + + return trace_init_addr (frame, cursor, cfa, pc, fp, sp); +} + +/* Fast stack backtrace for AArch64. + + This is used by backtrace() implementation to accelerate frequent + queries for current stack, without any desire to unwind. It fills + BUFFER with the call tree from CURSOR upwards for at most SIZE + stack levels. The first frame, backtrace itself, is omitted. When + called, SIZE should give the maximum number of entries that can be + stored into BUFFER. Uses an internal thread-specific cache to + accelerate queries. + + The caller should fall back to a unw_step() loop if this function + fails by returning -UNW_ESTOPUNWIND, meaning the routine hit a + stack frame that is too complex to be traced in the fast path. + + This function is tuned for clients which only need to walk the + stack to get the call tree as fast as possible but without any + other details, for example profilers sampling the stack thousands + to millions of times per second. The routine handles the most + common AArch64 ABI stack layouts: CFA is FP or SP plus/minus + constant offset, return address is in LR, and FP, LR and SP are + either unchanged or saved on stack at constant offset from the CFA; + the signal return frame; and frames without unwind info provided + they are at the outermost (final) frame or can conservatively be + assumed to be frame-pointer based. + + Any other stack layout will cause the routine to give up. There + are only a handful of relatively rarely used functions which do + not have a stack in the standard form: vfork, longjmp, setcontext + and _dl_runtime_profile on common linux systems for example. + + On success BUFFER and *SIZE reflect the trace progress up to *SIZE + stack levels or the outermost frame, which ever is less. It may + stop short of outermost frame if unw_step() loop would also do so, + e.g. if there is no more unwind information; this is not reported + as an error. + + The function returns a negative value for errors, -UNW_ESTOPUNWIND + if tracing stopped because of an unusual frame unwind info. The + BUFFER and *SIZE reflect tracing progress up to the error frame. + + Callers of this function would normally look like this: + + unw_cursor_t cur; + unw_context_t ctx; + void addrs[128]; + int depth = 128; + int ret; + + unw_getcontext(&ctx); + unw_init_local(&cur, &ctx); + if ((ret = unw_tdep_trace(&cur, addrs, &depth)) < 0) + { + depth = 0; + unw_getcontext(&ctx); + unw_init_local(&cur, &ctx); + while ((ret = unw_step(&cur)) > 0 && depth < 128) + { + unw_word_t ip; + unw_get_reg(&cur, UNW_REG_IP, &ip); + addresses[depth++] = (void *) ip; + } + } +*/ +HIDDEN int +tdep_trace (unw_cursor_t *cursor, void **buffer, int *size) +{ + struct cursor *c = (struct cursor *) cursor; + struct dwarf_cursor *d = &c->dwarf; + unw_trace_cache_t *cache; + unw_word_t fp, sp, pc, cfa, lr; + int maxdepth = 0; + int depth = 0; + int ret; + + /* Check input parameters. */ + if (unlikely(! cursor || ! buffer || ! size || (maxdepth = *size) <= 0)) + return -UNW_EINVAL; + + Debug (1, "begin ip 0x%lx cfa 0x%lx\n", d->ip, d->cfa); + + /* Tell core dwarf routines to call back to us. */ + d->stash_frames = 1; + + /* Determine initial register values. These are direct access safe + because we know they come from the initial machine context. */ + pc = d->ip; + sp = cfa = d->cfa; + ACCESS_MEM_FAST(ret, 0, d, DWARF_GET_LOC(d->loc[UNW_AARCH64_X29]), fp); + assert(ret == 0); + lr = 0; + + /* Get frame cache. */ + if (unlikely(! (cache = trace_cache_get()))) + { + Debug (1, "returning %d, cannot get trace cache\n", -UNW_ENOMEM); + *size = 0; + d->stash_frames = 0; + return -UNW_ENOMEM; + } + + /* Trace the stack upwards, starting from current RIP. Adjust + the RIP address for previous/next instruction as the main + unwinding logic would also do. We undo this before calling + back into unw_step(). */ + while (depth < maxdepth) + { + pc -= d->use_prev_instr; + Debug (2, "depth %d cfa 0x%lx pc 0x%lx sp 0x%lx fp 0x%lx\n", + depth, cfa, pc, sp, fp); + + /* See if we have this address cached. If not, evaluate enough of + the dwarf unwind information to fill the cache line data, or to + decide this frame cannot be handled in fast trace mode. We + cache negative results too to prevent unnecessary dwarf parsing + for common failures. */ + unw_tdep_frame_t *f = trace_lookup (cursor, cache, cfa, pc, fp, sp); + + /* If we don't have information for this frame, give up. */ + if (unlikely(! f)) + { + ret = -UNW_ENOINFO; + break; + } + + Debug (3, "frame va %lx type %d last %d cfa %s+%d fp @ cfa%+d lr @ cfa%+d sp @ cfa%+d\n", + f->virtual_address, f->frame_type, f->last_frame, + f->cfa_reg_sp ? "sp" : "fp", f->cfa_reg_offset, + f->fp_cfa_offset, f->lr_cfa_offset, f->sp_cfa_offset); + + assert (f->virtual_address == pc); + + /* Stop if this was the last frame. In particular don't evaluate + new register values as it may not be safe - we don't normally + run with full validation on, and do not want to - and there's + enough bad unwind info floating around that we need to trust + what unw_step() previously said, in potentially bogus frames. */ + if (f->last_frame) + { +#if defined(__QNXNTO__) + if (f->frame_type == UNW_AARCH64_FRAME_SIGRETURN) + { + Debug (3, "frame is a signal trampoline, stopping.\n"); + ret = -UNW_ESTOPUNWIND; + } +#endif + break; + } + + /* Evaluate CFA and registers for the next frame. */ + switch (f->frame_type) + { + case UNW_AARCH64_FRAME_GUESSED: + /* Fall thru to standard processing after forcing validation. */ + c->validate = 1; + + case UNW_AARCH64_FRAME_STANDARD: + /* Advance standard traceable frame. */ + cfa = (f->cfa_reg_sp ? sp : fp) + f->cfa_reg_offset; + if (likely(f->lr_cfa_offset != -1)) + { + ACCESS_MEM_FAST(ret, c->validate, d, cfa + f->lr_cfa_offset, pc); + if (likely(ret >= 0)) + pc = tdep_strip_ptrauth_insn_mask(cursor, pc); + } + else if (lr != 0) + { + /* Use the saved link register as the new pc. */ + pc = lr; + lr = 0; + } + else + { + /* Cached frame has no LR and neither do we. */ + Debug (3, "frame has no link register, stopping.\n"); + return -UNW_ESTOPUNWIND; + } + if (likely(ret >= 0) && likely(f->fp_cfa_offset != -1)) + ACCESS_MEM_FAST(ret, c->validate, d, cfa + f->fp_cfa_offset, fp); + + /* Don't bother reading SP from DWARF, CFA becomes new SP. */ + sp = cfa; + + /* Next frame needs to back up for unwind info lookup. */ + d->use_prev_instr = 1; + break; + + case UNW_AARCH64_FRAME_SIGRETURN: + cfa = cfa + f->cfa_reg_offset; /* cfa now points to ucontext_t. */ + + ACCESS_MEM_FAST(ret, c->validate, d, cfa + SC_PC_OFF, pc); + if (likely(ret >= 0)) + { + pc = tdep_strip_ptrauth_insn_mask(cursor, pc); + ACCESS_MEM_FAST(ret, c->validate, d, cfa + SC_X29_OFF, fp); + } + if (likely(ret >= 0)) + ACCESS_MEM_FAST(ret, c->validate, d, cfa + SC_SP_OFF, sp); + /* Save the link register here in case we end up in a function that + doesn't save the link register in the prologue, e.g. kill. */ + if (likely(ret >= 0)) + ACCESS_MEM_FAST(ret, c->validate, d, cfa + SC_X30_OFF, lr); + + /* Resume stack at signal restoration point. The stack is not + necessarily continuous here, especially with sigaltstack(). */ + cfa = sp; + + /* Next frame should not back up. */ + d->use_prev_instr = 0; + break; + + default: + /* We cannot trace through this frame, give up and tell the + caller we had to stop. Data collected so far may still be + useful to the caller, so let it know how far we got. */ + Debug (3, "frame has unknown type, stopping.\n"); + ret = -UNW_ESTOPUNWIND; + break; + } + + Debug (4, "new cfa 0x%lx pc 0x%lx sp 0x%lx fp 0x%lx\n", + cfa, pc, sp, fp); + + /* If we failed or ended up somewhere bogus, stop. */ + if (unlikely(ret < 0 || pc < 0x4000)) + break; + + /* Record this address in stack trace. We skipped the first address. */ + buffer[depth++] = (void *) pc; + } + +#if UNW_DEBUG + Debug (1, "returning %d, depth %d\n", ret, depth); +#endif + *size = depth; + return ret; +} diff --git a/vendor/libunwind/src/aarch64/Lapply_reg_state.c b/vendor/libunwind/src/aarch64/Lapply_reg_state.c new file mode 100644 index 0000000000..7ebada480e --- /dev/null +++ b/vendor/libunwind/src/aarch64/Lapply_reg_state.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gapply_reg_state.c" +#endif diff --git a/vendor/libunwind/src/aarch64/Lcreate_addr_space.c b/vendor/libunwind/src/aarch64/Lcreate_addr_space.c new file mode 100644 index 0000000000..0f2dc6be90 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Lcreate_addr_space.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gcreate_addr_space.c" +#endif diff --git a/vendor/libunwind/src/aarch64/Lget_proc_info.c b/vendor/libunwind/src/aarch64/Lget_proc_info.c new file mode 100644 index 0000000000..69028b019f --- /dev/null +++ b/vendor/libunwind/src/aarch64/Lget_proc_info.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gget_proc_info.c" +#endif diff --git a/vendor/libunwind/src/aarch64/Lget_save_loc.c b/vendor/libunwind/src/aarch64/Lget_save_loc.c new file mode 100644 index 0000000000..9ea048a907 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Lget_save_loc.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gget_save_loc.c" +#endif diff --git a/vendor/libunwind/src/aarch64/Lglobal.c b/vendor/libunwind/src/aarch64/Lglobal.c new file mode 100644 index 0000000000..6d7b489e14 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Lglobal.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gglobal.c" +#endif diff --git a/vendor/libunwind/src/aarch64/Linit.c b/vendor/libunwind/src/aarch64/Linit.c new file mode 100644 index 0000000000..e9abfdd46a --- /dev/null +++ b/vendor/libunwind/src/aarch64/Linit.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Ginit.c" +#endif diff --git a/vendor/libunwind/src/aarch64/Linit_local.c b/vendor/libunwind/src/aarch64/Linit_local.c new file mode 100644 index 0000000000..68a1687e85 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Linit_local.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Ginit_local.c" +#endif diff --git a/vendor/libunwind/src/aarch64/Linit_remote.c b/vendor/libunwind/src/aarch64/Linit_remote.c new file mode 100644 index 0000000000..58cb04ab7c --- /dev/null +++ b/vendor/libunwind/src/aarch64/Linit_remote.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Ginit_remote.c" +#endif diff --git a/vendor/libunwind/src/aarch64/Lis_signal_frame.c b/vendor/libunwind/src/aarch64/Lis_signal_frame.c new file mode 100644 index 0000000000..b9a7c4f51a --- /dev/null +++ b/vendor/libunwind/src/aarch64/Lis_signal_frame.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gis_signal_frame.c" +#endif diff --git a/vendor/libunwind/src/aarch64/Los-freebsd.c b/vendor/libunwind/src/aarch64/Los-freebsd.c new file mode 100644 index 0000000000..a75a205df1 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Los-freebsd.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gos-freebsd.c" +#endif diff --git a/vendor/libunwind/src/aarch64/Los-linux.c b/vendor/libunwind/src/aarch64/Los-linux.c new file mode 100644 index 0000000000..3cc18aabcc --- /dev/null +++ b/vendor/libunwind/src/aarch64/Los-linux.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gos-linux.c" +#endif diff --git a/vendor/libunwind/src/aarch64/Los-qnx.c b/vendor/libunwind/src/aarch64/Los-qnx.c new file mode 100644 index 0000000000..d5e4b82b9d --- /dev/null +++ b/vendor/libunwind/src/aarch64/Los-qnx.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gos-qnx.c" +#endif diff --git a/vendor/libunwind/src/aarch64/Lreg_states_iterate.c b/vendor/libunwind/src/aarch64/Lreg_states_iterate.c new file mode 100644 index 0000000000..f1eb1e79dc --- /dev/null +++ b/vendor/libunwind/src/aarch64/Lreg_states_iterate.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Greg_states_iterate.c" +#endif diff --git a/vendor/libunwind/src/aarch64/Lregs.c b/vendor/libunwind/src/aarch64/Lregs.c new file mode 100644 index 0000000000..2c9c75cd7d --- /dev/null +++ b/vendor/libunwind/src/aarch64/Lregs.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gregs.c" +#endif diff --git a/vendor/libunwind/src/aarch64/Lresume.c b/vendor/libunwind/src/aarch64/Lresume.c new file mode 100644 index 0000000000..41a8cf003d --- /dev/null +++ b/vendor/libunwind/src/aarch64/Lresume.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gresume.c" +#endif diff --git a/vendor/libunwind/src/aarch64/Lstash_frame.c b/vendor/libunwind/src/aarch64/Lstash_frame.c new file mode 100644 index 0000000000..77587803d0 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Lstash_frame.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gstash_frame.c" +#endif diff --git a/vendor/libunwind/src/aarch64/Lstep.c b/vendor/libunwind/src/aarch64/Lstep.c new file mode 100644 index 0000000000..c1ac3c7547 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Lstep.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gstep.c" +#endif diff --git a/vendor/libunwind/src/aarch64/Lstrip_ptrauth_insn_mask.c b/vendor/libunwind/src/aarch64/Lstrip_ptrauth_insn_mask.c new file mode 100644 index 0000000000..1acb9232b4 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Lstrip_ptrauth_insn_mask.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gstrip_ptrauth_insn_mask.c" +#endif \ No newline at end of file diff --git a/vendor/libunwind/src/aarch64/Ltrace.c b/vendor/libunwind/src/aarch64/Ltrace.c new file mode 100644 index 0000000000..fcd3f239c9 --- /dev/null +++ b/vendor/libunwind/src/aarch64/Ltrace.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gtrace.c" +#endif diff --git a/vendor/libunwind/src/aarch64/getcontext.S b/vendor/libunwind/src/aarch64/getcontext.S new file mode 100644 index 0000000000..6fcd17c488 --- /dev/null +++ b/vendor/libunwind/src/aarch64/getcontext.S @@ -0,0 +1,52 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 Google, Inc + Contributed by Paul Pluzhnikov + Copyright (C) 2010 Konstantin Belousov + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "ucontext_i.h" + +/* int _Uaarch64_getcontext_trace (unw_tdep_context_t *ucp) + + Saves limited machine context in UCP necessary for fast trace. If fast trace + fails, caller will have to get the full context. +*/ + + .global _Uaarch64_getcontext_trace + .hidden _Uaarch64_getcontext_trace + .type _Uaarch64_getcontext_trace, @function +_Uaarch64_getcontext_trace: + .cfi_startproc + + /* Save only FP, SP, PC - exclude this call. */ + str x29, [x0, #(UC_MCONTEXT_OFF + SC_X29_OFF)] + mov x9, sp + str x9, [x0, #(UC_MCONTEXT_OFF + SC_SP_OFF)] + str x30, [x0, #(UC_MCONTEXT_OFF + SC_PC_OFF)] + + ret + .cfi_endproc + .size _Uaarch64_getcontext_trace, . - _Uaarch64_getcontext_trace + + /* We do not need executable stack. */ + .section .note.GNU-stack,"",@progbits diff --git a/vendor/libunwind/src/aarch64/init.h b/vendor/libunwind/src/aarch64/init.h new file mode 100644 index 0000000000..e761329685 --- /dev/null +++ b/vendor/libunwind/src/aarch64/init.h @@ -0,0 +1,127 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2012 Tommi Rantala + Copyright (C) 2013 Linaro Limited + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +static inline int +common_init (struct cursor *c, unsigned use_prev_instr) +{ + int ret, i; + + for (i = UNW_AARCH64_PSTATE + 1; i < UNW_AARCH64_V0; ++i) + c->dwarf.loc[i] = DWARF_NULL_LOC; + + c->dwarf.loc[UNW_AARCH64_X0] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X0); + c->dwarf.loc[UNW_AARCH64_X1] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X1); + c->dwarf.loc[UNW_AARCH64_X2] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X2); + c->dwarf.loc[UNW_AARCH64_X3] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X3); + c->dwarf.loc[UNW_AARCH64_X4] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X4); + c->dwarf.loc[UNW_AARCH64_X5] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X5); + c->dwarf.loc[UNW_AARCH64_X6] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X6); + c->dwarf.loc[UNW_AARCH64_X7] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X7); + c->dwarf.loc[UNW_AARCH64_X8] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X8); + c->dwarf.loc[UNW_AARCH64_X9] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X9); + c->dwarf.loc[UNW_AARCH64_X10] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X10); + c->dwarf.loc[UNW_AARCH64_X11] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X11); + c->dwarf.loc[UNW_AARCH64_X12] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X12); + c->dwarf.loc[UNW_AARCH64_X13] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X13); + c->dwarf.loc[UNW_AARCH64_X14] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X14); + c->dwarf.loc[UNW_AARCH64_X15] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X15); + c->dwarf.loc[UNW_AARCH64_X16] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X16); + c->dwarf.loc[UNW_AARCH64_X17] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X17); + c->dwarf.loc[UNW_AARCH64_X18] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X18); + c->dwarf.loc[UNW_AARCH64_X19] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X19); + c->dwarf.loc[UNW_AARCH64_X20] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X20); + c->dwarf.loc[UNW_AARCH64_X21] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X21); + c->dwarf.loc[UNW_AARCH64_X22] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X22); + c->dwarf.loc[UNW_AARCH64_X23] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X23); + c->dwarf.loc[UNW_AARCH64_X24] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X24); + c->dwarf.loc[UNW_AARCH64_X25] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X25); + c->dwarf.loc[UNW_AARCH64_X26] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X26); + c->dwarf.loc[UNW_AARCH64_X27] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X27); + c->dwarf.loc[UNW_AARCH64_X28] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X28); + c->dwarf.loc[UNW_AARCH64_X29] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X29); + c->dwarf.loc[UNW_AARCH64_X30] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X30); + c->dwarf.loc[UNW_AARCH64_SP] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_SP); + c->dwarf.loc[UNW_AARCH64_PC] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_PC); + c->dwarf.loc[UNW_AARCH64_PSTATE] = DWARF_REG_LOC (&c->dwarf, + UNW_AARCH64_PSTATE); + c->dwarf.loc[UNW_AARCH64_VG] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_VG); + c->dwarf.loc[UNW_AARCH64_V0] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V0); + c->dwarf.loc[UNW_AARCH64_V1] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V1); + c->dwarf.loc[UNW_AARCH64_V2] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V2); + c->dwarf.loc[UNW_AARCH64_V3] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V3); + c->dwarf.loc[UNW_AARCH64_V4] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V4); + c->dwarf.loc[UNW_AARCH64_V5] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V5); + c->dwarf.loc[UNW_AARCH64_V6] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V6); + c->dwarf.loc[UNW_AARCH64_V7] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V7); + c->dwarf.loc[UNW_AARCH64_V8] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V8); + c->dwarf.loc[UNW_AARCH64_V9] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V9); + c->dwarf.loc[UNW_AARCH64_V10] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V10); + c->dwarf.loc[UNW_AARCH64_V11] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V11); + c->dwarf.loc[UNW_AARCH64_V12] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V12); + c->dwarf.loc[UNW_AARCH64_V13] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V13); + c->dwarf.loc[UNW_AARCH64_V14] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V14); + c->dwarf.loc[UNW_AARCH64_V15] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V15); + c->dwarf.loc[UNW_AARCH64_V16] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V16); + c->dwarf.loc[UNW_AARCH64_V17] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V17); + c->dwarf.loc[UNW_AARCH64_V18] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V18); + c->dwarf.loc[UNW_AARCH64_V19] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V19); + c->dwarf.loc[UNW_AARCH64_V20] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V20); + c->dwarf.loc[UNW_AARCH64_V21] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V21); + c->dwarf.loc[UNW_AARCH64_V22] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V22); + c->dwarf.loc[UNW_AARCH64_V23] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V23); + c->dwarf.loc[UNW_AARCH64_V24] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V24); + c->dwarf.loc[UNW_AARCH64_V25] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V25); + c->dwarf.loc[UNW_AARCH64_V26] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V26); + c->dwarf.loc[UNW_AARCH64_V27] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V27); + c->dwarf.loc[UNW_AARCH64_V28] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V28); + c->dwarf.loc[UNW_AARCH64_V29] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V29); + c->dwarf.loc[UNW_AARCH64_V30] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V30); + c->dwarf.loc[UNW_AARCH64_V31] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V31); + + ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_PC], &c->dwarf.ip); + if (ret < 0) + return ret; + + ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_SP], &c->dwarf.cfa); + if (ret < 0) + return ret; + + c->sigcontext_format = AARCH64_SCF_NONE; + c->sigcontext_addr = 0; + c->sigcontext_sp = 0; + c->sigcontext_pc = 0; + + c->dwarf.args_size = 0; + c->dwarf.stash_frames = 0; + c->dwarf.use_prev_instr = use_prev_instr; + c->dwarf.pi_valid = 0; + c->dwarf.pi_is_dynamic = 0; + c->dwarf.hint = 0; + c->dwarf.prev_rs = 0; + + return 0; +} diff --git a/vendor/libunwind/src/aarch64/is_fpreg.c b/vendor/libunwind/src/aarch64/is_fpreg.c new file mode 100644 index 0000000000..2981d27520 --- /dev/null +++ b/vendor/libunwind/src/aarch64/is_fpreg.c @@ -0,0 +1,32 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2013 Linaro Limited + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +int +unw_is_fpreg (int regnum) +{ + return (regnum >= UNW_AARCH64_V0 && regnum <= UNW_AARCH64_V31); +} diff --git a/vendor/libunwind/src/aarch64/longjmp.S b/vendor/libunwind/src/aarch64/longjmp.S new file mode 100644 index 0000000000..a1b73f0509 --- /dev/null +++ b/vendor/libunwind/src/aarch64/longjmp.S @@ -0,0 +1,46 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2023 Dmitry Chagin + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + + .global _UI_longjmp_cont + .type _UI_longjmp_cont, @function +_UI_longjmp_cont: +#if defined(__linux__) || defined(__QNX__) + ret +#elif defined(__FreeBSD__) + .cfi_startproc + /* + * x0 - return address + * x1 - return value + */ + mov x30, x0 + mov x0, x1 + ret + .cfi_endproc +#else +#error Port me +#endif + .size _UI_longjmp_cont, . - _UI_longjmp_cont + + /* We do not need executable stack. */ + .section .note.GNU-stack,"",%progbits diff --git a/vendor/libunwind/src/aarch64/regname.c b/vendor/libunwind/src/aarch64/regname.c new file mode 100644 index 0000000000..0f7a8bdcfb --- /dev/null +++ b/vendor/libunwind/src/aarch64/regname.c @@ -0,0 +1,106 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2012 Tommi Rantala + Copyright (C) 2013 Linaro Limited + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +static const char *const regname[] = + { + [UNW_AARCH64_X0] = "x0", + [UNW_AARCH64_X1] = "x1", + [UNW_AARCH64_X2] = "x2", + [UNW_AARCH64_X3] = "x3", + [UNW_AARCH64_X4] = "x4", + [UNW_AARCH64_X5] = "x5", + [UNW_AARCH64_X6] = "x6", + [UNW_AARCH64_X7] = "x7", + [UNW_AARCH64_X8] = "x8", + [UNW_AARCH64_X9] = "x9", + [UNW_AARCH64_X10] = "x10", + [UNW_AARCH64_X11] = "x11", + [UNW_AARCH64_X12] = "x12", + [UNW_AARCH64_X13] = "x13", + [UNW_AARCH64_X14] = "x14", + [UNW_AARCH64_X15] = "x15", + [UNW_AARCH64_X16] = "ip0", + [UNW_AARCH64_X17] = "ip1", + [UNW_AARCH64_X18] = "x18", + [UNW_AARCH64_X19] = "x19", + [UNW_AARCH64_X20] = "x20", + [UNW_AARCH64_X21] = "x21", + [UNW_AARCH64_X22] = "x22", + [UNW_AARCH64_X23] = "x23", + [UNW_AARCH64_X24] = "x24", + [UNW_AARCH64_X25] = "x25", + [UNW_AARCH64_X26] = "x26", + [UNW_AARCH64_X27] = "x27", + [UNW_AARCH64_X28] = "x28", + [UNW_AARCH64_X29] = "fp", + [UNW_AARCH64_X30] = "lr", + [UNW_AARCH64_SP] = "sp", + [UNW_AARCH64_PC] = "pc", + [UNW_AARCH64_V0] = "v0", + [UNW_AARCH64_V1] = "v1", + [UNW_AARCH64_V2] = "v2", + [UNW_AARCH64_V3] = "v3", + [UNW_AARCH64_V4] = "v4", + [UNW_AARCH64_V5] = "v5", + [UNW_AARCH64_V6] = "v6", + [UNW_AARCH64_V7] = "v7", + [UNW_AARCH64_V8] = "v8", + [UNW_AARCH64_V9] = "v9", + [UNW_AARCH64_V10] = "v10", + [UNW_AARCH64_V11] = "v11", + [UNW_AARCH64_V12] = "v12", + [UNW_AARCH64_V13] = "v13", + [UNW_AARCH64_V14] = "v14", + [UNW_AARCH64_V15] = "v15", + [UNW_AARCH64_V16] = "v16", + [UNW_AARCH64_V17] = "v17", + [UNW_AARCH64_V18] = "v18", + [UNW_AARCH64_V19] = "v19", + [UNW_AARCH64_V20] = "v20", + [UNW_AARCH64_V21] = "v21", + [UNW_AARCH64_V22] = "v22", + [UNW_AARCH64_V23] = "v23", + [UNW_AARCH64_V24] = "v24", + [UNW_AARCH64_V25] = "v25", + [UNW_AARCH64_V26] = "v26", + [UNW_AARCH64_V27] = "v27", + [UNW_AARCH64_V28] = "v28", + [UNW_AARCH64_V29] = "v29", + [UNW_AARCH64_V30] = "v30", + [UNW_AARCH64_V31] = "v31", + [UNW_AARCH64_FPSR] = "fpsr", + [UNW_AARCH64_FPCR] = "fpcr", + }; + +const char * +unw_regname (unw_regnum_t reg) +{ + if (reg < (unw_regnum_t) ARRAY_SIZE (regname) && regname[reg] != NULL) + return regname[reg]; + else + return "???"; +} diff --git a/vendor/libunwind/src/aarch64/setcontext.S b/vendor/libunwind/src/aarch64/setcontext.S new file mode 100644 index 0000000000..2ab1165f49 --- /dev/null +++ b/vendor/libunwind/src/aarch64/setcontext.S @@ -0,0 +1,60 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2023 Dmitry Chagin + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "ucontext_i.h" + + + .global _Uaarch64_setcontext + .type _Uaarch64_setcontext, @function +_Uaarch64_setcontext: + .cfi_startproc + + /* + * Since there are no signals involved here we restore EH and + * non scratch registers only. + */ + + mov x9, x0 + ldp x0, x1, [x9, #(UC_MCONTEXT_OFF + SC_GPR_OFF)] + ldp x2, x3, [x9, #(UC_MCONTEXT_OFF + SC_GPR_OFF + 2 * 8)] + ldp x19, x20, [x9, #(UC_MCONTEXT_OFF + SC_GPR_OFF + 19 * 8)] + ldp x21, x22, [x9, #(UC_MCONTEXT_OFF + SC_GPR_OFF + 21 * 8)] + ldp x23, x24, [x9, #(UC_MCONTEXT_OFF + SC_GPR_OFF + 23 * 8)] + ldp x25, x26, [x9, #(UC_MCONTEXT_OFF + SC_GPR_OFF + 25 * 8)] + ldp x27, x28, [x9, #(UC_MCONTEXT_OFF + SC_GPR_OFF + 27 * 8)] + ldp x29, x30, [x9, #(UC_MCONTEXT_OFF + SC_GPR_OFF + 29 * 8)] + + ldp q8, q9, [x9, #(UC_MCONTEXT_OFF + SC_FPSIMD_OFF + 8 * 16)] + ldp q10, q11, [x9, #(UC_MCONTEXT_OFF + SC_FPSIMD_OFF + 10 * 16)] + ldp q12, q13, [x9, #(UC_MCONTEXT_OFF + SC_FPSIMD_OFF + 12 * 16)] + ldp q14, q15, [x9, #(UC_MCONTEXT_OFF + SC_FPSIMD_OFF + 14 * 16)] + + ldr x9, [x9, #(UC_MCONTEXT_OFF + SC_SP_OFF)] + mov sp, x9 + + ret + .cfi_endproc + .size _Uaarch64_setcontext, . - _Uaarch64_setcontext + + .section .note.GNU-stack,"",@progbits diff --git a/vendor/libunwind/src/aarch64/siglongjmp.S b/vendor/libunwind/src/aarch64/siglongjmp.S new file mode 100644 index 0000000000..92de7b2521 --- /dev/null +++ b/vendor/libunwind/src/aarch64/siglongjmp.S @@ -0,0 +1,59 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2023 Dmitry Chagin + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#if defined(__FreeBSD__) +#include +#define SIG_SETMASK 3 +#endif + + .global _UI_siglongjmp_cont + .type _UI_siglongjmp_cont, @function +_UI_siglongjmp_cont: +#if defined(__linux__) || defined(__QNX__) + ret +#elif defined(__FreeBSD__) + .cfi_startproc + /* + * x0 - return address + * x1 - return value + * x2 - mask + */ + stp x0, x1, [sp, #-16]! + .cfi_def_cfa_offset 16 + /* Restore the signal mask */ + mov x1, x2 /* set */ + mov x2, #0 /* oset */ + mov x0, #SIG_SETMASK + mov x8, #SYS_sigprocmask + svc 0 + ldp x30, x0, [sp], #16 + .cfi_def_cfa_offset 0 + ret + .cfi_endproc +#else +#error Port me +#endif + .size _UI_siglongjmp_cont, . - _UI_siglongjmp_cont + /* We do not need executable stack. */ + .section .note.GNU-stack,"",%progbits diff --git a/vendor/libunwind/src/aarch64/ucontext_i.h b/vendor/libunwind/src/aarch64/ucontext_i.h new file mode 100644 index 0000000000..2f3bc0914b --- /dev/null +++ b/vendor/libunwind/src/aarch64/ucontext_i.h @@ -0,0 +1,75 @@ +/* Contributed by Dmitry Chagin . + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#ifndef libunwind_src_aarch64_ucontext_i_h +#define libunwind_src_aarch64_ucontext_i_h + +#if defined __FreeBSD__ || defined __APPLE__ + +#define UC_MCONTEXT_OFF 0x10 +#define SC_GPR_OFF 0x00 + +#define SC_X29_OFF 0x0e8 +#define SC_X30_OFF 0x0f0 +#define SC_SP_OFF 0x0f8 +#define SC_PC_OFF 0x100 +#define SC_PSTATE_OFF 0x108 +#define SC_FPSIMD_OFF 0x110 + +#define SCF_FORMAT AARCH64_SCF_FREEBSD_RT_SIGFRAME + +#elif defined(__linux__) + +#define UC_MCONTEXT_OFF 0xb0 +#define SC_GPR_OFF 0x08 + +#define SC_X29_OFF 0x0f0 +#define SC_X30_OFF 0x0f8 +#define SC_SP_OFF 0x100 +#define SC_PC_OFF 0x108 +#define SC_PSTATE_OFF 0x110 + +#define SCF_FORMAT AARCH64_SCF_LINUX_RT_SIGFRAME + +#define LINUX_SC_RESERVED_OFF 0x120 + +#define LINUX_SC_RESERVED_MAGIC_OFF 0x0 +#define LINUX_SC_RESERVED_SIZE_OFF 0x4 +#define LINUX_SC_RESERVED_SVE_VL_OFF 0x8 + +#elif defined(__QNX__) + +#define SI_UCONTEXT_OFF 0x38 +#define UC_MCONTEXT_OFF 48 +#define SC_GPR_OFF 0 +#define SC_X29_OFF 232 +#define SC_X30_OFF 240 +#define SC_SP_OFF 248 +#define SC_PC_OFF 256 +#define SC_PSTATE_OFF 264 +#define SCF_FORMAT AARCH64_SCF_QNX_RT_SIGFRAME + +#else +# error Port me +#endif + +#endif /* libunwind_src_aarch64_ucontext_i_h */ diff --git a/vendor/libunwind/src/aarch64/unwind_i.h b/vendor/libunwind/src/aarch64/unwind_i.h new file mode 100644 index 0000000000..ab2e1d13fa --- /dev/null +++ b/vendor/libunwind/src/aarch64/unwind_i.h @@ -0,0 +1,66 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2013 Linaro Limited + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef unwind_i_h +#define unwind_i_h + +#include + +#include + +#include "libunwind_i.h" + +/* DWARF column numbers for AArch64: */ +#define X29 29 +#define FP 29 +#define X30 30 +#define LR 30 +#define SP 31 + +#define aarch64_lock UNW_OBJ(lock) +#define aarch64_local_resume UNW_OBJ(local_resume) +#define aarch64_local_addr_space_init UNW_OBJ(local_addr_space_init) + +extern void aarch64_local_addr_space_init (void); +extern int aarch64_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, + void *arg); + +/* By-pass calls to access_mem() when known to be safe. */ +#ifdef UNW_LOCAL_ONLY +# undef ACCESS_MEM_FAST +# define ACCESS_MEM_FAST(ret,validate,cur,addr,to) \ + do { \ + if (unlikely(validate)) \ + (ret) = dwarf_get ((cur), DWARF_MEM_LOC ((cur), (addr)), &(to)); \ + else \ + (ret) = 0, (to) = *(unw_word_t *)(addr); \ + } while (0) +#endif + +#if defined(__linux__) +#define GET_FPCTX(uc) ((unw_fpsimd_context_t *)(&uc->uc_mcontext.__reserved)) +#endif + +#endif /* unwind_i_h */ diff --git a/vendor/libunwind/src/arm/Gapply_reg_state.c b/vendor/libunwind/src/arm/Gapply_reg_state.c new file mode 100644 index 0000000000..82f056da67 --- /dev/null +++ b/vendor/libunwind/src/arm/Gapply_reg_state.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +int +unw_apply_reg_state (unw_cursor_t *cursor, + void *reg_states_data) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_apply_reg_state (&c->dwarf, (dwarf_reg_state_t *)reg_states_data); +} diff --git a/vendor/libunwind/src/arm/Gcreate_addr_space.c b/vendor/libunwind/src/arm/Gcreate_addr_space.c new file mode 100644 index 0000000000..d4bdb4167f --- /dev/null +++ b/vendor/libunwind/src/arm/Gcreate_addr_space.c @@ -0,0 +1,59 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include + +#include "unwind_i.h" + +unw_addr_space_t +unw_create_addr_space (unw_accessors_t *a, int byte_order) +{ +#ifdef UNW_LOCAL_ONLY + return NULL; +#else + unw_addr_space_t as; + + /* + * ARM supports little-endian and big-endian. + */ + if (byte_order != 0 && byte_order_is_valid(byte_order) == 0) + return NULL; + + as = malloc (sizeof (*as)); + if (!as) + return NULL; + + memset (as, 0, sizeof (*as)); + + as->acc = *a; + + /* Default to little-endian for ARM. */ + if (byte_order == 0 || byte_order == UNW_LITTLE_ENDIAN) + as->big_endian = 0; + else + as->big_endian = 1; + + return as; +#endif +} diff --git a/vendor/libunwind/src/arm/Gex_tables.c b/vendor/libunwind/src/arm/Gex_tables.c new file mode 100644 index 0000000000..56bbd0d076 --- /dev/null +++ b/vendor/libunwind/src/arm/Gex_tables.c @@ -0,0 +1,561 @@ +/* libunwind - a platform-independent unwind library + Copyright 2011 Linaro Limited + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +/* This file contains functionality for parsing and interpreting the ARM +specific unwind information. Documentation about the exception handling +ABI for the ARM architecture can be found at: +http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038a/IHI0038A_ehabi.pdf +*/ + +#include "libunwind_i.h" + +#define ARM_EXBUF_START(x) (((x) >> 4) & 0x0f) +#define ARM_EXBUF_COUNT(x) ((x) & 0x0f) +#define ARM_EXBUF_END(x) (ARM_EXBUF_START(x) + ARM_EXBUF_COUNT(x)) + +#define ARM_EXIDX_CANT_UNWIND 0x00000001 +#define ARM_EXIDX_COMPACT 0x80000000 + +#define ARM_EXTBL_OP_FINISH 0xb0 + +enum arm_exbuf_cmd_flags { + ARM_EXIDX_VFP_SHIFT_16 = 1 << 16, + ARM_EXIDX_VFP_DOUBLE = 1 << 17, +}; + +struct arm_cb_data + { + /* in: */ + unw_word_t ip; /* instruction-pointer we're looking for */ + unw_proc_info_t *pi; /* proc-info pointer */ + /* out: */ + unw_dyn_info_t di; /* info about the ARM exidx segment */ + }; + +static inline uint32_t CONST_ATTR +prel31_read (uint32_t prel31) +{ + return ((int32_t)prel31 << 1) >> 1; +} + +static inline int +prel31_to_addr (unw_addr_space_t as, void *arg, unw_word_t prel31, + unw_word_t *val) +{ + unw_word_t offset; + + if ((*as->acc.access_mem)(as, prel31, &offset, 0, arg) < 0) + return -UNW_EINVAL; + + offset = ((long)offset << 1) >> 1; + *val = prel31 + offset; + + return 0; +} + +/** + * Applies the given command onto the new state to the given dwarf_cursor. + */ +HIDDEN int +arm_exidx_apply_cmd (struct arm_exbuf_data *edata, struct dwarf_cursor *c) +{ + int ret = 0; + unsigned i; + + switch (edata->cmd) + { + case ARM_EXIDX_CMD_FINISH: + /* Set LR to PC if not set already. */ + if (DWARF_IS_NULL_LOC (c->loc[UNW_ARM_R15])) + c->loc[UNW_ARM_R15] = c->loc[UNW_ARM_R14]; + /* Set IP. */ + dwarf_get (c, c->loc[UNW_ARM_R15], &c->ip); + break; + case ARM_EXIDX_CMD_DATA_PUSH: + Debug (2, "vsp = vsp - %d\n", edata->data); + c->cfa -= edata->data; + break; + case ARM_EXIDX_CMD_DATA_POP: + Debug (2, "vsp = vsp + %d\n", edata->data); + c->cfa += edata->data; + break; + case ARM_EXIDX_CMD_REG_POP: + for (i = 0; i < 16; i++) + if (edata->data & (1 << i)) + { + Debug (2, "pop {r%d}\n", i); + c->loc[UNW_ARM_R0 + i] = DWARF_LOC (c->cfa, 0); + c->cfa += 4; + } + /* Set cfa in case the SP got popped. */ + if (edata->data & (1 << 13)) + dwarf_get (c, c->loc[UNW_ARM_R13], &c->cfa); + break; + case ARM_EXIDX_CMD_REG_TO_SP: + assert (edata->data < 16); + Debug (2, "vsp = r%d\n", edata->data); + c->loc[UNW_ARM_R13] = c->loc[UNW_ARM_R0 + edata->data]; + dwarf_get (c, c->loc[UNW_ARM_R13], &c->cfa); + break; + case ARM_EXIDX_CMD_VFP_POP: + for (i = ARM_EXBUF_START (edata->data); i <= ARM_EXBUF_END (edata->data); + i++) + { + c->loc[UNW_ARM_S0 + i] = DWARF_LOC (c->cfa, 0); + c->cfa += 8; + } + if (!(edata->data & ARM_EXIDX_VFP_DOUBLE)) + c->cfa += 4; + break; + case ARM_EXIDX_CMD_WREG_POP: + for (i = ARM_EXBUF_START (edata->data); i <= ARM_EXBUF_END (edata->data); + i++) + c->cfa += 8; + break; + case ARM_EXIDX_CMD_WCGR_POP: + for (i = 0; i < 4; i++) + if (edata->data & (1 << i)) + c->cfa += 4; + break; + case ARM_EXIDX_CMD_REFUSED: + case ARM_EXIDX_CMD_RESERVED: + ret = -1; + break; + } + return ret; +} + +/** + * Decodes the given unwind instructions into arm_exbuf_data and calls + * arm_exidx_apply_cmd that applies the command onto the dwarf_cursor. + */ +HIDDEN int +arm_exidx_decode (const uint8_t *buf, uint8_t len, struct dwarf_cursor *c) +{ +#define READ_OP() *buf++ + assert(buf != NULL); + assert(len > 0); + + const uint8_t *end = buf + len; + int ret; + struct arm_exbuf_data edata; + + while (buf < end) + { + uint8_t op = READ_OP (); + if ((op & 0xc0) == 0x00) + { + edata.cmd = ARM_EXIDX_CMD_DATA_POP; + edata.data = (((int)op & 0x3f) << 2) + 4; + } + else if ((op & 0xc0) == 0x40) + { + edata.cmd = ARM_EXIDX_CMD_DATA_PUSH; + edata.data = (((int)op & 0x3f) << 2) + 4; + } + else if ((op & 0xf0) == 0x80) + { + uint8_t op2 = READ_OP (); + if (op == 0x80 && op2 == 0x00) + edata.cmd = ARM_EXIDX_CMD_REFUSED; + else + { + edata.cmd = ARM_EXIDX_CMD_REG_POP; + edata.data = ((op & 0xf) << 8) | op2; + edata.data = edata.data << 4; + } + } + else if ((op & 0xf0) == 0x90) + { + if (op == 0x9d || op == 0x9f) + edata.cmd = ARM_EXIDX_CMD_RESERVED; + else + { + edata.cmd = ARM_EXIDX_CMD_REG_TO_SP; + edata.data = op & 0x0f; + } + } + else if ((op & 0xf0) == 0xa0) + { + unsigned end = (op & 0x07); + edata.data = (1 << (end + 1)) - 1; + edata.data = edata.data << 4; + if (op & 0x08) + edata.data |= 1 << 14; + edata.cmd = ARM_EXIDX_CMD_REG_POP; + } + else if (op == ARM_EXTBL_OP_FINISH) + { + edata.cmd = ARM_EXIDX_CMD_FINISH; + buf = end; + } + else if (op == 0xb1) + { + uint8_t op2 = READ_OP (); + if (op2 == 0 || (op2 & 0xf0)) + edata.cmd = ARM_EXIDX_CMD_RESERVED; + else + { + edata.cmd = ARM_EXIDX_CMD_REG_POP; + edata.data = op2 & 0x0f; + } + } + else if (op == 0xb2) + { + uint32_t offset = 0; + uint8_t byte, shift = 0; + do + { + byte = READ_OP (); + offset |= (byte & 0x7f) << shift; + shift += 7; + } + while (byte & 0x80); + edata.data = offset * 4 + 0x204; + edata.cmd = ARM_EXIDX_CMD_DATA_POP; + } + else if (op == 0xb3 || op == 0xc8 || op == 0xc9) + { + edata.cmd = ARM_EXIDX_CMD_VFP_POP; + edata.data = READ_OP (); + if (op == 0xc8) + edata.data |= ARM_EXIDX_VFP_SHIFT_16; + if (op != 0xb3) + edata.data |= ARM_EXIDX_VFP_DOUBLE; + } + else if ((op & 0xf8) == 0xb8 || (op & 0xf8) == 0xd0) + { + edata.cmd = ARM_EXIDX_CMD_VFP_POP; + edata.data = 0x80 | (op & 0x07); + if ((op & 0xf8) == 0xd0) + edata.data |= ARM_EXIDX_VFP_DOUBLE; + } + else if (op >= 0xc0 && op <= 0xc5) + { + edata.cmd = ARM_EXIDX_CMD_WREG_POP; + edata.data = 0xa0 | (op & 0x07); + } + else if (op == 0xc6) + { + edata.cmd = ARM_EXIDX_CMD_WREG_POP; + edata.data = READ_OP (); + } + else if (op == 0xc7) + { + uint8_t op2 = READ_OP (); + if (op2 == 0 || (op2 & 0xf0)) + edata.cmd = ARM_EXIDX_CMD_RESERVED; + else + { + edata.cmd = ARM_EXIDX_CMD_WCGR_POP; + edata.data = op2 & 0x0f; + } + } + else + edata.cmd = ARM_EXIDX_CMD_RESERVED; + + ret = arm_exidx_apply_cmd (&edata, c); + if (ret < 0) + return ret; + } + return 0; +} + +/** + * Reads the entry from the given cursor and extracts the unwind instructions + * into buf. Returns the number of the extracted unwind insns or + * -UNW_ESTOPUNWIND if the special bit pattern ARM_EXIDX_CANT_UNWIND (0x1) was + * found. + */ +HIDDEN int +arm_exidx_extract (struct dwarf_cursor *c, uint8_t *buf) +{ + int nbuf = 0; + unw_word_t entry = (unw_word_t) c->pi.unwind_info; + unw_word_t addr; + uint32_t data; + + /* An ARM unwind entry consists of a prel31 offset to the start of a + function followed by 31bits of data: + * if set to 0x1: the function cannot be unwound (EXIDX_CANTUNWIND) + * if bit 31 is one: this is a table entry itself (ARM_EXIDX_COMPACT) + * if bit 31 is zero: this is a prel31 offset of the start of the + table entry for this function */ + if (prel31_to_addr(c->as, c->as_arg, entry, &addr) < 0) + return -UNW_EINVAL; + + if ((*c->as->acc.access_mem)(c->as, entry + 4, &data, 0, c->as_arg) < 0) + return -UNW_EINVAL; + + if (data == ARM_EXIDX_CANT_UNWIND) + { + Debug (2, "0x1 [can't unwind]\n"); + nbuf = -UNW_ESTOPUNWIND; + } + else if (data & ARM_EXIDX_COMPACT) + { + Debug (2, "%p compact model %d [%8.8x]\n", (void *)addr, + (data >> 24) & 0x7f, data); + buf[nbuf++] = data >> 16; + buf[nbuf++] = data >> 8; + buf[nbuf++] = data; + } + else + { + unw_word_t extbl_data; + unsigned int n_table_words = 0; + + if (prel31_to_addr(c->as, c->as_arg, entry + 4, &extbl_data) < 0) + return -UNW_EINVAL; + + if ((*c->as->acc.access_mem)(c->as, extbl_data, &data, 0, c->as_arg) < 0) + return -UNW_EINVAL; + + if (data & ARM_EXIDX_COMPACT) + { + int pers = (data >> 24) & 0x0f; + Debug (2, "%p compact model %d [%8.8x]\n", (void *)addr, pers, data); + if (pers == 1 || pers == 2) + { + n_table_words = (data >> 16) & 0xff; + extbl_data += 4; + } + else + buf[nbuf++] = data >> 16; + buf[nbuf++] = data >> 8; + buf[nbuf++] = data; + } + else + { + unw_word_t pers; + if (prel31_to_addr (c->as, c->as_arg, extbl_data, &pers) < 0) + return -UNW_EINVAL; + Debug (2, "%p Personality routine: %8p\n", (void *)addr, + (void *)pers); + if ((*c->as->acc.access_mem)(c->as, extbl_data + 4, &data, 0, + c->as_arg) < 0) + return -UNW_EINVAL; + n_table_words = data >> 24; + buf[nbuf++] = data >> 16; + buf[nbuf++] = data >> 8; + buf[nbuf++] = data; + extbl_data += 8; + } + assert (n_table_words <= 5); + unsigned j; + for (j = 0; j < n_table_words; j++) + { + if ((*c->as->acc.access_mem)(c->as, extbl_data, &data, 0, + c->as_arg) < 0) + return -UNW_EINVAL; + extbl_data += 4; + buf[nbuf++] = data >> 24; + buf[nbuf++] = data >> 16; + buf[nbuf++] = data >> 8; + buf[nbuf++] = data >> 0; + } + } + + if (nbuf > 0 && buf[nbuf - 1] != ARM_EXTBL_OP_FINISH) + buf[nbuf++] = ARM_EXTBL_OP_FINISH; + + return nbuf; +} + +static int +arm_search_unwind_table (unw_addr_space_t as, unw_word_t ip, + unw_dyn_info_t *di, unw_proc_info_t *pi, + int need_unwind_info, void *arg) +{ + /* The .ARM.exidx section contains a sorted list of key-value pairs - + the unwind entries. The 'key' is a prel31 offset to the start of a + function. We binary search this section in order to find the + appropriate unwind entry. */ + unw_word_t first = di->u.rti.table_data; + unw_word_t last = di->u.rti.table_data + di->u.rti.table_len - 8; + unw_word_t entry, val; + + if (prel31_to_addr (as, arg, first, &val) < 0 || ip < val) + return -UNW_ENOINFO; + + if (prel31_to_addr (as, arg, last, &val) < 0) + return -UNW_EINVAL; + + if (ip >= val) + { + entry = last; + + if (prel31_to_addr (as, arg, last, &pi->start_ip) < 0) + return -UNW_EINVAL; + + pi->end_ip = di->end_ip -1; + } + else + { + while (first < last - 8) + { + entry = first + (((last - first) / 8 + 1) >> 1) * 8; + + if (prel31_to_addr (as, arg, entry, &val) < 0) + return -UNW_EINVAL; + + if (ip < val) + last = entry; + else + first = entry; + } + + entry = first; + + if (prel31_to_addr (as, arg, entry, &pi->start_ip) < 0) + return -UNW_EINVAL; + + if (prel31_to_addr (as, arg, entry + 8, &pi->end_ip) < 0) + return -UNW_EINVAL; + + pi->end_ip--; + } + + if (need_unwind_info) + { + pi->unwind_info_size = 8; + pi->unwind_info = (void *) entry; + pi->format = UNW_INFO_FORMAT_ARM_EXIDX; + } + return 0; +} + +int +tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip, + unw_dyn_info_t *di, unw_proc_info_t *pi, + int need_unwind_info, void *arg) +{ + if (UNW_TRY_METHOD (UNW_ARM_METHOD_EXIDX) + && di->format == UNW_INFO_FORMAT_ARM_EXIDX) + return arm_search_unwind_table (as, ip, di, pi, need_unwind_info, arg); + else if (UNW_TRY_METHOD(UNW_ARM_METHOD_DWARF) + && di->format != UNW_INFO_FORMAT_ARM_EXIDX) + return dwarf_search_unwind_table (as, ip, di, pi, need_unwind_info, arg); + + return -UNW_ENOINFO; +} + +#ifndef UNW_REMOTE_ONLY +/** + * Callback to dl_iterate_phdr to find infos about the ARM exidx segment. + */ +static int +arm_phdr_cb (struct dl_phdr_info *info, size_t size, void *data) +{ + struct arm_cb_data *cb_data = data; + const Elf_W(Phdr) *p_text = NULL; + const Elf_W(Phdr) *p_arm_exidx = NULL; + const Elf_W(Phdr) *phdr = info->dlpi_phdr; + long n; + + for (n = info->dlpi_phnum; --n >= 0; phdr++) + { + switch (phdr->p_type) + { + case PT_LOAD: + if (cb_data->ip >= phdr->p_vaddr + info->dlpi_addr && + cb_data->ip < phdr->p_vaddr + info->dlpi_addr + phdr->p_memsz) + p_text = phdr; + break; + + case PT_ARM_EXIDX: + p_arm_exidx = phdr; + break; + + default: + break; + } + } + + if (p_text && p_arm_exidx) + { + cb_data->di.format = UNW_INFO_FORMAT_ARM_EXIDX; + cb_data->di.start_ip = p_text->p_vaddr + info->dlpi_addr; + cb_data->di.end_ip = cb_data->di.start_ip + p_text->p_memsz; + cb_data->di.u.rti.name_ptr = (unw_word_t) info->dlpi_name; + cb_data->di.u.rti.table_data = p_arm_exidx->p_vaddr + info->dlpi_addr; + cb_data->di.u.rti.table_len = p_arm_exidx->p_memsz; + return 1; + } + + return 0; +} + +HIDDEN int +arm_find_proc_info2 (unw_addr_space_t as, unw_word_t ip, + unw_proc_info_t *pi, int need_unwind_info, void *arg, + int methods) +{ + int ret = -1; + intrmask_t saved_mask; + + Debug (14, "looking for IP=0x%lx\n", (long) ip); + + if (UNW_TRY_METHOD (UNW_ARM_METHOD_DWARF) && (methods & UNW_ARM_METHOD_DWARF)) + ret = dwarf_find_proc_info (as, ip, pi, need_unwind_info, arg); + + if (ret < 0 && UNW_TRY_METHOD (UNW_ARM_METHOD_EXIDX) && + (methods & UNW_ARM_METHOD_EXIDX)) + { + struct arm_cb_data cb_data; + + memset (&cb_data, 0, sizeof (cb_data)); + cb_data.ip = ip; + cb_data.pi = pi; + cb_data.di.format = -1; + + SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &saved_mask); + ret = as->iterate_phdr_function (arm_phdr_cb, &cb_data); + SIGPROCMASK (SIG_SETMASK, &saved_mask, NULL); + + if (cb_data.di.format != -1) + ret = arm_search_unwind_table (as, ip, &cb_data.di, pi, + need_unwind_info, arg); + else + ret = -UNW_ENOINFO; + } + + return ret; +} + +HIDDEN int +arm_find_proc_info (unw_addr_space_t as, unw_word_t ip, + unw_proc_info_t *pi, int need_unwind_info, void *arg) +{ + return arm_find_proc_info2 (as, ip, pi, need_unwind_info, arg, + UNW_ARM_METHOD_ALL); +} + +HIDDEN void +arm_put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg) +{ + /* it's a no-op */ +} +#endif /* !UNW_REMOTE_ONLY */ + diff --git a/vendor/libunwind/src/arm/Gget_proc_info.c b/vendor/libunwind/src/arm/Gget_proc_info.c new file mode 100644 index 0000000000..4051a10766 --- /dev/null +++ b/vendor/libunwind/src/arm/Gget_proc_info.c @@ -0,0 +1,41 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +int +unw_get_proc_info (unw_cursor_t *cursor, unw_proc_info_t *pi) +{ + struct cursor *c = (struct cursor *) cursor; + int ret; + + /* We can only unwind using Dwarf into on ARM: return failure code + if it's not present. */ + ret = dwarf_make_proc_info (&c->dwarf); + if (ret < 0) + return ret; + + *pi = c->dwarf.pi; + return 0; +} diff --git a/vendor/libunwind/src/arm/Gget_save_loc.c b/vendor/libunwind/src/arm/Gget_save_loc.c new file mode 100644 index 0000000000..906c5b180d --- /dev/null +++ b/vendor/libunwind/src/arm/Gget_save_loc.c @@ -0,0 +1,100 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +int +unw_get_save_loc (unw_cursor_t *cursor, int reg, unw_save_loc_t *sloc) +{ + struct cursor *c = (struct cursor *) cursor; + dwarf_loc_t loc; + + loc = DWARF_NULL_LOC; /* default to "not saved" */ + + switch (reg) + { + case UNW_ARM_R0: + case UNW_ARM_R1: + case UNW_ARM_R2: + case UNW_ARM_R3: + case UNW_ARM_R4: + case UNW_ARM_R5: + case UNW_ARM_R6: + case UNW_ARM_R7: + case UNW_ARM_R8: + case UNW_ARM_R9: + case UNW_ARM_R10: + case UNW_ARM_R11: + case UNW_ARM_R12: + case UNW_ARM_R13: + case UNW_ARM_R14: + case UNW_ARM_R15: + loc = c->dwarf.loc[reg - UNW_ARM_R0]; + break; + + case UNW_ARM_D0: + case UNW_ARM_D1: + case UNW_ARM_D2: + case UNW_ARM_D3: + case UNW_ARM_D4: + case UNW_ARM_D5: + case UNW_ARM_D6: + case UNW_ARM_D7: + case UNW_ARM_D8: + case UNW_ARM_D9: + case UNW_ARM_D10: + case UNW_ARM_D11: + case UNW_ARM_D12: + case UNW_ARM_D13: + case UNW_ARM_D14: + case UNW_ARM_D15: + loc = c->dwarf.loc[UNW_ARM_S0 + (reg - UNW_ARM_D0)]; + break; + + default: + break; + } + + memset (sloc, 0, sizeof (*sloc)); + + if (DWARF_IS_NULL_LOC (loc)) + { + sloc->type = UNW_SLT_NONE; + return 0; + } + +#if !defined(UNW_LOCAL_ONLY) + if (DWARF_IS_REG_LOC (loc)) + { + sloc->type = UNW_SLT_REG; + sloc->u.regnum = DWARF_GET_LOC (loc); + } + else +#endif + { + sloc->type = UNW_SLT_MEMORY; + sloc->u.addr = DWARF_GET_LOC (loc); + } + return 0; +} diff --git a/vendor/libunwind/src/arm/Gglobal.c b/vendor/libunwind/src/arm/Gglobal.c new file mode 100644 index 0000000000..0700f930f4 --- /dev/null +++ b/vendor/libunwind/src/arm/Gglobal.c @@ -0,0 +1,70 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" +#include "dwarf_i.h" + +HIDDEN define_lock (arm_lock); +HIDDEN atomic_bool tdep_init_done = 0; + +/* Unwinding methods to use. See UNW_METHOD_ enums */ +#if defined(__ANDROID__) +/* Android only supports three types of unwinding methods. */ +HIDDEN int unwi_unwind_method = UNW_ARM_METHOD_DWARF | UNW_ARM_METHOD_EXIDX | UNW_ARM_METHOD_LR; +#else +HIDDEN int unwi_unwind_method = UNW_ARM_METHOD_ALL; +#endif + +HIDDEN void +tdep_init (void) +{ + intrmask_t saved_mask; + + sigfillset (&unwi_full_mask); + + lock_acquire (&arm_lock, saved_mask); + { + if (atomic_load(&tdep_init_done)) + /* another thread else beat us to it... */ + goto out; + + /* read ARM unwind method setting */ + const char* str = getenv ("UNW_ARM_UNWIND_METHOD"); + if (str) + { + unwi_unwind_method = atoi (str); + } + + mi_init (); + + dwarf_init (); + +#ifndef UNW_REMOTE_ONLY + arm_local_addr_space_init (); +#endif + atomic_store(&tdep_init_done, 1); /* signal that we're initialized... */ + } + out: + lock_release (&arm_lock, saved_mask); +} diff --git a/vendor/libunwind/src/arm/Ginit.c b/vendor/libunwind/src/arm/Ginit.c new file mode 100644 index 0000000000..20071fd013 --- /dev/null +++ b/vendor/libunwind/src/arm/Ginit.c @@ -0,0 +1,203 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include +#include + +#include "unwind_i.h" + +#ifdef UNW_REMOTE_ONLY + +/* unw_local_addr_space is a NULL pointer in this case. */ +unw_addr_space_t unw_local_addr_space; + +#else /* !UNW_REMOTE_ONLY */ + +static struct unw_addr_space local_addr_space; + +unw_addr_space_t unw_local_addr_space = &local_addr_space; + +static inline void * +uc_addr (unw_tdep_context_t *uc, int reg) +{ + if (reg >= UNW_ARM_R0 && reg < UNW_ARM_R0 + 16) + return &uc->regs[reg - UNW_ARM_R0]; + else if (reg >= UNW_ARM_D0 && reg <= UNW_ARM_D15) + return &uc->fpregs[reg - UNW_ARM_D0]; + else + return NULL; +} + +# ifdef UNW_LOCAL_ONLY + +HIDDEN void * +tdep_uc_addr (unw_tdep_context_t *uc, int reg) +{ + return uc_addr (uc, reg); +} + +# endif /* UNW_LOCAL_ONLY */ + +static int +get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) +{ +#ifndef UNW_LOCAL_ONLY +# pragma weak _U_dyn_info_list_addr + if (!_U_dyn_info_list_addr) + return -UNW_ENOINFO; +#endif + // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. + *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; +} + + +static int +access_mem (unw_addr_space_t as, unw_word_t addr, unw_word_t *val, int write, + void *arg) +{ + const struct cursor *c = (const struct cursor *) arg; + + if (write) + { + Debug (16, "mem[%x] <- %x\n", addr, *val); + memcpy ((void *) addr, val, sizeof(unw_word_t)); + } + else + { + if (likely (c!= NULL) && unlikely (c->validate) + && unlikely (!unw_address_is_valid (addr, sizeof(unw_word_t)))) + { + Debug (16, "mem[%#010lx] -> invalid\n", (long)addr); + return -1; + } + memcpy (val, (void *) addr, sizeof(unw_word_t)); + Debug (16, "mem[%#010lx] -> %#010lx\n", (long)addr, (long)*val); + } + return 0; +} + +static int +access_reg (unw_addr_space_t as, unw_regnum_t reg, unw_word_t *val, int write, + void *arg) +{ + unw_word_t *addr; + unw_tdep_context_t *uc = arg; + + if (unw_is_fpreg (reg)) + goto badreg; + + if (!(addr = uc_addr (uc, reg))) + goto badreg; + + if (write) + { + memcpy ((void *) addr, val, sizeof(unw_word_t)); + Debug (12, "%s <- %x\n", unw_regname (reg), *val); + } + else + { + memcpy (val, (void *) addr, sizeof(unw_word_t)); + Debug (12, "%s -> %x\n", unw_regname (reg), *val); + } + return 0; + + badreg: + Debug (1, "bad register number %u\n", reg); + return -UNW_EBADREG; +} + +static int +access_fpreg (unw_addr_space_t as, unw_regnum_t reg, unw_fpreg_t *val, + int write, void *arg) +{ + unw_tdep_context_t *uc = arg; + unw_fpreg_t *addr; + + if (!unw_is_fpreg (reg)) + goto badreg; + + if (!(addr = uc_addr (uc, reg))) + goto badreg; + + if (write) + { + Debug (12, "%s <- %08lx.%08lx.%08lx\n", unw_regname (reg), + ((long *)val)[0], ((long *)val)[1], ((long *)val)[2]); + *(unw_fpreg_t *) addr = *val; + } + else + { + *val = *(unw_fpreg_t *) addr; + Debug (12, "%s -> %08lx.%08lx.%08lx\n", unw_regname (reg), + ((long *)val)[0], ((long *)val)[1], ((long *)val)[2]); + } + return 0; + + badreg: + Debug (1, "bad register number %u\n", reg); + /* attempt to access a non-preserved register */ + return -UNW_EBADREG; +} + +static int +get_static_proc_name (unw_addr_space_t as, unw_word_t ip, + char *buf, size_t buf_len, unw_word_t *offp, + void *arg) +{ + return _Uelf32_get_proc_name (as, getpid (), ip, buf, buf_len, offp); +} + +static int +get_static_elf_filename (unw_addr_space_t as, unw_word_t ip, + char *buf, size_t buf_len, unw_word_t *offp, + void *arg) +{ + return _Uelf32_get_elf_filename (as, getpid (), ip, buf, buf_len, offp); +} + +HIDDEN void +arm_local_addr_space_init (void) +{ + memset (&local_addr_space, 0, sizeof (local_addr_space)); +#ifndef UNW_REMOTE_ONLY +# if defined(HAVE_DL_ITERATE_PHDR) + local_addr_space.iterate_phdr_function = dl_iterate_phdr; +# endif +#endif + local_addr_space.caching_policy = UNWI_DEFAULT_CACHING_POLICY; + local_addr_space.acc.find_proc_info = arm_find_proc_info; + local_addr_space.acc.put_unwind_info = arm_put_unwind_info; + local_addr_space.acc.get_dyn_info_list_addr = get_dyn_info_list_addr; + local_addr_space.acc.access_mem = access_mem; + local_addr_space.acc.access_reg = access_reg; + local_addr_space.acc.access_fpreg = access_fpreg; + local_addr_space.acc.resume = arm_local_resume; + local_addr_space.acc.get_proc_name = get_static_proc_name; + local_addr_space.acc.get_elf_filename = get_static_elf_filename; + unw_flush_cache (&local_addr_space, 0, 0); +} + +#endif /* !UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/src/arm/Ginit_local.c b/vendor/libunwind/src/arm/Ginit_local.c new file mode 100644 index 0000000000..8679805dfa --- /dev/null +++ b/vendor/libunwind/src/arm/Ginit_local.c @@ -0,0 +1,78 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright 2011 Linaro Limited + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" +#include "init.h" + +#ifdef UNW_REMOTE_ONLY + +int +unw_init_local (unw_cursor_t *cursor, unw_context_t *uc) +{ + return -UNW_EINVAL; +} + +#else /* !UNW_REMOTE_ONLY */ + +static int +unw_init_local_common (unw_cursor_t *cursor, unw_context_t *uc, unsigned use_prev_instr) +{ + struct cursor *c = (struct cursor *) cursor; + + if (!atomic_load(&tdep_init_done)) + tdep_init (); + + Debug (1, "(cursor=%p)\n", c); + + c->dwarf.as = unw_local_addr_space; + c->dwarf.as_arg = uc; + + return common_init (c, use_prev_instr); +} + +int +unw_init_local (unw_cursor_t *cursor, unw_context_t *uc) +{ + return unw_init_local_common(cursor, uc, 1); +} + +int +unw_init_local2 (unw_cursor_t *cursor, unw_context_t *uc, int flag) +{ + if (!flag) + { + return unw_init_local_common(cursor, uc, 1); + } + else if (flag == UNW_INIT_SIGNAL_FRAME) + { + return unw_init_local_common(cursor, uc, 0); + } + else + { + return -UNW_EINVAL; + } +} + +#endif /* !UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/src/arm/Ginit_remote.c b/vendor/libunwind/src/arm/Ginit_remote.c new file mode 100644 index 0000000000..26d11ba942 --- /dev/null +++ b/vendor/libunwind/src/arm/Ginit_remote.c @@ -0,0 +1,45 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "init.h" +#include "unwind_i.h" + +int +unw_init_remote (unw_cursor_t *cursor, unw_addr_space_t as, void *as_arg) +{ +#ifdef UNW_LOCAL_ONLY + return -UNW_EINVAL; +#else /* !UNW_LOCAL_ONLY */ + struct cursor *c = (struct cursor *) cursor; + + if (!atomic_load(&tdep_init_done)) + tdep_init (); + + Debug (1, "(cursor=%p)\n", c); + + c->dwarf.as = as; + c->dwarf.as_arg = as_arg; + return common_init (c, 0); +#endif /* !UNW_LOCAL_ONLY */ +} diff --git a/vendor/libunwind/src/arm/Gos-freebsd.c b/vendor/libunwind/src/arm/Gos-freebsd.c new file mode 100644 index 0000000000..1566a813b1 --- /dev/null +++ b/vendor/libunwind/src/arm/Gos-freebsd.c @@ -0,0 +1,132 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright 2011 Linaro Limited + Copyright (C) 2012 Tommi Rantala + Copyright 2015 The FreeBSD Foundation + + Portions of this software were developed by Konstantin Belousov + under sponsorship from the FreeBSD Foundation. + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include +#include +#include "unwind_i.h" +#include "offsets.h" +#include "ex_tables.h" + +HIDDEN int +arm_handle_signal_frame (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + int i, ret, fmt; + unw_word_t sc_addr, sp, sp_addr = c->dwarf.cfa; + struct dwarf_loc sp_loc = DWARF_LOC (sp_addr, 0); + + if ((ret = dwarf_get (&c->dwarf, sp_loc, &sp)) < 0) + return -UNW_EUNSPEC; + fmt = unw_is_signal_frame(cursor); + + c->dwarf.pi_valid = 0; + + if (fmt == UNW_ARM_FRAME_SYSCALL) + { + c->sigcontext_format = ARM_SCF_FREEBSD_SYSCALL; + c->frame_info.frame_type = UNW_ARM_FRAME_SYSCALL; + c->frame_info.cfa_reg_offset = 0; + c->dwarf.loc[UNW_ARM_R7] = c->dwarf.loc[UNW_ARM_R12]; + dwarf_get (&c->dwarf, c->dwarf.loc[UNW_ARM_R14], &c->dwarf.ip); + return 1; + } + + c->sigcontext_format = ARM_SCF_FREEBSD_SIGFRAME; + sc_addr = sp_addr; + + /* Save the SP and PC to be able to return execution at this point + later in time (unw_resume). */ + c->sigcontext_sp = c->dwarf.cfa; + c->sigcontext_pc = c->dwarf.ip; + + c->sigcontext_addr = sc_addr; + c->frame_info.frame_type = UNW_ARM_FRAME_SIGRETURN; + c->frame_info.cfa_reg_offset = sc_addr - sp_addr; + + for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) + c->dwarf.loc[i] = DWARF_NULL_LOC; + + /* Update the dwarf cursor. + Set the location of the registers to the corresponding addresses of the + uc_mcontext / sigcontext structure contents. */ +#define ROFF(n) (FREEBSD_SC_UCONTEXT_OFF + FREEBSD_UC_MCONTEXT_OFF + \ + FREEBSD_MC_R0_OFF + (n) * 4) +#define SL(n) \ + c->dwarf.loc[UNW_ARM_R ## n] = DWARF_LOC (sc_addr + ROFF(n), 0); + SL(0); SL(1); SL(2); SL(3); SL(4); SL(5); SL(6); SL(7); + SL(8); SL(9); SL(10); SL(11); SL(12); SL(13); SL(14); SL(15); +#undef SL +#undef ROFF + + /* Set SP/CFA and PC/IP. */ + dwarf_get (&c->dwarf, c->dwarf.loc[UNW_ARM_R13], &c->dwarf.cfa); + dwarf_get (&c->dwarf, c->dwarf.loc[UNW_ARM_R15], &c->dwarf.ip); + + return 1; +} + +/* Returns 1 in case of a non-RT signal frame and 2 in case of a RT signal + frame. */ +int +unw_is_signal_frame (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + unw_word_t w0, w1, w2, w3, ip; + unw_addr_space_t as; + unw_accessors_t *a; + void *arg; + int ret; + + as = c->dwarf.as; + a = unw_get_accessors_int (as); + arg = c->dwarf.as_arg; + + ip = c->dwarf.ip; + + if ((ret = (*a->access_mem) (as, ip, &w0, 0, arg)) < 0) + return ret; + if ((ret = (*a->access_mem) (as, ip + 4, &w1, 0, arg)) < 0) + return ret; + if ((ret = (*a->access_mem) (as, ip + 8, &w2, 0, arg)) < 0) + return ret; + if ((ret = (*a->access_mem) (as, ip + 12, &w3, 0, arg)) < 0) + return ret; + + if (w0 == 0xe1a0000d && w1 == 0xe2800040 && w2 == 0xe59f700c && + w3 == 0xef0001a1) + return UNW_ARM_FRAME_SIGRETURN; + + if ((ret = (*a->access_mem) (as, ip - 4, &w0, 0, arg)) < 0) + return ret; + if (w0 == 0xef000000) + return UNW_ARM_FRAME_SYSCALL; + + return 0; +} diff --git a/vendor/libunwind/src/arm/Gos-linux.c b/vendor/libunwind/src/arm/Gos-linux.c new file mode 100644 index 0000000000..197030307e --- /dev/null +++ b/vendor/libunwind/src/arm/Gos-linux.c @@ -0,0 +1,185 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright 2011 Linaro Limited + Copyright (C) 2012 Tommi Rantala + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include +#include +#include "unwind_i.h" +#include "offsets.h" + +HIDDEN int +arm_handle_signal_frame (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + int i, ret; + unw_word_t sc_addr, sp, sp_addr = c->dwarf.cfa; + struct dwarf_loc sp_loc = DWARF_LOC (sp_addr, 0); + + if ((ret = dwarf_get (&c->dwarf, sp_loc, &sp)) < 0) + return -UNW_EUNSPEC; + + /* Obtain signal frame type (non-RT or RT). */ + ret = unw_is_signal_frame (cursor); + + /* Save the SP and PC to be able to return execution at this point + later in time (unw_resume). */ + c->sigcontext_sp = c->dwarf.cfa; + c->sigcontext_pc = c->dwarf.ip; + + /* Since kernel version 2.6.18 the non-RT signal frame starts with a + ucontext while the RT signal frame starts with a siginfo, followed + by a sigframe whose first element is an ucontext. + Prior 2.6.18 the non-RT signal frame starts with a sigcontext while + the RT signal frame starts with two pointers followed by a siginfo + and an ucontext. The first pointer points to the start of the siginfo + structure and the second one to the ucontext structure. */ + + if (ret == 1) + { + /* Handle non-RT signal frames. Check if the first word on the stack + is the magic number. */ + if (sp == 0x5ac3c35a) + { + c->sigcontext_format = ARM_SCF_LINUX_SIGFRAME; + sc_addr = sp_addr + LINUX_UC_MCONTEXT_OFF; + } + else + { + c->sigcontext_format = ARM_SCF_LINUX_OLD_SIGFRAME; + sc_addr = sp_addr; + } + } + else if (ret == 2) + { + /* Handle RT signal frames. Check if the first word on the stack is a + pointer to the siginfo structure. */ + if (sp == sp_addr + 8) + { + c->sigcontext_format = ARM_SCF_LINUX_OLD_RT_SIGFRAME; + sc_addr = sp_addr + 8 + sizeof (siginfo_t) + LINUX_UC_MCONTEXT_OFF; + } + else + { + c->sigcontext_format = ARM_SCF_LINUX_RT_SIGFRAME; + sc_addr = sp_addr + sizeof (siginfo_t) + LINUX_UC_MCONTEXT_OFF; + } + } + else + return -UNW_EUNSPEC; + + c->sigcontext_addr = sc_addr; + c->frame_info.frame_type = UNW_ARM_FRAME_SIGRETURN; + c->frame_info.cfa_reg_offset = sc_addr - sp_addr; + + for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) + c->dwarf.loc[i] = DWARF_NULL_LOC; + + /* Update the dwarf cursor. + Set the location of the registers to the corresponding addresses of the + uc_mcontext / sigcontext structure contents. */ + c->dwarf.loc[UNW_ARM_R0] = DWARF_LOC (sc_addr + LINUX_SC_R0_OFF, 0); + c->dwarf.loc[UNW_ARM_R1] = DWARF_LOC (sc_addr + LINUX_SC_R1_OFF, 0); + c->dwarf.loc[UNW_ARM_R2] = DWARF_LOC (sc_addr + LINUX_SC_R2_OFF, 0); + c->dwarf.loc[UNW_ARM_R3] = DWARF_LOC (sc_addr + LINUX_SC_R3_OFF, 0); + c->dwarf.loc[UNW_ARM_R4] = DWARF_LOC (sc_addr + LINUX_SC_R4_OFF, 0); + c->dwarf.loc[UNW_ARM_R5] = DWARF_LOC (sc_addr + LINUX_SC_R5_OFF, 0); + c->dwarf.loc[UNW_ARM_R6] = DWARF_LOC (sc_addr + LINUX_SC_R6_OFF, 0); + c->dwarf.loc[UNW_ARM_R7] = DWARF_LOC (sc_addr + LINUX_SC_R7_OFF, 0); + c->dwarf.loc[UNW_ARM_R8] = DWARF_LOC (sc_addr + LINUX_SC_R8_OFF, 0); + c->dwarf.loc[UNW_ARM_R9] = DWARF_LOC (sc_addr + LINUX_SC_R9_OFF, 0); + c->dwarf.loc[UNW_ARM_R10] = DWARF_LOC (sc_addr + LINUX_SC_R10_OFF, 0); + c->dwarf.loc[UNW_ARM_R11] = DWARF_LOC (sc_addr + LINUX_SC_FP_OFF, 0); + c->dwarf.loc[UNW_ARM_R12] = DWARF_LOC (sc_addr + LINUX_SC_IP_OFF, 0); + c->dwarf.loc[UNW_ARM_R13] = DWARF_LOC (sc_addr + LINUX_SC_SP_OFF, 0); + c->dwarf.loc[UNW_ARM_R14] = DWARF_LOC (sc_addr + LINUX_SC_LR_OFF, 0); + c->dwarf.loc[UNW_ARM_R15] = DWARF_LOC (sc_addr + LINUX_SC_PC_OFF, 0); + + /* Set SP/CFA and PC/IP. */ + dwarf_get (&c->dwarf, c->dwarf.loc[UNW_ARM_R13], &c->dwarf.cfa); + dwarf_get (&c->dwarf, c->dwarf.loc[UNW_ARM_R15], &c->dwarf.ip); + + c->dwarf.pi_valid = 0; + + return 1; +} + +#define ARM_NR_sigreturn 119 +#define ARM_NR_rt_sigreturn 173 +#define ARM_NR_OABI_SYSCALL_BASE 0x900000 + +/* ARM EABI sigreturn (the syscall number is loaded into r7) */ +#define MOV_R7_SIGRETURN (0xe3a07000UL | ARM_NR_sigreturn) +#define MOV_R7_RT_SIGRETURN (0xe3a07000UL | ARM_NR_rt_sigreturn) + +/* ARM OABI sigreturn (using SWI) */ +#define ARM_SIGRETURN \ + (0xef000000UL | ARM_NR_sigreturn | ARM_NR_OABI_SYSCALL_BASE) +#define ARM_RT_SIGRETURN \ + (0xef000000UL | ARM_NR_rt_sigreturn | ARM_NR_OABI_SYSCALL_BASE) + +/* Thumb sigreturn (two insns, syscall number is loaded into r7) */ +#define THUMB_SIGRETURN (0xdf00UL << 16 | 0x2700 | ARM_NR_sigreturn) +#define THUMB_RT_SIGRETURN (0xdf00UL << 16 | 0x2700 | ARM_NR_rt_sigreturn) + +/* Thumb2 sigreturn (mov.w r7, $SYS_ify(rt_sigreturn/sigreturn)) */ +#define THUMB2_SIGRETURN (((0x0700 | ARM_NR_sigreturn) << 16) | \ + 0xf04f) +#define THUMB2_RT_SIGRETURN (((0x0700 | ARM_NR_rt_sigreturn) << 16) | \ + 0xf04f) +/* TODO: with different toolchains, there are a lot more possibilities */ + +/* Returns 1 in case of a non-RT signal frame and 2 in case of a RT signal + frame. */ +int +unw_is_signal_frame (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + unw_word_t w0, ip; + unw_addr_space_t as; + unw_accessors_t *a; + void *arg; + int ret; + + as = c->dwarf.as; + a = unw_get_accessors_int (as); + arg = c->dwarf.as_arg; + + /* The least bit denotes thumb/arm mode. Do not read there. */ + ip = c->dwarf.ip & ~0x1; + + if ((ret = (*a->access_mem) (as, ip, &w0, 0, arg)) < 0) + return ret; + + /* Return 1 if the IP points to a non-RT sigreturn sequence. */ + if (w0 == MOV_R7_SIGRETURN || w0 == ARM_SIGRETURN || w0 == THUMB_SIGRETURN + || w0 == THUMB2_SIGRETURN) + return 1; + /* Return 2 if the IP points to a RT sigreturn sequence. */ + else if (w0 == MOV_R7_RT_SIGRETURN || w0 == ARM_RT_SIGRETURN + || w0 == THUMB_RT_SIGRETURN || w0 == THUMB2_RT_SIGRETURN) + return 2; + + return 0; +} diff --git a/vendor/libunwind/src/arm/Gos-other.c b/vendor/libunwind/src/arm/Gos-other.c new file mode 100644 index 0000000000..73c102c3d2 --- /dev/null +++ b/vendor/libunwind/src/arm/Gos-other.c @@ -0,0 +1,48 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright 2011 Linaro Limited + Copyright (C) 2012 Tommi Rantala + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include +#include +#include "unwind_i.h" +#include "offsets.h" + +HIDDEN int +arm_handle_signal_frame (unw_cursor_t *cursor) +{ + return -UNW_EUNSPEC; +} + +int +unw_is_signal_frame (unw_cursor_t *cursor) +{ +#if defined(__QNX__) + /* Not supported yet */ + return 0; +#else + printf ("%s: implement me\n", __FUNCTION__); + return -UNW_ENOINFO; +#endif +} diff --git a/vendor/libunwind/src/arm/Greg_states_iterate.c b/vendor/libunwind/src/arm/Greg_states_iterate.c new file mode 100644 index 0000000000..a17dc1b561 --- /dev/null +++ b/vendor/libunwind/src/arm/Greg_states_iterate.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +int +unw_reg_states_iterate (unw_cursor_t *cursor, + unw_reg_states_callback cb, void *token) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_reg_states_iterate (&c->dwarf, cb, token); +} diff --git a/vendor/libunwind/src/arm/Gregs.c b/vendor/libunwind/src/arm/Gregs.c new file mode 100644 index 0000000000..30720631ce --- /dev/null +++ b/vendor/libunwind/src/arm/Gregs.c @@ -0,0 +1,112 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +HIDDEN int +tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, + int write) +{ + dwarf_loc_t loc = DWARF_NULL_LOC; + + switch (reg) + { + case UNW_ARM_R15: + if (write) + c->dwarf.ip = *valp; /* update the IP cache */ + case UNW_ARM_R0: + case UNW_ARM_R1: + case UNW_ARM_R2: + case UNW_ARM_R3: + case UNW_ARM_R4: + case UNW_ARM_R5: + case UNW_ARM_R6: + case UNW_ARM_R7: + case UNW_ARM_R8: + case UNW_ARM_R9: + case UNW_ARM_R10: + case UNW_ARM_R11: + case UNW_ARM_R12: + case UNW_ARM_R14: + loc = c->dwarf.loc[reg - UNW_ARM_R0]; + break; + + case UNW_ARM_R13: + case UNW_ARM_CFA: + if (write) + return -UNW_EREADONLYREG; + *valp = c->dwarf.cfa; + return 0; + + /* FIXME: Initialise coprocessor & shadow registers? */ + + default: + Debug (1, "bad register number %u\n", reg); + return -UNW_EBADREG; + } + + if (write) + return dwarf_put (&c->dwarf, loc, *valp); + else + return dwarf_get (&c->dwarf, loc, valp); +} + +/* FIXME for ARM. */ + +HIDDEN int +tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, unw_fpreg_t *valp, + int write) +{ + dwarf_loc_t loc = DWARF_NULL_LOC; + switch (reg) + { + case UNW_ARM_D0: + case UNW_ARM_D1: + case UNW_ARM_D2: + case UNW_ARM_D3: + case UNW_ARM_D4: + case UNW_ARM_D5: + case UNW_ARM_D6: + case UNW_ARM_D7: + case UNW_ARM_D8: + case UNW_ARM_D9: + case UNW_ARM_D10: + case UNW_ARM_D11: + case UNW_ARM_D12: + case UNW_ARM_D13: + case UNW_ARM_D14: + case UNW_ARM_D15: + loc = c->dwarf.loc[UNW_ARM_S0 + (reg - UNW_ARM_D0)]; + break; + + default: + Debug (1, "bad register number %u\n", reg); + return -UNW_EBADREG; + } + + if (write) + return dwarf_putfp (&c->dwarf, loc, *valp); + else + return dwarf_getfp (&c->dwarf, loc, valp); +} diff --git a/vendor/libunwind/src/arm/Gresume.c b/vendor/libunwind/src/arm/Gresume.c new file mode 100644 index 0000000000..ed284e7277 --- /dev/null +++ b/vendor/libunwind/src/arm/Gresume.c @@ -0,0 +1,154 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright 2011 Linaro Limited + Copyright (C) 2012 Tommi Rantala + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" +#include "offsets.h" + +#ifndef UNW_REMOTE_ONLY + +HIDDEN inline int +arm_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg) +{ +#ifdef __linux__ + struct cursor *c = (struct cursor *) cursor; + unw_tdep_context_t *uc = c->dwarf.as_arg; + + if (c->sigcontext_format == ARM_SCF_NONE) + { + /* Since there are no signals involved here we restore the non scratch + registers only. */ + unsigned long regs[10]; + regs[0] = uc->regs[4]; + regs[1] = uc->regs[5]; + regs[2] = uc->regs[6]; + regs[3] = uc->regs[7]; + regs[4] = uc->regs[8]; + regs[5] = uc->regs[9]; + regs[6] = uc->regs[10]; + regs[7] = uc->regs[11]; /* FP */ + regs[8] = uc->regs[13]; /* SP */ + regs[9] = uc->regs[15]; /* PC */ + + struct regs_overlay { + char x[sizeof(regs)]; + }; + + __asm__ __volatile__ ( + "ldmia %0, {r4-r12, lr}\n" + "mov sp, r12\n" + "bx lr\n" + : : "r" (regs), + "m" (*(struct regs_overlay *)regs) + ); + } + else + { + /* In case a signal frame is involved, we're using its trampoline which + calls sigreturn. */ + struct sigcontext *sc = (struct sigcontext *) c->sigcontext_addr; + sc->arm_r0 = uc->regs[0]; + sc->arm_r1 = uc->regs[1]; + sc->arm_r2 = uc->regs[2]; + sc->arm_r3 = uc->regs[3]; + sc->arm_r4 = uc->regs[4]; + sc->arm_r5 = uc->regs[5]; + sc->arm_r6 = uc->regs[6]; + sc->arm_r7 = uc->regs[7]; + sc->arm_r8 = uc->regs[8]; + sc->arm_r9 = uc->regs[9]; + sc->arm_r10 = uc->regs[10]; + sc->arm_fp = uc->regs[11]; /* FP */ + sc->arm_ip = uc->regs[12]; /* IP */ + sc->arm_sp = uc->regs[13]; /* SP */ + sc->arm_lr = uc->regs[14]; /* LR */ + sc->arm_pc = uc->regs[15]; /* PC */ + /* clear the ITSTATE bits. */ + sc->arm_cpsr &= 0xf9ff03ffUL; + + /* Set the SP and the PC in order to continue execution at the modified + trampoline which restores the signal mask and the registers. */ + __asm__ __volatile__ ( + "mov sp, %0\n" + "bx %1\n" + : : "r" (c->sigcontext_sp), "r" (c->sigcontext_pc) + ); + } + unreachable(); +#else + printf ("%s: implement me\n", __FUNCTION__); +#endif + return -UNW_EINVAL; +} + +#endif /* !UNW_REMOTE_ONLY */ + +static inline void +establish_machine_state (struct cursor *c) +{ + unw_addr_space_t as = c->dwarf.as; + void *arg = c->dwarf.as_arg; + unw_fpreg_t fpval; + unw_word_t val; + int reg; + + Debug (8, "copying out cursor state\n"); + + for (reg = 0; reg <= UNW_REG_LAST; ++reg) + { + Debug (16, "copying %s %d\n", unw_regname (reg), reg); + if (unw_is_fpreg (reg)) + { + if (tdep_access_fpreg (c, reg, &fpval, 0) >= 0) + as->acc.access_fpreg (as, reg, &fpval, 1, arg); + } + else + { + if (tdep_access_reg (c, reg, &val, 0) >= 0) + as->acc.access_reg (as, reg, &val, 1, arg); + } + } +} + +int +unw_resume (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + + Debug (1, "(cursor=%p)\n", c); + + if (!c->dwarf.ip) + { + /* This can happen easily when the frame-chain gets truncated + due to bad or missing unwind-info. */ + Debug (1, "refusing to resume execution at address 0\n"); + return -UNW_EINVAL; + } + + establish_machine_state (c); + + return (*c->dwarf.as->acc.resume) (c->dwarf.as, (unw_cursor_t *) c, + c->dwarf.as_arg); +} diff --git a/vendor/libunwind/src/arm/Gstash_frame.c b/vendor/libunwind/src/arm/Gstash_frame.c new file mode 100644 index 0000000000..a30d24cfe3 --- /dev/null +++ b/vendor/libunwind/src/arm/Gstash_frame.c @@ -0,0 +1,99 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2010, 2011 by FERMI NATIONAL ACCELERATOR LABORATORY + Copyright (C) 2014 CERN and Aalto University + Contributed by Filip Nyback + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +HIDDEN void +tdep_stash_frame (struct dwarf_cursor *d, struct dwarf_reg_state *rs) +{ + struct cursor *c = (struct cursor *) dwarf_to_cursor (d); + unw_tdep_frame_t *f = &c->frame_info; + + Debug (4, "ip=0x%x cfa=0x%x type %d cfa [where=%d val=%d] cfaoff=%d" + " ra=0x%x r7 [where=%d val=%d @0x%x] lr [where=%d val=%d @0x%x] " + "sp [where=%d val=%d @0x%x]\n", + d->ip, d->cfa, f->frame_type, + rs->reg.where[DWARF_CFA_REG_COLUMN], + rs->reg.val[DWARF_CFA_REG_COLUMN], + rs->reg.val[DWARF_CFA_OFF_COLUMN], + DWARF_GET_LOC(d->loc[rs->ret_addr_column]), + rs->reg.where[R7], rs->reg.val[R7], DWARF_GET_LOC(d->loc[R7]), + rs->reg.where[LR], rs->reg.val[LR], DWARF_GET_LOC(d->loc[LR]), + rs->reg.where[SP], rs->reg.val[SP], DWARF_GET_LOC(d->loc[SP])); + + /* A standard frame is defined as: + - CFA is register-relative offset off R7 or SP; + - Return address is saved in LR; + - R7 is unsaved or saved at CFA+offset, offset != -1; + - LR is unsaved or saved at CFA+offset, offset != -1; + - SP is unsaved or saved at CFA+offset, offset != -1. */ + if (f->frame_type == UNW_ARM_FRAME_OTHER + && (rs->reg.where[DWARF_CFA_REG_COLUMN] == DWARF_WHERE_REG) + && (rs->reg.val[DWARF_CFA_REG_COLUMN] == R7 + || rs->reg.val[DWARF_CFA_REG_COLUMN] == SP) + && labs(rs->reg.val[DWARF_CFA_OFF_COLUMN]) < (1 << 29) + && rs->ret_addr_column == LR + && (rs->reg.where[R7] == DWARF_WHERE_UNDEF + || rs->reg.where[R7] == DWARF_WHERE_SAME + || rs->reg.where[R7] == DWARF_WHERE_CFA + || (rs->reg.where[R7] == DWARF_WHERE_CFAREL + && labs(rs->reg.val[R7]) < (1 << 29) + && rs->reg.val[R7]+1 != 0)) + && (rs->reg.where[LR] == DWARF_WHERE_UNDEF + || rs->reg.where[LR] == DWARF_WHERE_SAME + || rs->reg.where[R7] == DWARF_WHERE_CFA + || (rs->reg.where[LR] == DWARF_WHERE_CFAREL + && labs(rs->reg.val[LR]) < (1 << 29) + && rs->reg.val[LR]+1 != 0)) + && (rs->reg.where[SP] == DWARF_WHERE_UNDEF + || rs->reg.where[SP] == DWARF_WHERE_SAME + || rs->reg.where[SP] == DWARF_WHERE_CFA + || (rs->reg.where[SP] == DWARF_WHERE_CFAREL + && labs(rs->reg.val[SP]) < (1 << 29) + && rs->reg.val[SP]+1 != 0))) + { + /* Save information for a standard frame. */ + f->frame_type = UNW_ARM_FRAME_STANDARD; + f->cfa_reg_sp = (rs->reg.val[DWARF_CFA_REG_COLUMN] == SP); + f->cfa_reg_offset = rs->reg.val[DWARF_CFA_OFF_COLUMN]; + if (rs->reg.where[R7] == DWARF_WHERE_CFAREL) + f->r7_cfa_offset = rs->reg.val[R7]; + if (rs->reg.where[LR] == DWARF_WHERE_CFAREL) + f->lr_cfa_offset = rs->reg.val[LR]; + if (rs->reg.where[SP] == DWARF_WHERE_CFAREL) + f->sp_cfa_offset = rs->reg.val[SP]; + if (rs->reg.where[R7] == DWARF_WHERE_CFA) + f->r7_cfa_offset = 0; + if (rs->reg.where[LR] == DWARF_WHERE_CFA) + f->lr_cfa_offset = 0; + if (rs->reg.where[SP] == DWARF_WHERE_CFA) + f->sp_cfa_offset = 0; + Debug (4, " standard frame\n"); + } + else + Debug (4, " unusual frame\n"); +} + diff --git a/vendor/libunwind/src/arm/Gstep.c b/vendor/libunwind/src/arm/Gstep.c new file mode 100644 index 0000000000..fccbbd5ff3 --- /dev/null +++ b/vendor/libunwind/src/arm/Gstep.c @@ -0,0 +1,225 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright 2011 Linaro Limited + Copyright (C) 2012 Tommi Rantala + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" +#include "offsets.h" +#include "ex_tables.h" + +#include + +#define arm_exidx_step UNW_OBJ(arm_exidx_step) + +static inline int +arm_exidx_step (struct cursor *c) +{ + unw_word_t old_ip, old_cfa; + uint8_t buf[32]; + int ret; + + old_ip = c->dwarf.ip; + old_cfa = c->dwarf.cfa; + + /* mark PC unsaved */ + c->dwarf.loc[UNW_ARM_R15] = DWARF_NULL_LOC; + unw_word_t ip = c->dwarf.ip; + if (c->dwarf.use_prev_instr) + /* The least bit denotes thumb/arm mode, clear it. */ + ip = (ip & ~(unw_word_t)0x1) - 1; + + /* check dynamic info first --- it overrides everything else */ + ret = unwi_find_dynamic_proc_info (c->dwarf.as, ip, &c->dwarf.pi, 1, + c->dwarf.as_arg); + if (ret == -UNW_ENOINFO) + { +#ifdef UNW_LOCAL_ONLY + if ((ret = arm_find_proc_info2 (c->dwarf.as, ip, &c->dwarf.pi, + 1, c->dwarf.as_arg, + UNW_ARM_METHOD_EXIDX)) < 0) + return ret; +#else + if ((ret = tdep_find_proc_info (&c->dwarf, ip, 1)) < 0) + return ret; +#endif + } + + if (c->dwarf.pi.format != UNW_INFO_FORMAT_ARM_EXIDX) + return -UNW_ENOINFO; + + ret = arm_exidx_extract (&c->dwarf, buf); + if (ret < 0) + return ret; + + ret = arm_exidx_decode (buf, ret, &c->dwarf); + if (ret < 0) + return ret; + + if (c->dwarf.ip == old_ip && c->dwarf.cfa == old_cfa) + { + Dprintf ("%s: ip and cfa unchanged; stopping here (ip=0x%lx)\n", + __FUNCTION__, (long) c->dwarf.ip); + return -UNW_EBADFRAME; + } + + c->dwarf.pi_valid = 0; + + return (c->dwarf.ip == 0) ? 0 : 1; +} + +int +unw_step (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + int ret = -UNW_EUNSPEC; + int has_stopunwind = 0; + int validate = c->validate; + c->validate = 1; + + Debug (1, "(cursor=%p)\n", c); + + /* Check if this is a signal frame. */ + if (unw_is_signal_frame (cursor) > 0) + return arm_handle_signal_frame (cursor); + + /* First, try extbl-based unwinding. */ + if (UNW_TRY_METHOD (UNW_ARM_METHOD_EXIDX)) + { + ret = arm_exidx_step (c); + Debug(1, "arm_exidx_step()=%d\n", ret); + if (ret > 0) + { + c->validate = validate; + return 1; + } + if (ret == 0) + { + c->validate = validate; + return ret; + } + if (ret == -UNW_ESTOPUNWIND) + has_stopunwind = 1; + } + +#ifdef CONFIG_DEBUG_FRAME + /* Second, try DWARF-based unwinding. */ + if (UNW_TRY_METHOD(UNW_ARM_METHOD_DWARF)) + { + Debug (13, "%s(ret=%d), trying extbl\n", + UNW_TRY_METHOD(UNW_ARM_METHOD_EXIDX) ? "arm_exidx_step() failed " : "", + ret); + ret = dwarf_step (&c->dwarf); + Debug(1, "dwarf_step()=%d\n", ret); + + if (likely (ret > 0)) + { + c->validate = validate; + return 1; + } + + if (ret < 0 && ret != -UNW_ENOINFO) + { + Debug (2, "returning %d\n", ret); + c->validate = validate; + return ret; + } + } +#endif /* CONFIG_DEBUG_FRAME */ + + c->validate = validate; + // Before trying the fallback, if any unwind info tell us to stop, do that. + if (has_stopunwind) + return -UNW_ESTOPUNWIND; + + /* Fall back on APCS frame parsing. + Note: This won't work in case the ARM EABI is used. */ +#ifdef __FreeBSD__ + if (0) +#else + if (unlikely (ret < 0)) +#endif + { + if (UNW_TRY_METHOD(UNW_ARM_METHOD_FRAME)) + { + Debug (13, "%s%s%s%s(ret=%d), trying frame-chain\n", + UNW_TRY_METHOD(UNW_ARM_METHOD_EXIDX) ? "arm_exidx_step() " : "", + (UNW_TRY_METHOD(UNW_ARM_METHOD_EXIDX) && UNW_TRY_METHOD(UNW_ARM_METHOD_DWARF)) ? "and " : "", + UNW_TRY_METHOD(UNW_ARM_METHOD_DWARF) ? "dwarf_step() " : "", + (UNW_TRY_METHOD(UNW_ARM_METHOD_EXIDX) || UNW_TRY_METHOD(UNW_ARM_METHOD_DWARF)) ? "failed " : "", + ret); + ret = UNW_ESUCCESS; + /* EXIDX and/or DWARF unwinding failed, try to follow APCS/optimized APCS frame chain */ + unw_word_t instr, i; + dwarf_loc_t ip_loc, fp_loc; + unw_word_t frame; + /* Mark all registers unsaved, since we don't know where + they are saved (if at all), except for the EBP and + EIP. */ + if (dwarf_get(&c->dwarf, c->dwarf.loc[UNW_ARM_R11], &frame) < 0) + { + return 0; + } + for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) { + c->dwarf.loc[i] = DWARF_NULL_LOC; + } + if (frame) + { + if (dwarf_get(&c->dwarf, DWARF_LOC(frame, 0), &instr) < 0) + { + return 0; + } + instr -= 8; + if (dwarf_get(&c->dwarf, DWARF_LOC(instr, 0), &instr) < 0) + { + return 0; + } + if ((instr & 0xFFFFD800) == 0xE92DD800) + { + /* Standard APCS frame. */ + ip_loc = DWARF_LOC(frame - 4, 0); + fp_loc = DWARF_LOC(frame - 12, 0); + } + else + { + /* Codesourcery optimized normal frame. */ + ip_loc = DWARF_LOC(frame, 0); + fp_loc = DWARF_LOC(frame - 4, 0); + } + if (dwarf_get(&c->dwarf, ip_loc, &c->dwarf.ip) < 0) + { + return 0; + } + c->dwarf.loc[UNW_ARM_R12] = ip_loc; + c->dwarf.loc[UNW_ARM_R11] = fp_loc; + c->dwarf.pi_valid = 0; + Debug(15, "ip=%x\n", c->dwarf.ip); + } + else + { + ret = -UNW_ENOINFO; + } + } + } + return ret == -UNW_ENOINFO ? 0 : ret; +} diff --git a/vendor/libunwind/src/arm/Gtrace.c b/vendor/libunwind/src/arm/Gtrace.c new file mode 100644 index 0000000000..a73f6cf0a9 --- /dev/null +++ b/vendor/libunwind/src/arm/Gtrace.c @@ -0,0 +1,557 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2010, 2011 by FERMI NATIONAL ACCELERATOR LABORATORY + Copyright (C) 2014 CERN and Aalto University + Contributed by Filip Nyback + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" +#include "offsets.h" +#include +#include + +#pragma weak pthread_once +#pragma weak pthread_key_create +#pragma weak pthread_getspecific +#pragma weak pthread_setspecific + +/* Initial hash table size. Table expands by 2 bits (times four). */ +#define HASH_MIN_BITS 14 + +typedef struct +{ + unw_tdep_frame_t *frames; + size_t log_size; + size_t used; + size_t dtor_count; /* Counts how many times our destructor has already + been called. */ +} unw_trace_cache_t; + +static const unw_tdep_frame_t empty_frame = { 0, UNW_ARM_FRAME_OTHER, -1, -1, 0, -1, -1, -1 }; +static define_lock (trace_init_lock); +static pthread_once_t trace_cache_once = PTHREAD_ONCE_INIT; +static sig_atomic_t trace_cache_once_happen; +static pthread_key_t trace_cache_key; +static struct mempool trace_cache_pool; +static _Thread_local unw_trace_cache_t *tls_cache; +static _Thread_local int tls_cache_destroyed; + +/* Free memory for a thread's trace cache. */ +static void +trace_cache_free (void *arg) +{ + unw_trace_cache_t *cache = arg; + if (++cache->dtor_count < PTHREAD_DESTRUCTOR_ITERATIONS) + { + /* Not yet our turn to get destroyed. Re-install ourselves into the key. */ + pthread_setspecific(trace_cache_key, cache); + Debug(5, "delayed freeing cache %p (%zx to go)\n", cache, + PTHREAD_DESTRUCTOR_ITERATIONS - cache->dtor_count); + return; + } + tls_cache_destroyed = 1; + tls_cache = NULL; + mi_munmap (cache->frames, (1u << cache->log_size) * sizeof(unw_tdep_frame_t)); + mempool_free (&trace_cache_pool, cache); + Debug(5, "freed cache %p\n", cache); +} + +/* Initialise frame tracing for threaded use. */ +static void +trace_cache_init_once (void) +{ + pthread_key_create (&trace_cache_key, &trace_cache_free); + mempool_init (&trace_cache_pool, sizeof (unw_trace_cache_t), 0); + trace_cache_once_happen = 1; +} + +static unw_tdep_frame_t * +trace_cache_buckets (size_t n) +{ + unw_tdep_frame_t *frames; + size_t i; + + GET_MEMORY(frames, n * sizeof (unw_tdep_frame_t)); + if (likely(frames != NULL)) + for (i = 0; i < n; ++i) + frames[i] = empty_frame; + + return frames; +} + +/* Allocate and initialise hash table for frame cache lookups. + Returns the cache initialised with (1u << HASH_LOW_BITS) hash + buckets, or NULL if there was a memory allocation problem. */ +static unw_trace_cache_t * +trace_cache_create (void) +{ + unw_trace_cache_t *cache; + + if (tls_cache_destroyed) + { + /* The current thread is in the process of exiting. Don't recreate + cache, as we wouldn't have another chance to free it. */ + Debug(5, "refusing to reallocate cache: " + "thread-locals are being deallocated\n"); + return NULL; + } + + if (! (cache = mempool_alloc(&trace_cache_pool))) + { + Debug(5, "failed to allocate cache\n"); + return NULL; + } + + if (! (cache->frames = trace_cache_buckets(1u << HASH_MIN_BITS))) + { + Debug(5, "failed to allocate buckets\n"); + mempool_free(&trace_cache_pool, cache); + return NULL; + } + + cache->log_size = HASH_MIN_BITS; + cache->used = 0; + cache->dtor_count = 0; + tls_cache_destroyed = 0; /* Paranoia: should already be 0. */ + Debug(5, "allocated cache %p\n", cache); + return cache; +} + +/* Expand the hash table in the frame cache if possible. This always + quadruples the hash size, and clears all previous frame entries. */ +static int +trace_cache_expand (unw_trace_cache_t *cache) +{ + size_t old_size = (1u << cache->log_size); + size_t new_log_size = cache->log_size + 2; + unw_tdep_frame_t *new_frames = trace_cache_buckets (1u << new_log_size); + + if (unlikely(! new_frames)) + { + Debug(5, "failed to expand cache to 2^%u buckets\n", new_log_size); + return -UNW_ENOMEM; + } + + Debug(5, "expanded cache from 2^%u to 2^%u buckets\n", cache->log_size, + new_log_size); + mi_munmap(cache->frames, old_size * sizeof(unw_tdep_frame_t)); + cache->frames = new_frames; + cache->log_size = new_log_size; + cache->used = 0; + return 0; +} + +static unw_trace_cache_t * +trace_cache_get_unthreaded (void) +{ + unw_trace_cache_t *cache; + intrmask_t saved_mask; + static unw_trace_cache_t *global_cache = NULL; + lock_acquire (&trace_init_lock, saved_mask); + if (! global_cache) + { + mempool_init (&trace_cache_pool, sizeof (unw_trace_cache_t), 0); + global_cache = trace_cache_create (); + } + cache = global_cache; + lock_release (&trace_init_lock, saved_mask); + Debug(5, "using cache %p\n", cache); + return cache; +} + +/* Get the frame cache for the current thread. Create it if there is none. */ +static unw_trace_cache_t * +trace_cache_get (void) +{ + unw_trace_cache_t *cache; + if (likely (pthread_once != NULL)) + { + pthread_once(&trace_cache_once, &trace_cache_init_once); + if (!trace_cache_once_happen) + { + return trace_cache_get_unthreaded(); + } + if (! (cache = tls_cache)) + { + cache = trace_cache_create(); + pthread_setspecific(trace_cache_key, cache); + tls_cache = cache; + } + Debug(5, "using cache %p\n", cache); + return cache; + } + else + { + return trace_cache_get_unthreaded(); + } +} + +/* Initialise frame properties for address cache slot F at address + PC using current CFA, R7 and SP values. Modifies CURSOR to + that location, performs one unw_step(), and fills F with what + was discovered about the location. Returns F. + + FIXME: This probably should tell DWARF handling to never evaluate + or use registers other than R7, SP and PC in case there is + highly unusual unwind info which uses these creatively. */ +static unw_tdep_frame_t * +trace_init_addr (unw_tdep_frame_t *f, + unw_cursor_t *cursor, + unw_word_t cfa, + unw_word_t pc, + unw_word_t r7, + unw_word_t sp) +{ + struct cursor *c = (struct cursor *) cursor; + struct dwarf_cursor *d = &c->dwarf; + int ret = -UNW_EINVAL; + + /* Initialise frame properties: unknown, not last. */ + f->virtual_address = pc; + f->frame_type = UNW_ARM_FRAME_OTHER; + f->last_frame = 0; + f->cfa_reg_sp = -1; + f->cfa_reg_offset = 0; + f->r7_cfa_offset = -1; + f->lr_cfa_offset = -1; + f->sp_cfa_offset = -1; + + /* Reinitialise cursor to this instruction - but undo next/prev RIP + adjustment because unw_step will redo it - and force PC, R7 and + SP into register locations (=~ ucontext we keep), then set + their desired values. Then perform the step. */ + d->ip = pc + d->use_prev_instr; + d->cfa = cfa; + d->loc[UNW_ARM_R7] = DWARF_REG_LOC (d, UNW_ARM_R7); + d->loc[UNW_ARM_R13] = DWARF_REG_LOC (d, UNW_ARM_R13); + d->loc[UNW_ARM_R15] = DWARF_REG_LOC (d, UNW_ARM_R15); + c->frame_info = *f; + + if (likely(dwarf_put (d, d->loc[UNW_ARM_R7], r7) >= 0) + && likely(dwarf_put (d, d->loc[UNW_ARM_R13], sp) >= 0) + && likely(dwarf_put (d, d->loc[UNW_ARM_R15], pc) >= 0) + && likely((ret = unw_step (cursor)) >= 0)) + *f = c->frame_info; + + /* If unw_step() stopped voluntarily, remember that, even if it + otherwise could not determine anything useful. This avoids + failing trace if we hit frames without unwind info, which is + common for the outermost frame (CRT stuff) on many systems. + This avoids failing trace in very common circumstances; failing + to unw_step() loop wouldn't produce any better result. */ + if (ret == 0) + f->last_frame = -1; + + Debug (3, "frame va %x type %d last %d cfa %s+%d r7 @ cfa%+d lr @ cfa%+d sp @ cfa%+d\n", + f->virtual_address, f->frame_type, f->last_frame, + f->cfa_reg_sp ? "sp" : "r7", f->cfa_reg_offset, + f->r7_cfa_offset, f->lr_cfa_offset, f->sp_cfa_offset); + + return f; +} + +/* Look up and if necessary fill in frame attributes for address PC + in CACHE using current CFA, R7 and SP values. Uses CURSOR to + perform any unwind steps necessary to fill the cache. Returns the + frame cache slot which describes RIP. */ +static unw_tdep_frame_t * +trace_lookup (unw_cursor_t *cursor, + unw_trace_cache_t *cache, + unw_word_t cfa, + unw_word_t pc, + unw_word_t r7, + unw_word_t sp) +{ + /* First look up for previously cached information using cache as + linear probing hash table with probe step of 1. Majority of + lookups should be completed within few steps, but it is very + important the hash table does not fill up, or performance falls + off the cliff. */ + uint32_t i, addr; + uint32_t cache_size = 1u << cache->log_size; + uint32_t slot = ((pc * 0x9e3779b9) >> 11) & (cache_size-1); + unw_tdep_frame_t *frame; + + for (i = 0; i < 16; ++i) + { + frame = &cache->frames[slot]; + addr = frame->virtual_address; + + /* Return if we found the address. */ + if (likely(addr == pc)) + { + Debug (4, "found address after %d steps\n", i); + return frame; + } + + /* If slot is empty, reuse it. */ + if (likely(! addr)) + break; + + /* Linear probe to next slot candidate, step = 1. */ + if (++slot >= cache_size) + slot -= cache_size; + } + + /* If we collided after 16 steps, or if the hash is more than half + full, force the hash to expand. Fill the selected slot, whether + it's free or collides. Note that hash expansion drops previous + contents; further lookups will refill the hash. */ + Debug (4, "updating slot %u after %d steps, replacing 0x%x\n", slot, i, addr); + if (unlikely(addr || cache->used >= cache_size / 2)) + { + if (unlikely(trace_cache_expand (cache) < 0)) + return NULL; + + cache_size = 1u << cache->log_size; + slot = ((pc * 0x9e3779b9) >> 11) & (cache_size-1); + frame = &cache->frames[slot]; + addr = frame->virtual_address; + } + + if (! addr) + ++cache->used; + + return trace_init_addr (frame, cursor, cfa, pc, r7, sp); +} + +/* Fast stack backtrace for ARM. + + This is used by backtrace() implementation to accelerate frequent + queries for current stack, without any desire to unwind. It fills + BUFFER with the call tree from CURSOR upwards for at most SIZE + stack levels. The first frame, backtrace itself, is omitted. When + called, SIZE should give the maximum number of entries that can be + stored into BUFFER. Uses an internal thread-specific cache to + accelerate queries. + + The caller should fall back to a unw_step() loop if this function + fails by returning -UNW_ESTOPUNWIND, meaning the routine hit a + stack frame that is too complex to be traced in the fast path. + + This function is tuned for clients which only need to walk the + stack to get the call tree as fast as possible but without any + other details, for example profilers sampling the stack thousands + to millions of times per second. The routine handles the most + common ARM ABI stack layouts: CFA is R7 or SP plus/minus + constant offset, return address is in LR, and R7, LR and SP are + either unchanged or saved on stack at constant offset from the CFA; + the signal return frame; and frames without unwind info provided + they are at the outermost (final) frame or can conservatively be + assumed to be frame-pointer based. + + Any other stack layout will cause the routine to give up. There + are only a handful of relatively rarely used functions which do + not have a stack in the standard form: vfork, longjmp, setcontext + and _dl_runtime_profile on common linux systems for example. + + On success BUFFER and *SIZE reflect the trace progress up to *SIZE + stack levels or the outermost frame, which ever is less. It may + stop short of outermost frame if unw_step() loop would also do so, + e.g. if there is no more unwind information; this is not reported + as an error. + + The function returns a negative value for errors, -UNW_ESTOPUNWIND + if tracing stopped because of an unusual frame unwind info. The + BUFFER and *SIZE reflect tracing progress up to the error frame. + + Callers of this function would normally look like this: + + unw_cursor_t cur; + unw_context_t ctx; + void addrs[128]; + int depth = 128; + int ret; + + unw_getcontext(&ctx); + unw_init_local(&cur, &ctx); + if ((ret = unw_tdep_trace(&cur, addrs, &depth)) < 0) + { + depth = 0; + unw_getcontext(&ctx); + unw_init_local(&cur, &ctx); + while ((ret = unw_step(&cur)) > 0 && depth < 128) + { + unw_word_t ip; + unw_get_reg(&cur, UNW_REG_IP, &ip); + addresses[depth++] = (void *) ip; + } + } +*/ +HIDDEN int +tdep_trace (unw_cursor_t *cursor, void **buffer, int *size) +{ + struct cursor *c = (struct cursor *) cursor; + struct dwarf_cursor *d = &c->dwarf; + unw_trace_cache_t *cache; + unw_word_t sp, pc, cfa, r7, lr; + int maxdepth = 0; + int depth = 0; + int ret; + + /* Check input parameters. */ + if (unlikely(! cursor || ! buffer || ! size || (maxdepth = *size) <= 0)) + return -UNW_EINVAL; + + Debug (1, "begin ip 0x%x cfa 0x%x\n", d->ip, d->cfa); + + /* Tell core dwarf routines to call back to us. */ + d->stash_frames = 1; + + /* Determine initial register values. These are direct access safe + because we know they come from the initial machine context. */ + pc = d->ip; + sp = cfa = d->cfa; + ACCESS_MEM_FAST(ret, 0, d, DWARF_GET_LOC(d->loc[UNW_ARM_R7]), r7); + assert(ret == 0); + lr = 0; + + /* Get frame cache. */ + if (unlikely(! (cache = trace_cache_get()))) + { + Debug (1, "returning %d, cannot get trace cache\n", -UNW_ENOMEM); + *size = 0; + d->stash_frames = 0; + return -UNW_ENOMEM; + } + + /* Trace the stack upwards, starting from current PC. Adjust + the PC address for previous/next instruction as the main + unwinding logic would also do. We undo this before calling + back into unw_step(). */ + while (depth < maxdepth) + { + pc -= d->use_prev_instr; + Debug (2, "depth %d cfa 0x%x pc 0x%x sp 0x%x r7 0x%x\n", + depth, cfa, pc, sp, r7); + + /* See if we have this address cached. If not, evaluate enough of + the dwarf unwind information to fill the cache line data, or to + decide this frame cannot be handled in fast trace mode. We + cache negative results too to prevent unnecessary dwarf parsing + for common failures. */ + unw_tdep_frame_t *f = trace_lookup (cursor, cache, cfa, pc, r7, sp); + + /* If we don't have information for this frame, give up. */ + if (unlikely(! f)) + { + ret = -UNW_ENOINFO; + break; + } + + Debug (3, "frame va %x type %d last %d cfa %s+%d r7 @ cfa%+d lr @ cfa%+d sp @ cfa%+d\n", + f->virtual_address, f->frame_type, f->last_frame, + f->cfa_reg_sp ? "sp" : "r7", f->cfa_reg_offset, + f->r7_cfa_offset, f->lr_cfa_offset, f->sp_cfa_offset); + + assert (f->virtual_address == pc); + + /* Stop if this was the last frame. In particular don't evaluate + new register values as it may not be safe - we don't normally + run with full validation on, and do not want to - and there's + enough bad unwind info floating around that we need to trust + what unw_step() previously said, in potentially bogus frames. */ + if (f->last_frame) + break; + + /* Evaluate CFA and registers for the next frame. */ + switch (f->frame_type) + { + case UNW_ARM_FRAME_GUESSED: + /* Fall thru to standard processing after forcing validation. */ + c->validate = 1; + + case UNW_ARM_FRAME_STANDARD: + /* Advance standard traceable frame. */ + cfa = (f->cfa_reg_sp ? sp : r7) + f->cfa_reg_offset; + if (likely(f->lr_cfa_offset != -1)) + ACCESS_MEM_FAST(ret, c->validate, d, cfa + f->lr_cfa_offset, pc); + else if (lr != 0) + { + /* Use the saved link register as the new pc. */ + pc = lr; + lr = 0; + } + if (likely(ret >= 0) && likely(f->r7_cfa_offset != -1)) + ACCESS_MEM_FAST(ret, c->validate, d, cfa + f->r7_cfa_offset, r7); + + /* Don't bother reading SP from DWARF, CFA becomes new SP. */ + sp = cfa; + + /* Next frame needs to back up for unwind info lookup. */ + d->use_prev_instr = 1; + break; + + case UNW_ARM_FRAME_SIGRETURN: + cfa = cfa + f->cfa_reg_offset; /* cfa now points to ucontext_t. */ +#if defined(__linux__) + ACCESS_MEM_FAST(ret, c->validate, d, cfa + LINUX_SC_PC_OFF, pc); + if (likely(ret >= 0)) + ACCESS_MEM_FAST(ret, c->validate, d, cfa + LINUX_SC_R7_OFF, r7); + if (likely(ret >= 0)) + ACCESS_MEM_FAST(ret, c->validate, d, cfa + LINUX_SC_SP_OFF, sp); + /* Save the link register here in case we end up in a function that + doesn't save the link register in the prologue, e.g. kill. */ + if (likely(ret >= 0)) + ACCESS_MEM_FAST(ret, c->validate, d, cfa + LINUX_SC_LR_OFF, lr); +#elif defined(__FreeBSD__) + #error implement UNW_ARM_FRAME_SIGRETURN on FreeBSD +#endif + + /* Resume stack at signal restoration point. The stack is not + necessarily continuous here, especially with sigaltstack(). */ + cfa = sp; + + /* Next frame should not back up. */ + d->use_prev_instr = 0; + break; + + case UNW_ARM_FRAME_SYSCALL: + Dprintf ("%s: implement me\n", __FUNCTION__); + break; + + default: + /* We cannot trace through this frame, give up and tell the + caller we had to stop. Data collected so far may still be + useful to the caller, so let it know how far we got. */ + ret = -UNW_ESTOPUNWIND; + break; + } + + Debug (4, "new cfa 0x%x pc 0x%x sp 0x%x r7 0x%x\n", + cfa, pc, sp, r7); + + /* If we failed or ended up somewhere bogus, stop. */ + if (unlikely(ret < 0 || pc < 0x4000)) + break; + + /* Record this address in stack trace. We skipped the first address. */ + buffer[depth++] = (void *) (pc - d->use_prev_instr); + } + +#if UNW_DEBUG + Debug (1, "returning %d, depth %d\n", ret, depth); +#endif + *size = depth; + return ret; +} + diff --git a/vendor/libunwind/src/arm/Lapply_reg_state.c b/vendor/libunwind/src/arm/Lapply_reg_state.c new file mode 100644 index 0000000000..7ebada480e --- /dev/null +++ b/vendor/libunwind/src/arm/Lapply_reg_state.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gapply_reg_state.c" +#endif diff --git a/vendor/libunwind/src/arm/Lcreate_addr_space.c b/vendor/libunwind/src/arm/Lcreate_addr_space.c new file mode 100644 index 0000000000..0f2dc6be90 --- /dev/null +++ b/vendor/libunwind/src/arm/Lcreate_addr_space.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gcreate_addr_space.c" +#endif diff --git a/vendor/libunwind/src/arm/Lex_tables.c b/vendor/libunwind/src/arm/Lex_tables.c new file mode 100644 index 0000000000..4a4f925c9c --- /dev/null +++ b/vendor/libunwind/src/arm/Lex_tables.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gex_tables.c" +#endif diff --git a/vendor/libunwind/src/arm/Lget_proc_info.c b/vendor/libunwind/src/arm/Lget_proc_info.c new file mode 100644 index 0000000000..69028b019f --- /dev/null +++ b/vendor/libunwind/src/arm/Lget_proc_info.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gget_proc_info.c" +#endif diff --git a/vendor/libunwind/src/arm/Lget_save_loc.c b/vendor/libunwind/src/arm/Lget_save_loc.c new file mode 100644 index 0000000000..9ea048a907 --- /dev/null +++ b/vendor/libunwind/src/arm/Lget_save_loc.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gget_save_loc.c" +#endif diff --git a/vendor/libunwind/src/arm/Lglobal.c b/vendor/libunwind/src/arm/Lglobal.c new file mode 100644 index 0000000000..6d7b489e14 --- /dev/null +++ b/vendor/libunwind/src/arm/Lglobal.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gglobal.c" +#endif diff --git a/vendor/libunwind/src/arm/Linit.c b/vendor/libunwind/src/arm/Linit.c new file mode 100644 index 0000000000..e9abfdd46a --- /dev/null +++ b/vendor/libunwind/src/arm/Linit.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Ginit.c" +#endif diff --git a/vendor/libunwind/src/arm/Linit_local.c b/vendor/libunwind/src/arm/Linit_local.c new file mode 100644 index 0000000000..68a1687e85 --- /dev/null +++ b/vendor/libunwind/src/arm/Linit_local.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Ginit_local.c" +#endif diff --git a/vendor/libunwind/src/arm/Linit_remote.c b/vendor/libunwind/src/arm/Linit_remote.c new file mode 100644 index 0000000000..58cb04ab7c --- /dev/null +++ b/vendor/libunwind/src/arm/Linit_remote.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Ginit_remote.c" +#endif diff --git a/vendor/libunwind/src/arm/Los-freebsd.c b/vendor/libunwind/src/arm/Los-freebsd.c new file mode 100644 index 0000000000..a75a205df1 --- /dev/null +++ b/vendor/libunwind/src/arm/Los-freebsd.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gos-freebsd.c" +#endif diff --git a/vendor/libunwind/src/arm/Los-linux.c b/vendor/libunwind/src/arm/Los-linux.c new file mode 100644 index 0000000000..3cc18aabcc --- /dev/null +++ b/vendor/libunwind/src/arm/Los-linux.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gos-linux.c" +#endif diff --git a/vendor/libunwind/src/arm/Los-other.c b/vendor/libunwind/src/arm/Los-other.c new file mode 100644 index 0000000000..a75a205df1 --- /dev/null +++ b/vendor/libunwind/src/arm/Los-other.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gos-freebsd.c" +#endif diff --git a/vendor/libunwind/src/arm/Lreg_states_iterate.c b/vendor/libunwind/src/arm/Lreg_states_iterate.c new file mode 100644 index 0000000000..f1eb1e79dc --- /dev/null +++ b/vendor/libunwind/src/arm/Lreg_states_iterate.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Greg_states_iterate.c" +#endif diff --git a/vendor/libunwind/src/arm/Lregs.c b/vendor/libunwind/src/arm/Lregs.c new file mode 100644 index 0000000000..2c9c75cd7d --- /dev/null +++ b/vendor/libunwind/src/arm/Lregs.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gregs.c" +#endif diff --git a/vendor/libunwind/src/arm/Lresume.c b/vendor/libunwind/src/arm/Lresume.c new file mode 100644 index 0000000000..41a8cf003d --- /dev/null +++ b/vendor/libunwind/src/arm/Lresume.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gresume.c" +#endif diff --git a/vendor/libunwind/src/arm/Lstash_frame.c b/vendor/libunwind/src/arm/Lstash_frame.c new file mode 100644 index 0000000000..77587803d0 --- /dev/null +++ b/vendor/libunwind/src/arm/Lstash_frame.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gstash_frame.c" +#endif diff --git a/vendor/libunwind/src/arm/Lstep.c b/vendor/libunwind/src/arm/Lstep.c new file mode 100644 index 0000000000..c1ac3c7547 --- /dev/null +++ b/vendor/libunwind/src/arm/Lstep.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gstep.c" +#endif diff --git a/vendor/libunwind/src/arm/Ltrace.c b/vendor/libunwind/src/arm/Ltrace.c new file mode 100644 index 0000000000..24b7b3cfa6 --- /dev/null +++ b/vendor/libunwind/src/arm/Ltrace.c @@ -0,0 +1,6 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gtrace.c" +#endif + diff --git a/vendor/libunwind/src/arm/getcontext.S b/vendor/libunwind/src/arm/getcontext.S new file mode 100644 index 0000000000..7e18784477 --- /dev/null +++ b/vendor/libunwind/src/arm/getcontext.S @@ -0,0 +1,63 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "offsets.h" + + .text + .arm + + .global _Uarm_getcontext + .type _Uarm_getcontext, %function + @ This is a stub version of getcontext() for ARM which only stores core + @ registers. It must be called in a special way, not as a regular + @ function -- see also the libunwind-arm.h:unw_tdep_getcontext macro. +_Uarm_getcontext: + stmfd sp!, {r0, r1} + @ store r0 +#if defined(__linux__) + str r0, [r0, #LINUX_UC_MCONTEXT_OFF + LINUX_SC_R0_OFF] + add r0, r0, #LINUX_UC_MCONTEXT_OFF + LINUX_SC_R0_OFF +#elif defined(__FreeBSD__) + str r0, [r0, #FREEBSD_UC_MCONTEXT_OFF + FREEBSD_MC_R0_OFF] + add r0, r0, #FREEBSD_UC_MCONTEXT_OFF + FREEBSD_MC_R0_OFF +#else +#error Fix me +#endif + @ store r1 to r12 + stmib r0, {r1-r12} + @ reconstruct r13 at call site, then store + add r1, sp, #12 + str r1, [r0, #13 * 4] + @ retrieve r14 from call site, then store + ldr r1, [sp, #8] + str r1, [r0, #14 * 4] + @ point lr to instruction after call site's stack adjustment + add r1, lr, #4 + str r1, [r0, #15 * 4] + ldmfd sp!, {r0, r1} + bx lr +#if defined(__linux__) || defined(__FreeBSD__) + /* We do not need executable stack. */ + .section .note.GNU-stack,"",%progbits +#endif diff --git a/vendor/libunwind/src/arm/init.h b/vendor/libunwind/src/arm/init.h new file mode 100644 index 0000000000..44cf7c229c --- /dev/null +++ b/vendor/libunwind/src/arm/init.h @@ -0,0 +1,94 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +static inline int +common_init (struct cursor *c, unsigned use_prev_instr) +{ + int ret, i; + + c->dwarf.loc[UNW_ARM_R0] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_R0); + c->dwarf.loc[UNW_ARM_R1] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_R1); + c->dwarf.loc[UNW_ARM_R2] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_R2); + c->dwarf.loc[UNW_ARM_R3] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_R3); + c->dwarf.loc[UNW_ARM_R4] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_R4); + c->dwarf.loc[UNW_ARM_R5] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_R5); + c->dwarf.loc[UNW_ARM_R6] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_R6); + c->dwarf.loc[UNW_ARM_R7] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_R7); + c->dwarf.loc[UNW_ARM_R8] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_R8); + c->dwarf.loc[UNW_ARM_R9] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_R9); + c->dwarf.loc[UNW_ARM_R10] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_R10); + c->dwarf.loc[UNW_ARM_R11] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_R11); + c->dwarf.loc[UNW_ARM_R12] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_R12); + c->dwarf.loc[UNW_ARM_R13] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_R13); + c->dwarf.loc[UNW_ARM_R14] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_R14); + c->dwarf.loc[UNW_ARM_R15] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_R15); + c->dwarf.loc[UNW_ARM_S0] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_S0); + c->dwarf.loc[UNW_ARM_S1] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_S1); + c->dwarf.loc[UNW_ARM_S2] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_S2); + c->dwarf.loc[UNW_ARM_S3] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_S3); + c->dwarf.loc[UNW_ARM_S4] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_S4); + c->dwarf.loc[UNW_ARM_S5] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_S5); + c->dwarf.loc[UNW_ARM_S6] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_S6); + c->dwarf.loc[UNW_ARM_S7] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_S7); + c->dwarf.loc[UNW_ARM_S8] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_S8); + c->dwarf.loc[UNW_ARM_S9] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_S9); + c->dwarf.loc[UNW_ARM_S10] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_S10); + c->dwarf.loc[UNW_ARM_S11] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_S11); + c->dwarf.loc[UNW_ARM_S12] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_S12); + c->dwarf.loc[UNW_ARM_S13] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_S13); + c->dwarf.loc[UNW_ARM_S14] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_S14); + c->dwarf.loc[UNW_ARM_S15] = DWARF_REG_LOC (&c->dwarf, UNW_ARM_S15); + + for (i = UNW_ARM_S15 + 1; i < DWARF_NUM_PRESERVED_REGS; ++i) + c->dwarf.loc[i] = DWARF_NULL_LOC; + + ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_ARM_R15], &c->dwarf.ip); + if (ret < 0) + return ret; + + /* FIXME: correct for ARM? */ + ret = dwarf_get (&c->dwarf, DWARF_REG_LOC (&c->dwarf, UNW_ARM_R13), + &c->dwarf.cfa); + if (ret < 0) + return ret; + + c->sigcontext_format = ARM_SCF_NONE; + c->sigcontext_addr = 0; + c->sigcontext_sp = 0; + c->sigcontext_pc = 0; + + /* FIXME: Initialisation for other registers. */ + + c->dwarf.args_size = 0; + c->dwarf.stash_frames = 0; + c->dwarf.use_prev_instr = use_prev_instr; + c->dwarf.pi_valid = 0; + c->dwarf.pi_is_dynamic = 0; + c->dwarf.hint = 0; + c->dwarf.prev_rs = 0; + + return 0; +} diff --git a/vendor/libunwind/src/arm/is_fpreg.c b/vendor/libunwind/src/arm/is_fpreg.c new file mode 100644 index 0000000000..e55bcff03e --- /dev/null +++ b/vendor/libunwind/src/arm/is_fpreg.c @@ -0,0 +1,39 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +/* FIXME: I'm not sure if libunwind's GP/FP register distinction is very useful + on ARM. Count all the FP or coprocessor registers we know about for now. */ + +int +unw_is_fpreg (int regnum) +{ + return ((regnum >= UNW_ARM_S0 && regnum <= UNW_ARM_S31) + || (regnum >= UNW_ARM_F0 && regnum <= UNW_ARM_F7) + || (regnum >= UNW_ARM_wCGR0 && regnum <= UNW_ARM_wCGR7) + || (regnum >= UNW_ARM_wR0 && regnum <= UNW_ARM_wR15) + || (regnum >= UNW_ARM_wC0 && regnum <= UNW_ARM_wC7) + || (regnum >= UNW_ARM_D0 && regnum <= UNW_ARM_D31)); +} diff --git a/vendor/libunwind/src/arm/offsets.h b/vendor/libunwind/src/arm/offsets.h new file mode 100644 index 0000000000..621701106c --- /dev/null +++ b/vendor/libunwind/src/arm/offsets.h @@ -0,0 +1,42 @@ +/* Linux-specific definitions: */ + +/* Define various structure offsets to simplify cross-compilation. */ + +/* Offsets for ARM Linux "ucontext_t": */ + +#define LINUX_UC_FLAGS_OFF 0x00 +#define LINUX_UC_LINK_OFF 0x04 +#define LINUX_UC_STACK_OFF 0x08 +#define LINUX_UC_MCONTEXT_OFF 0x14 +#define LINUX_UC_SIGMASK_OFF 0x68 +#define LINUX_UC_REGSPACE_OFF 0xE8 + +/* Offsets for ARM Linux "struct sigcontext": */ + +#define LINUX_SC_TRAPNO_OFF 0x00 +#define LINUX_SC_ERRORCODE_OFF 0x04 +#define LINUX_SC_OLDMASK_OFF 0x08 +#define LINUX_SC_R0_OFF 0x0C +#define LINUX_SC_R1_OFF 0x10 +#define LINUX_SC_R2_OFF 0x14 +#define LINUX_SC_R3_OFF 0x18 +#define LINUX_SC_R4_OFF 0x1C +#define LINUX_SC_R5_OFF 0x20 +#define LINUX_SC_R6_OFF 0x24 +#define LINUX_SC_R7_OFF 0x28 +#define LINUX_SC_R8_OFF 0x2C +#define LINUX_SC_R9_OFF 0x30 +#define LINUX_SC_R10_OFF 0x34 +#define LINUX_SC_FP_OFF 0x38 +#define LINUX_SC_IP_OFF 0x3C +#define LINUX_SC_SP_OFF 0x40 +#define LINUX_SC_LR_OFF 0x44 +#define LINUX_SC_PC_OFF 0x48 +#define LINUX_SC_CPSR_OFF 0x4C +#define LINUX_SC_FAULTADDR_OFF 0x50 + +/* FreeBSD-specific definitions: */ + +#define FREEBSD_SC_UCONTEXT_OFF 0x40 +#define FREEBSD_UC_MCONTEXT_OFF 0x10 +#define FREEBSD_MC_R0_OFF 0 diff --git a/vendor/libunwind/src/arm/regname.c b/vendor/libunwind/src/arm/regname.c new file mode 100644 index 0000000000..7cac630c17 --- /dev/null +++ b/vendor/libunwind/src/arm/regname.c @@ -0,0 +1,90 @@ +#include "unwind_i.h" + +static const char *regname[] = + { + /* 0. */ + "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", + /* 8. */ + "r8", "r9", "r10", "fp", "ip", "sp", "lr", "pc", + /* 16. Obsolete FPA names. */ + "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", + /* 24. */ + 0, 0, 0, 0, 0, 0, 0, 0, + /* 32. */ + 0, 0, 0, 0, 0, 0, 0, 0, + /* 40. */ + 0, 0, 0, 0, 0, 0, 0, 0, + /* 48. */ + 0, 0, 0, 0, 0, 0, 0, 0, + /* 56. */ + 0, 0, 0, 0, 0, 0, 0, 0, + /* 64. */ + "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", + /* 72. */ + "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", + /* 80. */ + "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23", + /* 88. */ + "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31", + /* 96. */ + "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", + /* 104. */ + "wCGR0", "wCGR1", "wCGR2", "wCGR3", "wCGR4", "wCGR5", "wCGR6", "wCGR7", + /* 112. */ + "wR0", "wR1", "wR2", "wR3", "wR4", "wR5", "wR6", "wR7", + /* 128. */ + "spsr", "spsr_fiq", "spsr_irq", "spsr_abt", "spsr_und", "spsr_svc", 0, 0, + /* 136. */ + 0, 0, 0, 0, 0, 0, 0, 0, + /* 144. */ + "r8_usr", "r9_usr", "r10_usr", "r11_usr", "r12_usr", "r13_usr", "r14_usr", + /* 151. */ + "r8_fiq", "r9_fiq", "r10_fiq", "r11_fiq", "r12_fiq", "r13_fiq", "r14_fiq", + /* 158. */ + "r13_irq", "r14_irq", + /* 160. */ + "r13_abt", "r14_abt", + /* 162. */ + "r13_und", "r14_und", + /* 164. */ + "r13_svc", "r14_svc", 0, 0, + /* 168. */ + 0, 0, 0, 0, 0, 0, 0, 0, + /* 176. */ + 0, 0, 0, 0, 0, 0, 0, 0, + /* 184. */ + 0, 0, 0, 0, 0, 0, 0, 0, + /* 192. */ + "wC0", "wC1", "wC2", "wC3", "wC4", "wC5", "wC6", "wC7", + /* 200. */ + 0, 0, 0, 0, 0, 0, 0, 0, + /* 208. */ + 0, 0, 0, 0, 0, 0, 0, 0, + /* 216. */ + 0, 0, 0, 0, 0, 0, 0, 0, + /* 224. */ + 0, 0, 0, 0, 0, 0, 0, 0, + /* 232. */ + 0, 0, 0, 0, 0, 0, 0, 0, + /* 240. */ + 0, 0, 0, 0, 0, 0, 0, 0, + /* 248. */ + 0, 0, 0, 0, 0, 0, 0, 0, + /* 256. */ + "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", + /* 264. */ + "d8", "d9", "d10", "d11", "d12", "d13", "d14", "d15", + /* 272. */ + "d16", "d17", "d18", "d19", "d20", "d21", "d22", "d23", + /* 280. */ + "d24", "d25", "d26", "d27", "d28", "d29", "d30", "d31", + }; + +const char * +unw_regname (unw_regnum_t reg) +{ + if (reg < (unw_regnum_t) ARRAY_SIZE (regname)) + return regname[reg]; + else + return "???"; +} diff --git a/vendor/libunwind/src/arm/siglongjmp.S b/vendor/libunwind/src/arm/siglongjmp.S new file mode 100644 index 0000000000..4df0736683 --- /dev/null +++ b/vendor/libunwind/src/arm/siglongjmp.S @@ -0,0 +1,12 @@ + /* Dummy implementation for now. */ + + .globl _UI_siglongjmp_cont + .globl _UI_longjmp_cont + +_UI_siglongjmp_cont: +_UI_longjmp_cont: + bx lr +#ifdef __linux__ + /* We do not need executable stack. */ + .section .note.GNU-stack,"",%progbits +#endif diff --git a/vendor/libunwind/src/arm/unwind_i.h b/vendor/libunwind/src/arm/unwind_i.h new file mode 100644 index 0000000000..fe0bca005b --- /dev/null +++ b/vendor/libunwind/src/arm/unwind_i.h @@ -0,0 +1,62 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef unwind_i_h +#define unwind_i_h + +#include + +#include + +#include "libunwind_i.h" + +/* DWARF column numbers for ARM: */ +#define R7 7 +#define SP 13 +#define LR 14 +#define PC 15 + +#define arm_lock UNW_OBJ(lock) +#define arm_local_resume UNW_OBJ(local_resume) +#define arm_local_addr_space_init UNW_OBJ(local_addr_space_init) + +extern void arm_local_addr_space_init (void); +extern int arm_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, + void *arg); +#define arm_handle_signal_frame UNW_OBJ(handle_signal_frame) +extern int arm_handle_signal_frame(unw_cursor_t *cursor); + +/* By-pass calls to access_mem() when known to be safe. */ +#ifdef UNW_LOCAL_ONLY +# undef ACCESS_MEM_FAST +# define ACCESS_MEM_FAST(ret,validate,cur,addr,to) \ + do { \ + if (unlikely(validate)) \ + (ret) = dwarf_get ((cur), DWARF_MEM_LOC ((cur), (addr)), &(to)); \ + else \ + (ret) = 0, (to) = *(unw_word_t *)(addr); \ + } while (0) +#endif + +#endif /* unwind_i_h */ diff --git a/vendor/libunwind/src/dl-iterate-phdr.c b/vendor/libunwind/src/dl-iterate-phdr.c new file mode 100644 index 0000000000..5c738a9ebc --- /dev/null +++ b/vendor/libunwind/src/dl-iterate-phdr.c @@ -0,0 +1,90 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#if defined(__ANDROID__) && __ANDROID_API__ < 21 + +#include +#include + +#include "libunwind_i.h" +#include "os-linux.h" + +#ifndef IS_ELF +/* Copied from NDK header. */ +#define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \ + (ehdr).e_ident[EI_MAG1] == ELFMAG1 && \ + (ehdr).e_ident[EI_MAG2] == ELFMAG2 && \ + (ehdr).e_ident[EI_MAG3] == ELFMAG3) +#endif + +HIDDEN int +dl_iterate_phdr (unw_iterate_phdr_callback_t callback, + void *data) +{ + static int initialized = 0; + static unw_iterate_phdr_func_t libc_impl; + int rc = 0; + struct map_iterator mi; + unsigned long start, end, offset, flags; + + if (!initialized) + { + libc_impl = dlsym (RTLD_NEXT, "dl_iterate_phdr"); + initialized = 1; + } + + if (libc_impl != NULL) + return libc_impl (callback, data); + + if (maps_init (&mi, getpid()) < 0) + return -1; + + while (maps_next (&mi, &start, &end, &offset, &flags)) + { + Elf_W(Ehdr) *ehdr = (Elf_W(Ehdr) *) start; + Dl_info canonical_info; + + if (mi.path[0] != '\0' && (flags & PROT_READ) != 0 && IS_ELF (*ehdr) + && dladdr (ehdr, &canonical_info) != 0 + && ehdr == canonical_info.dli_fbase) + { + struct dl_phdr_info info; + Elf_W(Phdr) *phdr = (Elf_W(Phdr) *) (start + ehdr->e_phoff); + + info.dlpi_addr = start; + info.dlpi_name = canonical_info.dli_fname; + info.dlpi_phdr = phdr; + info.dlpi_phnum = ehdr->e_phnum; + + rc = callback (&info, sizeof (info), data); + } + } + + maps_close (&mi); + + return rc; +} + +#endif diff --git a/vendor/libunwind/src/dwarf/Gexpr.c b/vendor/libunwind/src/dwarf/Gexpr.c new file mode 100644 index 0000000000..4a8da2ce1b --- /dev/null +++ b/vendor/libunwind/src/dwarf/Gexpr.c @@ -0,0 +1,712 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2003, 2005 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "dwarf_i.h" +#include "libunwind_i.h" + +/* The "pick" operator provides an index range of 0..255 indicating + that the stack could at least have a depth of up to 256 elements, + but the GCC unwinder restricts the depth to 64, which seems + reasonable so we use the same value here. */ +#define MAX_EXPR_STACK_SIZE 64 + +#define NUM_OPERANDS(signature) (((signature) >> 6) & 0x3) +#define OPND1_TYPE(signature) (((signature) >> 3) & 0x7) +#define OPND2_TYPE(signature) (((signature) >> 0) & 0x7) + +#define OPND_SIGNATURE(n, t1, t2) (((n) << 6) | ((t1) << 3) | ((t2) << 0)) +#define OPND1(t1) OPND_SIGNATURE(1, t1, 0) +#define OPND2(t1, t2) OPND_SIGNATURE(2, t1, t2) + +#define VAL8 0x0 +#define VAL16 0x1 +#define VAL32 0x2 +#define VAL64 0x3 +#define ULEB128 0x4 +#define SLEB128 0x5 +#define OFFSET 0x6 /* 32-bit offset for 32-bit DWARF, 64-bit otherwise */ +#define ADDR 0x7 /* Machine address. */ + +static const uint8_t operands[256] = + { + [DW_OP_addr] = OPND1 (ADDR), + [DW_OP_const1u] = OPND1 (VAL8), + [DW_OP_const1s] = OPND1 (VAL8), + [DW_OP_const2u] = OPND1 (VAL16), + [DW_OP_const2s] = OPND1 (VAL16), + [DW_OP_const4u] = OPND1 (VAL32), + [DW_OP_const4s] = OPND1 (VAL32), + [DW_OP_const8u] = OPND1 (VAL64), + [DW_OP_const8s] = OPND1 (VAL64), + [DW_OP_constu] = OPND1 (ULEB128), + [DW_OP_consts] = OPND1 (SLEB128), + [DW_OP_pick] = OPND1 (VAL8), + [DW_OP_plus_uconst] = OPND1 (ULEB128), + [DW_OP_skip] = OPND1 (VAL16), + [DW_OP_bra] = OPND1 (VAL16), + [DW_OP_breg0 + 0] = OPND1 (SLEB128), + [DW_OP_breg0 + 1] = OPND1 (SLEB128), + [DW_OP_breg0 + 2] = OPND1 (SLEB128), + [DW_OP_breg0 + 3] = OPND1 (SLEB128), + [DW_OP_breg0 + 4] = OPND1 (SLEB128), + [DW_OP_breg0 + 5] = OPND1 (SLEB128), + [DW_OP_breg0 + 6] = OPND1 (SLEB128), + [DW_OP_breg0 + 7] = OPND1 (SLEB128), + [DW_OP_breg0 + 8] = OPND1 (SLEB128), + [DW_OP_breg0 + 9] = OPND1 (SLEB128), + [DW_OP_breg0 + 10] = OPND1 (SLEB128), + [DW_OP_breg0 + 11] = OPND1 (SLEB128), + [DW_OP_breg0 + 12] = OPND1 (SLEB128), + [DW_OP_breg0 + 13] = OPND1 (SLEB128), + [DW_OP_breg0 + 14] = OPND1 (SLEB128), + [DW_OP_breg0 + 15] = OPND1 (SLEB128), + [DW_OP_breg0 + 16] = OPND1 (SLEB128), + [DW_OP_breg0 + 17] = OPND1 (SLEB128), + [DW_OP_breg0 + 18] = OPND1 (SLEB128), + [DW_OP_breg0 + 19] = OPND1 (SLEB128), + [DW_OP_breg0 + 20] = OPND1 (SLEB128), + [DW_OP_breg0 + 21] = OPND1 (SLEB128), + [DW_OP_breg0 + 22] = OPND1 (SLEB128), + [DW_OP_breg0 + 23] = OPND1 (SLEB128), + [DW_OP_breg0 + 24] = OPND1 (SLEB128), + [DW_OP_breg0 + 25] = OPND1 (SLEB128), + [DW_OP_breg0 + 26] = OPND1 (SLEB128), + [DW_OP_breg0 + 27] = OPND1 (SLEB128), + [DW_OP_breg0 + 28] = OPND1 (SLEB128), + [DW_OP_breg0 + 29] = OPND1 (SLEB128), + [DW_OP_breg0 + 30] = OPND1 (SLEB128), + [DW_OP_breg0 + 31] = OPND1 (SLEB128), + [DW_OP_regx] = OPND1 (ULEB128), + [DW_OP_fbreg] = OPND1 (SLEB128), + [DW_OP_bregx] = OPND2 (ULEB128, SLEB128), + [DW_OP_piece] = OPND1 (ULEB128), + [DW_OP_deref_size] = OPND1 (VAL8), + [DW_OP_xderef_size] = OPND1 (VAL8), + [DW_OP_call2] = OPND1 (VAL16), + [DW_OP_call4] = OPND1 (VAL32), + [DW_OP_call_ref] = OPND1 (OFFSET) + }; + +static inline unw_sword_t +sword (unw_addr_space_t as UNUSED, unw_word_t val) +{ + switch (dwarf_addr_size (as)) + { + case 1: return (int8_t) val; + case 2: return (int16_t) val; + case 4: return (int32_t) val; + case 8: return (int64_t) val; + default: abort (); + } +} + +static inline unw_word_t +read_operand (unw_addr_space_t as, unw_accessors_t *a, + unw_word_t *addr, int operand_type, unw_word_t *val, void *arg) +{ + uint8_t u8; + uint16_t u16; + uint32_t u32; + uint64_t u64; + int ret; + + if (operand_type == ADDR) + switch (dwarf_addr_size (as)) + { + case 1: operand_type = VAL8; break; + case 2: operand_type = VAL16; break; + case 4: operand_type = VAL32; break; + case 8: operand_type = VAL64; break; + default: abort (); + } + + switch (operand_type) + { + case VAL8: + ret = dwarf_readu8 (as, a, addr, &u8, arg); + if (ret < 0) + return ret; + *val = u8; + break; + + case VAL16: + ret = dwarf_readu16 (as, a, addr, &u16, arg); + if (ret < 0) + return ret; + *val = u16; + break; + + case VAL32: + ret = dwarf_readu32 (as, a, addr, &u32, arg); + if (ret < 0) + return ret; + *val = u32; + break; + + case VAL64: + ret = dwarf_readu64 (as, a, addr, &u64, arg); + if (ret < 0) + return ret; + *val = u64; + break; + + case ULEB128: + ret = dwarf_read_uleb128 (as, a, addr, val, arg); + break; + + case SLEB128: + ret = dwarf_read_sleb128 (as, a, addr, val, arg); + break; + + case OFFSET: /* only used by DW_OP_call_ref, which we don't implement */ + default: + Debug (1, "Unexpected operand type %d\n", operand_type); + ret = -UNW_EINVAL; + } + return ret; +} + +HIDDEN int +dwarf_stack_aligned(struct dwarf_cursor *c, unw_word_t cfa_addr, + unw_word_t rbp_addr, unw_word_t *cfa_offset) { + unw_accessors_t *a; + int ret; + void *arg; + unw_word_t len; + uint8_t opcode; + unw_word_t operand1; + + a = unw_get_accessors_int (c->as); + arg = c->as_arg; + + ret = dwarf_read_uleb128(c->as, a, &rbp_addr, &len, arg); + if (len != 2 || ret < 0) + return 0; + + ret = dwarf_readu8(c->as, a, &rbp_addr, &opcode, arg); + if (ret < 0 || opcode != DW_OP_breg6) + return 0; + + ret = read_operand(c->as, a, &rbp_addr, + OPND1_TYPE(operands[opcode]), &operand1, arg); + + if (ret < 0 || operand1 != 0) + return 0; + + ret = dwarf_read_uleb128(c->as, a, &cfa_addr, &len, arg); + if (ret < 0 || len != 3) + return 0; + + ret = dwarf_readu8(c->as, a, &cfa_addr, &opcode, arg); + if (ret < 0 || opcode != DW_OP_breg6) + return 0; + + ret = read_operand(c->as, a, &cfa_addr, + OPND1_TYPE(operands[opcode]), &operand1, arg); + if (ret < 0) + return 0; + + ret = dwarf_readu8(c->as, a, &cfa_addr, &opcode, arg); + if (ret < 0 || opcode != DW_OP_deref) + return 0; + + *cfa_offset = operand1; + return 1; +} + +HIDDEN int +dwarf_eval_expr (struct dwarf_cursor *c, unw_word_t stack_val, unw_word_t *addr, + unw_word_t len, unw_word_t *valp, int *is_register) +{ + unw_word_t operand1 = 0, operand2 = 0, tmp1, tmp2 = 0, tmp3, end_addr; + uint8_t opcode, operands_signature, u8; + unw_addr_space_t as; + unw_accessors_t *a; + void *arg; + unw_word_t stack[MAX_EXPR_STACK_SIZE]; + unsigned int tos = 0; + uint16_t u16; + uint32_t u32; + uint64_t u64; + int ret; + unw_word_t stackerror = 0; + +// pop() is either followed by a semicolon or +// used in a push() macro +// In either case we can sneak in an extra statement +# define pop() \ +(((tos - 1) >= MAX_EXPR_STACK_SIZE) ? \ + stackerror++ : stack[--tos]); \ +if (stackerror) \ + { \ + Debug (1, "Stack underflow\n"); \ + return -UNW_EINVAL; \ + } + +// Removed the parentheses on the assignment +// to allow the extra stack error check +// when x is evaluated +# define push(x) \ +do { \ + unw_word_t _x = x; \ + if (tos >= MAX_EXPR_STACK_SIZE) \ + { \ + Debug (1, "Stack overflow\n"); \ + return -UNW_EINVAL; \ + } \ + stack[tos++] = _x; \ +} while (0) + +// Pick is always used in a push() macro +// In either case we can sneak in an extra statement +# define pick(n) \ +(((tos - 1 - (n)) >= MAX_EXPR_STACK_SIZE) ? \ + stackerror++ : stack[tos - 1 - (n)]); \ +if (stackerror) \ + { \ + Debug (1, "Out-of-stack pick\n"); \ + return -UNW_EINVAL; \ + } + + as = c->as; + arg = c->as_arg; + a = unw_get_accessors_int (as); + end_addr = *addr + len; + *is_register = 0; + + Debug (14, "len=%lu, pushing initial value=0x%lx\n", + (unsigned long) len, (unsigned long) stack_val); + + /* The DWARF standard requires the current CFA to be pushed onto the stack */ + /* before evaluating DW_CFA_expression and DW_CFA_val_expression programs. */ + /* DW_CFA_def_cfa_expressions do not take an initial value, but we push on */ + /* a dummy value to keep this logic consistent. */ + push (stack_val); + + while (*addr < end_addr) + { + if ((ret = dwarf_readu8 (as, a, addr, &opcode, arg)) < 0) + return ret; + + operands_signature = operands[opcode]; + + if (unlikely (NUM_OPERANDS (operands_signature) > 0)) + { + if ((ret = read_operand (as, a, addr, + OPND1_TYPE (operands_signature), + &operand1, arg)) < 0) + return ret; + if (NUM_OPERANDS (operands_signature) > 1) + if ((ret = read_operand (as, a, addr, + OPND2_TYPE (operands_signature), + &operand2, arg)) < 0) + return ret; + } + + switch ((dwarf_expr_op_t) opcode) + { + case DW_OP_lit0: case DW_OP_lit1: case DW_OP_lit2: + case DW_OP_lit3: case DW_OP_lit4: case DW_OP_lit5: + case DW_OP_lit6: case DW_OP_lit7: case DW_OP_lit8: + case DW_OP_lit9: case DW_OP_lit10: case DW_OP_lit11: + case DW_OP_lit12: case DW_OP_lit13: case DW_OP_lit14: + case DW_OP_lit15: case DW_OP_lit16: case DW_OP_lit17: + case DW_OP_lit18: case DW_OP_lit19: case DW_OP_lit20: + case DW_OP_lit21: case DW_OP_lit22: case DW_OP_lit23: + case DW_OP_lit24: case DW_OP_lit25: case DW_OP_lit26: + case DW_OP_lit27: case DW_OP_lit28: case DW_OP_lit29: + case DW_OP_lit30: case DW_OP_lit31: + Debug (15, "OP_lit(%d)\n", (int) opcode - DW_OP_lit0); + push (opcode - DW_OP_lit0); + break; + + case DW_OP_breg0: case DW_OP_breg1: case DW_OP_breg2: + case DW_OP_breg3: case DW_OP_breg4: case DW_OP_breg5: + case DW_OP_breg6: case DW_OP_breg7: case DW_OP_breg8: + case DW_OP_breg9: case DW_OP_breg10: case DW_OP_breg11: + case DW_OP_breg12: case DW_OP_breg13: case DW_OP_breg14: + case DW_OP_breg15: case DW_OP_breg16: case DW_OP_breg17: + case DW_OP_breg18: case DW_OP_breg19: case DW_OP_breg20: + case DW_OP_breg21: case DW_OP_breg22: case DW_OP_breg23: + case DW_OP_breg24: case DW_OP_breg25: case DW_OP_breg26: + case DW_OP_breg27: case DW_OP_breg28: case DW_OP_breg29: + case DW_OP_breg30: case DW_OP_breg31: + Debug (15, "OP_breg(r%d,0x%lx)\n", + (int) opcode - DW_OP_breg0, (unsigned long) operand1); + if ((ret = unw_get_reg (dwarf_to_cursor (c), + dwarf_to_unw_regnum (opcode - DW_OP_breg0), + &tmp1)) < 0) + return ret; + push (tmp1 + operand1); + break; + + case DW_OP_bregx: + Debug (15, "OP_bregx(r%d,0x%lx)\n", + (int) operand1, (unsigned long) operand2); + if ((ret = unw_get_reg (dwarf_to_cursor (c), + dwarf_to_unw_regnum (operand1), &tmp1)) < 0) + return ret; + push (tmp1 + operand2); + break; + + case DW_OP_reg0: case DW_OP_reg1: case DW_OP_reg2: + case DW_OP_reg3: case DW_OP_reg4: case DW_OP_reg5: + case DW_OP_reg6: case DW_OP_reg7: case DW_OP_reg8: + case DW_OP_reg9: case DW_OP_reg10: case DW_OP_reg11: + case DW_OP_reg12: case DW_OP_reg13: case DW_OP_reg14: + case DW_OP_reg15: case DW_OP_reg16: case DW_OP_reg17: + case DW_OP_reg18: case DW_OP_reg19: case DW_OP_reg20: + case DW_OP_reg21: case DW_OP_reg22: case DW_OP_reg23: + case DW_OP_reg24: case DW_OP_reg25: case DW_OP_reg26: + case DW_OP_reg27: case DW_OP_reg28: case DW_OP_reg29: + case DW_OP_reg30: case DW_OP_reg31: + Debug (15, "OP_reg(r%d)\n", (int) opcode - DW_OP_reg0); + *valp = dwarf_to_unw_regnum (opcode - DW_OP_reg0); + *is_register = 1; + return 0; + + case DW_OP_regx: + Debug (15, "OP_regx(r%d)\n", (int) operand1); + *valp = dwarf_to_unw_regnum (operand1); + *is_register = 1; + return 0; + + case DW_OP_addr: + case DW_OP_const1u: + case DW_OP_const2u: + case DW_OP_const4u: + case DW_OP_const8u: + case DW_OP_constu: + case DW_OP_const8s: + case DW_OP_consts: + Debug (15, "OP_const(0x%lx)\n", (unsigned long) operand1); + push (operand1); + break; + + case DW_OP_const1s: + if (operand1 & 0x80) + operand1 |= ((unw_word_t) -1) << 8; + Debug (15, "OP_const1s(%ld)\n", (long) operand1); + push (operand1); + break; + + case DW_OP_const2s: + if (operand1 & 0x8000) + operand1 |= ((unw_word_t) -1) << 16; + Debug (15, "OP_const2s(%ld)\n", (long) operand1); + push (operand1); + break; + + case DW_OP_const4s: + if (operand1 & 0x80000000) + operand1 |= (((unw_word_t) -1) << 16) << 16; + Debug (15, "OP_const4s(%ld)\n", (long) operand1); + push (operand1); + break; + + case DW_OP_deref: + Debug (15, "OP_deref\n"); + tmp1 = pop (); + if ((ret = dwarf_readw (as, a, &tmp1, &tmp2, arg)) < 0) + return ret; + push (tmp2); + break; + + case DW_OP_deref_size: + Debug (15, "OP_deref_size(%d)\n", (int) operand1); + tmp1 = pop (); + switch (operand1) + { + default: + Debug (1, "Unexpected DW_OP_deref_size size %d\n", + (int) operand1); + return -UNW_EINVAL; + + case 1: + if ((ret = dwarf_readu8 (as, a, &tmp1, &u8, arg)) < 0) + return ret; + tmp2 = u8; + break; + + case 2: + if ((ret = dwarf_readu16 (as, a, &tmp1, &u16, arg)) < 0) + return ret; + tmp2 = u16; + break; + + case 3: + case 4: + if ((ret = dwarf_readu32 (as, a, &tmp1, &u32, arg)) < 0) + return ret; + tmp2 = u32; + if (operand1 == 3) + { + if (dwarf_is_big_endian (as)) + tmp2 >>= 8; + else + tmp2 &= 0xffffff; + } + break; + case 5: + case 6: + case 7: + case 8: + if ((ret = dwarf_readu64 (as, a, &tmp1, &u64, arg)) < 0) + return ret; + tmp2 = u64; + if (operand1 != 8) + { + if (dwarf_is_big_endian (as)) + tmp2 >>= 64 - 8 * operand1; + else + tmp2 &= (~ (unw_word_t) 0) << (8 * operand1); + } + break; + } + push (tmp2); + break; + + case DW_OP_dup: + Debug (15, "OP_dup\n"); + push (pick (0)); + break; + + case DW_OP_drop: + Debug (15, "OP_drop\n"); + (void) pop (); + break; + + case DW_OP_pick: + Debug (15, "OP_pick(%d)\n", (int) operand1); + push (pick (operand1)); + break; + + case DW_OP_over: + Debug (15, "OP_over\n"); + push (pick (1)); + break; + + case DW_OP_swap: + Debug (15, "OP_swap\n"); + tmp1 = pop (); + tmp2 = pop (); + push (tmp1); + push (tmp2); + break; + + case DW_OP_rot: + Debug (15, "OP_rot\n"); + tmp1 = pop (); + tmp2 = pop (); + tmp3 = pop (); + push (tmp1); + push (tmp3); + push (tmp2); + break; + + case DW_OP_abs: + Debug (15, "OP_abs\n"); + tmp1 = pop (); + if (tmp1 & ((unw_word_t) 1 << (8 * dwarf_addr_size (as) - 1))) + tmp1 = (~tmp1 + 1); + push (tmp1); + break; + + case DW_OP_and: + Debug (15, "OP_and\n"); + tmp1 = pop (); + tmp2 = pop (); + push (tmp1 & tmp2); + break; + + case DW_OP_div: + Debug (15, "OP_div\n"); + tmp1 = pop (); + tmp2 = pop (); + if (tmp1) + tmp1 = sword (as, tmp2) / sword (as, tmp1); + push (tmp1); + break; + + case DW_OP_minus: + Debug (15, "OP_minus\n"); + tmp1 = pop (); + tmp2 = pop (); + tmp1 = tmp2 - tmp1; + push (tmp1); + break; + + case DW_OP_mod: + Debug (15, "OP_mod\n"); + tmp1 = pop (); + tmp2 = pop (); + if (tmp1) + tmp1 = tmp2 % tmp1; + push (tmp1); + break; + + case DW_OP_mul: + Debug (15, "OP_mul\n"); + tmp1 = pop (); + tmp2 = pop (); + if (tmp1) + tmp1 = tmp2 * tmp1; + push (tmp1); + break; + + case DW_OP_neg: + Debug (15, "OP_neg\n"); + tmp1 = pop (); + push (~tmp1 + 1); + break; + + case DW_OP_not: + Debug (15, "OP_not\n"); + push (~pop ()); + break; + + case DW_OP_or: + Debug (15, "OP_or\n"); + tmp1 = pop (); + tmp2 = pop (); + push (tmp1 | tmp2); + break; + + case DW_OP_plus: + Debug (15, "OP_plus\n"); + tmp1 = pop (); + tmp2 = pop (); + push (tmp1 + tmp2); + break; + + case DW_OP_plus_uconst: + Debug (15, "OP_plus_uconst(%lu)\n", (unsigned long) operand1); + tmp1 = pop (); + push (tmp1 + operand1); + break; + + case DW_OP_shl: + Debug (15, "OP_shl\n"); + tmp1 = pop (); + tmp2 = pop (); + push (tmp2 << tmp1); + break; + + case DW_OP_shr: + Debug (15, "OP_shr\n"); + tmp1 = pop (); + tmp2 = pop (); + push (tmp2 >> tmp1); + break; + + case DW_OP_shra: + Debug (15, "OP_shra\n"); + tmp1 = pop (); + tmp2 = pop (); + push (sword (as, tmp2) >> tmp1); + break; + + case DW_OP_xor: + Debug (15, "OP_xor\n"); + tmp1 = pop (); + tmp2 = pop (); + push (tmp1 ^ tmp2); + break; + + case DW_OP_le: + Debug (15, "OP_le\n"); + tmp1 = pop (); + tmp2 = pop (); + push (sword (as, tmp2) <= sword (as, tmp1)); + break; + + case DW_OP_ge: + Debug (15, "OP_ge\n"); + tmp1 = pop (); + tmp2 = pop (); + push (sword (as, tmp2) >= sword (as, tmp1)); + break; + + case DW_OP_eq: + Debug (15, "OP_eq\n"); + tmp1 = pop (); + tmp2 = pop (); + push (sword (as, tmp2) == sword (as, tmp1)); + break; + + case DW_OP_lt: + Debug (15, "OP_lt\n"); + tmp1 = pop (); + tmp2 = pop (); + push (sword (as, tmp2) < sword (as, tmp1)); + break; + + case DW_OP_gt: + Debug (15, "OP_gt\n"); + tmp1 = pop (); + tmp2 = pop (); + push (sword (as, tmp2) > sword (as, tmp1)); + break; + + case DW_OP_ne: + Debug (15, "OP_ne\n"); + tmp1 = pop (); + tmp2 = pop (); + push (sword (as, tmp2) != sword (as, tmp1)); + break; + + case DW_OP_skip: + Debug (15, "OP_skip(%d)\n", (int16_t) operand1); + *addr += (int16_t) operand1; + break; + + case DW_OP_bra: + Debug (15, "OP_skip(%d)\n", (int16_t) operand1); + tmp1 = pop (); + if (tmp1) + *addr += (int16_t) operand1; + break; + + case DW_OP_nop: + Debug (15, "OP_nop\n"); + break; + + case DW_OP_call2: + case DW_OP_call4: + case DW_OP_call_ref: + case DW_OP_fbreg: + case DW_OP_piece: + case DW_OP_push_object_address: + case DW_OP_xderef: + case DW_OP_xderef_size: + default: + Debug (1, "Unexpected opcode 0x%x\n", opcode); + return -UNW_EINVAL; + } + } + *valp = pop (); + Debug (14, "final value = 0x%lx\n", (unsigned long) *valp); + return 0; +} diff --git a/vendor/libunwind/src/dwarf/Gfde.c b/vendor/libunwind/src/dwarf/Gfde.c new file mode 100644 index 0000000000..3847d0a03c --- /dev/null +++ b/vendor/libunwind/src/dwarf/Gfde.c @@ -0,0 +1,369 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2003-2005 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "dwarf_i.h" + +static inline int +is_cie_id (unw_word_t val, int is_debug_frame) +{ + /* The CIE ID is normally 0xffffffff (for 32-bit ELF) or + 0xffffffffffffffff (for 64-bit ELF). However, .eh_frame + uses 0. */ + if (is_debug_frame) + return (val == (uint32_t)(-1) || val == (uint64_t)(-1)); + else + return (val == 0); +} + +/* Note: we don't need to keep track of more than the first four + characters of the augmentation string, because we (a) ignore any + augmentation string contents once we find an unrecognized character + and (b) those characters that we do recognize, can't be + repeated. */ +static inline int +parse_cie (unw_addr_space_t as, unw_accessors_t *a, unw_word_t addr, + const unw_proc_info_t *pi, struct dwarf_cie_info *dci, + int is_debug_frame, void *arg) +{ + uint8_t version, ch, augstr[5], fde_encoding, handler_encoding; + uint8_t address_size, segment_size; + unw_word_t len, cie_end_addr, aug_size; + uint32_t u32val; + uint64_t u64val; + size_t i; + int ret; +# define STR2(x) #x +# define STR(x) STR2(x) + + /* Pick appropriate default for FDE-encoding. DWARF spec says + start-IP (initial_location) and the code-size (address_range) are + "address-unit sized constants". The `R' augmentation can be used + to override this, but by default, we pick an address-sized unit + for fde_encoding. */ + switch (dwarf_addr_size (as)) + { + case 4: fde_encoding = DW_EH_PE_udata4; break; + case 8: fde_encoding = DW_EH_PE_udata8; break; + default: fde_encoding = DW_EH_PE_omit; break; + } + + dci->lsda_encoding = DW_EH_PE_omit; + dci->handler = 0; + + if ((ret = dwarf_readu32 (as, a, &addr, &u32val, arg)) < 0) + return ret; + + if (u32val != 0xffffffff) + { + /* the CIE is in the 32-bit DWARF format */ + uint32_t cie_id; + /* DWARF says CIE id should be 0xffffffff, but in .eh_frame, it's 0 */ + const uint32_t expected_id = (is_debug_frame) ? 0xffffffff : 0; + + len = u32val; + cie_end_addr = addr + len; + if ((ret = dwarf_readu32 (as, a, &addr, &cie_id, arg)) < 0) + return ret; + if (cie_id != expected_id) + { + Debug (1, "Unexpected CIE id %x\n", cie_id); + return -UNW_EINVAL; + } + } + else + { + /* the CIE is in the 64-bit DWARF format */ + uint64_t cie_id; + /* DWARF says CIE id should be 0xffffffffffffffff, but in + .eh_frame, it's 0 */ + const uint64_t expected_id = (is_debug_frame) ? 0xffffffffffffffffull : 0; + + if ((ret = dwarf_readu64 (as, a, &addr, &u64val, arg)) < 0) + return ret; + len = u64val; + cie_end_addr = addr + len; + if ((ret = dwarf_readu64 (as, a, &addr, &cie_id, arg)) < 0) + return ret; + if (cie_id != expected_id) + { + Debug (1, "Unexpected CIE id %llx\n", (long long) cie_id); + return -UNW_EINVAL; + } + } + dci->cie_instr_end = cie_end_addr; + + if ((ret = dwarf_readu8 (as, a, &addr, &version, arg)) < 0) + return ret; + + /* GCC emits version 1??? */ + if (version != 1 && (version < DWARF_CIE_VERSION || version > DWARF_CIE_VERSION_MAX)) + { + Debug (1, "Got CIE version %u, expected version 1 or between " + STR (DWARF_CIE_VERSION) " and " STR (DWARF_CIE_VERSION_MAX) "\n", version); + return -UNW_EBADVERSION; + } + + /* read and parse the augmentation string: */ + memset (augstr, 0, sizeof (augstr)); + for (i = 0;;) + { + if ((ret = dwarf_readu8 (as, a, &addr, &ch, arg)) < 0) + return ret; + + if (!ch) + break; /* end of augmentation string */ + + if (i < sizeof (augstr) - 1) + augstr[i++] = ch; + } + + if (version > 3) + { + if((ret = dwarf_readu8(as, a, &addr, &address_size, arg)) < 0) + return ret; + + if((ret = dwarf_readu8(as, a, &addr, &segment_size, arg)) < 0) + return ret; + } + + if ((ret = dwarf_read_uleb128 (as, a, &addr, &dci->code_align, arg)) < 0 + || (ret = dwarf_read_sleb128 (as, a, &addr, &dci->data_align, arg)) < 0) + return ret; + + /* Read the return-address column either as a u8 or as a uleb128. */ + if (version == 1) + { + if ((ret = dwarf_readu8 (as, a, &addr, &ch, arg)) < 0) + return ret; + dci->ret_addr_column = ch; + } + else if ((ret = dwarf_read_uleb128 (as, a, &addr, &dci->ret_addr_column, + arg)) < 0) + return ret; + + i = 0; + if (augstr[0] == 'z') + { + dci->sized_augmentation = 1; + if ((ret = dwarf_read_uleb128 (as, a, &addr, &aug_size, arg)) < 0) + return ret; + i++; + } + + for (; i < sizeof (augstr) && augstr[i]; ++i) + switch (augstr[i]) + { + case 'L': + /* read the LSDA pointer-encoding format. */ + if ((ret = dwarf_readu8 (as, a, &addr, &ch, arg)) < 0) + return ret; + dci->lsda_encoding = ch; + break; + + case 'R': + /* read the FDE pointer-encoding format. */ + if ((ret = dwarf_readu8 (as, a, &addr, &fde_encoding, arg)) < 0) + return ret; + break; + + case 'P': + /* read the personality-routine pointer-encoding format. */ + if ((ret = dwarf_readu8 (as, a, &addr, &handler_encoding, arg)) < 0) + return ret; + if ((ret = dwarf_read_encoded_pointer (as, a, &addr, handler_encoding, + pi, &dci->handler, arg)) < 0) + return ret; + break; + + case 'S': + /* This is a signal frame. */ + dci->signal_frame = 1; + + /* Temporarily set it to one so dwarf_parse_fde() knows that + it should fetch the actual ABI/TAG pair from the FDE. */ + dci->have_abi_marker = 1; + break; + + default: + Debug (1, "Unexpected augmentation string `%s'\n", augstr); + if (dci->sized_augmentation) + /* If we have the size of the augmentation body, we can skip + over the parts that we don't understand, so we're OK. */ + goto done; + else + return -UNW_EINVAL; + } + done: + dci->fde_encoding = fde_encoding; + dci->cie_instr_start = addr; + Debug (15, "CIE parsed OK, augmentation = \"%s\", handler=0x%lx\n", + augstr, (long) dci->handler); + return 0; +} + +/* Extract proc-info from the FDE starting at address ADDR. + + Pass BASE as zero for eh_frame behaviour, or a pointer to + debug_frame base for debug_frame behaviour. */ + +HIDDEN int +dwarf_extract_proc_info_from_fde (unw_addr_space_t as, unw_accessors_t *a, + unw_word_t *addrp, unw_proc_info_t *pi, + unw_word_t base, + int need_unwind_info, int is_debug_frame, + void *arg) +{ + unw_word_t fde_end_addr, cie_addr, cie_offset_addr, aug_end_addr = 0; + unw_word_t start_ip, ip_range, aug_size, addr = *addrp; + int ret, ip_range_encoding; + struct dwarf_cie_info dci; + uint64_t u64val; + uint32_t u32val; + + Debug (12, "FDE @ 0x%lx\n", (long) addr); + + memset (&dci, 0, sizeof (dci)); + + if ((ret = dwarf_readu32 (as, a, &addr, &u32val, arg)) < 0) + return ret; + + if (u32val != 0xffffffff) + { + int32_t cie_offset = 0; + + /* In some configurations, an FDE with a 0 length indicates the + end of the FDE-table. */ + if (u32val == 0) + return -UNW_ENOINFO; + + /* the FDE is in the 32-bit DWARF format */ + + *addrp = fde_end_addr = addr + u32val; + cie_offset_addr = addr; + + if ((ret = dwarf_reads32 (as, a, &addr, &cie_offset, arg)) < 0) + return ret; + + if (is_cie_id (cie_offset, is_debug_frame)) + /* ignore CIEs (happens during linear searches) */ + return 0; + + if (is_debug_frame) + cie_addr = base + cie_offset; + else + /* DWARF says that the CIE_pointer in the FDE is a + .debug_frame-relative offset, but the GCC-generated .eh_frame + sections instead store a "pcrelative" offset, which is just + as fine as it's self-contained. */ + cie_addr = cie_offset_addr - cie_offset; + } + else + { + int64_t cie_offset = 0; + + /* the FDE is in the 64-bit DWARF format */ + + if ((ret = dwarf_readu64 (as, a, &addr, &u64val, arg)) < 0) + return ret; + + *addrp = fde_end_addr = addr + u64val; + cie_offset_addr = addr; + + if ((ret = dwarf_reads64 (as, a, &addr, &cie_offset, arg)) < 0) + return ret; + + if (is_cie_id (cie_offset, is_debug_frame)) + /* ignore CIEs (happens during linear searches) */ + return 0; + + if (is_debug_frame) + cie_addr = base + cie_offset; + else + /* DWARF says that the CIE_pointer in the FDE is a + .debug_frame-relative offset, but the GCC-generated .eh_frame + sections instead store a "pcrelative" offset, which is just + as fine as it's self-contained. */ + cie_addr = (unw_word_t) ((uint64_t) cie_offset_addr - cie_offset); + } + + Debug (15, "looking for CIE at address %lx\n", (long) cie_addr); + + if ((ret = parse_cie (as, a, cie_addr, pi, &dci, is_debug_frame, arg)) < 0) + return ret; + + /* IP-range has same encoding as FDE pointers, except that it's + always an absolute value: */ + ip_range_encoding = dci.fde_encoding & DW_EH_PE_FORMAT_MASK; + + if ((ret = dwarf_read_encoded_pointer (as, a, &addr, dci.fde_encoding, + pi, &start_ip, arg)) < 0 + || (ret = dwarf_read_encoded_pointer (as, a, &addr, ip_range_encoding, + pi, &ip_range, arg)) < 0) + return ret; + pi->start_ip = start_ip; + pi->end_ip = start_ip + ip_range; + pi->handler = dci.handler; + + if (dci.sized_augmentation) + { + if ((ret = dwarf_read_uleb128 (as, a, &addr, &aug_size, arg)) < 0) + return ret; + aug_end_addr = addr + aug_size; + } + + if ((ret = dwarf_read_encoded_pointer (as, a, &addr, dci.lsda_encoding, + pi, &pi->lsda, arg)) < 0) + return ret; + + Debug (15, "FDE covers IP 0x%lx-0x%lx, LSDA=0x%lx\n", + (long) pi->start_ip, (long) pi->end_ip, (long) pi->lsda); + + if (need_unwind_info) + { + pi->format = UNW_INFO_FORMAT_TABLE; + pi->unwind_info_size = sizeof (dci); + pi->unwind_info = mempool_alloc (&dwarf_cie_info_pool); + if (!pi->unwind_info) + return -UNW_ENOMEM; + + if (dci.have_abi_marker) + { + if ((ret = dwarf_readu16 (as, a, &addr, &dci.abi, arg)) < 0 + || (ret = dwarf_readu16 (as, a, &addr, &dci.tag, arg)) < 0) + return ret; + Debug (13, "Found ABI marker = (abi=%u, tag=%u)\n", + dci.abi, dci.tag); + } + + if (dci.sized_augmentation) + dci.fde_instr_start = aug_end_addr; + else + dci.fde_instr_start = addr; + dci.fde_instr_end = fde_end_addr; + + memcpy (pi->unwind_info, &dci, sizeof (dci)); + } + return 0; +} diff --git a/vendor/libunwind/src/dwarf/Gfind_proc_info-lsb.c b/vendor/libunwind/src/dwarf/Gfind_proc_info-lsb.c new file mode 100644 index 0000000000..c11345e883 --- /dev/null +++ b/vendor/libunwind/src/dwarf/Gfind_proc_info-lsb.c @@ -0,0 +1,1043 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2003-2005 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +/* Locate an FDE via the ELF data-structures defined by LSB v1.3 + (http://www.linuxbase.org/spec/). */ + +#include +#include +#include + +#include "dwarf_i.h" +#include "dwarf-eh.h" +#include "libunwind_i.h" + +#ifdef HAVE_ZLIB +#include +#endif /* HAVE_ZLIB */ + +struct table_entry + { + int32_t start_ip_offset; + int32_t fde_offset; + }; + +#ifndef UNW_REMOTE_ONLY + +#ifdef __linux__ +#include "os-linux.h" +#endif + +#ifndef __clang__ +static ALIAS(dwarf_search_unwind_table) int +dwarf_search_unwind_table_int (unw_addr_space_t as, + unw_word_t ip, + unw_dyn_info_t *di, + unw_proc_info_t *pi, + int need_unwind_info, void *arg); +#else +#define dwarf_search_unwind_table_int dwarf_search_unwind_table +#endif + +static int +linear_search (unw_addr_space_t as, unw_word_t ip, + unw_word_t eh_frame_start, unw_word_t eh_frame_end, + unw_word_t fde_count, + unw_proc_info_t *pi, int need_unwind_info, void *arg) +{ + unw_accessors_t *a = unw_get_accessors_int (unw_local_addr_space); + unw_word_t i = 0, fde_addr, addr = eh_frame_start; + int ret; + + while (i++ < fde_count && addr < eh_frame_end) + { + fde_addr = addr; + if ((ret = dwarf_extract_proc_info_from_fde (as, a, &addr, pi, + eh_frame_start, + 0, 0, arg)) < 0) + return ret; + + if (ip >= pi->start_ip && ip < pi->end_ip) + { + if (!need_unwind_info) + return 1; + addr = fde_addr; + if ((ret = dwarf_extract_proc_info_from_fde (as, a, &addr, pi, + eh_frame_start, + need_unwind_info, 0, + arg)) + < 0) + return ret; + return 1; + } + } + return -UNW_ENOINFO; +} +#endif /* !UNW_REMOTE_ONLY */ + +#ifdef CONFIG_DEBUG_FRAME +/* Load .debug_frame section from FILE. Allocates and returns space + in *BUF, and sets *BUFSIZE to its size. IS_LOCAL is 1 if using the + local process, in which case we can search the system debug file + directory; 0 for other address spaces, in which case we do + not. Returns 0 on success, 1 on error. Succeeds even if the file + contains no .debug_frame. */ +/* XXX: Could use mmap; but elf_map_image keeps tons mapped in. */ + +static int +load_debug_frame (const char *file, char **buf, size_t *bufsize, int is_local, + unw_word_t segbase, unw_word_t *load_offset) +{ + struct elf_image ei; + Elf_W (Ehdr) *ehdr; + Elf_W (Phdr) *phdr; + Elf_W (Shdr) *shdr; + int i; + int ret; + + ei.image = NULL; + *load_offset = 0; + + ret = elf_w (load_debuginfo) (file, &ei, is_local); + if (ret != 0) + return ret; + + shdr = elf_w (find_section) (&ei, ".debug_frame"); + if (!shdr || + (shdr->sh_offset + shdr->sh_size > ei.size)) + { + mi_munmap(ei.image, ei.size); + return 1; + } + +#if defined(SHF_COMPRESSED) + if (shdr->sh_flags & SHF_COMPRESSED) + { + Elf_W (Chdr) *chdr = (shdr->sh_offset + ei.image); +#ifdef HAVE_ZLIB + unsigned long destSize; + if (chdr->ch_type == ELFCOMPRESS_ZLIB) + { + *bufsize = destSize = chdr->ch_size; + + GET_MEMORY (*buf, *bufsize); + if (!*buf) + { + Debug (2, "failed to allocate zlib .debug_frame buffer, skipping\n"); + mi_munmap(ei.image, ei.size); + return 1; + } + + ret = uncompress((unsigned char *)*buf, &destSize, + shdr->sh_offset + ei.image + sizeof(*chdr), + shdr->sh_size - sizeof(*chdr)); + if (ret != Z_OK) + { + Debug (2, "failed to decompress zlib .debug_frame, skipping\n"); + mi_munmap(*buf, *bufsize); + mi_munmap(ei.image, ei.size); + return 1; + } + + Debug (4, "read %zd->%zd bytes of .debug_frame from offset %zd\n", + shdr->sh_size, *bufsize, shdr->sh_offset); + } + else +#endif /* HAVE_ZLIB */ + { + Debug (2, "unknown compression type %d, skipping\n", + chdr->ch_type); + mi_munmap(ei.image, ei.size); + return 1; + } + } + else + { +#endif + *bufsize = shdr->sh_size; + + GET_MEMORY (*buf, *bufsize); + if (!*buf) + { + Debug (2, "failed to allocate .debug_frame buffer, skipping\n"); + mi_munmap(ei.image, ei.size); + return 1; + } + + memcpy(*buf, shdr->sh_offset + ei.image, *bufsize); + + Debug (4, "read %zd bytes of .debug_frame from offset %zd\n", + *bufsize, shdr->sh_offset); +#if defined(SHF_COMPRESSED) + } +#endif + + ehdr = ei.image; + phdr = (Elf_W (Phdr) *) ((char *) ei.image + ehdr->e_phoff); + + for (i = 0; i < ehdr->e_phnum; ++i) + if (phdr[i].p_type == PT_LOAD) + { + *load_offset = segbase - phdr[i].p_vaddr; + + Debug (4, "%s load offset is 0x%zx\n", file, *load_offset); + + break; + } + + mi_munmap(ei.image, ei.size); + return 0; +} + +/* Locate the binary which originated the contents of address ADDR. Return + the name of the binary in *name (space is allocated by the caller) + Returns 0 if a binary is successfully found, or 1 if an error occurs. */ + +static int +find_binary_for_address (unw_word_t ip, char *name, size_t name_size) +{ +#if defined(__linux__) && (!UNW_REMOTE_ONLY) + struct map_iterator mi; + int found = 0; + int pid = getpid (); + unsigned long segbase, mapoff, hi; + + if (maps_init (&mi, pid) != 0) + return 1; + + while (maps_next (&mi, &segbase, &hi, &mapoff, NULL)) + if (ip >= segbase && ip < hi) + { + size_t len = strlen (mi.path); + + if (len + 1 <= name_size) + { + memcpy (name, mi.path, len + 1); + found = 1; + } + break; + } + maps_close (&mi); + return !found; +#endif + + return 1; +} + +/* Locate and/or try to load a debug_frame section for address ADDR. Return + pointer to debug frame descriptor, or zero if not found. */ + +static struct unw_debug_frame_list * +locate_debug_info (unw_addr_space_t as, unw_word_t addr, unw_word_t segbase, + const char *dlname, unw_word_t start, unw_word_t end) +{ + struct unw_debug_frame_list *w, *fdesc = 0; + char path[PATH_MAX]; + char *name = path; + int err; + char *buf; + size_t bufsize; + unw_word_t load_offset; + + /* First, see if we loaded this frame already. */ + + for (w = as->debug_frames; w; w = w->next) + { + Debug (4, "checking %p: %lx-%lx\n", w, (long)w->start, (long)w->end); + if (addr >= w->start && addr < w->end) + return w; + } + + /* If the object name we receive is blank, there's still a chance of locating + the file by parsing /proc/self/maps. */ + + if (strcmp (dlname, "") == 0) + { + err = find_binary_for_address (addr, name, sizeof(path)); + if (err) + { + Debug (15, "tried to locate binary for 0x%" PRIx64 ", but no luck\n", + (uint64_t) addr); + return 0; + } + } + else + name = (char*) dlname; + + err = load_debug_frame (name, &buf, &bufsize, as == unw_local_addr_space, + segbase, &load_offset); + + if (!err) + { + GET_MEMORY (fdesc, sizeof (struct unw_debug_frame_list)); + if (!fdesc) + { + Debug (2, "failed to allocate frame list entry\n"); + return 0; + } + + fdesc->start = start; + fdesc->end = end; + fdesc->load_offset = load_offset; + fdesc->debug_frame = buf; + fdesc->debug_frame_size = bufsize; + fdesc->index = NULL; + fdesc->next = as->debug_frames; + + as->debug_frames = fdesc; + } + + return fdesc; +} + +static size_t +debug_frame_index_make (struct unw_debug_frame_list *fdesc) +{ + unw_accessors_t *a = unw_get_accessors_int (unw_local_addr_space); + char *buf = fdesc->debug_frame; + size_t bufsize = fdesc->debug_frame_size; + unw_word_t addr = (unw_word_t) (uintptr_t) buf; + size_t count = 0; + + while (addr < (unw_word_t) (uintptr_t) (buf + bufsize)) + { + unw_word_t item_start = addr, item_end = 0; + uint32_t u32val = 0; + uint64_t cie_id = 0; + uint64_t id_for_cie; + + dwarf_readu32 (unw_local_addr_space, a, &addr, &u32val, NULL); + + if (u32val == 0) + break; + + if (u32val != 0xffffffff) + { + uint32_t cie_id32 = 0; + + item_end = addr + u32val; + dwarf_readu32 (unw_local_addr_space, a, &addr, &cie_id32, NULL); + cie_id = cie_id32; + id_for_cie = 0xffffffff; + } + else + { + uint64_t u64val = 0; + + /* Extended length. */ + dwarf_readu64 (unw_local_addr_space, a, &addr, &u64val, NULL); + item_end = addr + u64val; + + dwarf_readu64 (unw_local_addr_space, a, &addr, &cie_id, NULL); + id_for_cie = 0xffffffffffffffffull; + } + + /*Debug (1, "CIE/FDE id = %.8x\n", (int) cie_id);*/ + + if (cie_id == id_for_cie) + { + ; + /*Debug (1, "Found CIE at %.8x.\n", item_start);*/ + } + else + { + unw_word_t fde_addr = item_start; + unw_proc_info_t this_pi; + int err; + + /*Debug (1, "Found FDE at %.8x\n", item_start);*/ + + err = dwarf_extract_proc_info_from_fde (unw_local_addr_space, + a, &fde_addr, + &this_pi, + (uintptr_t) buf, 0, 1, + NULL); + + if (!err) + { + Debug (15, "start_ip = %lx, end_ip = %lx\n", + (long) this_pi.start_ip, (long) this_pi.end_ip); + + if (fdesc->index) + { + struct table_entry *e = &fdesc->index[count]; + + e->fde_offset = item_start - (unw_word_t) (uintptr_t) buf; + e->start_ip_offset = this_pi.start_ip; + } + + count++; + } + /*else + Debug (1, "FDE parse failed\n");*/ + } + + addr = item_end; + } + return count; +} + +static void +debug_frame_index_sort (struct unw_debug_frame_list *fdesc) +{ + size_t i, j, k, n = fdesc->index_size / sizeof (*fdesc->index); + struct table_entry *a = fdesc->index; + struct table_entry t; + + /* Use a simple Shell sort as it relatively fast and + * does not require additional memory. */ + + for (k = n / 2; k > 0; k /= 2) + { + for (i = k; i < n; i++) + { + t = a[i]; + + for (j = i; j >= k; j -= k) + { + if (t.start_ip_offset >= a[j - k].start_ip_offset) + break; + + a[j] = a[j - k]; + } + + a[j] = t; + } + } +} + +int +dwarf_find_debug_frame (int found, unw_dyn_info_t *di_debug, unw_word_t ip, + unw_word_t segbase, const char* obj_name, + unw_word_t start, unw_word_t end) +{ + unw_dyn_info_t *di = di_debug; + struct unw_debug_frame_list *fdesc; + + Debug (15, "Trying to find .debug_frame for %s\n", obj_name); + + fdesc = locate_debug_info (unw_local_addr_space, ip, segbase, obj_name, start, + end); + + if (!fdesc) + { + Debug (15, "couldn't load .debug_frame\n"); + return found; + } + + Debug (15, "loaded .debug_frame\n"); + + if (fdesc->debug_frame_size == 0) + { + Debug (15, "zero-length .debug_frame\n"); + return found; + } + + /* Now create a binary-search table, if it does not already exist. */ + + if (!fdesc->index) + { + /* Find all FDE entries in debug_frame, and make into a sorted + index. First determine an index element count. */ + + size_t count = debug_frame_index_make (fdesc); + + if (!count) + { + Debug (15, "no CIE/FDE found in .debug_frame\n"); + return found; + } + + fdesc->index_size = count * sizeof (*fdesc->index); + GET_MEMORY (fdesc->index, fdesc->index_size); + + if (!fdesc->index) + { + Debug (15, "couldn't allocate a frame index table\n"); + fdesc->index_size = 0; + return found; + } + + /* Then fill and sort the index. */ + + debug_frame_index_make (fdesc); + debug_frame_index_sort (fdesc); + + /*for (i = 0; i < count; i++) + { + const struct table_entry *e = &fdesc->index[i]; + + Debug (15, "ip %x, FDE offset %x\n", + e->start_ip_offset, e->fde_offset); + }*/ + } + + di->format = UNW_INFO_FORMAT_TABLE; + di->start_ip = fdesc->start; + di->end_ip = fdesc->end; + di->load_offset = fdesc->load_offset; + di->u.ti.name_ptr = (unw_word_t) (uintptr_t) obj_name; + di->u.ti.table_data = (unw_word_t *) fdesc; + di->u.ti.table_len = sizeof (*fdesc) / sizeof (unw_word_t); + di->u.ti.segbase = segbase; + + found = 1; + Debug (15, "found debug_frame table `%s': segbase=0x%lx, len=%lu, " + "gp=0x%lx, table_data=0x%lx\n", + (char *) (uintptr_t) di->u.ti.name_ptr, + (long) di->u.ti.segbase, (long) di->u.ti.table_len, + (long) di->gp, (long) di->u.ti.table_data); + + return found; +} + +#endif /* CONFIG_DEBUG_FRAME */ + +#ifndef UNW_REMOTE_ONLY + +static Elf_W (Addr) +dwarf_find_eh_frame_section(struct dl_phdr_info *info) +{ + int rc; + struct elf_image ei; + Elf_W (Addr) eh_frame = 0; + Elf_W (Shdr)* shdr; + const char *file = info->dlpi_name; + char exepath[PATH_MAX]; + + if (strlen(file) == 0) + { + tdep_get_exe_image_path(exepath); + file = exepath; + } + + Debug (1, "looking for .eh_frame section in %s\n", + file); + + rc = elf_map_image (&ei, file); + if (rc != 0) + return 0; + + shdr = elf_w (find_section) (&ei, ".eh_frame"); + if (!shdr) + goto out; + + eh_frame = shdr->sh_addr + info->dlpi_addr; + Debug (4, "found .eh_frame at address %lx\n", + eh_frame); + +out: + mi_munmap (ei.image, ei.size); + + return eh_frame; +} + +struct dwarf_callback_data + { + /* in: */ + unw_word_t ip; /* instruction-pointer we're looking for */ + unw_proc_info_t *pi; /* proc-info pointer */ + int need_unwind_info; + /* out: */ + int single_fde; /* did we find a single FDE? (vs. a table) */ + unw_dyn_info_t di; /* table info (if single_fde is false) */ + unw_dyn_info_t di_debug; /* additional table info for .debug_frame */ + }; + +/* ptr is a pointer to a dwarf_callback_data structure and, on entry, + member ip contains the instruction-pointer we're looking + for. */ +HIDDEN int +dwarf_callback (struct dl_phdr_info *info, size_t size, void *ptr) +{ + struct dwarf_callback_data *cb_data = ptr; + unw_dyn_info_t *di = &cb_data->di; + const Elf_W(Phdr) *phdr, *p_eh_hdr, *p_dynamic, *p_text; + unw_word_t addr, eh_frame_start, eh_frame_end, fde_count, ip; + Elf_W(Addr) load_base, max_load_addr = 0; + int ret, need_unwind_info = cb_data->need_unwind_info; + unw_proc_info_t *pi = cb_data->pi; + struct dwarf_eh_frame_hdr *hdr = NULL; + unw_accessors_t *a; + long n; + int found = 0; + struct dwarf_eh_frame_hdr synth_eh_frame_hdr; +#ifdef CONFIG_DEBUG_FRAME + unw_word_t start, end; +#endif /* CONFIG_DEBUG_FRAME*/ + + ip = cb_data->ip; + + /* Make sure struct dl_phdr_info is at least as big as we need. */ + if (size < offsetof (struct dl_phdr_info, dlpi_phnum) + + sizeof (info->dlpi_phnum)) + return -1; + + Debug (15, "checking %s, base=0x%lx)\n", + info->dlpi_name, (long) info->dlpi_addr); + + phdr = info->dlpi_phdr; + load_base = info->dlpi_addr; + p_text = NULL; + p_eh_hdr = NULL; + p_dynamic = NULL; + + /* See if PC falls into one of the loaded segments. Find the + eh-header segment at the same time. */ + for (n = info->dlpi_phnum; --n >= 0; phdr++) + { + if (phdr->p_type == PT_LOAD) + { + Elf_W(Addr) vaddr = phdr->p_vaddr + load_base; + + if (ip >= vaddr && ip < vaddr + phdr->p_memsz) + p_text = phdr; + + if (vaddr + phdr->p_filesz > max_load_addr) + max_load_addr = vaddr + phdr->p_filesz; + } + else if (phdr->p_type == PT_GNU_EH_FRAME) + p_eh_hdr = phdr; +#if defined __sun + else if (phdr->p_type == PT_SUNW_UNWIND) + p_eh_hdr = phdr; +#endif + else if (phdr->p_type == PT_DYNAMIC) + p_dynamic = phdr; + } + + if (!p_text) + return 0; + + if (p_eh_hdr) + { + hdr = (struct dwarf_eh_frame_hdr *) (p_eh_hdr->p_vaddr + load_base); + } + else + { + Elf_W (Addr) eh_frame; + Debug (1, "no .eh_frame_hdr section found\n"); + eh_frame = dwarf_find_eh_frame_section (info); + if (eh_frame) + { + Debug (1, "using synthetic .eh_frame_hdr section for %s\n", + info->dlpi_name); + synth_eh_frame_hdr.version = DW_EH_VERSION; + synth_eh_frame_hdr.eh_frame_ptr_enc = DW_EH_PE_absptr | + ((sizeof(Elf_W (Addr)) == 4) ? DW_EH_PE_udata4 : DW_EH_PE_udata8); + synth_eh_frame_hdr.fde_count_enc = DW_EH_PE_omit; + synth_eh_frame_hdr.table_enc = DW_EH_PE_omit; + synth_eh_frame_hdr.eh_frame = eh_frame; + hdr = &synth_eh_frame_hdr; + } + } + + if (hdr) + { + if (p_dynamic) + { + /* For dynamically linked executables and shared libraries, + DT_PLTGOT is the value that data-relative addresses are + relative to for that object. We call this the "gp". */ + Elf_W(Dyn) *dyn = (Elf_W(Dyn) *)(p_dynamic->p_vaddr + load_base); + for (; dyn->d_tag != DT_NULL; ++dyn) + if (dyn->d_tag == DT_PLTGOT) + { + /* Assume that _DYNAMIC is writable and GLIBC has + relocated it (true for x86 at least). */ + di->gp = dyn->d_un.d_ptr; + break; + } + } + else + /* Otherwise this is a static executable with no _DYNAMIC. Assume + that data-relative addresses are relative to 0, i.e., + absolute. */ + di->gp = 0; + pi->gp = di->gp; + + if (hdr->version != DW_EH_VERSION) + { + Debug (1, "table `%s' has unexpected version %d\n", + info->dlpi_name, hdr->version); + return 0; + } + + a = unw_get_accessors_int (unw_local_addr_space); + addr = (unw_word_t) (uintptr_t) (&hdr->eh_frame); + + /* (Optionally) read eh_frame_ptr: */ + if ((ret = dwarf_read_encoded_pointer (unw_local_addr_space, a, + &addr, hdr->eh_frame_ptr_enc, pi, + &eh_frame_start, NULL)) < 0) + return ret; + + /* (Optionally) read fde_count: */ + if ((ret = dwarf_read_encoded_pointer (unw_local_addr_space, a, + &addr, hdr->fde_count_enc, pi, + &fde_count, NULL)) < 0) + return ret; + + if (hdr->table_enc != (DW_EH_PE_datarel | DW_EH_PE_sdata4)) + { + /* If there is no search table or it has an unsupported + encoding, fall back on linear search. */ + if (hdr->table_enc == DW_EH_PE_omit) + { + Debug (4, "table `%s' lacks search table; doing linear search\n", + info->dlpi_name); + } + else + { + Debug (4, "table `%s' has encoding 0x%x; doing linear search\n", + info->dlpi_name, hdr->table_enc); + } + + eh_frame_end = max_load_addr; /* XXX can we do better? */ + + if (hdr->fde_count_enc == DW_EH_PE_omit) + fde_count = ~0UL; + if (hdr->eh_frame_ptr_enc == DW_EH_PE_omit) + abort (); + + Debug (1, "eh_frame_start = %lx eh_frame_end = %lx\n", + eh_frame_start, eh_frame_end); + + /* XXX we know how to build a local binary search table for + .debug_frame, so we could do that here too. */ + found = linear_search (unw_local_addr_space, ip, + eh_frame_start, eh_frame_end, fde_count, + pi, need_unwind_info, NULL); + if (found != 1) + found = 0; + else + cb_data->single_fde = 1; + } + else + { + di->format = UNW_INFO_FORMAT_REMOTE_TABLE; + di->start_ip = p_text->p_vaddr + load_base; + di->end_ip = p_text->p_vaddr + load_base + p_text->p_memsz; + di->u.rti.name_ptr = (unw_word_t) (uintptr_t) info->dlpi_name; + di->u.rti.table_data = addr; + assert (sizeof (struct table_entry) % sizeof (unw_word_t) == 0); + di->u.rti.table_len = (fde_count * sizeof (struct table_entry) + / sizeof (unw_word_t)); + /* For the binary-search table in the eh_frame_hdr, data-relative + means relative to the start of that section... */ + di->u.rti.segbase = (unw_word_t) (uintptr_t) hdr; + + found = 1; + Debug (15, "found table `%s': segbase=0x%lx, len=%lu, gp=0x%lx, " + "table_data=0x%lx\n", (char *) (uintptr_t) di->u.rti.name_ptr, + (long) di->u.rti.segbase, (long) di->u.rti.table_len, + (long) di->gp, (long) di->u.rti.table_data); + } + } + +#ifdef CONFIG_DEBUG_FRAME + /* Find the start/end of the described region by parsing the phdr_info + structure. */ + start = (unw_word_t) -1; + end = 0; + + for (n = 0; n < info->dlpi_phnum; n++) + { + if (info->dlpi_phdr[n].p_type == PT_LOAD) + { + unw_word_t seg_start = info->dlpi_addr + info->dlpi_phdr[n].p_vaddr; + unw_word_t seg_end = seg_start + info->dlpi_phdr[n].p_memsz; + + if (seg_start < start) + start = seg_start; + + if (seg_end > end) + end = seg_end; + } + } + + found = dwarf_find_debug_frame (found, &cb_data->di_debug, ip, + info->dlpi_addr, info->dlpi_name, start, + end); +#endif /* CONFIG_DEBUG_FRAME */ + + return found; +} + +HIDDEN int +dwarf_find_proc_info (unw_addr_space_t as, unw_word_t ip, + unw_proc_info_t *pi, int need_unwind_info, void *arg) +{ + struct dwarf_callback_data cb_data; + intrmask_t saved_mask; + int ret; + + Debug (14, "looking for IP=0x%lx\n", (long) ip); + + memset (&cb_data, 0, sizeof (cb_data)); + cb_data.ip = ip; + cb_data.pi = pi; + cb_data.need_unwind_info = need_unwind_info; + cb_data.di.format = -1; + cb_data.di_debug.format = -1; + + SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &saved_mask); + ret = as->iterate_phdr_function (dwarf_callback, &cb_data); + SIGPROCMASK (SIG_SETMASK, &saved_mask, NULL); + + if (ret > 0) + { + if (cb_data.single_fde) + /* already got the result in *pi */ + return 0; + + /* search the table: */ + if (cb_data.di.format != -1) + ret = dwarf_search_unwind_table_int (as, ip, &cb_data.di, + pi, need_unwind_info, arg); + else + ret = -UNW_ENOINFO; + + if (ret == -UNW_ENOINFO && cb_data.di_debug.format != -1) + ret = dwarf_search_unwind_table_int (as, ip, &cb_data.di_debug, pi, + need_unwind_info, arg); + } + else + ret = -UNW_ENOINFO; + + return ret; +} + +static inline const struct table_entry * +lookup (const struct table_entry *table, size_t table_size, int32_t rel_ip) +{ + unsigned long table_len = table_size / sizeof (struct table_entry); + const struct table_entry *e = NULL; + unsigned long lo, hi, mid; + + /* do a binary search for right entry: */ + for (lo = 0, hi = table_len; lo < hi;) + { + mid = (lo + hi) / 2; + e = table + mid; + Debug (15, "e->start_ip_offset = %lx\n", (long) e->start_ip_offset); + if (rel_ip < e->start_ip_offset) + hi = mid; + else + lo = mid + 1; + } + if (hi <= 0) + return NULL; + e = table + hi - 1; + return e; +} + +#endif /* !UNW_REMOTE_ONLY */ + +#ifndef UNW_LOCAL_ONLY + +/* Lookup an unwind-table entry in remote memory. Returns 1 if an + entry is found, 0 if no entry is found, negative if an error + occurred reading remote memory. */ +static int +remote_lookup (unw_addr_space_t as, + unw_word_t table, size_t table_size, int32_t rel_ip, + struct table_entry *e, int32_t *last_ip_offset, void *arg) +{ + size_t table_len = table_size / sizeof (struct table_entry); + unw_accessors_t *a = unw_get_accessors_int (as); + size_t lo, hi, mid; + unw_word_t e_addr = 0; + int32_t start = 0; + int ret; + + /* do a binary search for right entry: */ + for (lo = 0, hi = table_len; lo < hi;) + { + mid = (lo + hi) / 2; + e_addr = table + mid * sizeof (struct table_entry); + if ((ret = dwarf_reads32 (as, a, &e_addr, &start, arg)) < 0) + return ret; + + if (rel_ip < start) + hi = mid; + else + lo = mid + 1; + } + if (hi <= 0) + return 0; + e_addr = table + (hi - 1) * sizeof (struct table_entry); + if ((ret = dwarf_reads32 (as, a, &e_addr, &e->start_ip_offset, arg)) < 0 + || (ret = dwarf_reads32 (as, a, &e_addr, &e->fde_offset, arg)) < 0 + || (hi < table_len && + (ret = dwarf_reads32 (as, a, &e_addr, last_ip_offset, arg)) < 0)) + return ret; + return 1; +} + +#endif /* !UNW_LOCAL_ONLY */ + +static int is_remote_table(int format) +{ + return (format == UNW_INFO_FORMAT_REMOTE_TABLE || + format == UNW_INFO_FORMAT_IP_OFFSET); +} + +int +dwarf_search_unwind_table (unw_addr_space_t as, unw_word_t ip, + unw_dyn_info_t *di, unw_proc_info_t *pi, + int need_unwind_info, void *arg) +{ + const struct table_entry *e = NULL, *table = NULL; + unw_word_t ip_base = 0, segbase = 0, last_ip, fde_addr; + unw_accessors_t *a; +#ifndef UNW_LOCAL_ONLY + struct table_entry ent; +#endif + int ret; + unw_word_t debug_frame_base = 0; + size_t table_len = 0; + +#ifdef UNW_REMOTE_ONLY + assert (is_remote_table(di->format)); +#else + assert (is_remote_table(di->format) + || di->format == UNW_INFO_FORMAT_TABLE); +#endif + assert (ip >= di->start_ip && ip < di->end_ip); + + if (is_remote_table(di->format)) + { + table = (const struct table_entry *) (uintptr_t) di->u.rti.table_data; + table_len = di->u.rti.table_len * sizeof (unw_word_t); + debug_frame_base = 0; + } + else + { + assert(di->format == UNW_INFO_FORMAT_TABLE); +#ifndef UNW_REMOTE_ONLY + struct unw_debug_frame_list *fdesc = (void *) di->u.ti.table_data; + + /* UNW_INFO_FORMAT_TABLE (i.e. .debug_frame) is read from local address + space. Both the index and the unwind tables live in local memory, but + the address space to check for properties like the address size and + endianness is the target one. */ + as = unw_local_addr_space; + table = fdesc->index; + table_len = fdesc->index_size; + debug_frame_base = (uintptr_t) fdesc->debug_frame; +#endif + } + + a = unw_get_accessors_int (as); + + segbase = di->u.rti.segbase; + if (di->format == UNW_INFO_FORMAT_IP_OFFSET) { + ip_base = di->start_ip; + } else { + ip_base = segbase; + } + + Debug (6, "lookup IP 0x%lx\n", (long) (ip - ip_base - di->load_offset)); + +#ifndef UNW_REMOTE_ONLY + if (as == unw_local_addr_space) + { + e = lookup (table, table_len, ip - ip_base - di->load_offset); + if (e && &e[1] < &table[table_len / sizeof (struct table_entry)]) + last_ip = e[1].start_ip_offset + ip_base + di->load_offset; + else + last_ip = di->end_ip; + } + else +#endif + { +#ifndef UNW_LOCAL_ONLY + int32_t last_ip_offset = di->end_ip - ip_base - di->load_offset; + segbase = di->u.rti.segbase; + if ((ret = remote_lookup (as, (uintptr_t) table, table_len, + ip - ip_base, &ent, &last_ip_offset, arg)) < 0) + return ret; + if (ret) + { + e = &ent; + last_ip = last_ip_offset + ip_base + di->load_offset; + } + else + e = NULL; /* no info found */ +#endif + } + if (!e) + { + Debug (1, "IP %lx inside range %lx-%lx, but no explicit unwind info found\n", + (long) ip, (long) di->start_ip, (long) di->end_ip); + /* IP is inside this table's range, but there is no explicit + unwind info. */ + return -UNW_ENOINFO; + } + Debug (15, "ip=0x%lx, load_offset=0x%lx, start_ip=0x%lx\n", + (long) ip, (long) di->load_offset, (long) (e->start_ip_offset)); + if (debug_frame_base) + fde_addr = e->fde_offset + debug_frame_base; + else + fde_addr = e->fde_offset + segbase; + Debug (1, "e->fde_offset = %lx, segbase = %lx, debug_frame_base = %lx, " + "fde_addr = %lx\n", (long) e->fde_offset, (long) segbase, + (long) debug_frame_base, (long) fde_addr); + if ((ret = dwarf_extract_proc_info_from_fde (as, a, &fde_addr, pi, + debug_frame_base ? + debug_frame_base : segbase, + need_unwind_info, + debug_frame_base != 0, arg)) < 0) + return ret; + + /* .debug_frame uses an absolute encoding that does not know about any + shared library relocation. */ + if (di->format == UNW_INFO_FORMAT_TABLE) + { + pi->start_ip += segbase; + pi->end_ip += segbase; + pi->flags = UNW_PI_FLAG_DEBUG_FRAME; + } + + pi->start_ip += di->load_offset; + pi->end_ip += di->load_offset; + +#if defined(NEED_LAST_IP) + pi->last_ip = last_ip; +#else + (void)last_ip; +#endif + if (ip < pi->start_ip || ip >= pi->end_ip) + return -UNW_ENOINFO; + + return 0; +} + +HIDDEN void +dwarf_put_unwind_info (unw_addr_space_t as UNUSED, unw_proc_info_t *pi UNUSED, void *arg UNUSED) +{ + return; /* always a nop */ +} diff --git a/vendor/libunwind/src/dwarf/Gfind_unwind_table.c b/vendor/libunwind/src/dwarf/Gfind_unwind_table.c new file mode 100644 index 0000000000..a7c4dfd372 --- /dev/null +++ b/vendor/libunwind/src/dwarf/Gfind_unwind_table.c @@ -0,0 +1,238 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include +#include +#include + +#include + +#include "libunwind_i.h" +#include "dwarf-eh.h" +#include "dwarf_i.h" + +#define to_unw_word(p) ((unw_word_t) (uintptr_t) (p)) + +int +dwarf_find_unwind_table (struct elf_dyn_info *edi, + unw_addr_space_t as UNUSED, + const char *path UNUSED, + unw_word_t segbase, + unw_word_t mapoff, + unw_word_t ip UNUSED) +{ + Elf_W(Phdr) *phdr, *ptxt = NULL, *peh_hdr = NULL, *pdyn = NULL; + unw_word_t addr, eh_frame_start, fde_count, loadoff, load_base; + unw_word_t max_load_addr = 0; + unw_word_t start_ip = to_unw_word (-1); + unw_word_t end_ip = 0; + struct dwarf_eh_frame_hdr *hdr; + unw_proc_info_t pi; + unw_accessors_t *a; + Elf_W(Ehdr) *ehdr; +#if UNW_TARGET_ARM + const Elf_W(Phdr) *param_exidx = NULL; +#endif + int i, ret, found = 0; + + /* XXX: Much of this code is Linux/LSB-specific. */ + + if (!elf_w(valid_object) (&edi->ei)) + return -UNW_ENOINFO; + + ehdr = edi->ei.image; + phdr = (Elf_W(Phdr) *) ((char *) edi->ei.image + ehdr->e_phoff); + + for (i = 0; i < ehdr->e_phnum; ++i) + { + switch (phdr[i].p_type) + { + case PT_LOAD: + if (phdr[i].p_vaddr < start_ip) + start_ip = phdr[i].p_vaddr; + + if (phdr[i].p_vaddr + phdr[i].p_memsz > end_ip) + end_ip = phdr[i].p_vaddr + phdr[i].p_memsz; + + if ((phdr[i].p_flags & PF_X) == PF_X) + ptxt = phdr + i; + if ((uintptr_t) edi->ei.image + phdr->p_filesz > max_load_addr) + max_load_addr = (uintptr_t) edi->ei.image + phdr->p_filesz; + break; + + case PT_GNU_EH_FRAME: +#if defined __sun + case PT_SUNW_UNWIND: +#endif + peh_hdr = phdr + i; + break; + + case PT_DYNAMIC: + pdyn = phdr + i; + break; + +#if UNW_TARGET_ARM + case PT_ARM_EXIDX: + param_exidx = phdr + i; + break; +#endif + + default: + break; + } + } + + if (!ptxt) + return 0; + + loadoff = mapoff + (ptxt->p_vaddr - ptxt->p_offset); + load_base = segbase - loadoff; + start_ip += load_base; + end_ip += load_base; + + if (peh_hdr) + { + if (pdyn) + { + /* For dynamically linked executables and shared libraries, + DT_PLTGOT is the value that data-relative addresses are + relative to for that object. We call this the "gp". */ + Elf_W(Dyn) *dyn = (Elf_W(Dyn) *)(pdyn->p_offset + + (char *) edi->ei.image); + for (; dyn->d_tag != DT_NULL; ++dyn) + if (dyn->d_tag == DT_PLTGOT) + { + /* Assume that _DYNAMIC is writable and GLIBC has + relocated it (true for x86 at least). */ + edi->di_cache.gp = dyn->d_un.d_ptr; + break; + } + } + else + /* Otherwise this is a static executable with no _DYNAMIC. Assume + that data-relative addresses are relative to 0, i.e., + absolute. */ + edi->di_cache.gp = 0; + + hdr = (struct dwarf_eh_frame_hdr *) (peh_hdr->p_offset + + (char *) edi->ei.image); + if (hdr->version != DW_EH_VERSION) + { + Debug (1, "table `%s' has unexpected version %d\n", + path, hdr->version); + return -UNW_ENOINFO; + } + + a = unw_get_accessors_int (unw_local_addr_space); + addr = to_unw_word (&hdr->eh_frame); + + /* Fill in a dummy proc_info structure. We just need to fill in + enough to ensure that dwarf_read_encoded_pointer() can do it's + job. Since we don't have a procedure-context at this point, all + we have to do is fill in the global-pointer. */ + memset (&pi, 0, sizeof (pi)); + pi.gp = edi->di_cache.gp; + + /* (Optionally) read eh_frame_ptr: */ + if ((ret = dwarf_read_encoded_pointer (unw_local_addr_space, a, + &addr, hdr->eh_frame_ptr_enc, &pi, + &eh_frame_start, NULL)) < 0) + return -UNW_ENOINFO; + + /* (Optionally) read fde_count: */ + if ((ret = dwarf_read_encoded_pointer (unw_local_addr_space, a, + &addr, hdr->fde_count_enc, &pi, + &fde_count, NULL)) < 0) + return -UNW_ENOINFO; + + if (hdr->table_enc != (DW_EH_PE_datarel | DW_EH_PE_sdata4)) + { + #if 1 + abort (); + #else + unw_word_t eh_frame_end; + + /* If there is no search table or it has an unsupported + encoding, fall back on linear search. */ + if (hdr->table_enc == DW_EH_PE_omit) + Debug (4, "EH lacks search table; doing linear search\n"); + else + Debug (4, "EH table has encoding 0x%x; doing linear search\n", + hdr->table_enc); + + eh_frame_end = max_load_addr; /* XXX can we do better? */ + + if (hdr->fde_count_enc == DW_EH_PE_omit) + fde_count = ~0UL; + if (hdr->eh_frame_ptr_enc == DW_EH_PE_omit) + abort (); + + return linear_search (unw_local_addr_space, ip, + eh_frame_start, eh_frame_end, fde_count, + pi, need_unwind_info, NULL); + #endif + } + + edi->di_cache.start_ip = start_ip; + edi->di_cache.end_ip = end_ip; + edi->di_cache.load_offset = 0; + edi->di_cache.format = UNW_INFO_FORMAT_REMOTE_TABLE; + edi->di_cache.u.rti.name_ptr = 0; + /* two 32-bit values (ip_offset/fde_offset) per table-entry: */ + edi->di_cache.u.rti.table_len = (fde_count * 8) / sizeof (unw_word_t); + edi->di_cache.u.rti.table_data = ((load_base + peh_hdr->p_vaddr) + + (addr - to_unw_word (edi->ei.image) + - peh_hdr->p_offset)); + + /* For the binary-search table in the eh_frame_hdr, data-relative + means relative to the start of that section... */ + edi->di_cache.u.rti.segbase = ((load_base + peh_hdr->p_vaddr) + + (to_unw_word (hdr) - + to_unw_word (edi->ei.image) + - peh_hdr->p_offset)); + found = 1; + } + +#if UNW_TARGET_ARM + if (param_exidx) + { + edi->di_arm.format = UNW_INFO_FORMAT_ARM_EXIDX; + edi->di_arm.start_ip = start_ip; + edi->di_arm.end_ip = end_ip; + edi->di_arm.u.rti.name_ptr = to_unw_word (path); + edi->di_arm.u.rti.table_data = load_base + param_exidx->p_vaddr; + edi->di_arm.u.rti.table_len = param_exidx->p_memsz; + found = 1; + } +#endif + +#ifdef CONFIG_DEBUG_FRAME + /* Try .debug_frame. */ + found = dwarf_find_debug_frame (found, &edi->di_debug, ip, load_base, path, + start_ip, end_ip); +#endif + + return found; +} diff --git a/vendor/libunwind/src/dwarf/Gget_proc_info_in_range.c b/vendor/libunwind/src/dwarf/Gget_proc_info_in_range.c new file mode 100644 index 0000000000..8a08520ee4 --- /dev/null +++ b/vendor/libunwind/src/dwarf/Gget_proc_info_in_range.c @@ -0,0 +1,120 @@ +/* Copyright (C) 2022 Hewlett-Packard Co. + Contributed by David Mosberger-Tang . +This file is part of libunwind. +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include +#include "libunwind_i.h" +#include "dwarf-eh.h" +#include "dwarf_i.h" + +int +unw_get_proc_info_in_range (unw_word_t start_ip, + unw_word_t end_ip, + unw_word_t eh_frame_table, + unw_word_t eh_frame_table_len UNUSED, + unw_word_t exidx_frame_table UNUSED, + unw_word_t exidx_frame_table_len UNUSED, + unw_addr_space_t as, + unw_word_t ip, + unw_proc_info_t *pi, + int need_unwind_info, + void *arg) +{ + int ret = 0; + + unw_dyn_info_t di; + memset(&di, 0, sizeof(di)); + + di.start_ip = start_ip; + di.end_ip = end_ip; + di.gp = pi->gp; + di.u.rti.name_ptr = 0; + +#if UNW_TARGET_ARM + if (exidx_frame_table != 0) { + di.format = UNW_INFO_FORMAT_ARM_EXIDX; + di.u.rti.table_data = exidx_frame_table; + di.u.rti.table_len = exidx_frame_table_len; + di.u.rti.segbase = 0; + } + else +#endif + if (eh_frame_table != 0) { + unw_accessors_t *a = unw_get_accessors_int (as); + + unw_word_t data; + if ((*a->access_mem)(as, eh_frame_table, &data, 0, arg) < 0) { + return -UNW_EINVAL; + } + /* we are reading only the first 4 `char` members of `struct dwarf_eh_frame_hdr`, which + * are guaranteed to fit into the first `sizeof(unw_word_t)` bytes */ + struct dwarf_eh_frame_hdr exhdr; + memcpy(&exhdr, &data, sizeof(data)); + + if (exhdr.version != DW_EH_VERSION) { + Debug (1, "Unexpected version %d\n", exhdr.version); + return -UNW_EBADVERSION; + } + unw_word_t addr = eh_frame_table + offsetof(struct dwarf_eh_frame_hdr, eh_frame); + unw_word_t eh_frame_start; + unw_word_t fde_count; + + /* read eh_frame_ptr */ + if ((ret = dwarf_read_encoded_pointer(as, a, &addr, exhdr.eh_frame_ptr_enc, pi, &eh_frame_start, arg)) < 0) { + return ret; + } + + /* read fde_count */ + if ((ret = dwarf_read_encoded_pointer(as, a, &addr, exhdr.fde_count_enc, pi, &fde_count, arg)) < 0) { + return ret; + } + + // If there are no frame table entries + if (fde_count == 0) { + Debug(1, "No frame table entries\n"); + return -UNW_ENOINFO; + } + + if (exhdr.table_enc != (DW_EH_PE_datarel | DW_EH_PE_sdata4)) { + Debug (1, "Table encoding not supported %x\n", exhdr.table_enc); + return -UNW_EINVAL; + } + + di.format = UNW_INFO_FORMAT_REMOTE_TABLE; + di.u.rti.table_data = addr; + di.u.rti.table_len = (fde_count * 8) / sizeof (unw_word_t); + di.u.rti.segbase = eh_frame_table; + } + else { + Debug (1, "No frame table data\n"); + return -UNW_ENOINFO; + } + + ret = tdep_search_unwind_table(as, ip, &di, pi, need_unwind_info, arg); + if (ret < 0) { + return ret; + } + + if (ip < pi->start_ip || ip >= pi->end_ip) { + Debug (1, "ip %p not in range start_ip %p end_ip %p\n", ip, pi->start_ip, pi->end_ip); + return -UNW_ENOINFO; + } + return UNW_ESUCCESS; +} + diff --git a/vendor/libunwind/src/dwarf/Gparser.c b/vendor/libunwind/src/dwarf/Gparser.c new file mode 100644 index 0000000000..f99e8262d1 --- /dev/null +++ b/vendor/libunwind/src/dwarf/Gparser.c @@ -0,0 +1,1137 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2003, 2005 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "dwarf_i.h" +#include "libunwind_i.h" +#include +#include + +#define alloc_reg_state() (mempool_alloc (&dwarf_reg_state_pool)) +#define free_reg_state(rs) (mempool_free (&dwarf_reg_state_pool, rs)) + +#define DWARF_UNW_CACHE_SIZE(log_size) (1 << log_size) +#define DWARF_UNW_HASH_SIZE(log_size) (1 << (log_size + 1)) + +static inline int +read_regnum (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, + unw_word_t *valp, void *arg) +{ + int ret; + + if ((ret = dwarf_read_uleb128 (as, a, addr, valp, arg)) < 0) + return ret; + + if (*valp >= DWARF_NUM_PRESERVED_REGS) + { + Debug (1, "Invalid register number %u\n", (unsigned int) *valp); + return -UNW_EBADREG; + } + return 0; +} + +static inline void +set_reg (dwarf_state_record_t *sr, unw_word_t regnum, dwarf_where_t where, + unw_word_t val) +{ + sr->rs_current.reg.where[regnum] = where; + sr->rs_current.reg.val[regnum] = val; +} + +static inline int +push_rstate_stack(dwarf_stackable_reg_state_t **rs_stack) +{ + dwarf_stackable_reg_state_t *old_rs = *rs_stack; + if (NULL == (*rs_stack = alloc_reg_state ())) + { + *rs_stack = old_rs; + return -1; + } + (*rs_stack)->next = old_rs; + return 0; +} + +static inline void +pop_rstate_stack(dwarf_stackable_reg_state_t **rs_stack) +{ + dwarf_stackable_reg_state_t *old_rs = *rs_stack; + *rs_stack = old_rs->next; + free_reg_state (old_rs); +} + +static inline void +empty_rstate_stack(dwarf_stackable_reg_state_t **rs_stack) +{ + while (*rs_stack) + pop_rstate_stack(rs_stack); +} + +#ifdef UNW_TARGET_AARCH64 + +static void +aarch64_negate_ra_sign_state(dwarf_state_record_t *sr); + +#endif + +/* Run a CFI program to update the register state. */ +static int +run_cfi_program (struct dwarf_cursor *c, dwarf_state_record_t *sr, + unw_word_t *ip, unw_word_t end_ip, + unw_word_t *addr, unw_word_t end_addr, + dwarf_stackable_reg_state_t **rs_stack, + struct dwarf_cie_info *dci) +{ + unw_addr_space_t as; + void *arg; + + if (c->pi.flags & UNW_PI_FLAG_DEBUG_FRAME) + { + /* .debug_frame CFI is stored in local address space. */ + as = unw_local_addr_space; + arg = NULL; + } + else + { + as = c->as; + arg = c->as_arg; + } + unw_accessors_t *a = unw_get_accessors_int (as); + int ret = 0; + + while (*ip <= end_ip && *addr < end_addr && ret >= 0) + { + unw_word_t operand = 0, regnum, val, len; + uint8_t u8, op; + uint16_t u16; + uint32_t u32; + + if ((ret = dwarf_readu8 (as, a, addr, &op, arg)) < 0) + break; + + if (op & DWARF_CFA_OPCODE_MASK) + { + operand = op & DWARF_CFA_OPERAND_MASK; + op &= ~DWARF_CFA_OPERAND_MASK; + } + switch ((dwarf_cfa_t) op) + { + case DW_CFA_advance_loc: + *ip += operand * dci->code_align; + Debug (15, "CFA_advance_loc to 0x%lx\n", (long) *ip); + break; + + case DW_CFA_advance_loc1: + if ((ret = dwarf_readu8 (as, a, addr, &u8, arg)) < 0) + break; + *ip += u8 * dci->code_align; + Debug (15, "CFA_advance_loc1 to 0x%lx\n", (long) *ip); + break; + + case DW_CFA_advance_loc2: + if ((ret = dwarf_readu16 (as, a, addr, &u16, arg)) < 0) + break; + *ip += u16 * dci->code_align; + Debug (15, "CFA_advance_loc2 to 0x%lx\n", (long) *ip); + break; + + case DW_CFA_advance_loc4: + if ((ret = dwarf_readu32 (as, a, addr, &u32, arg)) < 0) + break; + *ip += u32 * dci->code_align; + Debug (15, "CFA_advance_loc4 to 0x%lx\n", (long) *ip); + break; + + case DW_CFA_MIPS_advance_loc8: +#ifdef UNW_TARGET_MIPS + { + uint64_t u64 = 0; + + if ((ret = dwarf_readu64 (as, a, addr, &u64, arg)) < 0) + break; + *ip += u64 * dci->code_align; + Debug (15, "CFA_MIPS_advance_loc8\n"); + break; + } +#else + Debug (1, "DW_CFA_MIPS_advance_loc8 on non-MIPS target\n"); + ret = -UNW_EINVAL; + break; +#endif + + case DW_CFA_offset: + regnum = operand; + if (regnum >= DWARF_NUM_PRESERVED_REGS) + { + Debug (1, "Invalid register number %u in DW_cfa_OFFSET\n", + (unsigned int) regnum); + ret = -UNW_EBADREG; + break; + } + if ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0) + break; + set_reg (sr, regnum, DWARF_WHERE_CFAREL, val * dci->data_align); + Debug (15, "CFA_offset r%lu at cfa+0x%lx\n", + (long) regnum, (long) (val * dci->data_align)); + break; + + case DW_CFA_offset_extended: + if (((ret = read_regnum (as, a, addr, ®num, arg)) < 0) + || ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0)) + break; + set_reg (sr, regnum, DWARF_WHERE_CFAREL, val * dci->data_align); + Debug (15, "CFA_offset_extended r%lu at cf+0x%lx\n", + (long) regnum, (long) (val * dci->data_align)); + break; + + case DW_CFA_offset_extended_sf: + if (((ret = read_regnum (as, a, addr, ®num, arg)) < 0) + || ((ret = dwarf_read_sleb128 (as, a, addr, &val, arg)) < 0)) + break; + set_reg (sr, regnum, DWARF_WHERE_CFAREL, val * dci->data_align); + Debug (15, "CFA_offset_extended_sf r%lu at cf+0x%lx\n", + (long) regnum, (long) (val * dci->data_align)); + break; + + case DW_CFA_restore: + regnum = operand; + if (regnum >= DWARF_NUM_PRESERVED_REGS) + { + Debug (1, "Invalid register number %u in DW_CFA_restore\n", + (unsigned int) regnum); + ret = -UNW_EINVAL; + break; + } + sr->rs_current.reg.where[regnum] = sr->rs_initial.reg.where[regnum]; + sr->rs_current.reg.val[regnum] = sr->rs_initial.reg.val[regnum]; + Debug (15, "CFA_restore r%lu\n", (long) regnum); + break; + + case DW_CFA_restore_extended: + if ((ret = dwarf_read_uleb128 (as, a, addr, ®num, arg)) < 0) + break; + if (regnum >= DWARF_NUM_PRESERVED_REGS) + { + Debug (1, "Invalid register number %u in " + "DW_CFA_restore_extended\n", (unsigned int) regnum); + ret = -UNW_EINVAL; + break; + } + sr->rs_current.reg.where[regnum] = sr->rs_initial.reg.where[regnum]; + sr->rs_current.reg.val[regnum] = sr->rs_initial.reg.val[regnum]; + Debug (15, "CFA_restore_extended r%lu\n", (long) regnum); + break; + + case DW_CFA_nop: + break; + + case DW_CFA_set_loc: + if ((ret = dwarf_read_encoded_pointer (as, a, addr, dci->fde_encoding, + &c->pi, ip, + arg)) < 0) + break; + Debug (15, "CFA_set_loc to 0x%lx\n", (long) *ip); + break; + + case DW_CFA_undefined: + if ((ret = read_regnum (as, a, addr, ®num, arg)) < 0) + break; + set_reg (sr, regnum, DWARF_WHERE_UNDEF, 0); + Debug (15, "CFA_undefined r%lu\n", (long) regnum); + break; + + case DW_CFA_same_value: + if ((ret = read_regnum (as, a, addr, ®num, arg)) < 0) + break; + set_reg (sr, regnum, DWARF_WHERE_SAME, 0); + Debug (15, "CFA_same_value r%lu\n", (long) regnum); + break; + + case DW_CFA_register: + if (((ret = read_regnum (as, a, addr, ®num, arg)) < 0) + || ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0)) + break; + set_reg (sr, regnum, DWARF_WHERE_REG, val); + Debug (15, "CFA_register r%lu to r%lu\n", (long) regnum, (long) val); + break; + + case DW_CFA_remember_state: + if (push_rstate_stack(rs_stack) < 0) + { + Debug (1, "Out of memory in DW_CFA_remember_state\n"); + ret = -UNW_ENOMEM; + break; + } + (*rs_stack)->state = sr->rs_current; + Debug (15, "CFA_remember_state\n"); + break; + + case DW_CFA_restore_state: + if (!*rs_stack) + { + Debug (1, "register-state stack underflow\n"); + ret = -UNW_EINVAL; + break; + } + sr->rs_current = (*rs_stack)->state; + pop_rstate_stack(rs_stack); + Debug (15, "CFA_restore_state\n"); + break; + + case DW_CFA_def_cfa: + if (((ret = read_regnum (as, a, addr, ®num, arg)) < 0) + || ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0)) + break; + set_reg (sr, DWARF_CFA_REG_COLUMN, DWARF_WHERE_REG, regnum); + set_reg (sr, DWARF_CFA_OFF_COLUMN, 0, val); /* NOT factored! */ + Debug (15, "CFA_def_cfa r%lu+0x%lx\n", (long) regnum, (long) val); + break; + + case DW_CFA_def_cfa_sf: + if (((ret = read_regnum (as, a, addr, ®num, arg)) < 0) + || ((ret = dwarf_read_sleb128 (as, a, addr, &val, arg)) < 0)) + break; + set_reg (sr, DWARF_CFA_REG_COLUMN, DWARF_WHERE_REG, regnum); + set_reg (sr, DWARF_CFA_OFF_COLUMN, 0, + val * dci->data_align); /* factored! */ + Debug (15, "CFA_def_cfa_sf r%lu+0x%lx\n", + (long) regnum, (long) (val * dci->data_align)); + break; + + case DW_CFA_def_cfa_register: + if ((ret = read_regnum (as, a, addr, ®num, arg)) < 0) + break; + set_reg (sr, DWARF_CFA_REG_COLUMN, DWARF_WHERE_REG, regnum); + Debug (15, "CFA_def_cfa_register r%lu\n", (long) regnum); + break; + + case DW_CFA_def_cfa_offset: + if ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0) + break; + set_reg (sr, DWARF_CFA_OFF_COLUMN, 0, val); /* NOT factored! */ + Debug (15, "CFA_def_cfa_offset 0x%lx\n", (long) val); + break; + + case DW_CFA_def_cfa_offset_sf: + if ((ret = dwarf_read_sleb128 (as, a, addr, &val, arg)) < 0) + break; + set_reg (sr, DWARF_CFA_OFF_COLUMN, 0, + val * dci->data_align); /* factored! */ + Debug (15, "CFA_def_cfa_offset_sf 0x%lx\n", + (long) (val * dci->data_align)); + break; + + case DW_CFA_def_cfa_expression: + /* Save the address of the DW_FORM_block for later evaluation. */ + set_reg (sr, DWARF_CFA_REG_COLUMN, DWARF_WHERE_EXPR, *addr); + + if ((ret = dwarf_read_uleb128 (as, a, addr, &len, arg)) < 0) + break; + + Debug (15, "CFA_def_cfa_expr @ 0x%lx [%lu bytes]\n", + (long) *addr, (long) len); + *addr += len; + break; + + case DW_CFA_expression: + if ((ret = read_regnum (as, a, addr, ®num, arg)) < 0) + break; + + /* Save the address of the DW_FORM_block for later evaluation. */ + set_reg (sr, regnum, DWARF_WHERE_EXPR, *addr); + + if ((ret = dwarf_read_uleb128 (as, a, addr, &len, arg)) < 0) + break; + + Debug (15, "CFA_expression r%lu @ 0x%lx [%lu bytes]\n", + (long) regnum, (long) addr, (long) len); + *addr += len; + break; + + case DW_CFA_val_expression: + if ((ret = read_regnum (as, a, addr, ®num, arg)) < 0) + break; + + /* Save the address of the DW_FORM_block for later evaluation. */ + set_reg (sr, regnum, DWARF_WHERE_VAL_EXPR, *addr); + + if ((ret = dwarf_read_uleb128 (as, a, addr, &len, arg)) < 0) + break; + + Debug (15, "CFA_val_expression r%lu @ 0x%lx [%lu bytes]\n", + (long) regnum, (long) addr, (long) len); + *addr += len; + break; + + case DW_CFA_GNU_args_size: + if ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0) + break; + sr->args_size = val; + Debug (15, "CFA_GNU_args_size %lu\n", (long) val); + break; + + case DW_CFA_GNU_negative_offset_extended: + /* A comment in GCC says that this is obsoleted by + DW_CFA_offset_extended_sf, but that it's used by older + PowerPC code. */ + if (((ret = read_regnum (as, a, addr, ®num, arg)) < 0) + || ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0)) + break; + set_reg (sr, regnum, DWARF_WHERE_CFAREL, ~(val * dci->data_align) + 1); + Debug (15, "CFA_GNU_negative_offset_extended cfa+0x%lx\n", + (long) (~(val * dci->data_align) + 1)); + break; + + case DW_CFA_GNU_window_save: +#ifdef UNW_TARGET_SPARC + /* This is a special CFA to handle all 16 windowed registers + on SPARC. */ + for (regnum = 16; regnum < 32; ++regnum) + set_reg (sr, regnum, DWARF_WHERE_CFAREL, + (regnum - 16) * sizeof (unw_word_t)); + Debug (15, "CFA_GNU_window_save\n"); + break; +#elif UNW_TARGET_AARCH64 + /* This is a specific opcode on aarch64, DW_CFA_AARCH64_negate_ra_state */ + Debug (15, "DW_CFA_AARCH64_negate_ra_state\n"); + aarch64_negate_ra_sign_state(sr); + break; +#else + /* FALL THROUGH */ +#endif + case DW_CFA_lo_user: + case DW_CFA_hi_user: + Debug (1, "Unexpected CFA opcode 0x%x\n", op); + ret = -UNW_EINVAL; + break; + } + } + + if (ret > 0) + ret = 0; + return ret; +} + +static int +fetch_proc_info (struct dwarf_cursor *c, unw_word_t ip) +{ + int ret, dynamic = 1; + + /* The 'ip' can point either to the previous or next instruction + depending on what type of frame we have: normal call or a place + to resume execution (e.g. after signal frame). + + For a normal call frame we need to back up so we point within the + call itself; this is important because a) the call might be the + very last instruction of the function and the edge of the FDE, + and b) so that run_cfi_program() runs locations up to the call + but not more. + + For signal frame, we need to do the exact opposite and look + up using the current 'ip' value. That is where execution will + continue, and it's important we get this right, as 'ip' could be + right at the function entry and hence FDE edge, or at instruction + that manipulates CFA (push/pop). */ + + if (c->use_prev_instr) + { +#if defined(__arm__) + /* On arm, the least bit denotes thumb/arm mode, clear it. */ + ip &= ~(unw_word_t)0x1; +#endif + --ip; + } + + memset (&c->pi, 0, sizeof (c->pi)); + + /* check dynamic info first --- it overrides everything else */ + ret = unwi_find_dynamic_proc_info (c->as, ip, &c->pi, 1, + c->as_arg); + if (ret == -UNW_ENOINFO) + { + dynamic = 0; + if ((ret = tdep_find_proc_info (c, ip, 1)) < 0) + return ret; + } + + if (c->pi.format != UNW_INFO_FORMAT_DYNAMIC + && c->pi.format != UNW_INFO_FORMAT_TABLE + && c->pi.format != UNW_INFO_FORMAT_REMOTE_TABLE) + return -UNW_ENOINFO; + + c->pi_valid = 1; + c->pi_is_dynamic = dynamic; + + /* Let system/machine-dependent code determine frame-specific attributes. */ + if (ret >= 0) + tdep_fetch_frame (c, ip, 1); + + return ret; +} + +static int +parse_dynamic (struct dwarf_cursor *c UNUSED, + unw_word_t ip UNUSED, + dwarf_state_record_t *sr UNUSED) +{ + Debug (1, "Not yet implemented\n"); + return -UNW_ENOINFO; +} + +static inline void +put_unwind_info (struct dwarf_cursor *c, unw_proc_info_t *pi) +{ + if (c->pi_is_dynamic) + unwi_put_dynamic_unwind_info (c->as, pi, c->as_arg); + else if (pi->unwind_info && pi->format == UNW_INFO_FORMAT_TABLE) + { + mempool_free (&dwarf_cie_info_pool, pi->unwind_info); + pi->unwind_info = NULL; + } + c->pi_valid = 0; +} + +static inline int +setup_fde (struct dwarf_cursor *c, dwarf_state_record_t *sr) +{ + int i, ret; + + assert (c->pi_valid); + + memset (sr, 0, sizeof (*sr)); + for (i = 0; i < DWARF_NUM_PRESERVED_REGS + 2; ++i) + set_reg (sr, i, DWARF_WHERE_SAME, 0); + +#if !defined(UNW_TARGET_ARM) && !(defined(UNW_TARGET_MIPS) && _MIPS_SIM == _ABI64) + // SP defaults to CFA (but is overridable) + set_reg (sr, TDEP_DWARF_SP, DWARF_WHERE_CFA, 0); +#endif + + struct dwarf_cie_info *dci = c->pi.unwind_info; + sr->rs_current.ret_addr_column = dci->ret_addr_column; + unw_word_t addr = dci->cie_instr_start; + unw_word_t curr_ip = 0; + dwarf_stackable_reg_state_t *rs_stack = NULL; + ret = run_cfi_program (c, sr, &curr_ip, ~(unw_word_t) 0, &addr, + dci->cie_instr_end, + &rs_stack, dci); + empty_rstate_stack(&rs_stack); + if (ret < 0) + return ret; + + memcpy (&sr->rs_initial, &sr->rs_current, sizeof (sr->rs_initial)); + return 0; +} + +static inline int +parse_fde (struct dwarf_cursor *c, unw_word_t ip, dwarf_state_record_t *sr) +{ + int ret; + struct dwarf_cie_info *dci = c->pi.unwind_info; + unw_word_t addr = dci->fde_instr_start; + unw_word_t curr_ip = c->pi.start_ip; + dwarf_stackable_reg_state_t *rs_stack = NULL; + /* Process up to current `ip` for signal frame and `ip - 1` for normal call frame + See `c->use_prev_instr` use in `fetch_proc_info` for details. */ + ret = run_cfi_program (c, sr, &curr_ip, ip - c->use_prev_instr, &addr, dci->fde_instr_end, + &rs_stack, dci); + empty_rstate_stack(&rs_stack); + if (ret < 0) + return ret; + + return 0; +} + +HIDDEN int +dwarf_flush_rs_cache (struct dwarf_rs_cache *cache) +{ + int i; + + if (cache->log_size == DWARF_DEFAULT_LOG_UNW_CACHE_SIZE + || !cache->hash) { + cache->hash = cache->default_hash; + cache->buckets = cache->default_buckets; + cache->links = cache->default_links; + cache->log_size = DWARF_DEFAULT_LOG_UNW_CACHE_SIZE; + } else { + if (cache->hash && cache->hash != cache->default_hash) + mi_munmap(cache->hash, DWARF_UNW_HASH_SIZE(cache->prev_log_size) + * sizeof (cache->hash[0])); + if (cache->buckets && cache->buckets != cache->default_buckets) + mi_munmap(cache->buckets, DWARF_UNW_CACHE_SIZE(cache->prev_log_size) + * sizeof (cache->buckets[0])); + if (cache->links && cache->links != cache->default_links) + mi_munmap(cache->links, DWARF_UNW_CACHE_SIZE(cache->prev_log_size) + * sizeof (cache->links[0])); + GET_MEMORY(cache->hash, DWARF_UNW_HASH_SIZE(cache->log_size) + * sizeof (cache->hash[0])); + GET_MEMORY(cache->buckets, DWARF_UNW_CACHE_SIZE(cache->log_size) + * sizeof (cache->buckets[0])); + GET_MEMORY(cache->links, DWARF_UNW_CACHE_SIZE(cache->log_size) + * sizeof (cache->links[0])); + if (!cache->hash || !cache->buckets || !cache->links) + { + Debug (1, "Unable to allocate cache memory"); + return -UNW_ENOMEM; + } + cache->prev_log_size = cache->log_size; + } + + cache->rr_head = 0; + + for (i = 0; i < DWARF_UNW_CACHE_SIZE(cache->log_size); ++i) + { + cache->links[i].coll_chain = -1; + cache->links[i].ip = 0; + cache->links[i].valid = 0; + } + for (i = 0; i< DWARF_UNW_HASH_SIZE(cache->log_size); ++i) + cache->hash[i] = -1; + + return 0; +} + +static inline struct dwarf_rs_cache * +get_rs_cache (unw_addr_space_t as, intrmask_t *saved_maskp) +{ + struct dwarf_rs_cache *cache = &as->global_cache; + unw_caching_policy_t caching = as->caching_policy; + + if (caching == UNW_CACHE_NONE) + return NULL; + +#if defined(HAVE___CACHE_PER_THREAD) && HAVE___CACHE_PER_THREAD + if (likely (caching == UNW_CACHE_PER_THREAD)) + { + static _Thread_local struct dwarf_rs_cache tls_cache __attribute__((tls_model("initial-exec"))); + Debug (16, "using TLS cache\n"); + cache = &tls_cache; + } + else +#else + if (likely (caching == UNW_CACHE_GLOBAL)) +#endif + { + Debug (16, "acquiring lock\n"); + lock_acquire (&cache->lock, *saved_maskp); + } + + if ((atomic_load (&as->cache_generation) != atomic_load (&cache->generation)) + || !cache->hash) + { + /* cache_size is only set in the global_cache, copy it over before flushing */ + cache->log_size = as->global_cache.log_size; + if (dwarf_flush_rs_cache (cache) < 0) + return NULL; + atomic_store (&cache->generation, atomic_load (&as->cache_generation)); + } + + return cache; +} + +static inline void +put_rs_cache (unw_addr_space_t as, struct dwarf_rs_cache *cache, + intrmask_t *saved_maskp) +{ + assert (as->caching_policy != UNW_CACHE_NONE); + + Debug (16, "unmasking signals/interrupts and releasing lock\n"); + if (likely (as->caching_policy == UNW_CACHE_GLOBAL)) + lock_release (&cache->lock, *saved_maskp); +} + +static inline unw_hash_index_t CONST_ATTR +hash (unw_word_t ip, unsigned short log_size) +{ + /* based on (sqrt(5)/2-1)*2^64 */ +# define magic ((unw_word_t) 0x9e3779b97f4a7c16ULL) + + return ip * magic >> ((sizeof(unw_word_t) * 8) - (log_size + 1)); +} + +static inline long +cache_match (struct dwarf_rs_cache *cache, unsigned short index, unw_word_t ip) +{ + return (cache->links[index].valid && (ip == cache->links[index].ip)); +} + +static dwarf_reg_state_t * +rs_lookup (struct dwarf_rs_cache *cache, struct dwarf_cursor *c) +{ + unsigned short index; + unw_word_t ip = c->ip; + + if (c->hint > 0) + { + index = c->hint - 1; + if (cache_match (cache, index, ip)) + return &cache->buckets[index]; + } + + for (index = cache->hash[hash (ip, cache->log_size)]; + index < DWARF_UNW_CACHE_SIZE(cache->log_size); + index = cache->links[index].coll_chain) + { + if (cache_match (cache, index, ip)) + return &cache->buckets[index]; + } + return NULL; +} + +static inline dwarf_reg_state_t * +rs_new (struct dwarf_rs_cache *cache, struct dwarf_cursor * c) +{ + unw_hash_index_t index; + unsigned short head; + + head = cache->rr_head; + cache->rr_head = (head + 1) & (DWARF_UNW_CACHE_SIZE(cache->log_size) - 1); + + /* remove the old rs from the hash table (if it's there): */ + if (cache->links[head].ip) + { + unsigned short *pindex; + for (pindex = &cache->hash[hash (cache->links[head].ip, cache->log_size)]; + *pindex < DWARF_UNW_CACHE_SIZE(cache->log_size); + pindex = &cache->links[*pindex].coll_chain) + { + if (*pindex == head) + { + *pindex = cache->links[*pindex].coll_chain; + break; + } + } + } + + /* enter new rs in the hash table */ + index = hash (c->ip, cache->log_size); + cache->links[head].coll_chain = cache->hash[index]; + cache->hash[index] = head; + + cache->links[head].ip = c->ip; + cache->links[head].valid = 1; + cache->links[head].signal_frame = tdep_cache_frame(c); + return cache->buckets + head; +} + +static int +create_state_record_for (struct dwarf_cursor *c, dwarf_state_record_t *sr, + unw_word_t ip) +{ + int ret; + switch (c->pi.format) + { + case UNW_INFO_FORMAT_TABLE: + case UNW_INFO_FORMAT_REMOTE_TABLE: + if ((ret = setup_fde(c, sr)) < 0) + return ret; + ret = parse_fde (c, ip, sr); + break; + + case UNW_INFO_FORMAT_DYNAMIC: + ret = parse_dynamic (c, ip, sr); + break; + + default: + Debug (1, "Unexpected unwind-info format %d\n", c->pi.format); + ret = -UNW_EINVAL; + } + return ret; +} + +static inline int +eval_location_expr (struct dwarf_cursor *c, unw_word_t stack_val, unw_addr_space_t as, + unw_accessors_t *a, unw_word_t addr, + dwarf_loc_t *locp, void *arg) +{ + int ret, is_register; + unw_word_t len, val; + + /* read the length of the expression: */ + if ((ret = dwarf_read_uleb128 (as, a, &addr, &len, arg)) < 0) + return ret; + + /* evaluate the expression: */ + if ((ret = dwarf_eval_expr (c, stack_val, &addr, len, &val, &is_register)) < 0) + return ret; + + if (is_register) + *locp = DWARF_REG_LOC (c, dwarf_to_unw_regnum (val)); + else + *locp = DWARF_MEM_LOC (c, val); + + return 0; +} + + +#ifdef UNW_TARGET_AARCH64 +#include "libunwind-aarch64.h" + +static void +aarch64_negate_ra_sign_state(dwarf_state_record_t *sr) +{ + unw_word_t ra_sign_state = sr->rs_current.reg.val[UNW_AARCH64_RA_SIGN_STATE]; + ra_sign_state ^= 0x1; + set_reg(sr, UNW_AARCH64_RA_SIGN_STATE, DWARF_WHERE_SAME, ra_sign_state); +} + +static unw_word_t +aarch64_get_ra_sign_state(struct dwarf_reg_state *rs) +{ + return rs->reg.val[UNW_AARCH64_RA_SIGN_STATE]; +} + +#endif + +static int +apply_reg_state (struct dwarf_cursor *c, struct dwarf_reg_state *rs) +{ + unw_word_t regnum, addr, cfa, ip; + unw_word_t prev_ip, prev_cfa; + unw_addr_space_t as; + dwarf_loc_t cfa_loc; + unw_accessors_t *a; + int i, ret; + void *arg; + + /* In the case that we have incorrect CFI, the return address column may be + * outside the valid range of data and will read invalid data. Protect + * against the errant read and indicate that we have a bad frame. */ + if (rs->ret_addr_column >= DWARF_NUM_PRESERVED_REGS) { + Dprintf ("%s: return address entry %zu is outside of range of CIE", + __FUNCTION__, rs->ret_addr_column); + return -UNW_EBADFRAME; + } + + prev_ip = c->ip; + prev_cfa = c->cfa; + + as = c->as; + arg = c->as_arg; + a = unw_get_accessors_int (as); + + /* Evaluate the CFA first, because it may be referred to by other + expressions. */ + + if (rs->reg.where[DWARF_CFA_REG_COLUMN] == DWARF_WHERE_REG) + { + /* CFA is equal to [reg] + offset: */ + + /* As a special-case, if the stack-pointer is the CFA and the + stack-pointer wasn't saved, popping the CFA implicitly pops + the stack-pointer as well. */ + if ((rs->reg.val[DWARF_CFA_REG_COLUMN] == TDEP_DWARF_SP) + && (TDEP_DWARF_SP < ARRAY_SIZE(rs->reg.val)) + && (DWARF_IS_NULL_LOC(c->loc[TDEP_DWARF_SP]))) + cfa = c->cfa; + else + { + regnum = dwarf_to_unw_regnum (rs->reg.val[DWARF_CFA_REG_COLUMN]); + if ((ret = unw_get_reg (dwarf_to_cursor(c), regnum, &cfa)) < 0) + return ret; + } + cfa += rs->reg.val[DWARF_CFA_OFF_COLUMN]; + } + else + { + /* CFA is equal to EXPR: */ + + assert (rs->reg.where[DWARF_CFA_REG_COLUMN] == DWARF_WHERE_EXPR); + + addr = rs->reg.val[DWARF_CFA_REG_COLUMN]; + /* The dwarf standard doesn't specify an initial value to be pushed on */ + /* the stack before DW_CFA_def_cfa_expression evaluation. We push on a */ + /* dummy value (0) to keep the eval_location_expr function consistent. */ + if ((ret = eval_location_expr (c, 0, as, a, addr, &cfa_loc, arg)) < 0) + return ret; + /* the returned location better be a memory location... */ + if (DWARF_IS_REG_LOC (cfa_loc)) + return -UNW_EBADFRAME; + cfa = DWARF_GET_LOC (cfa_loc); + } + + dwarf_loc_t new_loc[DWARF_NUM_PRESERVED_REGS]; + memcpy(new_loc, c->loc, sizeof(new_loc)); + + for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) + { + switch ((dwarf_where_t) rs->reg.where[i]) + { + case DWARF_WHERE_UNDEF: + new_loc[i] = DWARF_NULL_LOC; + break; + + case DWARF_WHERE_SAME: + break; + + case DWARF_WHERE_CFA: + new_loc[i] = DWARF_VAL_LOC (c, cfa); + break; + + case DWARF_WHERE_CFAREL: + new_loc[i] = DWARF_MEM_LOC (c, cfa + rs->reg.val[i]); + break; + + case DWARF_WHERE_REG: +#ifdef __s390x__ + /* GPRs can be saved in FPRs on s390x */ + if (unw_is_fpreg (dwarf_to_unw_regnum (rs->reg.val[i]))) + { + new_loc[i] = DWARF_FPREG_LOC (c, dwarf_to_unw_regnum (rs->reg.val[i])); + break; + } +#endif + new_loc[i] = new_loc[rs->reg.val[i]]; + break; + + case DWARF_WHERE_EXPR: + addr = rs->reg.val[i]; + /* The dwarf standard requires the current CFA to be pushed on the */ + /* stack before DW_CFA_expression evaluation. */ + if ((ret = eval_location_expr (c, cfa, as, a, addr, new_loc + i, arg)) < 0) + return ret; + break; + + case DWARF_WHERE_VAL_EXPR: + addr = rs->reg.val[i]; + /* The dwarf standard requires the current CFA to be pushed on the */ + /* stack before DW_CFA_val_expression evaluation. */ + if ((ret = eval_location_expr (c, cfa, as, a, addr, new_loc + i, arg)) < 0) + return ret; + new_loc[i] = DWARF_VAL_LOC (c, DWARF_GET_LOC (new_loc[i])); + break; + } + } + + memcpy(c->loc, new_loc, sizeof(new_loc)); + + c->cfa = cfa; + /* DWARF spec says undefined return address location means end of stack. */ + if (DWARF_IS_NULL_LOC (c->loc[rs->ret_addr_column])) + { + c->ip = 0; + } + else + { + ret = dwarf_get (c, c->loc[rs->ret_addr_column], &ip); + if (ret < 0) + return ret; +#ifdef UNW_TARGET_AARCH64 + if (aarch64_get_ra_sign_state(rs)) + { + ip = tdep_strip_ptrauth_insn_mask ((unw_cursor_t*)c, ip); + } +#endif + c->ip = ip; + } + ret = (c->ip != 0) ? 1 : 0; + + /* XXX: check for ip to be code_aligned */ + if (c->ip == prev_ip && c->cfa == prev_cfa) + { + Dprintf ("%s: ip and cfa unchanged; stopping here (ip=0x%lx)\n", + __FUNCTION__, (long) c->ip); + return -UNW_EBADFRAME; + } + + if (c->stash_frames) + tdep_stash_frame (c, rs); + + return ret; +} + +/* Find the saved locations. */ +static int +find_reg_state (struct dwarf_cursor *c, dwarf_state_record_t *sr) +{ + dwarf_reg_state_t *rs = NULL; + struct dwarf_rs_cache *cache; + int ret = 0; + intrmask_t saved_mask; + + if ((cache = get_rs_cache(c->as, &saved_mask)) && + (rs = rs_lookup(cache, c))) + { + /* update hint; no locking needed: single-word writes are atomic */ + unsigned short index = rs - cache->buckets; + c->use_prev_instr = ! cache->links[index].signal_frame; + memcpy (&sr->rs_current, rs, sizeof (*rs)); + } + else + { + ret = fetch_proc_info (c, c->ip); + int next_use_prev_instr = c->use_prev_instr; + if (ret >= 0) + { + /* Update use_prev_instr for the next frame. */ + assert(c->pi.unwind_info); + struct dwarf_cie_info *dci = c->pi.unwind_info; + next_use_prev_instr = ! dci->signal_frame; + ret = create_state_record_for (c, sr, c->ip); + } + put_unwind_info (c, &c->pi); + c->use_prev_instr = next_use_prev_instr; + + if (cache && ret >= 0) + { + rs = rs_new (cache, c); + cache->links[rs - cache->buckets].hint = 0; + memcpy(rs, &sr->rs_current, sizeof(*rs)); + } + } + + unsigned short index = -1; + if (cache) + { + if (rs) + { + index = rs - cache->buckets; + c->hint = cache->links[index].hint; + cache->links[c->prev_rs].hint = index + 1; + c->prev_rs = index; + } + if (ret >= 0) + tdep_reuse_frame (c, cache->links[index].signal_frame); + put_rs_cache (c->as, cache, &saved_mask); + } + return ret; +} + +/* The function finds the saved locations and applies the register + state as well. */ +HIDDEN int +dwarf_step (struct dwarf_cursor *c) +{ + int ret; + dwarf_state_record_t sr; + if ((ret = find_reg_state (c, &sr)) < 0) + return ret; + return apply_reg_state (c, &sr.rs_current); +} + +HIDDEN int +dwarf_make_proc_info (struct dwarf_cursor *c) +{ +#if 0 + if (c->as->caching_policy == UNW_CACHE_NONE + || get_cached_proc_info (c) < 0) +#endif + /* Need to check if current frame contains + args_size, and set cursor appropriately. Only + needed for unw_resume */ + dwarf_state_record_t sr; + sr.args_size = 0; + int ret; + + /* Lookup it up the slow way... */ + ret = fetch_proc_info (c, c->ip); + if (ret >= 0) + ret = create_state_record_for (c, &sr, c->ip); + put_unwind_info (c, &c->pi); + if (ret < 0) + return ret; + c->args_size = sr.args_size; + + return 0; +} + +static int +dwarf_reg_states_dynamic_iterate(struct dwarf_cursor *c UNUSED, + unw_reg_states_callback cb UNUSED, + void *token UNUSED) +{ + Debug (1, "Not yet implemented\n"); + return -UNW_ENOINFO; +} + +static int +dwarf_reg_states_table_iterate(struct dwarf_cursor *c, + unw_reg_states_callback cb, + void *token) +{ + dwarf_state_record_t sr; + int ret = setup_fde(c, &sr); + struct dwarf_cie_info *dci = c->pi.unwind_info; + unw_word_t addr = dci->fde_instr_start; + unw_word_t curr_ip = c->pi.start_ip; + dwarf_stackable_reg_state_t *rs_stack = NULL; + while (ret >= 0 && curr_ip < c->pi.end_ip && addr < dci->fde_instr_end) + { + unw_word_t prev_ip = curr_ip; + ret = run_cfi_program (c, &sr, &curr_ip, prev_ip, &addr, dci->fde_instr_end, + &rs_stack, dci); + if (ret >= 0 && prev_ip < curr_ip) + ret = cb(token, &sr.rs_current, sizeof(sr.rs_current), prev_ip, curr_ip); + } + empty_rstate_stack(&rs_stack); +#if defined(NEED_LAST_IP) + if (ret >= 0 && curr_ip < c->pi.last_ip) + /* report the dead zone after the procedure ends */ + ret = cb(token, &sr.rs_current, sizeof(sr.rs_current), curr_ip, c->pi.last_ip); +#else + if (ret >= 0 && curr_ip < c->pi.end_ip) + /* report for whatever is left before procedure end */ + ret = cb(token, &sr.rs_current, sizeof(sr.rs_current), curr_ip, c->pi.end_ip); +#endif + return ret; +} + +HIDDEN int +dwarf_reg_states_iterate(struct dwarf_cursor *c, + unw_reg_states_callback cb, + void *token) +{ + int ret = fetch_proc_info (c, c->ip); + int next_use_prev_instr = c->use_prev_instr; + if (ret >= 0) + { + /* Update use_prev_instr for the next frame. */ + assert(c->pi.unwind_info); + struct dwarf_cie_info *dci = c->pi.unwind_info; + next_use_prev_instr = ! dci->signal_frame; + switch (c->pi.format) + { + case UNW_INFO_FORMAT_TABLE: + case UNW_INFO_FORMAT_REMOTE_TABLE: + ret = dwarf_reg_states_table_iterate(c, cb, token); + break; + + case UNW_INFO_FORMAT_DYNAMIC: + ret = dwarf_reg_states_dynamic_iterate (c, cb, token); + break; + + default: + Debug (1, "Unexpected unwind-info format %d\n", c->pi.format); + ret = -UNW_EINVAL; + } + } + put_unwind_info (c, &c->pi); + c->use_prev_instr = next_use_prev_instr; + return ret; +} + +HIDDEN int +dwarf_apply_reg_state (struct dwarf_cursor *c, struct dwarf_reg_state *rs) +{ + return apply_reg_state(c, rs); +} diff --git a/vendor/libunwind/src/dwarf/Gpe.c b/vendor/libunwind/src/dwarf/Gpe.c new file mode 100644 index 0000000000..a0e37ba232 --- /dev/null +++ b/vendor/libunwind/src/dwarf/Gpe.c @@ -0,0 +1,39 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2003, 2005 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "dwarf_i.h" +#include "libunwind_i.h" + +#include + +HIDDEN int +dwarf_read_encoded_pointer (unw_addr_space_t as, unw_accessors_t *a, + unw_word_t *addr, unsigned char encoding, + const unw_proc_info_t *pi, + unw_word_t *valp, void *arg) +{ + return dwarf_read_encoded_pointer_inlined (as, a, addr, encoding, + pi, valp, arg); +} diff --git a/vendor/libunwind/src/dwarf/Lexpr.c b/vendor/libunwind/src/dwarf/Lexpr.c new file mode 100644 index 0000000000..245970c9e3 --- /dev/null +++ b/vendor/libunwind/src/dwarf/Lexpr.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gexpr.c" +#endif diff --git a/vendor/libunwind/src/dwarf/Lfde.c b/vendor/libunwind/src/dwarf/Lfde.c new file mode 100644 index 0000000000..e779e8f192 --- /dev/null +++ b/vendor/libunwind/src/dwarf/Lfde.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gfde.c" +#endif diff --git a/vendor/libunwind/src/dwarf/Lfind_proc_info-lsb.c b/vendor/libunwind/src/dwarf/Lfind_proc_info-lsb.c new file mode 100644 index 0000000000..27a5eeac18 --- /dev/null +++ b/vendor/libunwind/src/dwarf/Lfind_proc_info-lsb.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gfind_proc_info-lsb.c" +#endif diff --git a/vendor/libunwind/src/dwarf/Lfind_unwind_table.c b/vendor/libunwind/src/dwarf/Lfind_unwind_table.c new file mode 100644 index 0000000000..68e269f1d7 --- /dev/null +++ b/vendor/libunwind/src/dwarf/Lfind_unwind_table.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gfind_unwind_table.c" +#endif diff --git a/vendor/libunwind/src/dwarf/Lget_proc_info_in_range.c b/vendor/libunwind/src/dwarf/Lget_proc_info_in_range.c new file mode 100644 index 0000000000..da6700903e --- /dev/null +++ b/vendor/libunwind/src/dwarf/Lget_proc_info_in_range.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gget_proc_info_in_range.c" +#endif diff --git a/vendor/libunwind/src/dwarf/Lparser.c b/vendor/libunwind/src/dwarf/Lparser.c new file mode 100644 index 0000000000..f23aaf48e9 --- /dev/null +++ b/vendor/libunwind/src/dwarf/Lparser.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gparser.c" +#endif diff --git a/vendor/libunwind/src/dwarf/Lpe.c b/vendor/libunwind/src/dwarf/Lpe.c new file mode 100644 index 0000000000..a672358f06 --- /dev/null +++ b/vendor/libunwind/src/dwarf/Lpe.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gpe.c" +#endif diff --git a/vendor/libunwind/src/dwarf/global.c b/vendor/libunwind/src/dwarf/global.c new file mode 100644 index 0000000000..7098507142 --- /dev/null +++ b/vendor/libunwind/src/dwarf/global.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2003-2004 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "dwarf_i.h" + +HIDDEN struct mempool dwarf_reg_state_pool; +HIDDEN struct mempool dwarf_cie_info_pool; + +HIDDEN int +dwarf_init (void) +{ + mempool_init (&dwarf_reg_state_pool, sizeof (dwarf_stackable_reg_state_t), 0); + mempool_init (&dwarf_cie_info_pool, sizeof (struct dwarf_cie_info), 0); + return 0; +} diff --git a/vendor/libunwind/src/elf32.c b/vendor/libunwind/src/elf32.c new file mode 100644 index 0000000000..a70bb58f24 --- /dev/null +++ b/vendor/libunwind/src/elf32.c @@ -0,0 +1,4 @@ +#ifndef UNW_REMOTE_ONLY +# include "elf32.h" +# include "elfxx.c" +#endif diff --git a/vendor/libunwind/src/elf32.h b/vendor/libunwind/src/elf32.h new file mode 100644 index 0000000000..9747630a3d --- /dev/null +++ b/vendor/libunwind/src/elf32.h @@ -0,0 +1,9 @@ +#ifndef elf32_h +#define elf32_h + +#ifndef UNW_ELF_CLASS +# define UNW_ELF_CLASS UNW_ELFCLASS32 +#endif +#include "elfxx.h" + +#endif /* elf32_h */ diff --git a/vendor/libunwind/src/elf64.c b/vendor/libunwind/src/elf64.c new file mode 100644 index 0000000000..195b887948 --- /dev/null +++ b/vendor/libunwind/src/elf64.c @@ -0,0 +1,4 @@ +#ifndef UNW_REMOTE_ONLY +# include "elf64.h" +# include "elfxx.c" +#endif diff --git a/vendor/libunwind/src/elf64.h b/vendor/libunwind/src/elf64.h new file mode 100644 index 0000000000..1956c73c97 --- /dev/null +++ b/vendor/libunwind/src/elf64.h @@ -0,0 +1,9 @@ +#ifndef elf64_h +#define elf64_h + +#ifndef UNW_ELF_CLASS +# define UNW_ELF_CLASS UNW_ELFCLASS64 +#endif +#include "elfxx.h" + +#endif /* elf64_h */ diff --git a/vendor/libunwind/src/elfxx.c b/vendor/libunwind/src/elfxx.c new file mode 100644 index 0000000000..e7b2d561f4 --- /dev/null +++ b/vendor/libunwind/src/elfxx.c @@ -0,0 +1,982 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2005 Hewlett-Packard Co + Copyright (C) 2007 David Mosberger-Tang + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +#include +#include +#include + +#if HAVE_LZMA +#include +#endif /* HAVE_LZMA */ + +struct symbol_info +{ + const char *strtab; + const Elf_W (Sym) *sym; + Elf_W (Addr) start_ip; +}; + +struct symbol_lookup_context +{ + unw_addr_space_t as; + unw_word_t ip; + struct elf_image *ei; + Elf_W (Addr) load_offset; + Elf_W (Addr) *min_dist; +}; + +struct symbol_callback_data +{ + char *buf; + size_t buf_len; +}; + +struct ip_range_callback_data +{ + Elf_W (Addr) *start_ip; + Elf_W (Addr) *end_ip; +}; + +static Elf_W (Shdr)* +elf_w (section_table) (const struct elf_image *ei) +{ + Elf_W (Ehdr) *ehdr = ei->image; + Elf_W (Off) soff; + + soff = ehdr->e_shoff; + if (soff + ehdr->e_shnum * ehdr->e_shentsize > ei->size) + { + Debug (1, "section table outside of image? (%lu > %lu)\n", + (unsigned long) (soff + ehdr->e_shnum * ehdr->e_shentsize), + (unsigned long) ei->size); + return NULL; + } + + return (Elf_W (Shdr) *) ((char *) ei->image + soff); +} + +static char* +elf_w (string_table) (const struct elf_image *ei, int section) +{ + Elf_W (Ehdr) *ehdr = ei->image; + Elf_W (Off) soff, str_soff; + Elf_W (Shdr) *str_shdr; + + /* this offset is assumed to be OK */ + soff = ehdr->e_shoff; + + str_soff = soff + (section * ehdr->e_shentsize); + if (str_soff + ehdr->e_shentsize > ei->size) + { + Debug (1, "string shdr table outside of image? (%lu > %lu)\n", + (unsigned long) (str_soff + ehdr->e_shentsize), + (unsigned long) ei->size); + return NULL; + } + str_shdr = (Elf_W (Shdr) *) ((char *) ei->image + str_soff); + + if (str_shdr->sh_offset + str_shdr->sh_size > ei->size) + { + Debug (1, "string table outside of image? (%lu > %lu)\n", + (unsigned long) (str_shdr->sh_offset + str_shdr->sh_size), + (unsigned long) ei->size); + return NULL; + } + + Debug (16, "strtab=0x%lx\n", (long) str_shdr->sh_offset); + return ei->image + str_shdr->sh_offset; +} + +static int +elf_w (lookup_symbol_from_dynamic) (unw_addr_space_t as UNUSED, + const struct symbol_lookup_context *context, + int (*callback)(const struct symbol_lookup_context *context, + const struct symbol_info *syminfo, void *data), + void *data) + +{ + struct elf_image *ei = context->ei; + Elf_W (Addr) load_offset = context->load_offset; + Elf_W (Addr) file_offset = 0; + Elf_W (Ehdr) *ehdr = ei->image; + Elf_W (Sym) *sym = NULL, *symtab = NULL; + Elf_W (Phdr) *phdr; + Elf_W (Word) sym_num; + Elf_W (Word) *hash = NULL, *gnu_hash = NULL; + Elf_W (Addr) val; + const char *strtab = NULL; + int ret = -UNW_ENOINFO; + size_t i; + Elf_W(Dyn) *dyn = NULL; + + phdr = (Elf_W (Phdr) *) ((char *) ei->image + ehdr->e_phoff); + for (i = 0; i < ehdr->e_phnum; ++i) + if (phdr[i].p_type == PT_PHDR) + { + file_offset = phdr[i].p_vaddr - phdr[i].p_offset; + } + else if (phdr[i].p_type == PT_DYNAMIC) + { + dyn = (Elf_W (Dyn) *) ((char *)ei->image + phdr[i].p_offset); + break; + } + + if (!dyn) + return -UNW_ENOINFO; + + for (; dyn->d_tag != DT_NULL; ++dyn) + { + switch (dyn->d_tag) + { + case DT_SYMTAB: + symtab = (Elf_W (Sym) *) ((char *) ei->image + dyn->d_un.d_ptr - file_offset); + break; + case DT_STRTAB: + strtab = (const char *) ((char *) ei->image + dyn->d_un.d_ptr - file_offset); + break; + case DT_HASH: + hash = (Elf_W (Word) *) ((char *) ei->image + dyn->d_un.d_ptr - file_offset); + break; + case DT_GNU_HASH: + gnu_hash = (Elf_W (Word) *) ((char *) ei->image + dyn->d_un.d_ptr - file_offset); + break; + default: + break; + } + } + + if (!symtab || !strtab || (!hash && !gnu_hash)) + return -UNW_ENOINFO; + + if (gnu_hash) + { + uint32_t *buckets = gnu_hash + 4 + (gnu_hash[2] * sizeof(size_t)/4); + uint32_t *hashval; + for (i = sym_num = 0; i < gnu_hash[0]; i++) + if (buckets[i] > sym_num) + sym_num = buckets[i]; + + if (sym_num) + { + hashval = buckets + gnu_hash[0] + (sym_num - gnu_hash[1]); + do sym_num++; + while (!(*hashval++ & 1)); + } + } + else + { + sym_num = hash[1]; + } + + for (i = 0; i < sym_num; ++i) + { + sym = &symtab[i]; + if (ELF_W (ST_TYPE) (sym->st_info) == STT_FUNC + && sym->st_shndx != SHN_UNDEF) + { + val = sym->st_value; + if (sym->st_shndx != SHN_ABS) + val += load_offset; + if (tdep_get_func_addr (as, val, &val) < 0) + continue; + Debug (16, "0x%016lx info=0x%02x %s\n", + (long) val, sym->st_info, strtab + sym->st_name); + + /* as long as found one, the return will be success*/ + struct symbol_info syminfo = + { + .strtab = strtab, + .sym = sym, + .start_ip = val + }; + if ((*callback) (context, &syminfo, data) == UNW_ESUCCESS) + { + if (ret != UNW_ESUCCESS) + ret = UNW_ESUCCESS; + } + } + } + + return ret; +} + +static int +elf_w (lookup_symbol_closeness) (unw_addr_space_t as UNUSED, + const struct symbol_lookup_context *context, + int (*callback)(const struct symbol_lookup_context *context, + const struct symbol_info *syminfo, void *data), + void *data) +{ + struct elf_image *ei = context->ei; + Elf_W (Addr) load_offset = context->load_offset; + size_t syment_size; + Elf_W (Ehdr) *ehdr = ei->image; + Elf_W (Sym) *sym, *symtab, *symtab_end; + Elf_W (Shdr) *shdr; + Elf_W (Addr) val; + int i, ret = -UNW_ENOINFO; + char *strtab; + + if (!elf_w (valid_object) (ei)) + return -UNW_ENOINFO; + + shdr = elf_w (section_table) (ei); + if (!shdr) + return -UNW_ENOINFO; + + for (i = 0; i < ehdr->e_shnum; ++i) + { + switch (shdr->sh_type) + { + case SHT_SYMTAB: + case SHT_DYNSYM: + symtab = (Elf_W (Sym) *) ((char *) ei->image + shdr->sh_offset); + symtab_end = (Elf_W (Sym) *) ((char *) symtab + shdr->sh_size); + syment_size = shdr->sh_entsize; + + strtab = elf_w (string_table) (ei, shdr->sh_link); + if (!strtab) + break; + + Debug (16, "symtab=0x%lx[%d]\n", + (long) shdr->sh_offset, shdr->sh_type); + + for (sym = symtab; + sym < symtab_end; + sym = (Elf_W (Sym) *) ((char *) sym + syment_size)) + { + if (ELF_W (ST_TYPE) (sym->st_info) == STT_FUNC + && sym->st_shndx != SHN_UNDEF) + { + val = sym->st_value; + if (sym->st_shndx != SHN_ABS) + val += load_offset; + if (tdep_get_func_addr (as, val, &val) < 0) + continue; + Debug (16, "0x%016lx info=0x%02x %s\n", + (long) val, sym->st_info, strtab + sym->st_name); + + /* as long as found one, the return will be success*/ + struct symbol_info syminfo = + { + .strtab = strtab, + .sym = sym, + .start_ip = val + }; + if ((*callback) (context, &syminfo, data) == UNW_ESUCCESS) + { + if (ret != UNW_ESUCCESS) + ret = UNW_ESUCCESS; + } + } + } + break; + + default: + break; + } + shdr = (Elf_W (Shdr) *) (((char *) shdr) + ehdr->e_shentsize); + } + + if (ret != UNW_ESUCCESS) + ret = elf_w (lookup_symbol_from_dynamic) (as, context, callback, data); + + return ret; +} + +static int +elf_w (lookup_symbol_callback)(const struct symbol_lookup_context *context, + const struct symbol_info *syminfo, void *data) +{ + int ret = -UNW_ENOINFO; + struct symbol_callback_data *d = data; + + if (context->ip < syminfo->start_ip || + context->ip >= (syminfo->start_ip + syminfo->sym->st_size)) + return -UNW_ENOINFO; + + if ((Elf_W (Addr)) (context->ip - syminfo->start_ip) < *(context->min_dist)) + { + *(context->min_dist) = (Elf_W (Addr)) (context->ip - syminfo->start_ip); + Debug (1, "candidate sym: %s@0x%lx\n", syminfo->strtab + syminfo->sym->st_name, syminfo->start_ip); + strncpy (d->buf, syminfo->strtab + syminfo->sym->st_name, d->buf_len); + d->buf[d->buf_len - 1] = '\0'; + ret = (strlen (syminfo->strtab + syminfo->sym->st_name) >= d->buf_len + ? -UNW_ENOMEM : UNW_ESUCCESS); + } + + return ret; +} + +static int +elf_w (lookup_symbol) (unw_addr_space_t as, + unw_word_t ip, struct elf_image *ei, + Elf_W (Addr) load_offset, + char *buf, size_t buf_len, Elf_W (Addr) *min_dist) +{ + struct symbol_lookup_context context = + { + .as = as, + .ip = ip, + .ei = ei, + .load_offset = load_offset, + .min_dist = min_dist, + }; + struct symbol_callback_data data = + { + .buf = buf, + .buf_len = buf_len, + }; + return elf_w (lookup_symbol_closeness) (as, + &context, + elf_w (lookup_symbol_callback), + &data); +} + +static int +elf_w (lookup_ip_range_callback)(const struct symbol_lookup_context *context, + const struct symbol_info *syminfo, void *data) +{ + int ret = -UNW_ENOINFO; + struct ip_range_callback_data *d = data; + + if (context->ip < syminfo->start_ip || + context->ip >= (syminfo->start_ip + syminfo->sym->st_size)) + return -UNW_ENOINFO; + + if ((Elf_W (Addr)) (context->ip - syminfo->start_ip) < *(context->min_dist)) + { + *(context->min_dist) = (Elf_W (Addr)) (context->ip - syminfo->start_ip); + *(d->start_ip) = syminfo->start_ip; + *(d->end_ip) = syminfo->start_ip + syminfo->sym->st_size; + + ret = UNW_ESUCCESS; + } + + return ret; +} + +static int +elf_w (lookup_ip_range)(unw_addr_space_t as, + unw_word_t ip, struct elf_image *ei, + Elf_W (Addr) load_offset, Elf_W (Addr) *start_ip, + Elf_W (Addr) *end_ip, Elf_W (Addr) *min_dist) +{ + struct symbol_lookup_context context = + { + .as = as, + .ip = ip, + .ei = ei, + .load_offset = load_offset, + .min_dist = min_dist + }; + struct ip_range_callback_data data = + { + .start_ip = start_ip, + .end_ip = end_ip + }; + return elf_w (lookup_symbol_closeness) (as, + &context, + elf_w (lookup_ip_range_callback), + &data); +} + +static Elf_W (Addr) +elf_w (get_load_offset) (struct elf_image *ei, unsigned long segbase) +{ + Elf_W (Addr) offset = 0; + Elf_W (Ehdr) *ehdr; + Elf_W (Phdr) *phdr; + int i; + // mapoff is obtained from mmap information, so it is always aligned on a page size. + // PT_LOAD program headers p_offset however is not guaranteed to be aligned on a + // page size, ld.lld generate libraries where this is not the case. So we must + // make sure we compare both values with the same alignment. + unsigned long pagesize_alignment_mask = ~(unw_page_size - 1UL); + + ehdr = ei->image; + phdr = (Elf_W (Phdr) *) ((char *) ei->image + ehdr->e_phoff); + + for (i = 0; i < ehdr->e_phnum; ++i) + if (phdr[i].p_type == PT_LOAD && phdr[i].p_flags & PF_X) + { + offset = segbase - phdr[i].p_vaddr + (phdr[i].p_offset & (~pagesize_alignment_mask)); + break; + } + + return offset; +} + +#if HAVE_LZMA + +#define XZ_MAX_ALLOCS 16 +struct xz_allocator_data { + struct { + void *ptr; + size_t size; + } allocations[XZ_MAX_ALLOCS]; + uint8_t n_allocs; +}; + +static void* +xz_alloc (void *opaque, size_t nmemb, size_t size) +{ + struct xz_allocator_data *data = opaque; + if (XZ_MAX_ALLOCS == data->n_allocs) + return NULL; + size = UNW_ALIGN(size * nmemb, unw_page_size); + void *ptr; + GET_MEMORY (ptr, size); + if (!ptr) return ptr; + data->allocations[data->n_allocs].ptr = ptr; + data->allocations[data->n_allocs].size = size; + ++data->n_allocs; + return ptr; +} + +static void +xz_free (void *opaque, void *ptr) +{ + struct xz_allocator_data *data = opaque; + for (uint8_t i = data->n_allocs; i-- > 0;) + { + if (data->allocations[i].ptr == ptr) + { + mi_munmap (ptr, data->allocations[i].size); + --data->n_allocs; + if (i != data->n_allocs) + { + data->allocations[i] = data->allocations[data->n_allocs]; + } + return; + } + } +} + +static void +xz_free_all (struct xz_allocator_data *data) +{ + while (data->n_allocs-- > 0) + { + mi_munmap (data->allocations[data->n_allocs].ptr, data->allocations[data->n_allocs].size); + } +} + +static size_t +xz_uncompressed_size (lzma_allocator *xz_allocator, uint8_t *compressed, size_t length) +{ + uint64_t memlimit = UINT64_MAX; + size_t ret = 0, pos = 0; + lzma_stream_flags options; + lzma_index *index; + + if (length < LZMA_STREAM_HEADER_SIZE) + return 0; + + uint8_t *footer = compressed + length - LZMA_STREAM_HEADER_SIZE; + if (lzma_stream_footer_decode (&options, footer) != LZMA_OK) + return 0; + + if (length < LZMA_STREAM_HEADER_SIZE + options.backward_size) + return 0; + + uint8_t *indexdata = footer - options.backward_size; + if (lzma_index_buffer_decode (&index, &memlimit, xz_allocator, indexdata, + &pos, options.backward_size) != LZMA_OK) + return 0; + + if (lzma_index_size (index) == options.backward_size) + { + ret = lzma_index_uncompressed_size (index); + } + + lzma_index_end (index, xz_allocator); + return ret; +} + +static int +elf_w (extract_minidebuginfo) (struct elf_image *ei, struct elf_image *mdi) +{ + Elf_W (Shdr) *shdr; + uint8_t *compressed = NULL; + uint64_t memlimit = UINT64_MAX; /* no memory limit */ + size_t compressed_len, uncompressed_len; + + struct xz_allocator_data allocator_data; + lzma_allocator xz_allocator = + { + .alloc = xz_alloc, + .free = xz_free, + .opaque = &allocator_data + }; + + shdr = elf_w (find_section) (ei, ".gnu_debugdata"); + if (!shdr) + return 0; + + compressed = ((uint8_t *) ei->image) + shdr->sh_offset; + compressed_len = shdr->sh_size; + + uncompressed_len = xz_uncompressed_size (&xz_allocator, compressed, compressed_len); + if (uncompressed_len == 0) + { + xz_free_all (&allocator_data); + Debug (1, "invalid .gnu_debugdata contents\n"); + return 0; + } + + mdi->size = uncompressed_len; + GET_MEMORY (mdi->image, uncompressed_len); + + if (!mdi->image) + { + xz_free_all (&allocator_data); + return 0; + } + + size_t in_pos = 0, out_pos = 0; + lzma_ret lret; + lret = lzma_stream_buffer_decode (&memlimit, 0, &xz_allocator, + compressed, &in_pos, compressed_len, + mdi->image, &out_pos, mdi->size); + xz_free_all (&allocator_data); + + if (lret != LZMA_OK) + { + Debug (1, "LZMA decompression failed: %d\n", lret); + mi_munmap (mdi->image, mdi->size); + return 0; + } + + return 1; +} +#else +static int +elf_w (extract_minidebuginfo) (struct elf_image *ei UNUSED, struct elf_image *mdi UNUSED) +{ + return 0; +} +#endif /* !HAVE_LZMA */ + +/* Find the ELF image that contains IP and return the "closest" + procedure name, if there is one. With some caching, this could be + sped up greatly, but until an application materializes that's + sensitive to the performance of this routine, why bother... */ + +HIDDEN int +elf_w (get_proc_name_in_image) (unw_addr_space_t as, struct elf_image *ei, + unsigned long segbase, + unw_word_t ip, + char *buf, size_t buf_len, unw_word_t *offp) +{ + Elf_W (Addr) load_offset; + Elf_W (Addr) min_dist = ~(Elf_W (Addr))0; + int ret; + + load_offset = elf_w (get_load_offset) (ei, segbase); + ret = elf_w (lookup_symbol) (as, ip, ei, load_offset, buf, buf_len, &min_dist); + + /* If the ELF image has MiniDebugInfo embedded in it, look up the symbol in + there as well and replace the previously found if it is closer. */ + struct elf_image mdi; + if (elf_w (extract_minidebuginfo) (ei, &mdi)) + { + int ret_mdi = elf_w (lookup_symbol) (as, ip, &mdi, load_offset, buf, + buf_len, &min_dist); + + /* Closer symbol was found (possibly truncated). */ + if (ret_mdi == 0 || ret_mdi == -UNW_ENOMEM) + { + ret = ret_mdi; + } + + mi_munmap (mdi.image, mdi.size); + } + + if (min_dist >= ei->size) + return -UNW_ENOINFO; /* not found */ + if (offp) + *offp = min_dist; + return ret; +} + +HIDDEN int +elf_w (get_proc_name) (unw_addr_space_t as, pid_t pid, unw_word_t ip, + char *buf, size_t buf_len, unw_word_t *offp) +{ + unsigned long segbase, mapoff; + struct elf_image ei; + int ret; + char file[PATH_MAX]; + + ret = tdep_get_elf_image (&ei, pid, ip, &segbase, &mapoff, file, PATH_MAX); + if (ret < 0) + return ret; + + ret = elf_w (load_debuginfo) (file, &ei, 1); + if (ret < 0) + return ret; + + ret = elf_w (get_proc_name_in_image) (as, &ei, segbase, ip, buf, buf_len, offp); + + mi_munmap (ei.image, ei.size); + ei.image = NULL; + + return ret; +} + +HIDDEN int +elf_w (get_proc_ip_range_in_image) (unw_addr_space_t as, struct elf_image *ei, + unsigned long segbase, + unw_word_t ip, + unw_word_t *start, unw_word_t *end) +{ + Elf_W (Addr) load_offset; + Elf_W (Addr) min_dist = ~(Elf_W (Addr))0; + int ret; + + load_offset = elf_w (get_load_offset) (ei, segbase); + ret = elf_w (lookup_ip_range) (as, ip, ei, load_offset, start, end, &min_dist); + + /* If the ELF image has MiniDebugInfo embedded in it, look up the symbol in + there as well and replace the previously found if it is closer. */ + struct elf_image mdi; + if (elf_w (extract_minidebuginfo) (ei, &mdi)) + { + int ret_mdi = elf_w (lookup_ip_range) (as, ip, &mdi, load_offset, start, + end, &min_dist); + + /* Closer symbol was found (possibly truncated). */ + if (ret_mdi == 0 || ret_mdi == -UNW_ENOMEM) + { + ret = ret_mdi; + } + + mi_munmap (mdi.image, mdi.size); + } + + if (min_dist >= ei->size) + return -UNW_ENOINFO; /* not found */ + return ret; +} + +HIDDEN int +elf_w (get_proc_ip_range) (unw_addr_space_t as, pid_t pid, unw_word_t ip, + unw_word_t *start, unw_word_t *end) +{ + unsigned long segbase, mapoff; + struct elf_image ei; + int ret; + char file[PATH_MAX]; + + ret = tdep_get_elf_image (&ei, pid, ip, &segbase, &mapoff, file, PATH_MAX); + if (ret < 0) + return ret; + + ret = elf_w (load_debuginfo) (file, &ei, 1); + if (ret < 0) + return ret; + + ret = elf_w (get_proc_ip_range_in_image) (as, &ei, segbase, ip, start, end); + + mi_munmap (ei.image, ei.size); + ei.image = NULL; + + return ret; +} + +HIDDEN int +elf_w (get_elf_filename) (unw_addr_space_t as, pid_t pid, unw_word_t ip, + char *buf, size_t buf_len, unw_word_t *offp) +{ + unsigned long segbase, mapoff; + int ret = UNW_ESUCCESS; + + // use NULL to no map elf image + ret = tdep_get_elf_image (NULL, pid, ip, &segbase, &mapoff, buf, buf_len); + if (ret < 0) + return ret; + + if (offp) + *offp = ip - segbase + mapoff; + return ret; +} + +HIDDEN Elf_W (Shdr)* +elf_w (find_section) (const struct elf_image *ei, const char* secname) +{ + Elf_W (Ehdr) *ehdr = ei->image; + Elf_W (Shdr) *shdr; + char *strtab; + int i; + + if (!elf_w (valid_object) (ei)) + return 0; + + shdr = elf_w (section_table) (ei); + if (!shdr) + return 0; + + strtab = elf_w (string_table) (ei, ehdr->e_shstrndx); + if (!strtab) + return 0; + + for (i = 0; i < ehdr->e_shnum; ++i) + { + if (strcmp (strtab + shdr->sh_name, secname) == 0) + { + if (shdr->sh_offset + shdr->sh_size > ei->size) + { + Debug (1, "section \"%s\" outside image? (0x%lu > 0x%lu)\n", + secname, + (unsigned long) shdr->sh_offset + shdr->sh_size, + (unsigned long) ei->size); + return 0; + } + + Debug (16, "found section \"%s\" at 0x%lx\n", + secname, (unsigned long) shdr->sh_offset); + return shdr; + } + + shdr = (Elf_W (Shdr) *) (((char *) shdr) + ehdr->e_shentsize); + } + + /* section not found */ + return 0; +} + + +static char * +elf_w (add_hex_byte) (char *str, uint8_t byte) +{ + const char hex[] = "0123456789abcdef"; + + *str++ = hex[byte >> 4]; + *str++ = hex[byte & 0xf]; + *str = 0; + + return str; +} + + +static int +elf_w (find_build_id_path) (const struct elf_image *ei, char *path, unsigned path_len) +{ +/* + * build-id is only available on GNU plaforms. So on non-GNU platforms this + * function just returns fail (-1). + */ +#if defined(ELF_NOTE_GNU) && defined(NT_GNU_BUILD_ID) + const Elf_W (Ehdr) *ehdr = ei->image; + const Elf_W (Phdr) *phdr; + unsigned i; + + if (!elf_w (valid_object) (ei)) + return -1; + + phdr = (Elf_W (Phdr) *) ((uint8_t *) ehdr + ehdr->e_phoff); + + for (i = 0; i < ehdr->e_phnum; ++i, phdr = (const Elf_W (Phdr) *) (((const uint8_t *) phdr) + ehdr->e_phentsize)) + { + const uint8_t *notes; + const uint8_t *notes_end; + + /* The build-id is in a note section */ + if (phdr->p_type != PT_NOTE) + continue; + + notes = ((const uint8_t *) ehdr) + phdr->p_offset; + notes_end = notes + phdr->p_memsz; + + while(notes < notes_end) + { + const char prefix[] = "/usr/lib/debug/.build-id/"; + + /* See "man 5 elf" for notes about alignment in Nhdr */ + const Elf_W(Nhdr) *nhdr = (const ElfW(Nhdr) *) notes; + const ElfW(Word) namesz = nhdr->n_namesz; + const ElfW(Word) descsz = nhdr->n_descsz; + const ElfW(Word) nameasz = UNW_ALIGN(namesz, 4); /* Aligned size */ + const char *name = (const char *) (nhdr + 1); + const uint8_t *desc = (const uint8_t *) name + nameasz; + unsigned j; + + notes += sizeof(*nhdr) + nameasz + UNW_ALIGN(descsz, 4); + + if ((namesz != sizeof(ELF_NOTE_GNU)) || /* Spec says must be "GNU" with a NULL */ + (nhdr->n_type != NT_GNU_BUILD_ID) || /* Spec says must be NT_GNU_BUILD_ID */ + (strcmp(name, ELF_NOTE_GNU) != 0)) /* Must be "GNU" with NULL termination */ + continue; + + /* Validate that we have enough space */ + if (path_len < (sizeof(prefix) + /* Path prefix inc NULL */ + 2 + /* Subdirectory */ + 1 + /* Directory separator */ + (2 * (descsz - 1)) + /* Leaf filename */ + 6)) /* .debug extension */ + return -1; + + memcpy(path, prefix, sizeof(prefix)); + + path = elf_w (add_hex_byte) (path + sizeof(prefix) - 1, *desc); + *path++ = '/'; + + for(j = 1, ++desc; j < descsz; ++j, ++desc) + path = elf_w (add_hex_byte) (path, *desc); + + strcat(path, ".debug"); + + return 0; + } + } +#endif /* defined(ELF_NOTE_GNU) */ + + return -1; +} + +/* Load a debug section, following .gnu_debuglink if appropriate + * Loads ei from file if not already mapped. + * If is_local, will also search sys directories /usr/local/dbg + * + * Returns 0 on success, failure otherwise. + * ei will be mapped to file or the located .gnu_debuglink from file + */ +HIDDEN int +elf_w (load_debuginfo) (const char* file, struct elf_image *ei, int is_local) +{ + int ret; + Elf_W (Shdr) *shdr; + Elf_W (Ehdr) *prev_image; + off_t prev_size; + char path[PATH_MAX]; + + if (!ei->image) + { + ret = elf_map_image(ei, file); + if (ret) + return ret; + } + + prev_image = ei->image; + prev_size = ei->size; + + /* Ignore separate debug files which contain a .gnu_debuglink section. */ + if (is_local == -1) { + return 0; + } + + ret = elf_w (find_build_id_path) (ei, path, sizeof(path)); + if (ret == 0) + { + ei->image = NULL; + + ret = elf_w (load_debuginfo) (path, ei, -1); + if (ret == 0) + { + mi_munmap (prev_image, prev_size); + return 0; + } + + ei->image = prev_image; + ei->size = prev_size; + } + + shdr = elf_w (find_section) (ei, ".gnu_debuglink"); + if (shdr) { + if (shdr->sh_size >= PATH_MAX || + (shdr->sh_offset + shdr->sh_size > ei->size)) + return 0; + + { + char linkbuf[shdr->sh_size]; + char *link = ((char *) ei->image) + shdr->sh_offset; + char *p; + static const char *debugdir = "/usr/lib/debug"; + char basedir[strlen(file) + 1]; + char newname[shdr->sh_size + strlen (debugdir) + strlen (file) + 9]; + + memcpy(linkbuf, link, shdr->sh_size); + + if (memchr (linkbuf, 0, shdr->sh_size) == NULL) + return 0; + + ei->image = NULL; + + Debug(1, "Found debuglink section, following %s\n", linkbuf); + + p = strrchr (file, '/'); + if (p != NULL) + { + memcpy (basedir, file, p - file); + basedir[p - file] = '\0'; + } + else + basedir[0] = 0; + + strcpy (newname, basedir); + strcat (newname, "/"); + strcat (newname, linkbuf); + ret = elf_w (load_debuginfo) (newname, ei, -1); + + if (ret == -1) + { + strcpy (newname, basedir); + strcat (newname, "/.debug/"); + strcat (newname, linkbuf); + ret = elf_w (load_debuginfo) (newname, ei, -1); + } + + if (ret == -1 && is_local == 1) + { + strcpy (newname, debugdir); + strcat (newname, basedir); + strcat (newname, "/"); + strcat (newname, linkbuf); + ret = elf_w (load_debuginfo) (newname, ei, -1); + } + + if (ret == -1) + { + /* No debuglink file found even though .gnu_debuglink existed */ + ei->image = prev_image; + ei->size = prev_size; + + return 0; + } + else + { + mi_munmap (prev_image, prev_size); + } + + return ret; + } + } + + return 0; +} diff --git a/vendor/libunwind/src/elfxx.h b/vendor/libunwind/src/elfxx.h new file mode 100644 index 0000000000..ad82d9be86 --- /dev/null +++ b/vendor/libunwind/src/elfxx.h @@ -0,0 +1,111 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003, 2005 Hewlett-Packard Co + Copyright (C) 2007 David Mosberger-Tang + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include +#include + +#include +#include + +#include "libunwind_i.h" + +#if UNW_ELF_CLASS == UNW_ELFCLASS32 +# define ELF_W(x) ELF32_##x +# define Elf_W(x) Elf32_##x +# define elf_w(x) _Uelf32_##x +#else +# define ELF_W(x) ELF64_##x +# define Elf_W(x) Elf64_##x +# define elf_w(x) _Uelf64_##x +#endif + +extern int elf_w (get_proc_name) (unw_addr_space_t as, + pid_t pid, unw_word_t ip, + char *buf, size_t len, + unw_word_t *offp); + +extern int elf_w (get_proc_name_in_image) (unw_addr_space_t as, + struct elf_image *ei, + unsigned long segbase, + unw_word_t ip, + char *buf, size_t buf_len, unw_word_t *offp); + +extern int elf_w (get_proc_ip_range) (unw_addr_space_t as, + pid_t pid, unw_word_t ip, + unw_word_t *start, unw_word_t *end); + +extern int elf_w (get_proc_ip_range_in_image) (unw_addr_space_t as, struct elf_image *ei, + unsigned long segbase, unw_word_t ip, + unw_word_t *start, unw_word_t *end); + +extern int elf_w (get_elf_filename) (unw_addr_space_t as, pid_t pid, unw_word_t ip, + char *buf, size_t buf_len, unw_word_t *offp); + +extern Elf_W (Shdr)* elf_w (find_section) (const struct elf_image *ei, const char* secname); +extern int elf_w (load_debuginfo) (const char* file, struct elf_image *ei, int is_local); + +static inline int +elf_w (valid_object) (const struct elf_image *ei) +{ + if (ei->size <= EI_VERSION) + return 0; + + return (memcmp (ei->image, ELFMAG, SELFMAG) == 0 + && ((uint8_t *) ei->image)[EI_CLASS] == UNW_ELF_CLASS + && ((uint8_t *) ei->image)[EI_VERSION] != EV_NONE + && ((uint8_t *) ei->image)[EI_VERSION] <= EV_CURRENT); +} + +static inline int +elf_map_image (struct elf_image *ei, const char *path) +{ + struct stat stat; + int fd; + + fd = open (path, O_RDONLY); + if (fd < 0) + return -1; + + if (fstat (fd, &stat) < 0) + { + close (fd); + return -1; + } + + ei->size = stat.st_size; + ei->image = mi_mmap (NULL, ei->size, PROT_READ, MAP_PRIVATE, fd, 0); + close (fd); + if (ei->image == MAP_FAILED) + return -1; + + if (!elf_w (valid_object) (ei)) + { + mi_munmap(ei->image, ei->size); + return -1; + } + + return 0; +} diff --git a/vendor/libunwind/src/libunwind-generic.pc.in b/vendor/libunwind/src/libunwind-generic.pc.in new file mode 100644 index 0000000000..1f3baffe5b --- /dev/null +++ b/vendor/libunwind/src/libunwind-generic.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libunwind-generic +Description: libunwind generic library +Version: @VERSION@ +Requires: libunwind +Libs: -L${libdir} -lunwind-generic +Cflags: -I${includedir} diff --git a/vendor/libunwind/src/mi/Gaddress_validator.c b/vendor/libunwind/src/mi/Gaddress_validator.c new file mode 100644 index 0000000000..a81a08355b --- /dev/null +++ b/vendor/libunwind/src/mi/Gaddress_validator.c @@ -0,0 +1,303 @@ +/* + * Contributed by Stephen M. Webb + * + * This file is part of libunwind, a platform-independent unwind library. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +#include "libunwind_i.h" + + +#ifdef UNW_REMOTE_ONLY +bool +unw_address_is_valid(UNUSED unw_word_t addr, UNUSED size_t len) +{ + Debug(1, "remote-only invoked\n"); + return false; +} + +#else /* !UNW_REMOTE_ONLY */ + +#include + + +static atomic_flag _unw_address_validator_initialized = ATOMIC_FLAG_INIT; +static int _mem_validate_pipe[2] = {-1, -1}; + +#ifdef HAVE_PIPE2 +static int +_do_pipe2 (int pipefd[2]) +{ + return pipe2 (pipefd, O_CLOEXEC | O_NONBLOCK); +} +#else +static void +_set_pipe_flags (int fd) +{ + int fd_flags = fcntl (fd, F_GETFD, 0); + int status_flags = fcntl (fd, F_GETFL, 0); + + fd_flags |= FD_CLOEXEC; + fcntl (fd, F_SETFD, fd_flags); + + status_flags |= O_NONBLOCK; + fcntl (fd, F_SETFL, status_flags); +} + +static int +_do_pipe2 (int pipefd[2]) +{ + if (pipe (pipefd) < 0) + { + return -1; + } + _set_pipe_flags(pipefd[0]); + _set_pipe_flags(pipefd[1]); + return 0; +} +#endif + + +static int +_open_pipe (void) +{ + if (_mem_validate_pipe[0] != -1) + close (_mem_validate_pipe[0]); + if (_mem_validate_pipe[1] != -1) + close (_mem_validate_pipe[1]); + + return _do_pipe2 (_mem_validate_pipe); +} + + +/** + * Test is a memory address is valid by trying to write from it + * @param[in] addr The address to validate + * + * @returns true if the memory address is valid (readable), false otherwise. + * + * This check works by using the address as a (one-byte) buffer in a + * write-to-pipe operation. The write will fail if the memory is not in the + * process's address space and marked as readable. The read will force the page + * to be swapped in if it's not already there. + */ +static bool +_write_validate (unw_word_t addr) +{ + int ret = -1; + ssize_t bytes = 0; + + if (unlikely (!atomic_flag_test_and_set(&_unw_address_validator_initialized))) + { + if (_open_pipe () != 0) + { + return false; + } + } + + do + { + char buf; + bytes = read (_mem_validate_pipe[0], &buf, 1); + } + while ( errno == EINTR ); + + if (!(bytes > 0 || errno == EAGAIN || errno == EWOULDBLOCK)) + { + // re-open closed pipe + if (_open_pipe () != 0) + { + return false; + } + } + + do + { +#ifdef HAVE_SYS_SYSCALL_H + /* use syscall insteadof write() so that ASAN does not complain */ + ret = syscall (SYS_write, _mem_validate_pipe[1], addr, 1); +#else + ret = write (_mem_validate_pipe[1], (void *)addr, 1); +#endif + } + while ( errno == EINTR ); + + return ret > 0; +} + + +/* Cache of already validated addresses */ +enum { NLGA = 4 }; + +#if defined(HAVE___CACHE_PER_THREAD) && HAVE___CACHE_PER_THREAD +// thread-local variant +static _Thread_local unw_word_t last_good_addr[NLGA]; +static _Thread_local int lga_victim; + + +static bool +_is_cached_valid_mem(unw_word_t page_addr) +{ + int i; + for (i = 0; i < NLGA; i++) + { + if (page_addr == last_good_addr[i]) + return true; + } + return false; +} + + +static void +_cache_valid_mem(unw_word_t page_addr) +{ + int i, victim; + victim = lga_victim; + for (i = 0; i < NLGA; i++) + { + if (last_good_addr[victim] == 0) + { + last_good_addr[victim] = page_addr; + return; + } + victim = (victim + 1) % NLGA; + } + + /* All slots full. Evict the victim. */ + last_good_addr[victim] = page_addr; + victim = (victim + 1) % NLGA; + lga_victim = victim; +} + +#else +// global, thread safe variant +static _Atomic unw_word_t last_good_addr[NLGA]; +static _Atomic int lga_victim; + + +static bool +_is_cached_valid_mem(unw_word_t page_addr) +{ + int i; + for (i = 0; i < NLGA; i++) + { + if (page_addr == atomic_load(&last_good_addr[i])) + return true; + } + return false; +} + + +/** + * Adds a known-valid page address to the cache. + * + * This implementation is racy as all get-out but the worst case is that cached + * address get lost, forcing extra unnecessary validation checks. All of the + * atomic operations don't matter because of TOCTOU races. + */ +static void +_cache_valid_mem(unw_word_t page_addr) +{ + unw_word_t zero = 0; + int victim = atomic_load(&lga_victim); + for (int i = 0; i < NLGA; i++) + { + if (atomic_compare_exchange_strong(&last_good_addr[victim], &zero, page_addr)) + { + return; + } + victim = (victim + 1) % NLGA; + } + + /* All slots full. Evict the victim. */ + atomic_store(&last_good_addr[victim], page_addr); + victim = (victim + 1) % NLGA; + atomic_store(&lga_victim, victim); +} +#endif + + +/** + * Validate an address is readable + * @param[in] addr The (starting) address of the memory range to validate + * @param[in] len The size of the memory range to validate in bytes + * + * Validates the memory range from @p addr to (@p addr + @p len - 1) is + * readable. Since the granularity of memory readability is the page, only one + * byte needs to be validated per page for each page starting at @p addr and + * encompassing @p len bytes. Only the first address of each page is checked. + * + * @returns true if the memory is readable, false otherwise. + */ +bool +unw_address_is_valid(unw_word_t addr, size_t len) +{ + if (len == 0) + return true; + + /* + * Find the starting address of the page containing the start of the range. + */ + unw_word_t start_page_addr = unw_page_start (addr); + + /* + * Bounds check on bottom of memory: first page is always deemed inaccessible. + * This is potentially incorrect on an embedded system, especially one running + * on bare metal with no VMM, but the check has always been here and no one + * has complained. + */ + if (start_page_addr == 0) + return false; + + /* + * Bounds check on top of memory. Unsigned wraparound could be hazardous. + */ + if (addr > (UNW_WORD_MAX - len - unw_page_size)) + return false; + + /* + * Find the starting address of the page containing the end of the range. + */ + unw_word_t end_page_addr = unw_page_start (addr + (len - 1)) + unw_page_size; + + /* + * Step through each page and check if the first address in each is readable. + * The first non-readable page encountered means none of them in the given + * range can be considered readable. + */ + for (unw_word_t page_addr = start_page_addr; + page_addr < end_page_addr; + page_addr += unw_page_size) + { + if (!_is_cached_valid_mem(page_addr)) + { + if (!_write_validate (page_addr)) + { + Debug(1, "returning false\n"); + return false; + } + _cache_valid_mem(page_addr); + } + } + + return true; +} + +#endif /* !UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/src/mi/Gdestroy_addr_space.c b/vendor/libunwind/src/mi/Gdestroy_addr_space.c new file mode 100644 index 0000000000..fa29ac9555 --- /dev/null +++ b/vendor/libunwind/src/mi/Gdestroy_addr_space.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002, 2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +void +unw_destroy_addr_space (unw_addr_space_t as UNUSED) +{ +#ifndef UNW_LOCAL_ONLY +# if UNW_DEBUG + memset (as, 0, sizeof (*as)); +# endif + free (as); +#endif +} diff --git a/vendor/libunwind/src/mi/Gdyn-extract.c b/vendor/libunwind/src/mi/Gdyn-extract.c new file mode 100644 index 0000000000..5f7682e650 --- /dev/null +++ b/vendor/libunwind/src/mi/Gdyn-extract.c @@ -0,0 +1,64 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2001-2002, 2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +HIDDEN int +unwi_extract_dynamic_proc_info (unw_addr_space_t as, unw_word_t ip, + unw_proc_info_t *pi, unw_dyn_info_t *di, + int need_unwind_info, void *arg) +{ + pi->start_ip = di->start_ip; + pi->end_ip = di->end_ip; + pi->gp = di->gp; + pi->format = di->format; + switch (di->format) + { + case UNW_INFO_FORMAT_DYNAMIC: + pi->handler = di->u.pi.handler; + pi->lsda = 0; + pi->flags = di->u.pi.flags; + pi->unwind_info_size = 0; + if (need_unwind_info) + pi->unwind_info = di; + else + pi->unwind_info = NULL; + return 0; + + case UNW_INFO_FORMAT_TABLE: + case UNW_INFO_FORMAT_REMOTE_TABLE: + case UNW_INFO_FORMAT_ARM_EXIDX: + case UNW_INFO_FORMAT_IP_OFFSET: +#ifdef tdep_search_unwind_table + /* call platform-specific search routine: */ + return tdep_search_unwind_table (as, ip, di, pi, need_unwind_info, arg); +#else + /* fall through */ +#endif + default: + break; + } + return -UNW_EINVAL; +} diff --git a/vendor/libunwind/src/mi/Gdyn-remote.c b/vendor/libunwind/src/mi/Gdyn-remote.c new file mode 100644 index 0000000000..6d4ec1ecf8 --- /dev/null +++ b/vendor/libunwind/src/mi/Gdyn-remote.c @@ -0,0 +1,327 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2001-2002, 2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include + +#include "libunwind_i.h" +#include "remote.h" + +static void +free_regions (unw_dyn_region_info_t *region) +{ + if (region->next) + free_regions (region->next); + free (region); +} + +static int +intern_op (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, + unw_dyn_op_t *op, void *arg) +{ + int ret; + + if ((ret = fetch8 (as, a, addr, &op->tag, arg)) < 0 + || (ret = fetch8 (as, a, addr, &op->qp, arg)) < 0 + || (ret = fetch16 (as, a, addr, &op->reg, arg)) < 0 + || (ret = fetch32 (as, a, addr, &op->when, arg)) < 0 + || (ret = fetchw (as, a, addr, &op->val, arg)) < 0) + return ret; + return 0; +} + +static int +intern_regions (unw_addr_space_t as, unw_accessors_t *a, + unw_word_t *addr, unw_dyn_region_info_t **regionp, void *arg) +{ + uint32_t insn_count, op_count, i; + unw_dyn_region_info_t *region; + unw_word_t next_addr; + int ret; + + *regionp = NULL; + + if (!*addr) + return 0; /* NULL region-list */ + + if ((ret = fetchw (as, a, addr, &next_addr, arg)) < 0 + || (ret = fetch32 (as, a, addr, (int32_t *) &insn_count, arg)) < 0 + || (ret = fetch32 (as, a, addr, (int32_t *) &op_count, arg)) < 0) + return ret; + + region = calloc (1, _U_dyn_region_info_size (op_count)); + if (!region) + { + ret = -UNW_ENOMEM; + goto out; + } + + region->insn_count = insn_count; + region->op_count = op_count; + for (i = 0; i < op_count; ++i) + if ((ret = intern_op (as, a, addr, region->op + i, arg)) < 0) + goto out; + + if (next_addr) + if ((ret = intern_regions (as, a, &next_addr, ®ion->next, arg)) < 0) + goto out; + + *regionp = region; + return 0; + + out: + if (region) + free_regions (region); + return ret; +} + +static int +intern_array (unw_addr_space_t as, unw_accessors_t *a, + unw_word_t *addr, unw_word_t table_len, unw_word_t **table_data, + void *arg) +{ + unw_word_t i, *data = calloc (table_len, WSIZE); + int ret = 0; + + if (!data) + { + ret = -UNW_ENOMEM; + goto out; + } + + for (i = 0; i < table_len; ++i) + if (fetchw (as, a, addr, data + i, arg) < 0) + goto out; + + *table_data = data; + return 0; + + out: + if (data) + free (data); + return ret; +} + +static void +free_dyn_info (unw_dyn_info_t *di) +{ + switch (di->format) + { + case UNW_INFO_FORMAT_DYNAMIC: + if (di->u.pi.regions) + { + free_regions (di->u.pi.regions); + di->u.pi.regions = NULL; + } + break; + + case UNW_INFO_FORMAT_TABLE: + if (di->u.ti.table_data) + { + free (di->u.ti.table_data); + di->u.ti.table_data = NULL; + } + break; + + case UNW_INFO_FORMAT_REMOTE_TABLE: + default: + break; + } +} + +static int +intern_dyn_info (unw_addr_space_t as, unw_accessors_t *a, + unw_word_t *addr, unw_dyn_info_t *di, void *arg) +{ + unw_word_t first_region; + int ret; + + switch (di->format) + { + case UNW_INFO_FORMAT_DYNAMIC: + if ((ret = fetchw (as, a, addr, &di->u.pi.name_ptr, arg)) < 0 + || (ret = fetchw (as, a, addr, &di->u.pi.handler, arg)) < 0 + || (ret = fetch32 (as, a, addr, + (int32_t *) &di->u.pi.flags, arg)) < 0) + goto out; + *addr += 4; /* skip over pad0 */ + if ((ret = fetchw (as, a, addr, &first_region, arg)) < 0 + || (ret = intern_regions (as, a, &first_region, &di->u.pi.regions, + arg)) < 0) + goto out; + break; + + case UNW_INFO_FORMAT_TABLE: + if ((ret = fetchw (as, a, addr, &di->u.ti.name_ptr, arg)) < 0 + || (ret = fetchw (as, a, addr, &di->u.ti.segbase, arg)) < 0 + || (ret = fetchw (as, a, addr, &di->u.ti.table_len, arg)) < 0 + || (ret = intern_array (as, a, addr, di->u.ti.table_len, + &di->u.ti.table_data, arg)) < 0) + goto out; + break; + + case UNW_INFO_FORMAT_REMOTE_TABLE: + if ((ret = fetchw (as, a, addr, &di->u.rti.name_ptr, arg)) < 0 + || (ret = fetchw (as, a, addr, &di->u.rti.segbase, arg)) < 0 + || (ret = fetchw (as, a, addr, &di->u.rti.table_len, arg)) < 0 + || (ret = fetchw (as, a, addr, &di->u.rti.table_data, arg)) < 0) + goto out; + break; + + default: + ret = -UNW_ENOINFO; + goto out; + } + return 0; + + out: + free_dyn_info (di); + return ret; +} + +HIDDEN int +unwi_dyn_remote_find_proc_info (unw_addr_space_t as, unw_word_t ip, + unw_proc_info_t *pi, + int need_unwind_info, void *arg) +{ + unw_accessors_t *a = unw_get_accessors_int (as); + unw_word_t dyn_list_addr, addr, next_addr, gen1, gen2, start_ip, end_ip; + unw_dyn_info_t *di = NULL; + int ret; + + if (as->dyn_info_list_addr) + dyn_list_addr = as->dyn_info_list_addr; + else + { + if ((*a->get_dyn_info_list_addr) (as, &dyn_list_addr, arg) < 0) + return -UNW_ENOINFO; + if (as->caching_policy != UNW_CACHE_NONE) + as->dyn_info_list_addr = dyn_list_addr; + } + + do + { + addr = dyn_list_addr; + + ret = -UNW_ENOINFO; + + if (fetchw (as, a, &addr, &gen1, arg) < 0 + || fetchw (as, a, &addr, &next_addr, arg) < 0) + return ret; + + for (addr = next_addr; addr != 0; addr = next_addr) + { + if (fetchw (as, a, &addr, &next_addr, arg) < 0) + goto recheck; /* only fail if generation # didn't change */ + + addr += WSIZE; /* skip over prev_addr */ + + if (fetchw (as, a, &addr, &start_ip, arg) < 0 + || fetchw (as, a, &addr, &end_ip, arg) < 0) + goto recheck; /* only fail if generation # didn't change */ + + if (ip >= start_ip && ip < end_ip) + { + if (!di) + di = calloc (1, sizeof (*di)); + + di->start_ip = start_ip; + di->end_ip = end_ip; + + if (fetchw (as, a, &addr, &di->gp, arg) < 0 + || fetch32 (as, a, &addr, &di->format, arg) < 0) + goto recheck; /* only fail if generation # didn't change */ + + addr += 4; /* skip over padding */ + + if (need_unwind_info + && intern_dyn_info (as, a, &addr, di, arg) < 0) + goto recheck; /* only fail if generation # didn't change */ + + if (unwi_extract_dynamic_proc_info (as, ip, pi, di, + need_unwind_info, arg) < 0) + { + free_dyn_info (di); + goto recheck; /* only fail if generation # didn't change */ + } + ret = 0; /* OK, found it */ + break; + } + } + + /* Re-check generation number to ensure the data we have is + consistent. */ + recheck: + addr = dyn_list_addr; + if (fetchw (as, a, &addr, &gen2, arg) < 0) + return ret; + } + while (gen1 != gen2); + + if (ret < 0 && di) + free (di); + + return ret; +} + +HIDDEN void +unwi_dyn_remote_put_unwind_info (unw_addr_space_t as UNUSED, + unw_proc_info_t *pi, + void *arg UNUSED) +{ + if (!pi->unwind_info) + return; + + free_dyn_info (pi->unwind_info); + free (pi->unwind_info); + pi->unwind_info = NULL; +} + +/* Returns 1 if the cache is up-to-date or -1 if the cache contained + stale data and had to be flushed. */ + +HIDDEN int +unwi_dyn_validate_cache (unw_addr_space_t as, void *arg) +{ + unw_word_t addr, gen; + unw_accessors_t *a; + + if (!as->dyn_info_list_addr) + /* If we don't have the dyn_info_list_addr, we don't have anything + in the cache. */ + return 0; + + a = unw_get_accessors_int (as); + addr = as->dyn_info_list_addr; + + if (fetchw (as, a, &addr, &gen, arg) < 0) + return 1; + + if (gen == as->dyn_generation) + return 1; + + unw_flush_cache (as, 0, 0); + as->dyn_generation = gen; + return -1; +} diff --git a/vendor/libunwind/src/mi/Gfind_dynamic_proc_info.c b/vendor/libunwind/src/mi/Gfind_dynamic_proc_info.c new file mode 100644 index 0000000000..dcd7f9de0d --- /dev/null +++ b/vendor/libunwind/src/mi/Gfind_dynamic_proc_info.c @@ -0,0 +1,95 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2001-2002, 2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +#ifdef UNW_REMOTE_ONLY + +static inline int +local_find_proc_info (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi, + int need_unwind_info, void *arg) +{ + return -UNW_ENOINFO; +} + +#else /* !UNW_REMOTE_ONLY */ + +static inline int +local_find_proc_info (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi, + int need_unwind_info, void *arg) +{ + unw_dyn_info_list_t *list; + unw_dyn_info_t *di; + +#ifndef UNW_LOCAL_ONLY +# pragma weak _U_dyn_info_list_addr + if (!_U_dyn_info_list_addr) + return -UNW_ENOINFO; +#endif + + // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. + list = (unw_dyn_info_list_t *) (uintptr_t) _U_dyn_info_list_addr (); + for (di = list->first; di; di = di->next) + if (ip >= di->start_ip && ip < di->end_ip) + return unwi_extract_dynamic_proc_info (as, ip, pi, di, need_unwind_info, + arg); + return -UNW_ENOINFO; +} + +#endif /* !UNW_REMOTE_ONLY */ + +#ifdef UNW_LOCAL_ONLY + +static inline int +remote_find_proc_info (unw_addr_space_t as UNUSED, + unw_word_t ip UNUSED, + unw_proc_info_t *pi UNUSED, + int need_unwind_info UNUSED, + void *arg UNUSED) +{ + return -UNW_ENOINFO; +} + +#else /* !UNW_LOCAL_ONLY */ + +static inline int +remote_find_proc_info (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi, + int need_unwind_info, void *arg) +{ + return unwi_dyn_remote_find_proc_info (as, ip, pi, need_unwind_info, arg); +} + +#endif /* !UNW_LOCAL_ONLY */ + +HIDDEN int +unwi_find_dynamic_proc_info (unw_addr_space_t as, unw_word_t ip, + unw_proc_info_t *pi, int need_unwind_info, + void *arg) +{ + if (as == unw_local_addr_space) + return local_find_proc_info (as, ip, pi, need_unwind_info, arg); + else + return remote_find_proc_info (as, ip, pi, need_unwind_info, arg); +} diff --git a/vendor/libunwind/src/mi/Gget_accessors.c b/vendor/libunwind/src/mi/Gget_accessors.c new file mode 100644 index 0000000000..8b8a72ea3d --- /dev/null +++ b/vendor/libunwind/src/mi/Gget_accessors.c @@ -0,0 +1,38 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002, 2004-2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" +#include + +HIDDEN ALIAS(unw_get_accessors) unw_accessors_t * +unw_get_accessors_int (unw_addr_space_t as); + +unw_accessors_t * +unw_get_accessors (unw_addr_space_t as) +{ + if (!atomic_load(&tdep_init_done)) + tdep_init (); + return &as->acc; +} diff --git a/vendor/libunwind/src/mi/Gget_elf_filename.c b/vendor/libunwind/src/mi/Gget_elf_filename.c new file mode 100644 index 0000000000..97d0645164 --- /dev/null +++ b/vendor/libunwind/src/mi/Gget_elf_filename.c @@ -0,0 +1,77 @@ +/* libunwind - a platform-independent unwind library +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +#include "libunwind_i.h" +#include "remote.h" + +int +unw_get_elf_filename_by_ip (unw_addr_space_t as, unw_word_t ip, + char *buf, size_t buf_len, unw_word_t *offp, + void *arg) +{ + unw_accessors_t *a = unw_get_accessors_int (as); + unw_proc_info_t pi; + int ret; + + buf[0] = '\0'; /* always return a valid string, even if it's empty */ + + ret = unwi_find_dynamic_proc_info (as, ip, &pi, 1, arg); + if (ret == 0) + { + unwi_put_dynamic_unwind_info (as, &pi, arg); + return -UNW_ENOINFO; + } + + if (a->get_elf_filename) + return (*a->get_elf_filename) (as, ip, buf, buf_len, offp, arg); + + return -UNW_ENOINFO; +} + +int +unw_get_elf_filename (unw_cursor_t *cursor, char *buf, size_t buf_len, + unw_word_t *offp) +{ + struct cursor *c = (struct cursor *) cursor; + unw_word_t ip; + int error; + + ip = tdep_get_ip (c); +#if !defined(__ia64__) + if (c->dwarf.use_prev_instr) + { +#if defined(__arm__) + /* On arm, the least bit denotes thumb/arm mode, clear it. */ + ip &= ~(unw_word_t)0x1; +#endif + --ip; + } + +#endif + error = unw_get_elf_filename_by_ip (tdep_get_as (c), ip, buf, buf_len, offp, + tdep_get_as_arg (c)); +#if !defined(__ia64__) + if (c->dwarf.use_prev_instr && offp != NULL && error == 0) + *offp += 1; +#endif + return error; +} diff --git a/vendor/libunwind/src/mi/Gget_fpreg.c b/vendor/libunwind/src/mi/Gget_fpreg.c new file mode 100644 index 0000000000..f32b128625 --- /dev/null +++ b/vendor/libunwind/src/mi/Gget_fpreg.c @@ -0,0 +1,34 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2004-2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +int +unw_get_fpreg (unw_cursor_t *cursor, int regnum, unw_fpreg_t *valp) +{ + struct cursor *c = (struct cursor *) cursor; + + return tdep_access_fpreg (c, regnum, valp, 0); +} diff --git a/vendor/libunwind/src/mi/Gget_proc_info_by_ip.c b/vendor/libunwind/src/mi/Gget_proc_info_by_ip.c new file mode 100644 index 0000000000..2697ff84e7 --- /dev/null +++ b/vendor/libunwind/src/mi/Gget_proc_info_by_ip.c @@ -0,0 +1,39 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003, 2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +int +unw_get_proc_info_by_ip (unw_addr_space_t as, unw_word_t ip, + unw_proc_info_t *pi, void *as_arg) +{ + unw_accessors_t *a = unw_get_accessors_int (as); + int ret; + + ret = unwi_find_dynamic_proc_info (as, ip, pi, 0, as_arg); + if (ret == -UNW_ENOINFO) + ret = (*a->find_proc_info) (as, ip, pi, 0, as_arg); + return ret; +} diff --git a/vendor/libunwind/src/mi/Gget_proc_name.c b/vendor/libunwind/src/mi/Gget_proc_name.c new file mode 100644 index 0000000000..15fbbc8fa7 --- /dev/null +++ b/vendor/libunwind/src/mi/Gget_proc_name.c @@ -0,0 +1,127 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2001-2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" +#include "remote.h" + +static inline int +intern_string (unw_addr_space_t as, unw_accessors_t *a, + unw_word_t addr, char *buf, size_t buf_len, void *arg) +{ + size_t i; + int ret; + + for (i = 0; i < buf_len; ++i) + { + if ((ret = fetch8 (as, a, &addr, (int8_t *) buf + i, arg)) < 0) + return ret; + + if (buf[i] == '\0') + return 0; /* copied full string; return success */ + } + buf[buf_len - 1] = '\0'; /* ensure string is NUL terminated */ + return -UNW_ENOMEM; +} + +int +unw_get_proc_name_by_ip (unw_addr_space_t as, unw_word_t ip, + char *buf, size_t buf_len, unw_word_t *offp, + void *arg) +{ + unw_accessors_t *a = unw_get_accessors_int (as); + unw_proc_info_t pi; + int ret; + + buf[0] = '\0'; /* always return a valid string, even if it's empty */ + + ret = unwi_find_dynamic_proc_info (as, ip, &pi, 1, arg); + if (ret == 0) + { + unw_dyn_info_t *di = pi.unwind_info; + + if (offp) + *offp = ip - pi.start_ip; + + switch (di->format) + { + case UNW_INFO_FORMAT_DYNAMIC: + ret = intern_string (as, a, di->u.pi.name_ptr, buf, buf_len, arg); + break; + + case UNW_INFO_FORMAT_TABLE: + case UNW_INFO_FORMAT_REMOTE_TABLE: + /* XXX should we create a fake name, e.g.: "tablenameN", + where N is the index of the function in the table??? */ + ret = -UNW_ENOINFO; + break; + + default: + ret = -UNW_EINVAL; + break; + } + unwi_put_dynamic_unwind_info (as, &pi, arg); + return ret; + } + + if (ret != -UNW_ENOINFO) + return ret; + + /* not a dynamic procedure, try to lookup static procedure name: */ + + if (a->get_proc_name) + return (*a->get_proc_name) (as, ip, buf, buf_len, offp, arg); + + return -UNW_ENOINFO; +} + +int +unw_get_proc_name (unw_cursor_t *cursor, char *buf, size_t buf_len, + unw_word_t *offp) +{ + struct cursor *c = (struct cursor *) cursor; + unw_word_t ip; + int error; + + ip = tdep_get_ip (c); +#if !defined(__ia64__) + if (c->dwarf.use_prev_instr) + { +#if defined(__arm__) + /* On arm, the least bit denotes thumb/arm mode, clear it. */ + ip &= ~(unw_word_t)0x1; +#endif + --ip; + } + + +#endif + error = unw_get_proc_name_by_ip (tdep_get_as (c), ip, buf, buf_len, offp, + tdep_get_as_arg (c)); +#if !defined(__ia64__) + if (c->dwarf.use_prev_instr && offp != NULL && error == 0) + *offp += 1; +#endif + return error; +} diff --git a/vendor/libunwind/src/mi/Gget_reg.c b/vendor/libunwind/src/mi/Gget_reg.c new file mode 100644 index 0000000000..9fc725c9c8 --- /dev/null +++ b/vendor/libunwind/src/mi/Gget_reg.c @@ -0,0 +1,41 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002, 2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +int +unw_get_reg (unw_cursor_t *cursor, int regnum, unw_word_t *valp) +{ + struct cursor *c = (struct cursor *) cursor; + + // We can get the IP value directly without needing a lookup. + if (regnum == UNW_REG_IP) + { + *valp = tdep_get_ip (c); + return 0; + } + + return tdep_access_reg (c, regnum, valp, 0); +} diff --git a/vendor/libunwind/src/mi/Gis_plt_entry.c b/vendor/libunwind/src/mi/Gis_plt_entry.c new file mode 100644 index 0000000000..5c7551863b --- /dev/null +++ b/vendor/libunwind/src/mi/Gis_plt_entry.c @@ -0,0 +1,39 @@ +/** + * Default implementation of unw_is_plt_entry() for those CPU-OS-ENV targets + * that don't need to specialize this function. + */ +/* + * Copyright 2024 Stephen M. Webb + * + * This file is part of libunwind. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#include "libunwind_i.h" + +/** + * This weakly-defined version of this public API function does nothing other + * than always return false. + */ +WEAK int +unw_is_plt_entry (unw_cursor_t *c UNUSED) +{ + return 0; +} diff --git a/vendor/libunwind/src/mi/Gput_dynamic_unwind_info.c b/vendor/libunwind/src/mi/Gput_dynamic_unwind_info.c new file mode 100644 index 0000000000..ca377c98a8 --- /dev/null +++ b/vendor/libunwind/src/mi/Gput_dynamic_unwind_info.c @@ -0,0 +1,55 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2001-2002, 2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +HIDDEN void +unwi_put_dynamic_unwind_info (unw_addr_space_t as, unw_proc_info_t *pi, + void *arg) +{ + switch (pi->format) + { + case UNW_INFO_FORMAT_DYNAMIC: +#ifndef UNW_LOCAL_ONLY +# ifdef UNW_REMOTE_ONLY + unwi_dyn_remote_put_unwind_info (as, pi, arg); +# else + if (as != unw_local_addr_space) + unwi_dyn_remote_put_unwind_info (as, pi, arg); +# endif +#endif + break; + + case UNW_INFO_FORMAT_TABLE: + case UNW_INFO_FORMAT_REMOTE_TABLE: +#ifdef tdep_put_unwind_info + tdep_put_unwind_info (as, pi, arg); + break; +#endif + /* fall through */ + default: + break; + } +} diff --git a/vendor/libunwind/src/mi/Gset_cache_size.c b/vendor/libunwind/src/mi/Gset_cache_size.c new file mode 100644 index 0000000000..014576a1be --- /dev/null +++ b/vendor/libunwind/src/mi/Gset_cache_size.c @@ -0,0 +1,72 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2014 + Contributed by Milian Wolff + and Dave Watson + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +int +unw_set_cache_size (unw_addr_space_t as, size_t size, int flag) +{ + size_t power = 1; + unsigned short log_size = 0; + + if (!atomic_load(&tdep_init_done)) + tdep_init (); + + if (flag != 0) + return -1; + + /* Currently not supported for per-thread cache due to memory leak */ + /* A pthread-key destructor would work, but is not signal safe */ +#if defined(HAVE___THREAD) && HAVE___THREAD + return -1; +#endif + + /* Round up to next power of two, slowly but portably */ + while(power < size) + { + power *= 2; + log_size++; + /* Largest size currently supported by rs_cache */ + if (log_size >= 15) + break; + } + +#if !defined(__ia64__) + if (log_size == as->global_cache.log_size) + return 0; /* no change */ + + as->global_cache.log_size = log_size; +#endif + + /* Ensure caches are empty (and initialized). */ + unw_flush_cache (as, 0, 0); +#ifdef __ia64__ + return 0; +#else + /* Synchronously purge cache, to ensure memory is allocated */ + return dwarf_flush_rs_cache(&as->global_cache); +#endif +} diff --git a/vendor/libunwind/src/mi/Gset_caching_policy.c b/vendor/libunwind/src/mi/Gset_caching_policy.c new file mode 100644 index 0000000000..8fe0829836 --- /dev/null +++ b/vendor/libunwind/src/mi/Gset_caching_policy.c @@ -0,0 +1,46 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002, 2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +int +unw_set_caching_policy (unw_addr_space_t as, unw_caching_policy_t policy) +{ + if (!atomic_load(&tdep_init_done)) + tdep_init (); + +#if !(defined(HAVE___THREAD) && HAVE___THREAD) + if (policy == UNW_CACHE_PER_THREAD) + policy = UNW_CACHE_GLOBAL; +#endif + + if (policy == as->caching_policy) + return 0; /* no change */ + + as->caching_policy = policy; + /* Ensure caches are empty (and initialized). */ + unw_flush_cache (as, 0, 0); + return 0; +} diff --git a/vendor/libunwind/src/mi/Gset_fpreg.c b/vendor/libunwind/src/mi/Gset_fpreg.c new file mode 100644 index 0000000000..8c37afd226 --- /dev/null +++ b/vendor/libunwind/src/mi/Gset_fpreg.c @@ -0,0 +1,34 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2004-2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +int +unw_set_fpreg (unw_cursor_t *cursor, int regnum, unw_fpreg_t val) +{ + struct cursor *c = (struct cursor *) cursor; + + return tdep_access_fpreg (c, regnum, &val, 1); +} diff --git a/vendor/libunwind/src/mi/Gset_iterate_phdr_function.c b/vendor/libunwind/src/mi/Gset_iterate_phdr_function.c new file mode 100644 index 0000000000..d56f1fb69e --- /dev/null +++ b/vendor/libunwind/src/mi/Gset_iterate_phdr_function.c @@ -0,0 +1,23 @@ +#include "libunwind_i.h" + +//! Set an alternative function to use in place of dl_iterate_phdr. +/*! Suggested use is to specify an async-signal safe implementation. + * If not set (or set to NULL) the system dl_iterate_phdr will + * be used. */ +void +unw_set_iterate_phdr_function (unw_addr_space_t as, unw_iterate_phdr_func_t function) +{ + if (!tdep_init_done) + tdep_init (); + +#ifndef UNW_REMOTE_ONLY + if (function) + as->iterate_phdr_function = function; + else +# if defined(HAVE_DL_ITERATE_PHDR) + as->iterate_phdr_function = dl_iterate_phdr; +# else + as->iterate_phdr_function = NULL; +# endif +#endif +} diff --git a/vendor/libunwind/src/mi/Gset_reg.c b/vendor/libunwind/src/mi/Gset_reg.c new file mode 100644 index 0000000000..b1b1770337 --- /dev/null +++ b/vendor/libunwind/src/mi/Gset_reg.c @@ -0,0 +1,34 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002, 2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +int +unw_set_reg (unw_cursor_t *cursor, int regnum, unw_word_t valp) +{ + struct cursor *c = (struct cursor *) cursor; + + return tdep_access_reg (c, regnum, &valp, 1); +} diff --git a/vendor/libunwind/src/mi/Laddress_validator.c b/vendor/libunwind/src/mi/Laddress_validator.c new file mode 100644 index 0000000000..b810a3fea0 --- /dev/null +++ b/vendor/libunwind/src/mi/Laddress_validator.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gaddress_validator.c" +#endif diff --git a/vendor/libunwind/src/mi/Ldestroy_addr_space.c b/vendor/libunwind/src/mi/Ldestroy_addr_space.c new file mode 100644 index 0000000000..5bf9364bc7 --- /dev/null +++ b/vendor/libunwind/src/mi/Ldestroy_addr_space.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gdestroy_addr_space.c" +#endif diff --git a/vendor/libunwind/src/mi/Ldyn-extract.c b/vendor/libunwind/src/mi/Ldyn-extract.c new file mode 100644 index 0000000000..1802f865f7 --- /dev/null +++ b/vendor/libunwind/src/mi/Ldyn-extract.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gdyn-extract.c" +#endif diff --git a/vendor/libunwind/src/mi/Lfind_dynamic_proc_info.c b/vendor/libunwind/src/mi/Lfind_dynamic_proc_info.c new file mode 100644 index 0000000000..bc88e1c53f --- /dev/null +++ b/vendor/libunwind/src/mi/Lfind_dynamic_proc_info.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gfind_dynamic_proc_info.c" +#endif diff --git a/vendor/libunwind/src/mi/Lget_accessors.c b/vendor/libunwind/src/mi/Lget_accessors.c new file mode 100644 index 0000000000..555e37f30d --- /dev/null +++ b/vendor/libunwind/src/mi/Lget_accessors.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gget_accessors.c" +#endif diff --git a/vendor/libunwind/src/mi/Lget_elf_filename.c b/vendor/libunwind/src/mi/Lget_elf_filename.c new file mode 100644 index 0000000000..6f24fdbdf2 --- /dev/null +++ b/vendor/libunwind/src/mi/Lget_elf_filename.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gget_elf_filename.c" +#endif diff --git a/vendor/libunwind/src/mi/Lget_fpreg.c b/vendor/libunwind/src/mi/Lget_fpreg.c new file mode 100644 index 0000000000..e3be441437 --- /dev/null +++ b/vendor/libunwind/src/mi/Lget_fpreg.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gget_fpreg.c" +#endif diff --git a/vendor/libunwind/src/mi/Lget_proc_info_by_ip.c b/vendor/libunwind/src/mi/Lget_proc_info_by_ip.c new file mode 100644 index 0000000000..96910d83e4 --- /dev/null +++ b/vendor/libunwind/src/mi/Lget_proc_info_by_ip.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gget_proc_info_by_ip.c" +#endif diff --git a/vendor/libunwind/src/mi/Lget_proc_name.c b/vendor/libunwind/src/mi/Lget_proc_name.c new file mode 100644 index 0000000000..378097b57a --- /dev/null +++ b/vendor/libunwind/src/mi/Lget_proc_name.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gget_proc_name.c" +#endif diff --git a/vendor/libunwind/src/mi/Lget_reg.c b/vendor/libunwind/src/mi/Lget_reg.c new file mode 100644 index 0000000000..effe8a8063 --- /dev/null +++ b/vendor/libunwind/src/mi/Lget_reg.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gget_reg.c" +#endif diff --git a/vendor/libunwind/src/mi/Lis_plt_entry.c b/vendor/libunwind/src/mi/Lis_plt_entry.c new file mode 100644 index 0000000000..e1ec8c10c7 --- /dev/null +++ b/vendor/libunwind/src/mi/Lis_plt_entry.c @@ -0,0 +1,33 @@ +/** + * Default implementation of unw_is_plt_entry() for those CPU-OS-ENV targets + * that don't need to specialize this function. + */ +/* + * Copyright 2024 Stephen M. Webb + * + * This file is part of libunwind. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#define UNW_LOCAL_ONLY +#include "libunwind_i.h" +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gis_plt_entry.c" +#endif diff --git a/vendor/libunwind/src/mi/Lput_dynamic_unwind_info.c b/vendor/libunwind/src/mi/Lput_dynamic_unwind_info.c new file mode 100644 index 0000000000..99597cd5fa --- /dev/null +++ b/vendor/libunwind/src/mi/Lput_dynamic_unwind_info.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gput_dynamic_unwind_info.c" +#endif diff --git a/vendor/libunwind/src/mi/Lset_cache_size.c b/vendor/libunwind/src/mi/Lset_cache_size.c new file mode 100644 index 0000000000..670f64d3a9 --- /dev/null +++ b/vendor/libunwind/src/mi/Lset_cache_size.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gset_cache_size.c" +#endif diff --git a/vendor/libunwind/src/mi/Lset_caching_policy.c b/vendor/libunwind/src/mi/Lset_caching_policy.c new file mode 100644 index 0000000000..cc18816b37 --- /dev/null +++ b/vendor/libunwind/src/mi/Lset_caching_policy.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gset_caching_policy.c" +#endif diff --git a/vendor/libunwind/src/mi/Lset_fpreg.c b/vendor/libunwind/src/mi/Lset_fpreg.c new file mode 100644 index 0000000000..2497d404f4 --- /dev/null +++ b/vendor/libunwind/src/mi/Lset_fpreg.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gset_fpreg.c" +#endif diff --git a/vendor/libunwind/src/mi/Lset_iterate_phdr_function.c b/vendor/libunwind/src/mi/Lset_iterate_phdr_function.c new file mode 100644 index 0000000000..67cef9519c --- /dev/null +++ b/vendor/libunwind/src/mi/Lset_iterate_phdr_function.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gset_iterate_phdr_function.c" +#endif diff --git a/vendor/libunwind/src/mi/Lset_reg.c b/vendor/libunwind/src/mi/Lset_reg.c new file mode 100644 index 0000000000..c7a872b016 --- /dev/null +++ b/vendor/libunwind/src/mi/Lset_reg.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gset_reg.c" +#endif diff --git a/vendor/libunwind/src/mi/_ReadSLEB.c b/vendor/libunwind/src/mi/_ReadSLEB.c new file mode 100644 index 0000000000..c041e37a05 --- /dev/null +++ b/vendor/libunwind/src/mi/_ReadSLEB.c @@ -0,0 +1,25 @@ +#include + +unw_word_t +_ReadSLEB (unsigned char **dpp) +{ + unsigned shift = 0; + unw_word_t byte, result = 0; + unsigned char *bp = *dpp; + + while (1) + { + byte = *bp++; + result |= (byte & 0x7f) << shift; + shift += 7; + if ((byte & 0x80) == 0) + break; + } + + if (shift < 8 * sizeof (unw_word_t) && (byte & 0x40) != 0) + /* sign-extend negative value */ + result |= ((unw_word_t) -1) << shift; + + *dpp = bp; + return result; +} diff --git a/vendor/libunwind/src/mi/_ReadULEB.c b/vendor/libunwind/src/mi/_ReadULEB.c new file mode 100644 index 0000000000..116f3e19bc --- /dev/null +++ b/vendor/libunwind/src/mi/_ReadULEB.c @@ -0,0 +1,20 @@ +#include + +unw_word_t +_ReadULEB (unsigned char **dpp) +{ + unsigned shift = 0; + unw_word_t byte, result = 0; + unsigned char *bp = *dpp; + + while (1) + { + byte = *bp++; + result |= (byte & 0x7f) << shift; + if ((byte & 0x80) == 0) + break; + shift += 7; + } + *dpp = bp; + return result; +} diff --git a/vendor/libunwind/src/mi/backtrace.c b/vendor/libunwind/src/mi/backtrace.c new file mode 100644 index 0000000000..e532b79d82 --- /dev/null +++ b/vendor/libunwind/src/mi/backtrace.c @@ -0,0 +1,124 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2001-2002 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#if !defined(UNW_REMOTE_ONLY) && !defined(UNW_LOCAL_ONLY) +#define UNW_LOCAL_ONLY + +#include +#include +#include + +/* See glibc manual for a description of this function. */ + +static ALWAYS_INLINE int +slow_backtrace (void **buffer, int size, unw_context_t *uc, int flag) +{ + unw_cursor_t cursor; + unw_word_t ip; + int n = 0; + + if (unlikely (unw_init_local2 (&cursor, uc, flag) < 0)) + return 0; + + + while (unw_step (&cursor) > 0) + { + if (n >= size) + return n; + + if (unw_get_reg (&cursor, UNW_REG_IP, &ip) < 0) + return n; + buffer[n++] = (void *) (uintptr_t) ip; + } + return n; +} + +int +unw_backtrace (void **buffer, int size) +{ + unw_cursor_t cursor; + unw_context_t uc; + int n = size; + + tdep_getcontext_trace (&uc); + + if (unlikely (unw_init_local (&cursor, &uc) < 0)) + return 0; + + if (unlikely (tdep_trace (&cursor, buffer, &n) < 0)) + { + unw_getcontext (&uc); + return slow_backtrace (buffer, size, &uc, 0); + } + + return n; +} + +int +unw_backtrace2 (void **buffer, int size, unw_context_t* uc2, int flag) +{ + if (size == 0) + return 0; + + if (uc2 == NULL) + return unw_backtrace(buffer, size); + + unw_cursor_t cursor; + // need to copy, because the context will be modified by tdep_trace + unw_context_t uc = *(unw_context_t*)uc2; + + if (unlikely (unw_init_local2 (&cursor, &uc, flag) < 0)) + return 0; + + // get the first ip from the context + unw_word_t ip; + + if (unw_get_reg (&cursor, UNW_REG_IP, &ip) < 0) + return 0; + + buffer[0] = (void *) (uintptr_t)ip; + + // update buffer info to collect the rest of the IPs + buffer = buffer+1; + int remaining_size = size-1; + + int n = remaining_size; + + // returns the number of frames collected by tdep_trace or slow_backtrace + // and add 1 to it (the one we retrieved above) + if (unlikely (tdep_trace (&cursor, buffer, &n) < 0)) + { + return slow_backtrace (buffer, remaining_size, &uc, flag) + 1; + } + + return n + 1; +} + +#ifdef CONFIG_WEAK_BACKTRACE +extern int backtrace (void **buffer, int size) + WEAK ALIAS(unw_backtrace); +#endif + +#endif /* !UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/src/mi/dyn-cancel.c b/vendor/libunwind/src/mi/dyn-cancel.c new file mode 100644 index 0000000000..9d7472d5fd --- /dev/null +++ b/vendor/libunwind/src/mi/dyn-cancel.c @@ -0,0 +1,46 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2001-2002, 2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +void +_U_dyn_cancel (unw_dyn_info_t *di) +{ + mutex_lock (&_U_dyn_info_list_lock); + { + ++_U_dyn_info_list.generation; + + if (di->prev) + di->prev->next = di->next; + else + _U_dyn_info_list.first = di->next; + + if (di->next) + di->next->prev = di->prev; + } + mutex_unlock (&_U_dyn_info_list_lock); + + di->next = di->prev = NULL; +} diff --git a/vendor/libunwind/src/mi/dyn-info-list.c b/vendor/libunwind/src/mi/dyn-info-list.c new file mode 100644 index 0000000000..1c7c55090a --- /dev/null +++ b/vendor/libunwind/src/mi/dyn-info-list.c @@ -0,0 +1,34 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2001-2002, 2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +HIDDEN unw_dyn_info_list_t _U_dyn_info_list; + +unw_word_t +_U_dyn_info_list_addr (void) +{ + return (unw_word_t) (uintptr_t) &_U_dyn_info_list; +} diff --git a/vendor/libunwind/src/mi/dyn-register.c b/vendor/libunwind/src/mi/dyn-register.c new file mode 100644 index 0000000000..efdad3de07 --- /dev/null +++ b/vendor/libunwind/src/mi/dyn-register.c @@ -0,0 +1,44 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2001-2002, 2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +HIDDEN define_lock (_U_dyn_info_list_lock); + +void +_U_dyn_register (unw_dyn_info_t *di) +{ + mutex_lock (&_U_dyn_info_list_lock); + { + ++_U_dyn_info_list.generation; + + di->next = _U_dyn_info_list.first; + di->prev = NULL; + if (di->next) + di->next->prev = di; + _U_dyn_info_list.first = di; + } + mutex_unlock (&_U_dyn_info_list_lock); +} diff --git a/vendor/libunwind/src/mi/flush_cache.c b/vendor/libunwind/src/mi/flush_cache.c new file mode 100644 index 0000000000..0ea78be892 --- /dev/null +++ b/vendor/libunwind/src/mi/flush_cache.c @@ -0,0 +1,57 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002-2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" +#include + +void +unw_flush_cache (unw_addr_space_t as, unw_word_t lo UNUSED, unw_word_t hi UNUSED) +{ +#if !UNW_TARGET_IA64 + struct unw_debug_frame_list *w = as->debug_frames; + + while (w) + { + struct unw_debug_frame_list *n = w->next; + + if (w->index) + mi_munmap (w->index, w->index_size); + + mi_munmap (w->debug_frame, w->debug_frame_size); + mi_munmap (w, sizeof (*w)); + w = n; + } + as->debug_frames = NULL; +#endif + + /* clear dyn_info_list_addr cache: */ + as->dyn_info_list_addr = 0; + + /* This lets us flush caches lazily. The implementation currently + ignores the flush range arguments (lo-hi). This is OK because + unw_flush_cache() is allowed to flush more than the requested + range. */ + atomic_fetch_add (&as->cache_generation, 1); +} diff --git a/vendor/libunwind/src/mi/init.c b/vendor/libunwind/src/mi/init.c new file mode 100644 index 0000000000..e4431eeb20 --- /dev/null +++ b/vendor/libunwind/src/mi/init.c @@ -0,0 +1,84 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002-2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +HIDDEN intrmask_t unwi_full_mask; + +static const char rcsid[] UNUSED = + "$Id: " PACKAGE_STRING " --- report bugs to " PACKAGE_BUGREPORT " $"; + +#if UNW_DEBUG + +/* Must not be declared HIDDEN because libunwind.so and + libunwind-PLATFORM.so will both define their own copies of this + variable and we want to use only one or the other when both + libraries are loaded. */ +long unwi_debug_level; + +#endif /* UNW_DEBUG */ +long unw_page_size; +static void +unw_init_page_size (void) +{ + errno = 0; + long result = sysconf (_SC_PAGESIZE); + if (result == -1) + { + if (errno != 0) + { + print_error ("Failed to get _SC_PAGESIZE: "); + print_error (strerror(errno)); + print_error ("\n"); + } + else + print_error ("Failed to get _SC_PAGESIZE, errno was not set.\n"); + + unw_page_size = 4096; + } + else + { + unw_page_size = result; + } +} + +HIDDEN void +mi_init (void) +{ +#if UNW_DEBUG + const char *str = getenv ("UNW_DEBUG_LEVEL"); + + if (str) + unwi_debug_level = atoi (str); + + if (unwi_debug_level > 0) + { + setbuf (stdout, NULL); + setbuf (stderr, NULL); + } +#endif + unw_init_page_size(); + assert(sizeof(struct cursor) <= sizeof(unw_cursor_t)); +} diff --git a/vendor/libunwind/src/mi/mempool.c b/vendor/libunwind/src/mi/mempool.c new file mode 100644 index 0000000000..a45f19e8c2 --- /dev/null +++ b/vendor/libunwind/src/mi/mempool.c @@ -0,0 +1,163 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002-2003, 2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + Copyright (C) 2012 Tommi Rantala + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" +#include +#include + +/* From GCC docs: ``Gcc also provides a target specific macro + * __BIGGEST_ALIGNMENT__, which is the largest alignment ever used for any data + * type on the target machine you are compiling for.'' */ +#ifdef __BIGGEST_ALIGNMENT__ +# define MAX_ALIGN __BIGGEST_ALIGNMENT__ +#else +/* Crude hack to check that MAX_ALIGN is power-of-two. + * sizeof(long double) = 12 on i386. */ +# define MAX_ALIGN_(n) (n < 8 ? 8 : \ + n < 16 ? 16 : n) +# define MAX_ALIGN MAX_ALIGN_(sizeof (long double)) +#endif + +static alignas(MAX_ALIGN) char sos_memory[SOS_MEMORY_SIZE]; +static _Atomic size_t sos_memory_freepos = 0; + +HIDDEN void * +sos_alloc (size_t size) +{ + size_t pos; + + size = UNW_ALIGN(size, MAX_ALIGN); + + /* Assume `sos_memory' is suitably aligned. */ + assert(((uintptr_t) &sos_memory[0] & (MAX_ALIGN-1)) == 0); + + pos = atomic_fetch_add (&sos_memory_freepos, size); + + assert (((uintptr_t) &sos_memory[pos] & (MAX_ALIGN-1)) == 0); + assert ((pos+size) <= SOS_MEMORY_SIZE); + + return &sos_memory[pos]; +} + +/* Must be called while holding the mempool lock. */ + +static void +free_object (struct mempool *pool, void *object) +{ + struct object *obj = object; + + obj->next = pool->free_list; + pool->free_list = obj; + ++pool->num_free; +} + +static void +add_memory (struct mempool *pool, char *mem, size_t size, size_t obj_size) +{ + char *obj; + + for (obj = mem; obj <= mem + size - obj_size; obj += obj_size) + free_object (pool, obj); +} + +static void +expand (struct mempool *pool) +{ + size_t size; + char *mem; + + size = pool->chunk_size; + GET_MEMORY (mem, size); + if (!mem) + { + size = UNW_ALIGN(pool->obj_size, unw_page_size); + GET_MEMORY (mem, size); + if (!mem) + { + /* last chance: try to allocate one object from the SOS memory */ + size = pool->obj_size; + mem = sos_alloc (size); + } + } + add_memory (pool, mem, size, pool->obj_size); +} + +HIDDEN void +mempool_init (struct mempool *pool, size_t obj_size, size_t reserve) +{ + memset (pool, 0, sizeof (*pool)); + + lock_init (&pool->lock); + + /* round object-size up to integer multiple of MAX_ALIGN */ + obj_size = UNW_ALIGN(obj_size, MAX_ALIGN); + + if (!reserve) + { + reserve = unw_page_size / obj_size / 4; + if (!reserve) + reserve = 16; + } + + pool->obj_size = obj_size; + pool->reserve = reserve; + pool->chunk_size = UNW_ALIGN(2*reserve*obj_size, unw_page_size); + + expand (pool); +} + +HIDDEN void * +mempool_alloc (struct mempool *pool) +{ + intrmask_t saved_mask; + struct object *obj; + + lock_acquire (&pool->lock, saved_mask); + { + if (pool->num_free <= pool->reserve) + expand (pool); + + assert (pool->num_free > 0); + + --pool->num_free; + obj = pool->free_list; + pool->free_list = obj->next; + } + lock_release (&pool->lock, saved_mask); + return obj; +} + +HIDDEN void +mempool_free (struct mempool *pool, void *object) +{ + intrmask_t saved_mask; + + lock_acquire (&pool->lock, saved_mask); + { + free_object (pool, object); + } + lock_release (&pool->lock, saved_mask); +} diff --git a/vendor/libunwind/src/mi/strerror.c b/vendor/libunwind/src/mi/strerror.c new file mode 100644 index 0000000000..2cec73d1db --- /dev/null +++ b/vendor/libunwind/src/mi/strerror.c @@ -0,0 +1,51 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2004 BEA Systems + Contributed by Thomas Hallgren + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +/* Returns the text corresponding to the given err_code or the + text "invalid error code" if the err_code is invalid. */ +const char * +unw_strerror (int err_code) +{ + const char *cp; + unw_error_t error = (unw_error_t)-err_code; + switch (error) + { + case UNW_ESUCCESS: cp = "no error"; break; + case UNW_EUNSPEC: cp = "unspecified (general) error"; break; + case UNW_ENOMEM: cp = "out of memory"; break; + case UNW_EBADREG: cp = "bad register number"; break; + case UNW_EREADONLYREG: cp = "attempt to write read-only register"; break; + case UNW_ESTOPUNWIND: cp = "stop unwinding"; break; + case UNW_EINVALIDIP: cp = "invalid IP"; break; + case UNW_EBADFRAME: cp = "bad frame"; break; + case UNW_EINVAL: cp = "unsupported operation or bad value"; break; + case UNW_EBADVERSION: cp = "unwind info has unsupported version"; break; + case UNW_ENOINFO: cp = "no unwind info found"; break; + default: cp = "invalid error code"; + } + return cp; +} diff --git a/vendor/libunwind/src/os-freebsd.c b/vendor/libunwind/src/os-freebsd.c new file mode 100644 index 0000000000..2d7c6bea92 --- /dev/null +++ b/vendor/libunwind/src/os-freebsd.c @@ -0,0 +1,170 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2010 Konstantin Belousov + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include +#include +#include +#include +#include +#include +#include + +#include "libunwind_i.h" + +static void * +get_mem(size_t sz) +{ + void *res; + + res = mi_mmap(NULL, sz, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0); + if (res == MAP_FAILED) + return (NULL); + return (res); +} + +static void +free_mem(void *ptr, size_t sz) +{ + mi_munmap(ptr, sz); +} + +static int +get_pid_by_tid(int tid) +{ + int mib[3], error; + size_t len, len1; + char *buf; + struct kinfo_proc *kv; + unsigned i, pid; + + len = 0; + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_ALL; + + error = sysctl(mib, 3, NULL, &len, NULL, 0); + if (error == -1) + return (-1); + len1 = len * 4 / 3; + buf = get_mem(len1); + if (buf == NULL) + return (-1); + len = len1; + error = sysctl(mib, 3, buf, &len, NULL, 0); + if (error == -1) { + free_mem(buf, len1); + return (-1); + } + pid = -1; + for (i = 0, kv = (struct kinfo_proc *)buf; i < len / sizeof(*kv); + i++, kv++) { + if (kv->ki_tid == tid) { + pid = kv->ki_pid; + break; + } + } + free_mem(buf, len1); + return (pid); +} + +int +tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, char *path, size_t pathlen) +{ + int mib[4], error, ret; + size_t len, len1; + char *buf, *bp, *eb; + struct kinfo_vmentry *kv; + + len = 0; + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_VMMAP; + mib[3] = pid; + + error = sysctl(mib, 4, NULL, &len, NULL, 0); + if (error == -1) { + if (errno == ESRCH) { + mib[3] = get_pid_by_tid(pid); + if (mib[3] != -1) + error = sysctl(mib, 4, NULL, &len, NULL, 0); + if (error == -1) + return (-UNW_EUNSPEC); + } else + return (-UNW_EUNSPEC); + } + len1 = len * 4 / 3; + buf = get_mem(len1); + if (buf == NULL) + return (-UNW_EUNSPEC); + len = len1; + error = sysctl(mib, 4, buf, &len, NULL, 0); + if (error == -1) { + free_mem(buf, len1); + return (-UNW_EUNSPEC); + } + ret = -UNW_EUNSPEC; + for (bp = buf, eb = buf + len; bp < eb; bp += kv->kve_structsize) { + kv = (struct kinfo_vmentry *)(uintptr_t)bp; + if (ip < kv->kve_start || ip >= kv->kve_end) + continue; + if (kv->kve_type != KVME_TYPE_VNODE) + continue; + *segbase = kv->kve_start; + *mapoff = kv->kve_offset; + if (path) + { + strncpy(path, kv->kve_path, pathlen); + path[pathlen - 1] = '\0'; + } + if (ei) + ret = elf_map_image (ei, kv->kve_path); + else + ret = strlen (kv->kve_path) >= pathlen ? -UNW_ENOMEM : UNW_ESUCCESS; + break; + } + free_mem(buf, len1); + return (ret); +} + +#ifndef UNW_REMOTE_ONLY + +void +tdep_get_exe_image_path (char *path) +{ + int mib[4], error; + size_t len; + + len = 0; + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_PATHNAME; + mib[3] = getpid(); + + error = sysctl(mib, 4, path, &len, NULL, 0); + if (error == -1) + path[0] = 0; +} + +#endif diff --git a/vendor/libunwind/src/os-hpux.c b/vendor/libunwind/src/os-hpux.c new file mode 100644 index 0000000000..7b8a2313cf --- /dev/null +++ b/vendor/libunwind/src/os-hpux.c @@ -0,0 +1,83 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include +#include +#include + +#include "libunwind_i.h" + +#include "elf64.h" + +HIDDEN int +tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen) +{ + struct load_module_desc lmd; + const char *path2; + int ret; + + if (pid != getpid ()) + { + printf ("%s: remote case not implemented yet\n", __FUNCTION__); + return -UNW_ENOINFO; + } + + if (!dlmodinfo (ip, &lmd, sizeof (lmd), NULL, 0, 0)) + return -UNW_ENOINFO; + + *segbase = lmd.text_base; + *mapoff = 0; /* XXX fix me? */ + + path2 = dlgetname (&lmd, sizeof (lmd), NULL, 0, 0); + if (!path2) + return -UNW_ENOINFO; + if (path) + { + strncpy(path, path2, pathlen); + path[pathlen - 1] = '\0'; + if (strcmp(path, path2) != 0) + Debug(1, "buffer size (%d) not big enough to hold path\n", pathlen); + } + Debug(1, "segbase=%lx, mapoff=%lx, path=%s\n", *segbase, *mapoff, path); + + if (ei) + ret = elf_map_image (ei, path); + else + ret = strlen (path2) >= path ? -UNW_ENOMEM : UNW_ESUCCESS; + return ret; +} + +#ifndef UNW_REMOTE_ONLY + +void +tdep_get_exe_image_path (char *path) +{ + path[0] = 0; /* XXX */ +} + +#endif + diff --git a/vendor/libunwind/src/os-linux.c b/vendor/libunwind/src/os-linux.c new file mode 100644 index 0000000000..b47abc394b --- /dev/null +++ b/vendor/libunwind/src/os-linux.c @@ -0,0 +1,122 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include +#include +#include +#include +#include +#include + +#include "libunwind_i.h" +#include "os-linux.h" + +int +tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen) +{ + struct map_iterator mi; + int found = 0, rc = UNW_ESUCCESS; + unsigned long hi; + char root[sizeof ("/proc/0123456789/root")], *cp; + char *full_path; + struct stat st; + + if (maps_init (&mi, pid) < 0) + return -1; + + while (maps_next (&mi, segbase, &hi, mapoff, NULL)) + if (ip >= *segbase && ip < hi) + { + found = 1; + break; + } + + if (!found) + { + maps_close (&mi); + return -1; + } + + // get path only, no need to map elf image + if (!ei && path) + { + strncpy(path, mi.path, pathlen); + path[pathlen - 1] = '\0'; + if (strlen(mi.path) >= pathlen) + rc = -UNW_ENOMEM; + + maps_close (&mi); + return rc; + } + + full_path = mi.path; + + /* Get process root */ + memcpy (root, "/proc/", 6); + cp = unw_ltoa (root + 6, pid); + assert (cp + 6 < root + sizeof (root)); + memcpy (cp, "/root", 6); + + size_t _len = strlen (mi.path) + 1; + if (!stat(root, &st) && S_ISDIR(st.st_mode)) + _len += strlen (root); + else + root[0] = '\0'; + + full_path = path; + if(!path) + full_path = (char*) malloc (_len); + else if(_len >= pathlen) // passed buffer is too small, fail + { + maps_close (&mi); + return -1; + } + + strcpy (full_path, root); + strcat (full_path, mi.path); + + if (stat(full_path, &st) || !S_ISREG(st.st_mode)) + strcpy(full_path, mi.path); + + rc = elf_map_image (ei, full_path); + + if (!path) + free (full_path); + + maps_close (&mi); + return rc; +} + +#ifndef UNW_REMOTE_ONLY + +void +tdep_get_exe_image_path (char *path) +{ + strcpy(path, "/proc/self/exe"); +} + +#endif /* !UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/src/os-linux.h b/vendor/libunwind/src/os-linux.h new file mode 100644 index 0000000000..fb1d4f50fd --- /dev/null +++ b/vendor/libunwind/src/os-linux.h @@ -0,0 +1,313 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + Copyright (C) 2007 David Mosberger-Tang + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef os_linux_h +#define os_linux_h + +struct map_iterator + { + off_t offset; + int fd; + size_t buf_size; + char *buf; + char *buf_end; + char *path; + }; + +static inline char * +unw_ltoa (char *buf, long val) +{ + char *cp = buf, tmp; + ssize_t i, len; + + do + { + *cp++ = '0' + (val % 10); + val /= 10; + } + while (val); + + /* reverse the order of the digits: */ + len = cp - buf; + --cp; + for (i = 0; i < len / 2; ++i) + { + tmp = buf[i]; + buf[i] = cp[-i]; + cp[-i] = tmp; + } + return buf + len; +} + +static inline int +maps_init (struct map_iterator *mi, pid_t pid) +{ + char path[sizeof ("/proc/0123456789/maps")], *cp; + + memcpy (path, "/proc/", 6); + cp = unw_ltoa (path + 6, pid); + assert (cp + 6 < path + sizeof (path)); + memcpy (cp, "/maps", 6); + + mi->fd = open (path, O_RDONLY); + if (mi->fd >= 0) + { + /* Try to allocate a page-sized buffer. */ + mi->buf_size = getpagesize (); + GET_MEMORY (cp, mi->buf_size); + if (!cp) + { + close(mi->fd); + mi->fd = -1; + return -1; + } + else + { + mi->offset = 0; + mi->buf = mi->buf_end = cp + mi->buf_size; + return 0; + } + } + return -1; +} + +static inline char * +skip_whitespace (char *cp) +{ + if (!cp) + return NULL; + + while (*cp == ' ' || *cp == '\t') + ++cp; + return cp; +} + +static inline char * +scan_hex (char *cp, unsigned long *valp) +{ + unsigned long num_digits = 0, digit, val = 0; + + cp = skip_whitespace (cp); + if (!cp) + return NULL; + + while (1) + { + digit = *cp; + if ((digit - '0') <= 9) + digit -= '0'; + else if ((digit - 'A') < 6) + digit -= 'A' - 10; + else if ((digit - 'a') < 6) + digit -= 'a' - 10; + else + break; + val = (val << 4) | digit; + ++num_digits; + ++cp; + } + if (!num_digits) + return NULL; + *valp = val; + return cp; +} + +static inline char * +scan_dec (char *cp, unsigned long *valp) +{ + unsigned long num_digits = 0, digit, val = 0; + + if (!(cp = skip_whitespace (cp))) + return NULL; + + while (1) + { + digit = *cp; + if ((digit - '0') <= 9) + { + digit -= '0'; + ++cp; + } + else + break; + val = (10 * val) + digit; + ++num_digits; + } + if (!num_digits) + return NULL; + *valp = val; + return cp; +} + +static inline char * +scan_char (char *cp, char *valp) +{ + if (!cp) + return NULL; + + *valp = *cp; + + /* don't step over NUL terminator */ + if (*cp) + ++cp; + return cp; +} + +/* Scan a string delimited by white-space. Fails on empty string or + if string is doesn't fit in the specified buffer. */ +static inline char * +scan_string (char *cp, char *valp, size_t buf_size) +{ + size_t i = 0; + + if (!(cp = skip_whitespace (cp))) + return NULL; + + while (*cp != ' ' && *cp != '\t' && *cp != '\0') + { + if ((valp != NULL) && (i < buf_size - 1)) + valp[i++] = *cp; + ++cp; + } + if (i == 0 || i >= buf_size) + return NULL; + valp[i] = '\0'; + return cp; +} + +static inline int +maps_next (struct map_iterator *mi, + unsigned long *low, unsigned long *high, unsigned long *offset, + unsigned long *flags) +{ + char perm[16], dash = 0, colon = 0, *cp; + unsigned long major, minor, inum; + ssize_t i, nread; + + if (mi->fd < 0) + return 0; + + while (1) + { + ssize_t bytes_left = mi->buf_end - mi->buf; + char *eol = NULL; + + for (i = 0; i < bytes_left; ++i) + { + if (mi->buf[i] == '\n') + { + eol = mi->buf + i; + break; + } + else if (mi->buf[i] == '\0') + break; + } + if (!eol) + { + /* copy down the remaining bytes, if any */ + if (bytes_left > 0) + memmove (mi->buf_end - mi->buf_size, mi->buf, bytes_left); + + mi->buf = mi->buf_end - mi->buf_size; + nread = read (mi->fd, mi->buf + bytes_left, + mi->buf_size - bytes_left); + if (nread <= 0) + return 0; + else if ((size_t) (nread + bytes_left) < mi->buf_size) + { + /* Move contents to the end of the buffer so we + maintain the invariant that all bytes between + mi->buf and mi->buf_end are valid. */ + memmove (mi->buf_end - nread - bytes_left, mi->buf, + nread + bytes_left); + mi->buf = mi->buf_end - nread - bytes_left; + } + + eol = mi->buf + bytes_left + nread - 1; + + for (i = bytes_left; i < bytes_left + nread; ++i) + if (mi->buf[i] == '\n') + { + eol = mi->buf + i; + break; + } + } + cp = mi->buf; + mi->buf = eol + 1; + *eol = '\0'; + + /* scan: "LOW-HIGH PERM OFFSET MAJOR:MINOR INUM PATH" */ + cp = scan_hex (cp, low); + cp = scan_char (cp, &dash); + cp = scan_hex (cp, high); + cp = scan_string (cp, perm, sizeof (perm)); + cp = scan_hex (cp, offset); + cp = scan_hex (cp, &major); + cp = scan_char (cp, &colon); + cp = scan_hex (cp, &minor); + cp = scan_dec (cp, &inum); + cp = mi->path = skip_whitespace (cp); + if (!cp) + continue; + cp = scan_string (cp, NULL, 0); + if (dash != '-' || colon != ':') + continue; /* skip line with unknown or bad format */ + if (flags) + { + *flags = 0; + if (perm[0] == 'r') + { + *flags |= PROT_READ; + } + if (perm[1] == 'w') + { + *flags |= PROT_WRITE; + } + if (perm[2] == 'x') + { + *flags |= PROT_EXEC; + } + } + return 1; + } + return 0; +} + +static inline void +maps_close (struct map_iterator *mi) +{ + if (mi->fd < 0) + return; + close (mi->fd); + mi->fd = -1; + if (mi->buf) + { + mi_munmap (mi->buf_end - mi->buf_size, mi->buf_size); + mi->buf = mi->buf_end = NULL; + } +} + +#endif /* os_linux_h */ diff --git a/vendor/libunwind/src/os-qnx.c b/vendor/libunwind/src/os-qnx.c new file mode 100644 index 0000000000..f306929e67 --- /dev/null +++ b/vendor/libunwind/src/os-qnx.c @@ -0,0 +1,341 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2013 Garmin International + Contributed by Matt Fischer + Copyright (c) 2022-2023 BlackBerry Limited. All rights reserved. + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" +#include "os-qnx.h" + +#include +#include +#include +#include +#include +#include + + +#if __PTR_BITS__ == 32 +typedef Elf32_Ehdr elf_ehdr_t; +typedef Elf32_Phdr elf_phdr_t; +#else +typedef Elf64_Ehdr elf_ehdr_t; +typedef Elf64_Phdr elf_phdr_t; +#endif + +struct cb_info +{ + unw_word_t ip; + unsigned long segbase; + unsigned long offset; + const char *path; +}; + +static int +phdr_callback(const struct dl_phdr_info *info, size_t size, void *data) +{ + int i; + struct cb_info *cbi = (struct cb_info*)data; + for(i=0; idlpi_phnum; i++) + { + unw_word_t segbase = info->dlpi_addr + info->dlpi_phdr[i].p_vaddr; + if(cbi->ip >= segbase && cbi->ip < segbase + info->dlpi_phdr[i].p_memsz) + { + cbi->path = info->dlpi_name; + cbi->offset = info->dlpi_phdr[i].p_offset; + cbi->segbase = segbase; + return 1; + } + } + + return 0; +} + + +/** + * Gets the number of mapped segments loaded in the target process image. + * + * @param[in] ctl_fd file descriptor for the process control file + * + * @returns the number of mapped segments loaded in the process image. + */ +static int +_get_map_count(int ctl_fd) +{ + int count = 0; + int err = devctl(ctl_fd, DCMD_PROC_MAPINFO, NULL, 0, &count); + if (err != EOK) + { + fprintf(stderr, "error %d in devctl(DCMD_PROC_MAPINFO): %s\n", err, strerror(err)); + return 0; + } + + return count; +} + + +/** + * Read some bytes from the procfs address space file for the target process. + * + * @param[in] as_fd file descriptor of te opened address space file + * @param[in] pos offset within the file to start the read + * @param[in] sz number of bytes to read + * @param[out] buf destination in which to read the bytes + * + * @returns the number of bytes read. On failure to read, a byte count of 0 is + * returned and errno is set appropriately. + */ +static int +_read_procfs_as(int as_fd, + uintptr_t pos, + size_t sz, + void *buf) +{ + if (lseek(as_fd, (off_t)pos, SEEK_SET) == -1) + { + fprintf(stderr, "error %d in lseek(%" PRIxPTR "): %s\n", errno, pos, strerror(errno)); + return 0; + } + + size_t bytes_read = 0; + for (size_t readn = sz; readn > 0; ) + { + int ret = read(as_fd, buf + bytes_read, readn); + if (ret <= 0) + { + if (errno == EINTR || errno == EAGAIN) + { + continue; + } + else if (ret == 0) + { + errno = EFAULT; + } + return 0; + } + bytes_read += ret; + readn -= ret; + } + + return sz; +} + + +/** + * Indicate of a chunk of memory is a valid ELF header. + * + * @param[in] e_ident A (putative) ELF header + * + * @return true if it's a valid ELF header, false otherwise. + */ +static bool +_is_elf_header(unsigned char e_ident[EI_NIDENT]) +{ + return e_ident[EI_MAG0] == ELFMAG0 + && e_ident[EI_MAG1] == ELFMAG1 + && e_ident[EI_MAG2] == ELFMAG2 + && e_ident[EI_MAG3] == ELFMAG3; +} + + +static int +_get_remote_elf_image(struct elf_image *ei, + pid_t pid, + unw_word_t ip, + unsigned long *segbase, + unsigned long *mapoff, + char *path, + size_t pathlen) +{ + int ret = -UNW_ENOINFO; + + union + { + procfs_debuginfo i; + char path[PATH_MAX]; + } debug_info; + + int ctl_fd = unw_nto_procfs_open_ctl(pid); + if (ctl_fd < 0) + { + fprintf(stderr, "error %d opening procfs ctl file for pid %d: %s\n", + errno, pid, strerror(errno)); + return ret; + } + + int as_fd = unw_nto_procfs_open_as(pid); + if (as_fd < 0) + { + fprintf(stderr, "error %d opening procfs as file for pid %d: %s\n", + errno, pid, strerror(errno)); + close(ctl_fd); + return -UNW_ENOINFO; + } + + int map_count = _get_map_count(ctl_fd); + size_t maps_size = sizeof(procfs_mapinfo) * map_count; + procfs_mapinfo *maps = malloc(maps_size); + if (maps == NULL) + { + fprintf(stderr, "error %d in malloc(%zu): %s", errno, maps_size, strerror(errno)); + close (as_fd); + close (ctl_fd); + return -UNW_ENOINFO; + } + + int nmaps = 0; + ret = devctl(ctl_fd, DCMD_PROC_MAPINFO, maps, maps_size, &nmaps); + if (ret != EOK) + { + fprintf(stderr, "error %d in devctl(DCMD_PROC_MAPINFO): %s", ret, strerror(ret)); + free(maps); + close (as_fd); + close (ctl_fd); + return -UNW_ENOINFO; + } + + int i = 0; + for (; i < nmaps; ++i) + { + if (maps[i].flags & (MAP_ELF | PROT_EXEC)) + { + uintptr_t vaddr = maps[i].vaddr; + + elf_ehdr_t elf_ehdr; + ret = _read_procfs_as(as_fd, vaddr, sizeof(elf_ehdr), &elf_ehdr); + if (ret != sizeof(elf_ehdr)) + { + continue; + } + + /* Skip region if it's not an ELF segment. */ + if (!_is_elf_header(elf_ehdr.e_ident)) + { + continue; + } + size_t size = elf_ehdr.e_ehsize; + + debug_info.i.vaddr = vaddr; + debug_info.i.path[0]=0; + ret = devctl(ctl_fd, DCMD_PROC_MAPDEBUG, &debug_info, sizeof(debug_info), 0); + if (ret != EOK) + { + fprintf(stderr, "error %d in devctl(DCMD_PROC_MAPDEBUG): %s", ret, strerror(ret)); + continue; + } + uintptr_t reloc = debug_info.i.vaddr; + + elf_phdr_t elf_phdr; + uintptr_t phdr_offset = vaddr + elf_ehdr.e_phoff; + for (int i = 0; i < elf_ehdr.e_phnum; ++i, phdr_offset+=elf_ehdr.e_phentsize) + { + ret = _read_procfs_as(as_fd, phdr_offset, sizeof(elf_phdr_t), &elf_phdr); + if (ret == -1) + { + continue; + } + if (elf_phdr.p_type == PT_LOAD && !(elf_phdr.p_flags&PF_W)) + { + size += elf_phdr.p_memsz; + } + } + + /* Skip segment if the IP is not contained within it. */ + if ((ip < vaddr) || (ip >= (vaddr + size))) + { + continue; + } + + *segbase = vaddr; + *mapoff = reloc; + if (path) + { + strncpy(path, debug_info.i.path, pathlen); + path[pathlen - 1] = '\0'; + } + + if (ei) + ret = elf_map_image(ei, path); + else + ret = strlen (debug_info.i.path) >= pathlen ? -UNW_ENOMEM : UNW_ESUCCESS; + + break; + } + } + + free(maps); + close(as_fd); + close(ctl_fd); + return i == nmaps ? -UNW_ENOINFO : ret; +} + + +int +tdep_get_elf_image(struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen) +{ + int ret = -UNW_ENOINFO; + if (pid != getpid()) + { + ret = _get_remote_elf_image(ei, pid, ip, segbase, mapoff, path, pathlen); + return ret; + } + else + { + struct cb_info cbi; + cbi.ip = ip; + cbi.segbase = 0; + cbi.offset = 0; + cbi.path = NULL; + + if (dl_iterate_phdr (phdr_callback, &cbi) != 0) + { + if (path) + { + strncpy (path, cbi.path, pathlen); + path[pathlen - 1] = '\0'; + } + + *mapoff = cbi.offset; + *segbase = cbi.segbase; + + if (ei) + ret = elf_map_image (ei, cbi.path); + else + ret = strlen (cbi.path) >= pathlen ? -UNW_ENOMEM : UNW_ESUCCESS; + } + } + + return ret; +} + +#ifndef UNW_REMOTE_ONLY + +void +tdep_get_exe_image_path (char *path) +{ + path[0] = 0; /* XXX */ +} + +#endif diff --git a/vendor/libunwind/src/os-solaris.c b/vendor/libunwind/src/os-solaris.c new file mode 100644 index 0000000000..032bacf671 --- /dev/null +++ b/vendor/libunwind/src/os-solaris.c @@ -0,0 +1,80 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include +#include + +#include "libunwind_i.h" +#include "os-linux.h" // using linux header for map_iterator implementation + +int +tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, + unsigned long *segbase, unsigned long *mapoff, + char *path, size_t pathlen) +{ + struct map_iterator mi; + int found = 0, rc = UNW_ESUCCESS; + unsigned long hi; + + if (maps_init (&mi, pid) < 0) + return -1; + + while (maps_next (&mi, segbase, &hi, mapoff, NULL)) + if (ip >= *segbase && ip < hi) + { + found = 1; + break; + } + + if (!found) + { + maps_close (&mi); + return -1; + } + + if (path) + { + strncpy(path, mi.path, pathlen); + path[pathlen - 1] = '\0'; + } + + if (ei) + rc = elf_map_image (ei, mi.path); + else + rc = strlen(mi.path) >= pathlen ? -UNW_ENOMEM : UNW_ESUCCESS:; + + maps_close (&mi); + return rc; +} + +#ifndef UNW_REMOTE_ONLY + +void +tdep_get_exe_image_path (char *path) +{ + strcpy(path, getexecname()); +} + +#endif /* !UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/src/riscv/Gapply_reg_state.c b/vendor/libunwind/src/riscv/Gapply_reg_state.c new file mode 100644 index 0000000000..09299ac585 --- /dev/null +++ b/vendor/libunwind/src/riscv/Gapply_reg_state.c @@ -0,0 +1,36 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + Copyright (c) 2004 Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +int +unw_apply_reg_state (unw_cursor_t *cursor, + void *reg_states_data) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_apply_reg_state (&c->dwarf, (dwarf_reg_state_t *)reg_states_data); +} diff --git a/vendor/libunwind/src/riscv/Gcreate_addr_space.c b/vendor/libunwind/src/riscv/Gcreate_addr_space.c new file mode 100644 index 0000000000..5cf016417d --- /dev/null +++ b/vendor/libunwind/src/riscv/Gcreate_addr_space.c @@ -0,0 +1,54 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2014 Tilera Corp. + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include + +#include "unwind_i.h" + +unw_addr_space_t +unw_create_addr_space (unw_accessors_t *a, int byte_order) +{ +#ifdef UNW_LOCAL_ONLY + return NULL; +#else + unw_addr_space_t as; + + /* + * We only support little-endian for now. + */ + if (byte_order != 0 && byte_order != __LITTLE_ENDIAN) + return NULL; + + as = malloc (sizeof (*as)); + if (!as) + return NULL; + + memset (as, 0, sizeof (*as)); + + as->acc = *a; + + return as; +#endif +} diff --git a/vendor/libunwind/src/riscv/Gget_proc_info.c b/vendor/libunwind/src/riscv/Gget_proc_info.c new file mode 100644 index 0000000000..ff11c59bda --- /dev/null +++ b/vendor/libunwind/src/riscv/Gget_proc_info.c @@ -0,0 +1,45 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +int +unw_get_proc_info (unw_cursor_t *cursor, unw_proc_info_t *pi) +{ + struct cursor *c = (struct cursor *) cursor; + int ret; + + ret = dwarf_make_proc_info (&c->dwarf); + + if (ret < 0) { + /* No DWARF info? */ + memset (pi, 0, sizeof (*pi)); + pi->start_ip = c->dwarf.ip; + pi->end_ip = c->dwarf.ip + 1; + return 0; + } + + *pi = c->dwarf.pi; + return 0; +} diff --git a/vendor/libunwind/src/riscv/Gget_save_loc.c b/vendor/libunwind/src/riscv/Gget_save_loc.c new file mode 100644 index 0000000000..342f8654fb --- /dev/null +++ b/vendor/libunwind/src/riscv/Gget_save_loc.c @@ -0,0 +1,97 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2021 Zhaofeng Li + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +int +unw_get_save_loc (unw_cursor_t *cursor, int reg, unw_save_loc_t *sloc) +{ + struct cursor *c = (struct cursor *) cursor; + dwarf_loc_t loc; + + switch (reg) + { + case UNW_RISCV_X1: + case UNW_RISCV_X2: + case UNW_RISCV_X3: + case UNW_RISCV_X4: + case UNW_RISCV_X5: + case UNW_RISCV_X6: + case UNW_RISCV_X7: + case UNW_RISCV_X8: + case UNW_RISCV_X9: + case UNW_RISCV_X10: + case UNW_RISCV_X11: + case UNW_RISCV_X12: + case UNW_RISCV_X13: + case UNW_RISCV_X14: + case UNW_RISCV_X15: + case UNW_RISCV_X16: + case UNW_RISCV_X17: + case UNW_RISCV_X18: + case UNW_RISCV_X19: + case UNW_RISCV_X20: + case UNW_RISCV_X21: + case UNW_RISCV_X22: + case UNW_RISCV_X23: + case UNW_RISCV_X24: + case UNW_RISCV_X25: + case UNW_RISCV_X26: + case UNW_RISCV_X27: + case UNW_RISCV_X28: + case UNW_RISCV_X29: + case UNW_RISCV_X30: + case UNW_RISCV_X31: + case UNW_RISCV_PC: + loc = c->dwarf.loc[reg - UNW_RISCV_X0]; + break; + + default: + loc = DWARF_NULL_LOC; /* default to "not saved" */ + break; + } + + memset (sloc, 0, sizeof (*sloc)); + + if (DWARF_IS_NULL_LOC (loc)) + { + sloc->type = UNW_SLT_NONE; + return 0; + } + +#if !defined(UNW_LOCAL_ONLY) + if (DWARF_IS_REG_LOC (loc)) + { + sloc->type = UNW_SLT_REG; + sloc->u.regnum = DWARF_GET_LOC (loc); + } + else +#endif + { + sloc->type = UNW_SLT_MEMORY; + sloc->u.addr = DWARF_GET_LOC (loc); + } + return 0; +} diff --git a/vendor/libunwind/src/riscv/Gglobal.c b/vendor/libunwind/src/riscv/Gglobal.c new file mode 100644 index 0000000000..9ad2e31884 --- /dev/null +++ b/vendor/libunwind/src/riscv/Gglobal.c @@ -0,0 +1,126 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2021 Zhaofeng Li + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" +#include "dwarf_i.h" + +HIDDEN define_lock (riscv_lock); +HIDDEN atomic_bool tdep_init_done = 0; + +/* Our ordering is already consistent with + https://github.com/riscv/riscv-elf-psabi-doc/blob/74ecf07bcebd0cb4bf3c39f3f9d96946cd6aba61/riscv-elf.md#dwarf-register-numbers- */ +HIDDEN const uint8_t dwarf_to_unw_regnum_map[] = + { + UNW_RISCV_X0, + UNW_RISCV_X1, + UNW_RISCV_X2, + UNW_RISCV_X3, + UNW_RISCV_X4, + UNW_RISCV_X5, + UNW_RISCV_X6, + UNW_RISCV_X7, + UNW_RISCV_X8, + UNW_RISCV_X9, + UNW_RISCV_X10, + UNW_RISCV_X11, + UNW_RISCV_X12, + UNW_RISCV_X13, + UNW_RISCV_X14, + UNW_RISCV_X15, + UNW_RISCV_X16, + UNW_RISCV_X17, + UNW_RISCV_X18, + UNW_RISCV_X19, + UNW_RISCV_X20, + UNW_RISCV_X21, + UNW_RISCV_X22, + UNW_RISCV_X23, + UNW_RISCV_X24, + UNW_RISCV_X25, + UNW_RISCV_X26, + UNW_RISCV_X27, + UNW_RISCV_X28, + UNW_RISCV_X29, + UNW_RISCV_X30, + UNW_RISCV_X31, + + UNW_RISCV_F0, + UNW_RISCV_F1, + UNW_RISCV_F2, + UNW_RISCV_F3, + UNW_RISCV_F4, + UNW_RISCV_F5, + UNW_RISCV_F6, + UNW_RISCV_F7, + UNW_RISCV_F8, + UNW_RISCV_F9, + UNW_RISCV_F10, + UNW_RISCV_F11, + UNW_RISCV_F12, + UNW_RISCV_F13, + UNW_RISCV_F14, + UNW_RISCV_F15, + UNW_RISCV_F16, + UNW_RISCV_F17, + UNW_RISCV_F18, + UNW_RISCV_F19, + UNW_RISCV_F20, + UNW_RISCV_F21, + UNW_RISCV_F22, + UNW_RISCV_F23, + UNW_RISCV_F24, + UNW_RISCV_F25, + UNW_RISCV_F26, + UNW_RISCV_F27, + UNW_RISCV_F28, + UNW_RISCV_F29, + UNW_RISCV_F30, + UNW_RISCV_F31, + }; + +HIDDEN void +tdep_init (void) +{ + intrmask_t saved_mask; + + sigfillset (&unwi_full_mask); + + lock_acquire (&riscv_lock, saved_mask); + + if (atomic_load(&tdep_init_done)) + /* another thread else beat us to it... */ + goto out; + + mi_init (); + dwarf_init (); + +#ifndef UNW_REMOTE_ONLY + riscv_local_addr_space_init (); +#endif + atomic_store(&tdep_init_done, 1); /* signal that we're initialized... */ + + out: + lock_release (&riscv_lock, saved_mask); +} diff --git a/vendor/libunwind/src/riscv/Ginit.c b/vendor/libunwind/src/riscv/Ginit.c new file mode 100644 index 0000000000..861197be32 --- /dev/null +++ b/vendor/libunwind/src/riscv/Ginit.c @@ -0,0 +1,229 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2012 Tommi Rantala + Copyright (C) 2013 Linaro Limited + Copyright (C) 2021 Zhaofeng Li + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include +#include +#include + +#include "unwind_i.h" + +#ifdef UNW_REMOTE_ONLY + +/* unw_local_addr_space is a NULL pointer in this case. */ +unw_addr_space_t unw_local_addr_space; + +#else /* !UNW_REMOTE_ONLY */ + +static struct unw_addr_space local_addr_space; + +unw_addr_space_t unw_local_addr_space = &local_addr_space; + +/* + NB: as_arg is the cursor (see Ginit_local.c) +*/ + +static inline void * +uc_addr (unw_context_t *uc, int reg) +{ + /* FIXME: Floating-point? */ + + unw_word_t *regs = (unw_word_t*)&uc->uc_mcontext; + if (reg >= UNW_RISCV_X1 && reg <= UNW_RISCV_X31) + return ®s[reg]; + else if (reg >= UNW_RISCV_F0 && reg <= UNW_RISCV_F31) + { + unw_fpreg_t *fpregs = (unw_fpreg_t*)(regs + 32); + return &fpregs[reg - UNW_RISCV_F0]; + } + else if (reg == UNW_RISCV_PC) + return ®s[0]; + else + return NULL; +} + +# ifdef UNW_LOCAL_ONLY + +HIDDEN void * +tdep_uc_addr (unw_context_t *uc, int reg) +{ + return uc_addr (uc, reg); +} + +# endif /* UNW_LOCAL_ONLY */ + +static void +put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg) +{ + /* it's a no-op */ +} + +static int +get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) +{ +#ifndef UNW_LOCAL_ONLY +# pragma weak _U_dyn_info_list_addr + if (!_U_dyn_info_list_addr) + return -UNW_ENOINFO; +#endif + // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. + *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; +} + + +static int +access_mem (unw_addr_space_t as, unw_word_t addr, unw_word_t *val, int write, + void *arg) +{ + if (write) + { + Debug (16, "mem[%p] <- %lx\n", addr, *val); + *(unw_word_t *) (intptr_t) addr = *val; + } + else + { + /* validate address */ + const struct cursor *c = (const struct cursor *)arg; + + if (likely (c != NULL) && unlikely (c->validate) + && unlikely (!unw_address_is_valid (addr, sizeof(unw_word_t)))) { + Debug (16, "mem[%016lx] -> invalid\n", addr); + return -1; + } + memcpy (val, (void *) addr, sizeof(unw_word_t)); + Debug (16, "mem[%lx] -> %lx\n", addr, *val); + } + return 0; +} + +static int +access_reg (unw_addr_space_t as, unw_regnum_t reg, unw_word_t *val, int write, + void *arg) +{ + unw_word_t *addr; + unw_tdep_context_t *uc = ((struct cursor *)arg)->uc; + + if (unw_is_fpreg (reg)) + goto badreg; + + Debug (16, "reg = %s\n", unw_regname (reg)); + if (!(addr = uc_addr (uc, reg))) + goto badreg; + + if (write) + { + *addr = *val; + Debug (12, "%s <- %lx\n", unw_regname (reg), *val); + } + else + { + memcpy (val, (void *) addr, sizeof(unw_word_t)); + Debug (12, "%s -> %lx\n", unw_regname (reg), *val); + } + return 0; + + badreg: + Debug (1, "bad register number %u\n", reg); + return -UNW_EBADREG; +} + +static int +access_fpreg (unw_addr_space_t as, unw_regnum_t reg, unw_fpreg_t *fpval, int write, + void *arg) +{ + struct cursor *c = (struct cursor *)arg; + + unw_fpreg_t *addr; + unw_context_t *uc = c->uc; + + if (!unw_is_fpreg (reg)) + goto badreg; + + Debug (16, "reg = %s\n", unw_regname (reg)); + if (!(addr = uc_addr (uc, reg))) + goto badreg; + + if (write) + { + *addr = *fpval; + Debug (12, "%s <- %lx\n", unw_regname (reg), *fpval); + } + else + { + *fpval = *(unw_word_t *) addr; + Debug (12, "%s -> %lx\n", unw_regname (reg), *fpval); + } + return 0; + + badreg: + Debug (1, "bad register number %u\n", reg); + return -UNW_EBADREG; +} + +static int +get_static_proc_name (unw_addr_space_t as, unw_word_t ip, + char *buf, size_t buf_len, unw_word_t *offp, + void *arg) +{ + return elf_w (get_proc_name) (as, getpid (), ip, buf, buf_len, offp); +} + +static int +get_static_elf_filename (unw_addr_space_t as, unw_word_t ip, + char *buf, size_t buf_len, unw_word_t *offp, + void *arg) +{ + return elf_w (get_elf_filename) (as, getpid (), ip, buf, buf_len, offp); +} + +HIDDEN void +riscv_local_addr_space_init (void) +{ + memset (&local_addr_space, 0, sizeof (local_addr_space)); + +#ifndef UNW_REMOTE_ONLY +# if defined(HAVE_DL_ITERATE_PHDR) + local_addr_space.iterate_phdr_function = dl_iterate_phdr; +# endif +#endif + local_addr_space.caching_policy = UNWI_DEFAULT_CACHING_POLICY; + local_addr_space.addr_size = sizeof (void *); + local_addr_space.acc.find_proc_info = dwarf_find_proc_info; + local_addr_space.acc.put_unwind_info = put_unwind_info; + local_addr_space.acc.get_dyn_info_list_addr = get_dyn_info_list_addr; + local_addr_space.acc.access_mem = access_mem; + local_addr_space.acc.access_reg = access_reg; + local_addr_space.acc.access_fpreg = access_fpreg; + local_addr_space.acc.resume = riscv_local_resume; + local_addr_space.acc.get_proc_name = get_static_proc_name; + local_addr_space.acc.get_elf_filename = get_static_elf_filename; + local_addr_space.big_endian = target_is_big_endian(); + unw_flush_cache (&local_addr_space, 0, 0); +} + +#endif /* !UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/src/riscv/Ginit_local.c b/vendor/libunwind/src/riscv/Ginit_local.c new file mode 100644 index 0000000000..255e75a2bf --- /dev/null +++ b/vendor/libunwind/src/riscv/Ginit_local.c @@ -0,0 +1,81 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2014 Tilera Corp. + Copyright (C) 2021 Zhaofeng Li + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" +#include "init.h" + +#ifdef UNW_REMOTE_ONLY + +int +unw_init_local (unw_cursor_t *cursor, ucontext_t *uc) +{ + return -UNW_EINVAL; +} + +#else /* !UNW_REMOTE_ONLY */ + +static int +unw_init_local_common(unw_cursor_t *cursor, ucontext_t *uc, unsigned use_prev_instr) +{ + struct cursor *c = (struct cursor *) cursor; + + if (!atomic_load(&tdep_init_done)) + tdep_init (); + + Debug (1, "(cursor=%p)\n", c); + + c->dwarf.as = unw_local_addr_space; + c->dwarf.as_arg = cursor; + c->uc = uc; + c->validate = 1; + + return common_init (c, use_prev_instr); +} + +int +unw_init_local (unw_cursor_t *cursor, unw_context_t *uc) +{ + return unw_init_local_common(cursor, uc, 1); +} + +int +unw_init_local2 (unw_cursor_t *cursor, unw_context_t *uc, int flag) +{ + if (!flag) + { + return unw_init_local_common(cursor, uc, 1); + } + else if (flag == UNW_INIT_SIGNAL_FRAME) + { + return unw_init_local_common(cursor, uc, 0); + } + else + { + return -UNW_EINVAL; + } +} + +#endif /* !UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/src/riscv/Ginit_remote.c b/vendor/libunwind/src/riscv/Ginit_remote.c new file mode 100644 index 0000000000..08f5f15824 --- /dev/null +++ b/vendor/libunwind/src/riscv/Ginit_remote.c @@ -0,0 +1,55 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "init.h" +#include "unwind_i.h" + +int +unw_init_remote (unw_cursor_t *cursor, unw_addr_space_t as, void *as_arg) +{ +#ifdef UNW_LOCAL_ONLY + return -UNW_EINVAL; +#else /* !UNW_LOCAL_ONLY */ + struct cursor *c = (struct cursor *) cursor; + + if (!atomic_load(&tdep_init_done)) + tdep_init (); + + Debug (1, "(cursor=%p)\n", c); + + c->dwarf.as = as; + if (as == unw_local_addr_space) + { + c->dwarf.as_arg = c; + c->uc = as_arg; + } + else + { + c->dwarf.as_arg = as_arg; + c->uc = 0; + } + + return common_init (c, 0); +#endif /* !UNW_LOCAL_ONLY */ +} diff --git a/vendor/libunwind/src/riscv/Gis_signal_frame.c b/vendor/libunwind/src/riscv/Gis_signal_frame.c new file mode 100644 index 0000000000..923563431c --- /dev/null +++ b/vendor/libunwind/src/riscv/Gis_signal_frame.c @@ -0,0 +1,79 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2021 Zhaofeng Li + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +#ifdef __linux__ + +/* + The stub looks like: + + addi x17, zero, 139 0x08b00893 + ecall 0x00000073 + + See . +*/ +#define SIGRETURN_I0 0x08b00893 +#define SIGRETURN_I1 0x00000073 + +#endif /* __linux__ */ + +int +unw_is_signal_frame (unw_cursor_t *cursor) +{ +#ifdef __linux__ + struct cursor *c = (struct cursor*) cursor; + unw_word_t i0, i1, ip; + unw_addr_space_t as; + unw_accessors_t *a; + void *arg; + int ret; + + as = c->dwarf.as; + a = unw_get_accessors_int (as); + arg = c->dwarf.as_arg; + + ip = c->dwarf.ip; + + if (!ip || !a->access_mem || (ip & (sizeof(unw_word_t) - 1))) + return 0; + + if ((ret = (*a->access_mem) (as, ip, &i0, 0, arg)) < 0) + return ret; + + if ((ret = (*a->access_mem) (as, ip + 4, &i1, 0, arg)) < 0) + return ret; + + if ((i0 & 0xffffffff) == SIGRETURN_I0 && (i1 & 0xffffffff) == SIGRETURN_I1) + { + Debug (8, "cursor at signal frame\n"); + return 1; + } + + return 0; +#else + return -UNW_ENOINFO; +#endif +} diff --git a/vendor/libunwind/src/riscv/Greg_states_iterate.c b/vendor/libunwind/src/riscv/Greg_states_iterate.c new file mode 100644 index 0000000000..b436370cfb --- /dev/null +++ b/vendor/libunwind/src/riscv/Greg_states_iterate.c @@ -0,0 +1,36 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + Copyright (c) 2004 Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +int +unw_reg_states_iterate (unw_cursor_t *cursor, + unw_reg_states_callback cb, void *token) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_reg_states_iterate (&c->dwarf, cb, token); +} diff --git a/vendor/libunwind/src/riscv/Gregs.c b/vendor/libunwind/src/riscv/Gregs.c new file mode 100644 index 0000000000..61db986813 --- /dev/null +++ b/vendor/libunwind/src/riscv/Gregs.c @@ -0,0 +1,95 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2021 Zhaofeng Li + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +HIDDEN int +tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, + int write) +{ + dwarf_loc_t loc; + + if (reg >= UNW_RISCV_F0 && reg <= UNW_RISCV_F31) + return -UNW_EBADREG; + + switch (reg) + { + case UNW_RISCV_X0: + if (write) + return -UNW_EREADONLYREG; + *valp = 0; + return 0; + case UNW_TDEP_IP: + if (write) + { + Debug (16, "pc is now 0x%lx\n", *valp); + c->dwarf.ip = *valp; + } + + /* We store PC in place of the hard-wired X0 */ + loc = c->dwarf.loc[0]; + + /* FIXME: Is IP valid? */ + break; + case UNW_TDEP_SP: + if (write) + return -UNW_EREADONLYREG; + *valp = c->dwarf.cfa; + return 0; + default: + loc = c->dwarf.loc[reg]; + break; + } + + if (write) + { + return dwarf_put (&c->dwarf, loc, *valp); + } + else + { + return dwarf_get (&c->dwarf, loc, valp); + } +} + +HIDDEN int +tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, unw_fpreg_t *valp, + int write) +{ + dwarf_loc_t loc; + + if (reg < UNW_RISCV_F0 || reg > UNW_RISCV_F31) + return -UNW_EBADREG; + + loc = c->dwarf.loc[reg]; + + if (write) + { + return dwarf_putfp (&c->dwarf, loc, *valp); + } + else + { + return dwarf_getfp (&c->dwarf, loc, valp); + } +} diff --git a/vendor/libunwind/src/riscv/Gresume.c b/vendor/libunwind/src/riscv/Gresume.c new file mode 100644 index 0000000000..c157ea6eb4 --- /dev/null +++ b/vendor/libunwind/src/riscv/Gresume.c @@ -0,0 +1,122 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + + +#include "unwind_i.h" +#include "offsets.h" +#include + +#ifndef UNW_REMOTE_ONLY + +HIDDEN inline int +riscv_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg) +{ +#ifdef __linux__ + struct cursor *c = (struct cursor *) cursor; + ucontext_t *uc = c->uc; + + unw_word_t *mcontext = (unw_word_t*) &uc->uc_mcontext; + mcontext[0] = c->dwarf.ip; + + if (c->sigcontext_format == RISCV_SCF_NONE) + { + /* Restore PC in RA */ + mcontext[1] = c->dwarf.ip; + + Debug (8, "resuming at ip=0x%lx via setcontext()\n", c->dwarf.ip); + + setcontext(uc); + } + else + { + struct sigcontext *sc = (struct sigcontext *) c->sigcontext_addr; + unw_word_t *regs = (unw_word_t*)sc; + + regs[0] = c->dwarf.ip; + for (int i = UNW_RISCV_X1; i <= UNW_RISCV_F31; ++i) { + regs[i] = mcontext[i]; + } + + Debug (8, "resuming at ip=0x%lx via sigreturn() (trampoline @ 0x%lx, sp @ 0x%lx)\n", c->dwarf.ip, c->sigcontext_pc, c->sigcontext_sp); + + // Jump back to the trampoline + __asm__ __volatile__ ( + "mv sp, %0\n" + "jr %1 \n" + : : "r" (c->sigcontext_sp), "r" (c->sigcontext_pc) + ); + } + + unreachable(); +#else +# warning Implement me +#endif + return -UNW_EINVAL; +} + +#endif /* !UNW_REMOTE_ONLY */ + +static inline int +establish_machine_state (struct cursor *c) +{ + unw_addr_space_t as = c->dwarf.as; + void *arg = c->dwarf.as_arg; + unw_fpreg_t fpval; + unw_word_t val; + int reg; + + Debug (8, "copying out cursor state\n"); + + for (reg = UNW_RISCV_X1; reg <= UNW_REG_LAST; ++reg) + { + Debug (16, "copying %s %d\n", unw_regname (reg), reg); + if (unw_is_fpreg (reg)) + { + if (tdep_access_fpreg (c, reg, &fpval, 0) >= 0) + as->acc.access_fpreg (as, reg, &fpval, 1, arg); + } + else + { + if (tdep_access_reg (c, reg, &val, 0) >= 0) + as->acc.access_reg (as, reg, &val, 1, arg); + } + } + + return 0; +} + +int +unw_resume (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + int ret; + + Debug (1, "(cursor=%p)\n", c); + + if ((ret = establish_machine_state (c)) < 0) + return ret; + + return (*c->dwarf.as->acc.resume) (c->dwarf.as, (unw_cursor_t *)c, + c->dwarf.as_arg); +} diff --git a/vendor/libunwind/src/riscv/Gstep.c b/vendor/libunwind/src/riscv/Gstep.c new file mode 100644 index 0000000000..28687a8f0b --- /dev/null +++ b/vendor/libunwind/src/riscv/Gstep.c @@ -0,0 +1,133 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2021 Zhaofeng Li + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" +#include "offsets.h" + +static int +riscv_handle_signal_frame (unw_cursor_t *cursor) +{ + int ret, i; + struct cursor *c = (struct cursor *) cursor; + unw_word_t sp, sp_addr = c->dwarf.cfa; + struct dwarf_loc sp_loc = DWARF_LOC (sp_addr, 0); + + if ((ret = dwarf_get (&c->dwarf, sp_loc, &sp)) < 0) + return -UNW_EUNSPEC; + + if (!unw_is_signal_frame (cursor)) + return -UNW_EUNSPEC; + +#ifdef __linux__ + /* rt_sigframe contains the siginfo structure, the ucontext, and then + the trampoline. We store the mcontext inside ucontext as sigcontext_addr. + */ + c->sigcontext_format = RISCV_SCF_LINUX_RT_SIGFRAME; + c->sigcontext_addr = sp_addr + sizeof (siginfo_t) + UC_MCONTEXT_REGS_OFF; + c->sigcontext_sp = sp_addr; + c->sigcontext_pc = c->dwarf.ip; +#else + /* Not making any assumption at all - You need to implement this */ + return -UNW_EUNSPEC; +#endif + + for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) + c->dwarf.loc[i] = DWARF_NULL_LOC; + + /* Update the dwarf cursor. + Set the location of the registers to the corresponding addresses of the + uc_mcontext / sigcontext structure contents. */ + +#define SC_REG_OFFSET(X) (8 * X) + + /* The PC is stored in place of X0 in sigcontext */ + c->dwarf.loc[UNW_TDEP_IP] = DWARF_LOC (c->sigcontext_addr + SC_REG_OFFSET(UNW_RISCV_X0), 0); + + for (i = UNW_RISCV_X1; i <= UNW_RISCV_F31; i++) + { + c->dwarf.loc[i] = DWARF_LOC (c->sigcontext_addr + SC_REG_OFFSET(i), 0); + } + + /* Set SP/CFA and PC/IP. */ + dwarf_get (&c->dwarf, c->dwarf.loc[UNW_TDEP_SP], &c->dwarf.cfa); + dwarf_get (&c->dwarf, c->dwarf.loc[UNW_TDEP_IP], &c->dwarf.ip); + + return 1; +} + +int +unw_step (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + int validate = c->validate; + int ret; + + Debug (1, "(cursor=%p, ip=0x%016lx, sp=0x%016lx)\n", + c, c->dwarf.ip, c->dwarf.cfa); + + /* Validate all addresses before dereferencing. */ + c->validate = 1; + + /* Special handling the signal frame. */ + if (unw_is_signal_frame (cursor) > 0) + return riscv_handle_signal_frame (cursor); + + /* Restore default memory validation state */ + c->validate = validate; + + /* Try DWARF-based unwinding... */ + ret = dwarf_step (&c->dwarf); + + if (unlikely (ret == -UNW_ESTOPUNWIND)) + return ret; + + /* DWARF unwinding didn't work, let's tread carefully here */ + if (unlikely (ret < 0)) + { + Debug (1, "DWARF unwinding failed (cursor=%p, ip=0x%016lx, sp=0x%016lx)\n", c, c->dwarf.ip, c->dwarf.cfa); + + /* Try RA/X1? */ + c->dwarf.loc[UNW_RISCV_PC] = c->dwarf.loc[UNW_RISCV_X1]; + c->dwarf.loc[UNW_RISCV_X1] = DWARF_NULL_LOC; + if (!DWARF_IS_NULL_LOC (c->dwarf.loc[UNW_RISCV_PC])) + { + ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_RISCV_PC], &c->dwarf.ip); + if (ret < 0) + { + Debug (2, "Failed to get PC from return address: %d\n", ret); + return ret; + } + + Debug (2, "ra= 0x%016lx\n", c->dwarf.ip); + ret = 1; + } + else + { + c->dwarf.ip = 0; + } + } + + return (c->dwarf.ip == 0) ? 0 : 1; +} diff --git a/vendor/libunwind/src/riscv/Lapply_reg_state.c b/vendor/libunwind/src/riscv/Lapply_reg_state.c new file mode 100644 index 0000000000..7ebada480e --- /dev/null +++ b/vendor/libunwind/src/riscv/Lapply_reg_state.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gapply_reg_state.c" +#endif diff --git a/vendor/libunwind/src/riscv/Lcreate_addr_space.c b/vendor/libunwind/src/riscv/Lcreate_addr_space.c new file mode 100644 index 0000000000..0f2dc6be90 --- /dev/null +++ b/vendor/libunwind/src/riscv/Lcreate_addr_space.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gcreate_addr_space.c" +#endif diff --git a/vendor/libunwind/src/riscv/Lget_proc_info.c b/vendor/libunwind/src/riscv/Lget_proc_info.c new file mode 100644 index 0000000000..69028b019f --- /dev/null +++ b/vendor/libunwind/src/riscv/Lget_proc_info.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gget_proc_info.c" +#endif diff --git a/vendor/libunwind/src/riscv/Lget_save_loc.c b/vendor/libunwind/src/riscv/Lget_save_loc.c new file mode 100644 index 0000000000..9ea048a907 --- /dev/null +++ b/vendor/libunwind/src/riscv/Lget_save_loc.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gget_save_loc.c" +#endif diff --git a/vendor/libunwind/src/riscv/Lglobal.c b/vendor/libunwind/src/riscv/Lglobal.c new file mode 100644 index 0000000000..6d7b489e14 --- /dev/null +++ b/vendor/libunwind/src/riscv/Lglobal.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gglobal.c" +#endif diff --git a/vendor/libunwind/src/riscv/Linit.c b/vendor/libunwind/src/riscv/Linit.c new file mode 100644 index 0000000000..e9abfdd46a --- /dev/null +++ b/vendor/libunwind/src/riscv/Linit.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Ginit.c" +#endif diff --git a/vendor/libunwind/src/riscv/Linit_local.c b/vendor/libunwind/src/riscv/Linit_local.c new file mode 100644 index 0000000000..68a1687e85 --- /dev/null +++ b/vendor/libunwind/src/riscv/Linit_local.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Ginit_local.c" +#endif diff --git a/vendor/libunwind/src/riscv/Linit_remote.c b/vendor/libunwind/src/riscv/Linit_remote.c new file mode 100644 index 0000000000..58cb04ab7c --- /dev/null +++ b/vendor/libunwind/src/riscv/Linit_remote.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Ginit_remote.c" +#endif diff --git a/vendor/libunwind/src/riscv/Lis_signal_frame.c b/vendor/libunwind/src/riscv/Lis_signal_frame.c new file mode 100644 index 0000000000..b9a7c4f51a --- /dev/null +++ b/vendor/libunwind/src/riscv/Lis_signal_frame.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gis_signal_frame.c" +#endif diff --git a/vendor/libunwind/src/riscv/Lreg_states_iterate.c b/vendor/libunwind/src/riscv/Lreg_states_iterate.c new file mode 100644 index 0000000000..f1eb1e79dc --- /dev/null +++ b/vendor/libunwind/src/riscv/Lreg_states_iterate.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Greg_states_iterate.c" +#endif diff --git a/vendor/libunwind/src/riscv/Lregs.c b/vendor/libunwind/src/riscv/Lregs.c new file mode 100644 index 0000000000..2c9c75cd7d --- /dev/null +++ b/vendor/libunwind/src/riscv/Lregs.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gregs.c" +#endif diff --git a/vendor/libunwind/src/riscv/Lresume.c b/vendor/libunwind/src/riscv/Lresume.c new file mode 100644 index 0000000000..41a8cf003d --- /dev/null +++ b/vendor/libunwind/src/riscv/Lresume.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gresume.c" +#endif diff --git a/vendor/libunwind/src/riscv/Lstep.c b/vendor/libunwind/src/riscv/Lstep.c new file mode 100644 index 0000000000..c1ac3c7547 --- /dev/null +++ b/vendor/libunwind/src/riscv/Lstep.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gstep.c" +#endif diff --git a/vendor/libunwind/src/riscv/asm.h b/vendor/libunwind/src/riscv/asm.h new file mode 100644 index 0000000000..7f7b444f93 --- /dev/null +++ b/vendor/libunwind/src/riscv/asm.h @@ -0,0 +1,46 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2021 Zhaofeng Li + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#if __riscv_xlen == 32 +# define STORE sw +# define LOAD lw +# define SZREG 4 +#elif __riscv_xlen == 64 +# define STORE sd +# define LOAD ld +# define SZREG 8 +#endif + +#if __riscv_flen == 64 +# define SZFREG 8 +# define STORE_FP fsd +# define LOAD_FP fld +#elif __riscv_flen == 32 +# define SZFREG 4 +# define STORE_FP fsw +# define LOAD_FP flw +#else +# error "Unsupported RISC-V floating-point length" +#endif + diff --git a/vendor/libunwind/src/riscv/getcontext.S b/vendor/libunwind/src/riscv/getcontext.S new file mode 100644 index 0000000000..9c24888b86 --- /dev/null +++ b/vendor/libunwind/src/riscv/getcontext.S @@ -0,0 +1,87 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2021 Zhaofeng Li + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "offsets.h" +#include "asm.h" + +#define REG(X) (UC_MCONTEXT_REGS_OFF + SZREG * X)(a0) +#define FREG(X) (UC_MCONTEXT_REGS_OFF + SZREG * 32 + SZFREG * X)(a0) + + .text + .global _Uriscv_getcontext + .type _Uriscv_getcontext, @function +_Uriscv_getcontext: + .cfi_startproc + + STORE ra, REG(0) + STORE ra, REG(1) + STORE sp, REG(2) + STORE s0, REG(8) + STORE s1, REG(9) + STORE x0, REG(10) /* Write 0 to a0 */ + STORE a1, REG(11) + STORE a2, REG(12) + STORE a3, REG(13) + STORE a4, REG(14) + STORE a5, REG(15) + STORE a6, REG(16) + STORE a7, REG(17) + STORE s2, REG(18) + STORE s3, REG(19) + STORE s4, REG(20) + STORE s5, REG(21) + STORE s6, REG(22) + STORE s7, REG(23) + STORE s8, REG(24) + STORE s9, REG(25) + STORE s10, REG(26) + STORE s11, REG(27) + +#ifdef STORE_FP + /* The FCSR is always 32-bits and comes after all registers */ + frcsr a1 + sw a1, FREG(32) + + STORE_FP fs0, FREG(8) + STORE_FP fs1, FREG(9) + STORE_FP fs2, FREG(18) + STORE_FP fs3, FREG(19) + STORE_FP fs4, FREG(20) + STORE_FP fs5, FREG(21) + STORE_FP fs6, FREG(22) + STORE_FP fs7, FREG(23) + STORE_FP fs8, FREG(24) + STORE_FP fs9, FREG(25) + STORE_FP fs10, FREG(26) + STORE_FP fs11, FREG(27) +#endif + + li a0, 0 + ret + + .cfi_endproc + .size _Uriscv_getcontext, . - _Uriscv_getcontext + + /* We do not need executable stack. */ + .section .note.GNU-stack,"",@progbits diff --git a/vendor/libunwind/src/riscv/init.h b/vendor/libunwind/src/riscv/init.h new file mode 100644 index 0000000000..163ddb4276 --- /dev/null +++ b/vendor/libunwind/src/riscv/init.h @@ -0,0 +1,65 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2014 Tilera Corp. + Copyright (C) 2021 Zhaofeng Li + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +static inline int +common_init (struct cursor *c, unsigned use_prev_instr) +{ + int ret, i; + + for (i = 0; i < 32; i++) + c->dwarf.loc[i] = DWARF_REG_LOC (&c->dwarf, UNW_RISCV_X0 + i); + + for (i = 32; i < DWARF_NUM_PRESERVED_REGS; i++) + c->dwarf.loc[i] = DWARF_NULL_LOC; + + c->dwarf.loc[UNW_RISCV_PC] = DWARF_REG_LOC (&c->dwarf, UNW_RISCV_PC); + + ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_RISCV_PC], &c->dwarf.ip); + if (ret < 0) + return ret; + + ret = dwarf_get (&c->dwarf, DWARF_REG_LOC (&c->dwarf, UNW_TDEP_SP), + &c->dwarf.cfa); + if (ret < 0) + return ret; + + c->sigcontext_format = RISCV_SCF_NONE; + c->sigcontext_addr = 0; + c->sigcontext_sp = 0; + c->sigcontext_pc = 0; + + c->dwarf.args_size = 0; + c->dwarf.stash_frames = 0; + c->dwarf.use_prev_instr = use_prev_instr; + c->dwarf.pi_valid = 0; + c->dwarf.pi_is_dynamic = 0; + c->dwarf.hint = 0; + c->dwarf.prev_rs = 0; + + return 0; +} diff --git a/vendor/libunwind/src/riscv/is_fpreg.c b/vendor/libunwind/src/riscv/is_fpreg.c new file mode 100644 index 0000000000..f5a6dc4e31 --- /dev/null +++ b/vendor/libunwind/src/riscv/is_fpreg.c @@ -0,0 +1,31 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +int +unw_is_fpreg (int regnum) +{ + return (regnum >= UNW_RISCV_F0 && regnum <= UNW_RISCV_F31); +} diff --git a/vendor/libunwind/src/riscv/offsets.h b/vendor/libunwind/src/riscv/offsets.h new file mode 100644 index 0000000000..66a2eef62a --- /dev/null +++ b/vendor/libunwind/src/riscv/offsets.h @@ -0,0 +1,13 @@ +#ifdef __linux__ + +/* Linux-specific definitions: */ + +/* The RISC-V ucontext has the following structure: + + https://github.com/torvalds/linux/blob/44db63d1ad8d71c6932cbe007eb41f31c434d140/arch/riscv/include/uapi/asm/ucontext.h +*/ +#define UC_MCONTEXT_REGS_OFF 176 + +#else +# error "Unsupported OS" +#endif diff --git a/vendor/libunwind/src/riscv/regname.c b/vendor/libunwind/src/riscv/regname.c new file mode 100644 index 0000000000..370383ac69 --- /dev/null +++ b/vendor/libunwind/src/riscv/regname.c @@ -0,0 +1,59 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + Copyright (C) 2014 Tilera Corp. + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +static const char *regname[] = + { + /* 0. */ + "zero", "ra", "sp", "gp", "tp", "t0", "t1", "t2", + /* 8. */ + "s0", "s1", "a0", "a1", "a2", "a3", "a4", "a5", + /* 16. */ + "a6", "a7", "s2", "s3", "s4", "s5", "s6", "s7", + /* 24. */ + "s8", "s9", "s10", "s11", "t3", "t4", "t5", "t6", + + /* 0. */ + "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", + /* 8. */ + "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", + /* 16. */ + "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", + /* 24. */ + "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", + + /* pc */ + "pc" + }; + +const char * +unw_regname (unw_regnum_t reg) +{ + if (reg < (unw_regnum_t) ARRAY_SIZE (regname)) + return regname[reg]; + else + return "???"; +} diff --git a/vendor/libunwind/src/riscv/setcontext.S b/vendor/libunwind/src/riscv/setcontext.S new file mode 100644 index 0000000000..43f0b92906 --- /dev/null +++ b/vendor/libunwind/src/riscv/setcontext.S @@ -0,0 +1,87 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2021 Zhaofeng Li + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "offsets.h" +#include "asm.h" + +#define REG(X) (UC_MCONTEXT_REGS_OFF + SZREG * X)(a0) +#define FREG(X) (UC_MCONTEXT_REGS_OFF + SZREG * 32 + SZFREG * X)(a0) + + .text + .global _Uriscv_setcontext + .type _Uriscv_setcontext, @function +_Uriscv_setcontext: + .cfi_startproc + +#ifdef LOAD_FP + /* The FCSR is always 32-bits and comes after all registers */ + lw a1, FREG(32) + fscsr a1 + + LOAD_FP fs0, FREG(8) + LOAD_FP fs1, FREG(9) + LOAD_FP fs2, FREG(18) + LOAD_FP fs3, FREG(19) + LOAD_FP fs4, FREG(20) + LOAD_FP fs5, FREG(21) + LOAD_FP fs6, FREG(22) + LOAD_FP fs7, FREG(23) + LOAD_FP fs8, FREG(24) + LOAD_FP fs9, FREG(25) + LOAD_FP fs10, FREG(26) + LOAD_FP fs11, FREG(27) +#endif + + LOAD t1, REG(0) + LOAD ra, REG(1) + LOAD sp, REG(2) + LOAD s0, REG(8) + LOAD s1, REG(9) + LOAD a1, REG(11) + LOAD a2, REG(12) + LOAD a3, REG(13) + LOAD a4, REG(14) + LOAD a5, REG(15) + LOAD a6, REG(16) + LOAD a7, REG(17) + LOAD s2, REG(18) + LOAD s3, REG(19) + LOAD s4, REG(20) + LOAD s5, REG(21) + LOAD s6, REG(22) + LOAD s7, REG(23) + LOAD s8, REG(24) + LOAD s9, REG(25) + LOAD s10, REG(26) + LOAD s11, REG(27) + + LOAD a0, REG(10) + + jr t1 + + .cfi_endproc + .size _Uriscv_setcontext, . - _Uriscv_setcontext + + /* We do not need executable stack. */ + .section .note.GNU-stack,"",@progbits diff --git a/vendor/libunwind/src/riscv/siglongjmp.S b/vendor/libunwind/src/riscv/siglongjmp.S new file mode 100644 index 0000000000..9960691d99 --- /dev/null +++ b/vendor/libunwind/src/riscv/siglongjmp.S @@ -0,0 +1,7 @@ + /* Dummy implementation for now. */ + .globl _UI_siglongjmp_cont + .globl _UI_longjmp_cont + +_UI_siglongjmp_cont: +_UI_longjmp_cont: + ret diff --git a/vendor/libunwind/src/riscv/unwind_i.h b/vendor/libunwind/src/riscv/unwind_i.h new file mode 100644 index 0000000000..3a045da0ac --- /dev/null +++ b/vendor/libunwind/src/riscv/unwind_i.h @@ -0,0 +1,46 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 CodeSourcery + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef unwind_i_h +#define unwind_i_h + +#include +#include + +#include + +#include "libunwind_i.h" + +#define riscv_lock UNW_OBJ(lock) +#define riscv_local_resume UNW_OBJ(local_resume) +#define riscv_local_addr_space_init UNW_OBJ(local_addr_space_init) +#define setcontext UNW_ARCH_OBJ (setcontext) + +extern void riscv_local_addr_space_init (void); +extern int riscv_local_resume (unw_addr_space_t as, + unw_cursor_t *cursor, + void *arg); +extern int setcontext (const ucontext_t *ucp); + +#endif /* unwind_i_h */ diff --git a/vendor/libunwind/src/unwind/Backtrace.c b/vendor/libunwind/src/unwind/Backtrace.c new file mode 100644 index 0000000000..0b14df4cb9 --- /dev/null +++ b/vendor/libunwind/src/unwind/Backtrace.c @@ -0,0 +1,56 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind-internal.h" + +_Unwind_Reason_Code +_Unwind_Backtrace (_Unwind_Trace_Fn trace, void *trace_parameter) +{ + struct _Unwind_Context context; + unw_context_t uc; + int ret; + + if (_Unwind_InitContext (&context, &uc) < 0) + return _URC_FATAL_PHASE1_ERROR; + + /* Phase 1 (search phase) */ + + while (1) + { + if ((ret = unw_step (&context.cursor)) <= 0) + { + if (ret == 0) + return _URC_END_OF_STACK; + else + return _URC_FATAL_PHASE1_ERROR; + } + + if ((*trace) (&context, trace_parameter) != _URC_NO_REASON) + return _URC_FATAL_PHASE1_ERROR; + } +} + +_Unwind_Reason_Code __libunwind_Unwind_Backtrace (_Unwind_Trace_Fn, void *) + ALIAS (_Unwind_Backtrace); diff --git a/vendor/libunwind/src/unwind/DeleteException.c b/vendor/libunwind/src/unwind/DeleteException.c new file mode 100644 index 0000000000..ad38eaf651 --- /dev/null +++ b/vendor/libunwind/src/unwind/DeleteException.c @@ -0,0 +1,38 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind-internal.h" + +void +_Unwind_DeleteException (struct _Unwind_Exception *exception_object) +{ + _Unwind_Exception_Cleanup_Fn cleanup = exception_object->exception_cleanup; + + if (cleanup) + (*cleanup) (_URC_FOREIGN_EXCEPTION_CAUGHT, exception_object); +} + +void __libunwind_Unwind_DeleteException (struct _Unwind_Exception *) + ALIAS (_Unwind_DeleteException); diff --git a/vendor/libunwind/src/unwind/FindEnclosingFunction.c b/vendor/libunwind/src/unwind/FindEnclosingFunction.c new file mode 100644 index 0000000000..4f10666172 --- /dev/null +++ b/vendor/libunwind/src/unwind/FindEnclosingFunction.c @@ -0,0 +1,42 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind-internal.h" + +void * +_Unwind_FindEnclosingFunction (void *ip) +{ + unw_proc_info_t pi; + + if (unw_get_proc_info_by_ip (unw_local_addr_space, + (unw_word_t) (uintptr_t) ip, &pi, 0) + < 0) + return NULL; + + return (void *) (uintptr_t) pi.start_ip; +} + +void *__libunwind_Unwind_FindEnclosingFunction (void *) + ALIAS (_Unwind_FindEnclosingFunction); diff --git a/vendor/libunwind/src/unwind/ForcedUnwind.c b/vendor/libunwind/src/unwind/ForcedUnwind.c new file mode 100644 index 0000000000..905b31cd87 --- /dev/null +++ b/vendor/libunwind/src/unwind/ForcedUnwind.c @@ -0,0 +1,52 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind-internal.h" + +_Unwind_Reason_Code +_Unwind_ForcedUnwind (struct _Unwind_Exception *exception_object, + _Unwind_Stop_Fn stop, void *stop_parameter) +{ + struct _Unwind_Context context; + unw_context_t uc; + + /* We check "stop" here to tell the compiler's inliner that + exception_object->private_1 isn't NULL when calling + _Unwind_Phase2(). */ + if (!stop) + return _URC_FATAL_PHASE2_ERROR; + + if (_Unwind_InitContext (&context, &uc) < 0) + return _URC_FATAL_PHASE2_ERROR; + + exception_object->private_1 = (unsigned long) stop; + exception_object->private_2 = (unsigned long) stop_parameter; + + return _Unwind_Phase2 (exception_object, &context); +} + +_Unwind_Reason_Code __libunwind_Unwind_ForcedUnwind (struct _Unwind_Exception*, + _Unwind_Stop_Fn, void *) + ALIAS (_Unwind_ForcedUnwind); diff --git a/vendor/libunwind/src/unwind/GetBSP.c b/vendor/libunwind/src/unwind/GetBSP.c new file mode 100644 index 0000000000..d1bc84e0d2 --- /dev/null +++ b/vendor/libunwind/src/unwind/GetBSP.c @@ -0,0 +1,42 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind-internal.h" + +unsigned long +_Unwind_GetBSP (struct _Unwind_Context *context) +{ +#ifdef UNW_TARGET_IA64 + unw_word_t val; + + unw_get_reg (&context->cursor, UNW_IA64_BSP, &val); + return val; +#else + return 0; +#endif +} + +unsigned long __libunwind_Unwind_GetBSP (struct _Unwind_Context *) + ALIAS (_Unwind_GetBSP); diff --git a/vendor/libunwind/src/unwind/GetCFA.c b/vendor/libunwind/src/unwind/GetCFA.c new file mode 100644 index 0000000000..5ca63903dd --- /dev/null +++ b/vendor/libunwind/src/unwind/GetCFA.c @@ -0,0 +1,38 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind-internal.h" + +unsigned long +_Unwind_GetCFA (struct _Unwind_Context *context) +{ + unw_word_t val; + + unw_get_reg (&context->cursor, UNW_REG_SP, &val); + return val; +} + +unsigned long __libunwind_Unwind_GetCFA (struct _Unwind_Context *) + ALIAS (_Unwind_GetCFA); diff --git a/vendor/libunwind/src/unwind/GetDataRelBase.c b/vendor/libunwind/src/unwind/GetDataRelBase.c new file mode 100644 index 0000000000..8e6914f4f3 --- /dev/null +++ b/vendor/libunwind/src/unwind/GetDataRelBase.c @@ -0,0 +1,39 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind-internal.h" + +unsigned long +_Unwind_GetDataRelBase (struct _Unwind_Context *context) +{ + unw_proc_info_t pi; + + pi.gp = 0; + unw_get_proc_info (&context->cursor, &pi); + return pi.gp; +} + +unsigned long __libunwind_Unwind_GetDataRelBase (struct _Unwind_Context *) + ALIAS (_Unwind_GetDataRelBase); diff --git a/vendor/libunwind/src/unwind/GetGR.c b/vendor/libunwind/src/unwind/GetGR.c new file mode 100644 index 0000000000..fa70943435 --- /dev/null +++ b/vendor/libunwind/src/unwind/GetGR.c @@ -0,0 +1,43 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind-internal.h" + +unsigned long +_Unwind_GetGR (struct _Unwind_Context *context, int index) +{ + unw_word_t val; + + if (index == UNW_REG_SP && context->end_of_stack) + /* _Unwind_ForcedUnwind() requires us to return a NULL + stack-pointer after reaching the end of the stack. */ + return 0; + + unw_get_reg (&context->cursor, index, &val); + return val; +} + +unsigned long __libunwind_Unwind_GetGR (struct _Unwind_Context *, int) + ALIAS (_Unwind_GetGR); diff --git a/vendor/libunwind/src/unwind/GetIP.c b/vendor/libunwind/src/unwind/GetIP.c new file mode 100644 index 0000000000..e9fc494402 --- /dev/null +++ b/vendor/libunwind/src/unwind/GetIP.c @@ -0,0 +1,38 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind-internal.h" + +unsigned long +_Unwind_GetIP (struct _Unwind_Context *context) +{ + unw_word_t val; + + unw_get_reg (&context->cursor, UNW_REG_IP, &val); + return val; +} + +unsigned long __libunwind_Unwind_GetIP (struct _Unwind_Context *) + ALIAS (_Unwind_GetIP); diff --git a/vendor/libunwind/src/unwind/GetIPInfo.c b/vendor/libunwind/src/unwind/GetIPInfo.c new file mode 100644 index 0000000000..e8ee7fd7f1 --- /dev/null +++ b/vendor/libunwind/src/unwind/GetIPInfo.c @@ -0,0 +1,42 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2009 Red Hat + Contributed by Jan Kratochvil + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind-internal.h" + +/* gcc/unwind-dw2.c: Retrieve the return address and flag whether that IP is + before or after first not yet fully executed instruction. */ + +unsigned long +_Unwind_GetIPInfo (struct _Unwind_Context *context, int *ip_before_insn) +{ + unw_word_t val; + + unw_get_reg (&context->cursor, UNW_REG_IP, &val); + *ip_before_insn = unw_is_signal_frame (&context->cursor); + return val; +} + +unsigned long __libunwind_Unwind_GetIPInfo (struct _Unwind_Context *, int *) + ALIAS (_Unwind_GetIPInfo); diff --git a/vendor/libunwind/src/unwind/GetLanguageSpecificData.c b/vendor/libunwind/src/unwind/GetLanguageSpecificData.c new file mode 100644 index 0000000000..e7ca9b453c --- /dev/null +++ b/vendor/libunwind/src/unwind/GetLanguageSpecificData.c @@ -0,0 +1,40 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind-internal.h" + +unsigned long +_Unwind_GetLanguageSpecificData (struct _Unwind_Context *context) +{ + unw_proc_info_t pi; + + pi.lsda = 0; + unw_get_proc_info (&context->cursor, &pi); + return pi.lsda; +} + +unsigned long +__libunwind_Unwind_GetLanguageSpecificData (struct _Unwind_Context *) + ALIAS (_Unwind_GetLanguageSpecificData); diff --git a/vendor/libunwind/src/unwind/GetRegionStart.c b/vendor/libunwind/src/unwind/GetRegionStart.c new file mode 100644 index 0000000000..f4995813fa --- /dev/null +++ b/vendor/libunwind/src/unwind/GetRegionStart.c @@ -0,0 +1,39 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind-internal.h" + +unsigned long +_Unwind_GetRegionStart (struct _Unwind_Context *context) +{ + unw_proc_info_t pi; + + pi.start_ip = 0; + unw_get_proc_info (&context->cursor, &pi); + return pi.start_ip; +} + +unsigned long __libunwind_Unwind_GetRegionStart (struct _Unwind_Context *) + ALIAS (_Unwind_GetRegionStart); diff --git a/vendor/libunwind/src/unwind/GetTextRelBase.c b/vendor/libunwind/src/unwind/GetTextRelBase.c new file mode 100644 index 0000000000..ce65ae93e7 --- /dev/null +++ b/vendor/libunwind/src/unwind/GetTextRelBase.c @@ -0,0 +1,35 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind-internal.h" + +unsigned long +_Unwind_GetTextRelBase (struct _Unwind_Context *context) +{ + return 0; +} + +unsigned long __libunwind_Unwind_GetTextRelBase (struct _Unwind_Context *) + ALIAS (_Unwind_GetTextRelBase); diff --git a/vendor/libunwind/src/unwind/RaiseException.c b/vendor/libunwind/src/unwind/RaiseException.c new file mode 100644 index 0000000000..3c3ca19e98 --- /dev/null +++ b/vendor/libunwind/src/unwind/RaiseException.c @@ -0,0 +1,103 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind-internal.h" + +_Unwind_Reason_Code +_Unwind_RaiseException (struct _Unwind_Exception *exception_object) +{ + uint64_t exception_class = exception_object->exception_class; + _Unwind_Personality_Fn personality; + struct _Unwind_Context context; + _Unwind_Reason_Code reason; + unw_proc_info_t pi; + unw_context_t uc; + unw_word_t ip; + int ret; + + Debug (1, "(exception_object=%p)\n", exception_object); + + if (_Unwind_InitContext (&context, &uc) < 0) + return _URC_FATAL_PHASE1_ERROR; + + /* Phase 1 (search phase) */ + + while (1) + { + if ((ret = unw_step (&context.cursor)) <= 0) + { + if (ret == 0) + { + Debug (1, "no handler found\n"); + return _URC_END_OF_STACK; + } + else + return _URC_FATAL_PHASE1_ERROR; + } + + if (unw_get_proc_info (&context.cursor, &pi) < 0) + return _URC_FATAL_PHASE1_ERROR; + + personality = (_Unwind_Personality_Fn) (uintptr_t) pi.handler; + if (personality) + { + reason = (*personality) (_U_VERSION, _UA_SEARCH_PHASE, + exception_class, exception_object, + &context); + if (reason != _URC_CONTINUE_UNWIND) + { + if (reason == _URC_HANDLER_FOUND) + break; + else + { + Debug (1, "personality returned %d\n", reason); + return _URC_FATAL_PHASE1_ERROR; + } + } + } + } + + /* Exceptions are associated with IP-ranges. If a given exception + is handled at a particular IP, it will _always_ be handled at + that IP. If this weren't true, we'd have to track the tuple + (IP,SP,BSP) to uniquely identify the stack frame that's handling + the exception. */ + if (unw_get_reg (&context.cursor, UNW_REG_IP, &ip) < 0) + return _URC_FATAL_PHASE1_ERROR; + exception_object->private_1 = 0; /* clear "stop" pointer */ + exception_object->private_2 = ip; /* save frame marker */ + + Debug (1, "found handler for IP=%lx; entering cleanup phase\n", (long) ip); + + /* Reset the cursor to the first frame: */ + if (unw_init_local (&context.cursor, &uc) < 0) + return _URC_FATAL_PHASE1_ERROR; + + return _Unwind_Phase2 (exception_object, &context); +} + +_Unwind_Reason_Code +__libunwind_Unwind_RaiseException (struct _Unwind_Exception *) + ALIAS (_Unwind_RaiseException); diff --git a/vendor/libunwind/src/unwind/Resume.c b/vendor/libunwind/src/unwind/Resume.c new file mode 100644 index 0000000000..e23d6be27c --- /dev/null +++ b/vendor/libunwind/src/unwind/Resume.c @@ -0,0 +1,42 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind-internal.h" + +void +_Unwind_Resume (struct _Unwind_Exception *exception_object) +{ + struct _Unwind_Context context; + unw_context_t uc; + + if (_Unwind_InitContext (&context, &uc) < 0) + abort (); + + _Unwind_Phase2 (exception_object, &context); + abort (); +} + +void __libunwind_Unwind_Resume (struct _Unwind_Exception *) + ALIAS (_Unwind_Resume); diff --git a/vendor/libunwind/src/unwind/Resume_or_Rethrow.c b/vendor/libunwind/src/unwind/Resume_or_Rethrow.c new file mode 100644 index 0000000000..9c76443b36 --- /dev/null +++ b/vendor/libunwind/src/unwind/Resume_or_Rethrow.c @@ -0,0 +1,47 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind-internal.h" + +_Unwind_Reason_Code +_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *exception_object) +{ + struct _Unwind_Context context; + unw_context_t uc; + + if (exception_object->private_1) + { + if (_Unwind_InitContext (&context, &uc) < 0) + return _URC_FATAL_PHASE2_ERROR; + + return _Unwind_Phase2 (exception_object, &context); + } + else + return _Unwind_RaiseException (exception_object); +} + +_Unwind_Reason_Code +__libunwind_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *) + ALIAS (_Unwind_Resume_or_Rethrow); diff --git a/vendor/libunwind/src/unwind/SetGR.c b/vendor/libunwind/src/unwind/SetGR.c new file mode 100644 index 0000000000..ae77a8e825 --- /dev/null +++ b/vendor/libunwind/src/unwind/SetGR.c @@ -0,0 +1,47 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind-internal.h" +#ifdef UNW_TARGET_X86 +#include "dwarf_i.h" +#endif + +void +_Unwind_SetGR (struct _Unwind_Context *context, int index, + unsigned long new_value) +{ +#ifdef UNW_TARGET_X86 + index = dwarf_to_unw_regnum(index); +#endif + unw_set_reg (&context->cursor, index, new_value); +#ifdef UNW_TARGET_IA64 + if (index >= UNW_IA64_GR && index <= UNW_IA64_GR + 127) + /* Clear the NaT bit. */ + unw_set_reg (&context->cursor, UNW_IA64_NAT + (index - UNW_IA64_GR), 0); +#endif +} + +void __libunwind_Unwind_SetGR (struct _Unwind_Context *, int, unsigned long) + ALIAS (_Unwind_SetGR); diff --git a/vendor/libunwind/src/unwind/SetIP.c b/vendor/libunwind/src/unwind/SetIP.c new file mode 100644 index 0000000000..fccc2f0dd5 --- /dev/null +++ b/vendor/libunwind/src/unwind/SetIP.c @@ -0,0 +1,35 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind-internal.h" + +void +_Unwind_SetIP (struct _Unwind_Context *context, unsigned long new_value) +{ + unw_set_reg (&context->cursor, UNW_REG_IP, new_value); +} + +void __libunwind_Unwind_SetIP (struct _Unwind_Context *, unsigned long) + ALIAS (_Unwind_SetIP); diff --git a/vendor/libunwind/src/unwind/libunwind.pc.in b/vendor/libunwind/src/unwind/libunwind.pc.in new file mode 100644 index 0000000000..9a65faf39e --- /dev/null +++ b/vendor/libunwind/src/unwind/libunwind.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libunwind +Description: libunwind base library +Version: @VERSION@ +Libs: -L${libdir} -lunwind +Libs.private: @LIBLZMA@ @LIBZ@ +Cflags: -I${includedir} diff --git a/vendor/libunwind/src/unwind/unwind-internal.h b/vendor/libunwind/src/unwind/unwind-internal.h new file mode 100644 index 0000000000..c68fc3c5ed --- /dev/null +++ b/vendor/libunwind/src/unwind/unwind-internal.h @@ -0,0 +1,140 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003, 2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef unwind_internal_h +#define unwind_internal_h + +#define UNW_LOCAL_ONLY + +#include +#include +#include + +#include "libunwind_i.h" + +/* The version of the _Unwind_*() interface implemented by this code. */ +#define _U_VERSION 1 + +typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn) + (int, _Unwind_Action, uint64_t, struct _Unwind_Exception *, + struct _Unwind_Context *); + +struct _Unwind_Context { + unw_cursor_t cursor; + int end_of_stack; /* set to 1 if the end of stack was reached */ +}; + +/* This must be a macro because unw_getcontext() must be invoked from + the callee, even if optimization (and hence inlining) is turned + off. The macro arguments MUST NOT have any side-effects. */ +#define _Unwind_InitContext(context, uc) \ + ((context)->end_of_stack = 0, \ + ((unw_getcontext (uc) < 0 || unw_init_local (&(context)->cursor, uc) < 0) \ + ? -1 : 0)) + +static _Unwind_Reason_Code ALWAYS_INLINE +_Unwind_Phase2 (struct _Unwind_Exception *exception_object, + struct _Unwind_Context *context) +{ + _Unwind_Stop_Fn stop = (_Unwind_Stop_Fn) exception_object->private_1; + uint64_t exception_class = exception_object->exception_class; + void *stop_parameter = (void *) exception_object->private_2; + _Unwind_Personality_Fn personality; + _Unwind_Reason_Code reason; + _Unwind_Action actions; + unw_proc_info_t pi; + unw_word_t ip; + int ret; + + actions = _UA_CLEANUP_PHASE; + if (stop) + actions |= _UA_FORCE_UNWIND; + + while (1) + { + ret = unw_step (&context->cursor); + if (ret <= 0) + { + if (ret == 0) + { + actions |= _UA_END_OF_STACK; + context->end_of_stack = 1; + } + else + return _URC_FATAL_PHASE2_ERROR; + } + + if (stop) + { + reason = (*stop) (_U_VERSION, actions, exception_class, + exception_object, context, stop_parameter); + if (reason != _URC_NO_REASON) + /* Stop function may return _URC_FATAL_PHASE2_ERROR if + it's unable to handle end-of-stack condition or + _URC_FATAL_PHASE2_ERROR if something is wrong. Not + that it matters: the resulting state is indeterminate + anyhow so we must return _URC_FATAL_PHASE2_ERROR... */ + return _URC_FATAL_PHASE2_ERROR; + } + + if (context->end_of_stack + || unw_get_proc_info (&context->cursor, &pi) < 0) + return _URC_FATAL_PHASE2_ERROR; + + personality = (_Unwind_Personality_Fn) (uintptr_t) pi.handler; + if (personality) + { + if (!stop) + { + if (unw_get_reg (&context->cursor, UNW_REG_IP, &ip) < 0) + return _URC_FATAL_PHASE2_ERROR; + + if ((unsigned long) stop_parameter == ip) + actions |= _UA_HANDLER_FRAME; + } + + reason = (*personality) (_U_VERSION, actions, exception_class, + exception_object, context); + if (reason != _URC_CONTINUE_UNWIND) + { + if (reason == _URC_INSTALL_CONTEXT) + { + /* we may regain control via _Unwind_Resume() */ + unw_resume (&context->cursor); + abort (); + } + else + return _URC_FATAL_PHASE2_ERROR; + } + if (actions & _UA_HANDLER_FRAME) + /* The personality routine for the handler-frame changed + it's mind; that's a no-no... */ + abort (); + } + } + return _URC_FATAL_PHASE2_ERROR; /* shouldn't be reached */ +} + +#endif /* unwind_internal_h */ diff --git a/vendor/libunwind/src/x86/Gapply_reg_state.c b/vendor/libunwind/src/x86/Gapply_reg_state.c new file mode 100644 index 0000000000..82f056da67 --- /dev/null +++ b/vendor/libunwind/src/x86/Gapply_reg_state.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +int +unw_apply_reg_state (unw_cursor_t *cursor, + void *reg_states_data) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_apply_reg_state (&c->dwarf, (dwarf_reg_state_t *)reg_states_data); +} diff --git a/vendor/libunwind/src/x86/Gcreate_addr_space.c b/vendor/libunwind/src/x86/Gcreate_addr_space.c new file mode 100644 index 0000000000..a7e41a58f4 --- /dev/null +++ b/vendor/libunwind/src/x86/Gcreate_addr_space.c @@ -0,0 +1,58 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include + +#include "unwind_i.h" + +#if defined(_LITTLE_ENDIAN) && !defined(__LITTLE_ENDIAN) +#define __LITTLE_ENDIAN _LITTLE_ENDIAN +#endif + +unw_addr_space_t +unw_create_addr_space (unw_accessors_t *a, int byte_order) +{ +#ifdef UNW_LOCAL_ONLY + return NULL; +#else + unw_addr_space_t as; + + /* + * x86 supports only little-endian. + */ + if (byte_order != 0 && byte_order != __LITTLE_ENDIAN) + return NULL; + + as = malloc (sizeof (*as)); + if (!as) + return NULL; + + memset (as, 0, sizeof (*as)); + + as->acc = *a; + + return as; +#endif +} diff --git a/vendor/libunwind/src/x86/Gget_proc_info.c b/vendor/libunwind/src/x86/Gget_proc_info.c new file mode 100644 index 0000000000..4dc2cff366 --- /dev/null +++ b/vendor/libunwind/src/x86/Gget_proc_info.c @@ -0,0 +1,45 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +int +unw_get_proc_info (unw_cursor_t *cursor, unw_proc_info_t *pi) +{ + struct cursor *c = (struct cursor *) cursor; + + if (dwarf_make_proc_info (&c->dwarf) < 0) + { + /* On x86, it's relatively common to be missing DWARF unwind + info. We don't want to fail in that case, because the + frame-chain still would let us do a backtrace at least. */ + memset (pi, 0, sizeof (*pi)); + pi->start_ip = c->dwarf.ip; + pi->end_ip = c->dwarf.ip + 1; + return 0; + } + *pi = c->dwarf.pi; + return 0; +} diff --git a/vendor/libunwind/src/x86/Gget_save_loc.c b/vendor/libunwind/src/x86/Gget_save_loc.c new file mode 100644 index 0000000000..e459382f6d --- /dev/null +++ b/vendor/libunwind/src/x86/Gget_save_loc.c @@ -0,0 +1,133 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +int +unw_get_save_loc (unw_cursor_t *cursor, int reg, unw_save_loc_t *sloc) +{ + struct cursor *c = (struct cursor *) cursor; + dwarf_loc_t loc; + + loc = DWARF_NULL_LOC; /* default to "not saved" */ + + switch (reg) + { + case UNW_X86_EIP: loc = c->dwarf.loc[EIP]; break; + case UNW_X86_CFA: break; + case UNW_X86_EAX: loc = c->dwarf.loc[EAX]; break; + case UNW_X86_ECX: loc = c->dwarf.loc[ECX]; break; + case UNW_X86_EDX: loc = c->dwarf.loc[EDX]; break; + case UNW_X86_EBX: loc = c->dwarf.loc[EBX]; break; + case UNW_X86_ESP: loc = c->dwarf.loc[ESP]; break; + case UNW_X86_EBP: loc = c->dwarf.loc[EBP]; break; + case UNW_X86_ESI: loc = c->dwarf.loc[ESI]; break; + case UNW_X86_EDI: loc = c->dwarf.loc[EDI]; break; + case UNW_X86_EFLAGS: loc = c->dwarf.loc[EFLAGS]; break; + case UNW_X86_TRAPNO: loc = c->dwarf.loc[TRAPNO]; break; + case UNW_X86_ST0: loc = c->dwarf.loc[ST0]; break; + + case UNW_X86_FCW: + case UNW_X86_FSW: + case UNW_X86_FTW: + case UNW_X86_FOP: + case UNW_X86_FCS: + case UNW_X86_FIP: + case UNW_X86_FEA: + case UNW_X86_FDS: + case UNW_X86_MXCSR: + case UNW_X86_GS: + case UNW_X86_FS: + case UNW_X86_ES: + case UNW_X86_DS: + case UNW_X86_SS: + case UNW_X86_CS: + case UNW_X86_TSS: + case UNW_X86_LDT: + loc = x86_scratch_loc (c, reg); + break; + + /* stacked fp registers */ + case UNW_X86_ST1: + case UNW_X86_ST2: + case UNW_X86_ST3: + case UNW_X86_ST4: + case UNW_X86_ST5: + case UNW_X86_ST6: + case UNW_X86_ST7: + /* SSE fp registers */ + case UNW_X86_XMM0_lo: + case UNW_X86_XMM0_hi: + case UNW_X86_XMM1_lo: + case UNW_X86_XMM1_hi: + case UNW_X86_XMM2_lo: + case UNW_X86_XMM2_hi: + case UNW_X86_XMM3_lo: + case UNW_X86_XMM3_hi: + case UNW_X86_XMM4_lo: + case UNW_X86_XMM4_hi: + case UNW_X86_XMM5_lo: + case UNW_X86_XMM5_hi: + case UNW_X86_XMM6_lo: + case UNW_X86_XMM6_hi: + case UNW_X86_XMM7_lo: + case UNW_X86_XMM7_hi: + case UNW_X86_XMM0: + case UNW_X86_XMM1: + case UNW_X86_XMM2: + case UNW_X86_XMM3: + case UNW_X86_XMM4: + case UNW_X86_XMM5: + case UNW_X86_XMM6: + case UNW_X86_XMM7: + loc = x86_scratch_loc (c, reg); + break; + + default: + break; + } + + memset (sloc, 0, sizeof (*sloc)); + + if (DWARF_IS_NULL_LOC (loc)) + { + sloc->type = UNW_SLT_NONE; + return 0; + } + +#if !defined(UNW_LOCAL_ONLY) + if (DWARF_IS_REG_LOC (loc)) + { + sloc->type = UNW_SLT_REG; + sloc->u.regnum = DWARF_GET_LOC (loc); + } + else +#endif + { + sloc->type = UNW_SLT_MEMORY; + sloc->u.addr = DWARF_GET_LOC (loc); + } + return 0; +} diff --git a/vendor/libunwind/src/x86/Gglobal.c b/vendor/libunwind/src/x86/Gglobal.c new file mode 100644 index 0000000000..f1d11d18f5 --- /dev/null +++ b/vendor/libunwind/src/x86/Gglobal.c @@ -0,0 +1,67 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2003, 2005 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" +#include "dwarf_i.h" + +HIDDEN define_lock (x86_lock); +HIDDEN atomic_bool tdep_init_done = 0; + +/* See comments for svr4_dbx_register_map[] in gcc/config/i386/i386.c. */ + +HIDDEN const uint8_t dwarf_to_unw_regnum_map[19] = + { + UNW_X86_EAX, UNW_X86_ECX, UNW_X86_EDX, UNW_X86_EBX, + UNW_X86_ESP, UNW_X86_EBP, UNW_X86_ESI, UNW_X86_EDI, + UNW_X86_EIP, UNW_X86_EFLAGS, UNW_X86_TRAPNO, + UNW_X86_ST0, UNW_X86_ST1, UNW_X86_ST2, UNW_X86_ST3, + UNW_X86_ST4, UNW_X86_ST5, UNW_X86_ST6, UNW_X86_ST7 + }; + +HIDDEN void +tdep_init (void) +{ + intrmask_t saved_mask; + + sigfillset (&unwi_full_mask); + + lock_acquire (&x86_lock, saved_mask); + { + if (atomic_load(&tdep_init_done)) + /* another thread else beat us to it... */ + goto out; + + mi_init (); + + dwarf_init (); + +#ifndef UNW_REMOTE_ONLY + x86_local_addr_space_init (); +#endif + atomic_store(&tdep_init_done, 1); /* signal that we're initialized... */ + } + out: + lock_release (&x86_lock, saved_mask); +} diff --git a/vendor/libunwind/src/x86/Ginit.c b/vendor/libunwind/src/x86/Ginit.c new file mode 100644 index 0000000000..956d8088b6 --- /dev/null +++ b/vendor/libunwind/src/x86/Ginit.c @@ -0,0 +1,203 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002 Hewlett-Packard Co + Copyright (C) 2007 David Mosberger-Tang + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#include "unwind_i.h" + +#ifdef UNW_REMOTE_ONLY + +/* unw_local_addr_space is a NULL pointer in this case. */ +unw_addr_space_t unw_local_addr_space; + +#else /* !UNW_REMOTE_ONLY */ + +static struct unw_addr_space local_addr_space; + +unw_addr_space_t unw_local_addr_space = &local_addr_space; + +# ifdef UNW_LOCAL_ONLY + +HIDDEN void * +tdep_uc_addr (ucontext_t *uc, int reg) +{ + return x86_r_uc_addr (uc, reg); +} + +# endif /* UNW_LOCAL_ONLY */ + +static void +put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg) +{ + /* it's a no-op */ +} + +static int +get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr, + void *arg) +{ +#ifndef UNW_LOCAL_ONLY +# pragma weak _U_dyn_info_list_addr + if (!_U_dyn_info_list_addr) + return -UNW_ENOINFO; +#endif + // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. + *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; +} + + +static int +access_mem (unw_addr_space_t as, unw_word_t addr, unw_word_t *val, int write, + void *arg) +{ + if (write) + { + Debug (16, "mem[%x] <- %x\n", addr, *val); + memcpy ((void *) addr, val, sizeof(unw_word_t)); + } + else + { + /* validate address */ + const struct cursor *c = (const struct cursor *)arg; + if (unlikely (c && c->validate) && !unw_address_is_valid (addr, sizeof(unw_word_t))) + { + Debug (16, "mem[%#010lx] -> invalid\n", (long)addr); + return -1; + } + memcpy (val, (void *) addr, sizeof(unw_word_t)); + Debug (16, "mem[%x] -> %x\n", addr, *val); + } + return 0; +} + +static int +access_reg (unw_addr_space_t as, unw_regnum_t reg, unw_word_t *val, int write, + void *arg) +{ + unw_word_t *addr; + ucontext_t *uc = ((struct cursor *)arg)->uc; + + if (unw_is_fpreg (reg)) + goto badreg; + + if (!(addr = x86_r_uc_addr (uc, reg))) + goto badreg; + + if (write) + { + memcpy ((void *) addr, val, sizeof(unw_word_t)); + Debug (12, "%s <- %x\n", unw_regname (reg), *val); + } + else + { + memcpy (val, (void *) addr, sizeof(unw_word_t)); + Debug (12, "%s -> %x\n", unw_regname (reg), *val); + } + return 0; + + badreg: + Debug (1, "bad register number %u\n", reg); + return -UNW_EBADREG; +} + +static int +access_fpreg (unw_addr_space_t as, unw_regnum_t reg, unw_fpreg_t *val, + int write, void *arg) +{ + ucontext_t *uc = ((struct cursor *)arg)->uc; + unw_fpreg_t *addr; + + if (!unw_is_fpreg (reg)) + goto badreg; + + if (!(addr = x86_r_uc_addr (uc, reg))) + goto badreg; + + if (write) + { + Debug (12, "%s <- %08lx.%08lx.%08lx\n", unw_regname (reg), + ((long *)val)[0], ((long *)val)[1], ((long *)val)[2]); + *(unw_fpreg_t *) addr = *val; + } + else + { + *val = *(unw_fpreg_t *) addr; + Debug (12, "%s -> %08lx.%08lx.%08lx\n", unw_regname (reg), + ((long *)val)[0], ((long *)val)[1], ((long *)val)[2]); + } + return 0; + + badreg: + Debug (1, "bad register number %u\n", reg); + /* attempt to access a non-preserved register */ + return -UNW_EBADREG; +} + +static int +get_static_proc_name (unw_addr_space_t as, unw_word_t ip, + char *buf, size_t buf_len, unw_word_t *offp, + void *arg) +{ + return _Uelf32_get_proc_name (as, getpid (), ip, buf, buf_len, offp); +} + +static int +get_static_elf_filename (unw_addr_space_t as, unw_word_t ip, + char *buf, size_t buf_len, unw_word_t *offp, + void *arg) +{ + return _Uelf32_get_elf_filename (as, getpid (), ip, buf, buf_len, offp); +} + +HIDDEN void +x86_local_addr_space_init (void) +{ + memset (&local_addr_space, 0, sizeof (local_addr_space)); +#ifndef UNW_REMOTE_ONLY +# if defined(HAVE_DL_ITERATE_PHDR) + local_addr_space.iterate_phdr_function = dl_iterate_phdr; +# endif +#endif + local_addr_space.caching_policy = UNWI_DEFAULT_CACHING_POLICY; + local_addr_space.acc.find_proc_info = dwarf_find_proc_info; + local_addr_space.acc.put_unwind_info = put_unwind_info; + local_addr_space.acc.get_dyn_info_list_addr = get_dyn_info_list_addr; + local_addr_space.acc.access_mem = access_mem; + local_addr_space.acc.access_reg = access_reg; + local_addr_space.acc.access_fpreg = access_fpreg; + local_addr_space.acc.resume = x86_local_resume; + local_addr_space.acc.get_proc_name = get_static_proc_name; + local_addr_space.acc.get_elf_filename = get_static_elf_filename; + unw_flush_cache (&local_addr_space, 0, 0); +} + +#endif /* !UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/src/x86/Ginit_local.c b/vendor/libunwind/src/x86/Ginit_local.c new file mode 100644 index 0000000000..0342315d82 --- /dev/null +++ b/vendor/libunwind/src/x86/Ginit_local.c @@ -0,0 +1,79 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" +#include "init.h" + +#ifdef UNW_REMOTE_ONLY + +int +unw_init_local (unw_cursor_t *cursor, ucontext_t *uc) +{ + return -UNW_EINVAL; +} + +#else /* !UNW_REMOTE_ONLY */ + +static int +unw_init_local_common(unw_cursor_t *cursor, ucontext_t *uc, unsigned use_prev_instr) +{ + struct cursor *c = (struct cursor *) cursor; + + if (!atomic_load(&tdep_init_done)) + tdep_init (); + + Debug (1, "(cursor=%p)\n", c); + + c->dwarf.as = unw_local_addr_space; + c->dwarf.as_arg = c; + c->uc = uc; + c->validate = 0; + return common_init (c, use_prev_instr); +} + +int +unw_init_local (unw_cursor_t *cursor, ucontext_t *uc) +{ + return unw_init_local_common(cursor, uc, 1); +} + +int +unw_init_local2 (unw_cursor_t *cursor, ucontext_t *uc, int flag) +{ + if (!flag) + { + return unw_init_local_common(cursor, uc, 1); + } + else if (flag == UNW_INIT_SIGNAL_FRAME) + { + return unw_init_local_common(cursor, uc, 0); + } + else + { + return -UNW_EINVAL; + } +} + +#endif /* !UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/src/x86/Ginit_remote.c b/vendor/libunwind/src/x86/Ginit_remote.c new file mode 100644 index 0000000000..18c46624bc --- /dev/null +++ b/vendor/libunwind/src/x86/Ginit_remote.c @@ -0,0 +1,56 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "init.h" +#include "unwind_i.h" + +int +unw_init_remote (unw_cursor_t *cursor, unw_addr_space_t as, void *as_arg) +{ +#ifdef UNW_LOCAL_ONLY + return -UNW_EINVAL; +#else /* !UNW_LOCAL_ONLY */ + struct cursor *c = (struct cursor *) cursor; + + if (!atomic_load(&tdep_init_done)) + tdep_init (); + + Debug (1, "(cursor=%p)\n", c); + + c->dwarf.as = as; + c->dwarf.as_arg = as_arg; + if (as == unw_local_addr_space) + { + c->dwarf.as_arg = c; + c->uc = as_arg; + } + else + { + c->dwarf.as_arg = as_arg; + c->uc = 0; + } + return common_init (c, 0); +#endif /* !UNW_LOCAL_ONLY */ +} diff --git a/vendor/libunwind/src/x86/Gos-freebsd.c b/vendor/libunwind/src/x86/Gos-freebsd.c new file mode 100644 index 0000000000..ca95f17c20 --- /dev/null +++ b/vendor/libunwind/src/x86/Gos-freebsd.c @@ -0,0 +1,379 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2010 Konstantin Belousov + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include + +#include "unwind_i.h" +#include "offsets.h" + +int +unw_is_signal_frame (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + unw_word_t w0, w1, w2, w3, w4, w5, ip; + unw_addr_space_t as; + unw_accessors_t *a; + void *arg; + int ret; + + as = c->dwarf.as; + a = unw_get_accessors_int (as); + arg = c->dwarf.as_arg; + + /* Check if EIP points at sigreturn() sequence. It can be: +sigcode+4: from amd64 freebsd32 environment +8d 44 24 20 lea 0x20(%esp),%eax +50 push %eax +b8 a1 01 00 00 mov $0x1a1,%eax +50 push %eax +cd 80 int $0x80 + +sigcode+4: from real i386 +8d 44 24 20 lea 0x20(%esp),%eax +50 push %eax +f7 40 54 00 02 00 testl $0x20000,0x54(%eax) +75 03 jne sigcode+21 +8e 68 14 mov 0x14(%eax),%gs +b8 a1 01 00 00 mov $0x1a1,%eax +50 push %eax +cd 80 int $0x80 + +freebsd4_sigcode+4: +XXX +osigcode: +XXX + */ + ip = c->dwarf.ip; + ret = X86_SCF_NONE; + c->sigcontext_format = ret; + if ((*a->access_mem) (as, ip, &w0, 0, arg) < 0 || + (*a->access_mem) (as, ip + 4, &w1, 0, arg) < 0 || + (*a->access_mem) (as, ip + 8, &w2, 0, arg) < 0 || + (*a->access_mem) (as, ip + 12, &w3, 0, arg) < 0) + return ret; + if (w0 == 0x2024448d && w1 == 0x01a1b850 && w2 == 0xcd500000 && + (w3 & 0xff) == 0x80) + ret = X86_SCF_FREEBSD_SIGFRAME; + else { + if ((*a->access_mem) (as, ip + 16, &w4, 0, arg) < 0 || + (*a->access_mem) (as, ip + 20, &w5, 0, arg) < 0) + return ret; + if (w0 == 0x2024448d && w1 == 0x5440f750 && w2 == 0x75000200 && + w3 == 0x14688e03 && w4 == 0x0001a1b8 && w5 == 0x80cd5000) + ret = X86_SCF_FREEBSD_SIGFRAME; + } + + /* Check for syscall */ + if (ret == X86_SCF_NONE && (*a->access_mem) (as, ip - 2, &w0, 0, arg) >= 0 && + (w0 & 0xffff) == 0x80cd) + ret = X86_SCF_FREEBSD_SYSCALL; + Debug (16, "returning %d\n", ret); + c->sigcontext_format = ret; + return (ret); +} + +HIDDEN int +x86_handle_signal_frame (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + int ret; + + if (c->sigcontext_format == X86_SCF_FREEBSD_SIGFRAME) { + struct sigframe *sf; + uintptr_t uc_addr; + struct dwarf_loc esp_loc; + int i; + + sf = (struct sigframe *)c->dwarf.cfa; + uc_addr = (uintptr_t)&(sf->sf_uc); + c->sigcontext_addr = c->dwarf.cfa; + + esp_loc = DWARF_LOC (uc_addr + FREEBSD_UC_MCONTEXT_ESP_OFF, 0); + ret = dwarf_get (&c->dwarf, esp_loc, &c->dwarf.cfa); + if (ret < 0) + { + Debug (2, "returning 0\n"); + return 0; + } + + for (int i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) + c->dwarf.loc[i] = DWARF_NULL_LOC; + + c->dwarf.loc[EIP] = DWARF_LOC (uc_addr + FREEBSD_UC_MCONTEXT_EIP_OFF, 0); + c->dwarf.loc[ESP] = DWARF_LOC (uc_addr + FREEBSD_UC_MCONTEXT_ESP_OFF, 0); + c->dwarf.loc[EAX] = DWARF_LOC (uc_addr + FREEBSD_UC_MCONTEXT_EAX_OFF, 0); + c->dwarf.loc[ECX] = DWARF_LOC (uc_addr + FREEBSD_UC_MCONTEXT_ECX_OFF, 0); + c->dwarf.loc[EDX] = DWARF_LOC (uc_addr + FREEBSD_UC_MCONTEXT_EDX_OFF, 0); + c->dwarf.loc[EBX] = DWARF_LOC (uc_addr + FREEBSD_UC_MCONTEXT_EBX_OFF, 0); + c->dwarf.loc[EBP] = DWARF_LOC (uc_addr + FREEBSD_UC_MCONTEXT_EBP_OFF, 0); + c->dwarf.loc[ESI] = DWARF_LOC (uc_addr + FREEBSD_UC_MCONTEXT_ESI_OFF, 0); + c->dwarf.loc[EDI] = DWARF_LOC (uc_addr + FREEBSD_UC_MCONTEXT_EDI_OFF, 0); + c->dwarf.loc[EFLAGS] = DWARF_LOC (uc_addr + FREEBSD_UC_MCONTEXT_EFLAGS_OFF, 0); + c->dwarf.loc[TRAPNO] = DWARF_LOC (uc_addr + FREEBSD_UC_MCONTEXT_TRAPNO_OFF, 0); + c->dwarf.loc[ST0] = DWARF_NULL_LOC; + } else if (c->sigcontext_format == X86_SCF_FREEBSD_SYSCALL) { + c->dwarf.loc[EIP] = DWARF_LOC (c->dwarf.cfa, 0); + c->dwarf.loc[ESP] = DWARF_VAL_LOC (c, c->dwarf.cfa + 4); + c->dwarf.loc[EAX] = DWARF_NULL_LOC; + c->dwarf.cfa += 4; + c->dwarf.use_prev_instr = 1; + } else { + Debug (8, "Gstep: not handling frame format %d\n", c->sigcontext_format); + abort(); + } + return 0; +} + +HIDDEN dwarf_loc_t +x86_get_scratch_loc (struct cursor *c, unw_regnum_t reg) +{ + unw_word_t addr = c->sigcontext_addr, off, xmm_off; + unw_word_t fpstate, fpformat; + int ret, is_fpstate = 0, is_xmmstate = 0; + + switch (c->sigcontext_format) + { + case X86_SCF_NONE: + return DWARF_REG_LOC (&c->dwarf, reg); + + case X86_SCF_FREEBSD_SIGFRAME: + addr += offsetof(struct sigframe, sf_uc) + FREEBSD_UC_MCONTEXT_OFF; + break; + + case X86_SCF_FREEBSD_SIGFRAME4: + abort(); + break; + + case X86_SCF_FREEBSD_OSIGFRAME: + /* XXXKIB */ + abort(); + break; + + case X86_SCF_FREEBSD_SYSCALL: + /* XXXKIB */ + abort(); + break; + + default: + /* XXXKIB */ + abort(); + break; + } + + off = 0; /* shut gcc warning */ + switch (reg) + { + case UNW_X86_GS: off = FREEBSD_UC_MCONTEXT_GS_OFF; break; + case UNW_X86_FS: off = FREEBSD_UC_MCONTEXT_FS_OFF; break; + case UNW_X86_ES: off = FREEBSD_UC_MCONTEXT_ES_OFF; break; + case UNW_X86_DS: off = FREEBSD_UC_MCONTEXT_SS_OFF; break; + case UNW_X86_EDI: off = FREEBSD_UC_MCONTEXT_EDI_OFF; break; + case UNW_X86_ESI: off = FREEBSD_UC_MCONTEXT_ESI_OFF; break; + case UNW_X86_EBP: off = FREEBSD_UC_MCONTEXT_EBP_OFF; break; + case UNW_X86_ESP: off = FREEBSD_UC_MCONTEXT_ESP_OFF; break; + case UNW_X86_EBX: off = FREEBSD_UC_MCONTEXT_EBX_OFF; break; + case UNW_X86_EDX: off = FREEBSD_UC_MCONTEXT_EDX_OFF; break; + case UNW_X86_ECX: off = FREEBSD_UC_MCONTEXT_ECX_OFF; break; + case UNW_X86_EAX: off = FREEBSD_UC_MCONTEXT_EAX_OFF; break; + case UNW_X86_TRAPNO: off = FREEBSD_UC_MCONTEXT_TRAPNO_OFF; break; + case UNW_X86_EIP: off = FREEBSD_UC_MCONTEXT_EIP_OFF; break; + case UNW_X86_CS: off = FREEBSD_UC_MCONTEXT_CS_OFF; break; + case UNW_X86_EFLAGS: off = FREEBSD_UC_MCONTEXT_EFLAGS_OFF; break; + case UNW_X86_SS: off = FREEBSD_UC_MCONTEXT_SS_OFF; break; + + case UNW_X86_FCW: + is_fpstate = 1; + off = FREEBSD_UC_MCONTEXT_CW_OFF; + xmm_off = FREEBSD_UC_MCONTEXT_CW_XMM_OFF; + break; + case UNW_X86_FSW: + is_fpstate = 1; + off = FREEBSD_UC_MCONTEXT_SW_OFF; + xmm_off = FREEBSD_UC_MCONTEXT_SW_XMM_OFF; + break; + case UNW_X86_FTW: + is_fpstate = 1; + xmm_off = FREEBSD_UC_MCONTEXT_TAG_XMM_OFF; + off = FREEBSD_UC_MCONTEXT_TAG_OFF; + break; + case UNW_X86_FCS: + is_fpstate = 1; + off = FREEBSD_UC_MCONTEXT_CSSEL_OFF; + xmm_off = FREEBSD_UC_MCONTEXT_CSSEL_XMM_OFF; + break; + case UNW_X86_FIP: + is_fpstate = 1; + off = FREEBSD_UC_MCONTEXT_IPOFF_OFF; + xmm_off = FREEBSD_UC_MCONTEXT_IPOFF_XMM_OFF; + break; + case UNW_X86_FEA: + is_fpstate = 1; + off = FREEBSD_UC_MCONTEXT_DATAOFF_OFF; + xmm_off = FREEBSD_UC_MCONTEXT_DATAOFF_XMM_OFF; + break; + case UNW_X86_FDS: + is_fpstate = 1; + off = FREEBSD_US_MCONTEXT_DATASEL_OFF; + xmm_off = FREEBSD_US_MCONTEXT_DATASEL_XMM_OFF; + break; + case UNW_X86_MXCSR: + is_fpstate = 1; + is_xmmstate = 1; + xmm_off = FREEBSD_UC_MCONTEXT_MXCSR_XMM_OFF; + break; + + /* stacked fp registers */ + case UNW_X86_ST0: case UNW_X86_ST1: case UNW_X86_ST2: case UNW_X86_ST3: + case UNW_X86_ST4: case UNW_X86_ST5: case UNW_X86_ST6: case UNW_X86_ST7: + is_fpstate = 1; + off = FREEBSD_UC_MCONTEXT_ST0_OFF + 10*(reg - UNW_X86_ST0); + xmm_off = FREEBSD_UC_MCONTEXT_ST0_XMM_OFF + 10*(reg - UNW_X86_ST0); + break; + + /* SSE fp registers */ + case UNW_X86_XMM0_lo: case UNW_X86_XMM0_hi: + case UNW_X86_XMM1_lo: case UNW_X86_XMM1_hi: + case UNW_X86_XMM2_lo: case UNW_X86_XMM2_hi: + case UNW_X86_XMM3_lo: case UNW_X86_XMM3_hi: + case UNW_X86_XMM4_lo: case UNW_X86_XMM4_hi: + case UNW_X86_XMM5_lo: case UNW_X86_XMM5_hi: + case UNW_X86_XMM6_lo: case UNW_X86_XMM6_hi: + case UNW_X86_XMM7_lo: case UNW_X86_XMM7_hi: + is_fpstate = 1; + is_xmmstate = 1; + xmm_off = FREEBSD_UC_MCONTEXT_XMM0_OFF + 8*(reg - UNW_X86_XMM0_lo); + break; + case UNW_X86_XMM0: + case UNW_X86_XMM1: + case UNW_X86_XMM2: + case UNW_X86_XMM3: + case UNW_X86_XMM4: + case UNW_X86_XMM5: + case UNW_X86_XMM6: + case UNW_X86_XMM7: + is_fpstate = 1; + is_xmmstate = 1; + xmm_off = FREEBSD_UC_MCONTEXT_XMM0_OFF + 16*(reg - UNW_X86_XMM0); + break; + + case UNW_X86_FOP: + case UNW_X86_TSS: + case UNW_X86_LDT: + default: + return DWARF_REG_LOC (&c->dwarf, reg); + } + + if (is_fpstate) + { + if ((ret = dwarf_get (&c->dwarf, + DWARF_MEM_LOC (&c->dwarf, addr + FREEBSD_UC_MCONTEXT_FPSTATE_OFF), + &fpstate)) < 0) + return DWARF_NULL_LOC; + if (fpstate == FREEBSD_UC_MCONTEXT_FPOWNED_NONE) + return DWARF_NULL_LOC; + if ((ret = dwarf_get (&c->dwarf, + DWARF_MEM_LOC (&c->dwarf, addr + FREEBSD_UC_MCONTEXT_FPFORMAT_OFF), + &fpformat)) < 0) + return DWARF_NULL_LOC; + if (fpformat == FREEBSD_UC_MCONTEXT_FPFMT_NODEV || + (is_xmmstate && fpformat != FREEBSD_UC_MCONTEXT_FPFMT_XMM)) + return DWARF_NULL_LOC; + if (is_xmmstate) + off = xmm_off; + } + + return DWARF_MEM_LOC (c, addr + off); +} + +#ifndef UNW_REMOTE_ONLY +HIDDEN void * +x86_r_uc_addr (ucontext_t *uc, int reg) +{ + void *addr; + + switch (reg) + { + case UNW_X86_GS: addr = &uc->uc_mcontext.mc_gs; break; + case UNW_X86_FS: addr = &uc->uc_mcontext.mc_fs; break; + case UNW_X86_ES: addr = &uc->uc_mcontext.mc_es; break; + case UNW_X86_DS: addr = &uc->uc_mcontext.mc_ds; break; + case UNW_X86_EAX: addr = &uc->uc_mcontext.mc_eax; break; + case UNW_X86_EBX: addr = &uc->uc_mcontext.mc_ebx; break; + case UNW_X86_ECX: addr = &uc->uc_mcontext.mc_ecx; break; + case UNW_X86_EDX: addr = &uc->uc_mcontext.mc_edx; break; + case UNW_X86_ESI: addr = &uc->uc_mcontext.mc_esi; break; + case UNW_X86_EDI: addr = &uc->uc_mcontext.mc_edi; break; + case UNW_X86_EBP: addr = &uc->uc_mcontext.mc_ebp; break; + case UNW_X86_EIP: addr = &uc->uc_mcontext.mc_eip; break; + case UNW_X86_ESP: addr = &uc->uc_mcontext.mc_esp; break; + case UNW_X86_TRAPNO: addr = &uc->uc_mcontext.mc_trapno; break; + case UNW_X86_CS: addr = &uc->uc_mcontext.mc_cs; break; + case UNW_X86_EFLAGS: addr = &uc->uc_mcontext.mc_eflags; break; + case UNW_X86_SS: addr = &uc->uc_mcontext.mc_ss; break; + + default: + addr = NULL; + } + return addr; +} + +HIDDEN int +x86_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg) +{ + struct cursor *c = (struct cursor *) cursor; + ucontext_t *uc = c->uc; + + /* Ensure c->pi is up-to-date. On x86, it's relatively common to be + missing DWARF unwind info. We don't want to fail in that case, + because the frame-chain still would let us do a backtrace at + least. */ + dwarf_make_proc_info (&c->dwarf); + + if (c->sigcontext_format == X86_SCF_NONE) { + Debug (8, "resuming at ip=%x via setcontext()\n", c->dwarf.ip); + setcontext (uc); + abort(); + } else if (c->sigcontext_format == X86_SCF_FREEBSD_SIGFRAME) { + struct sigcontext *sc = (struct sigcontext *) c->sigcontext_addr; + + Debug (8, "resuming at ip=%x via sigreturn(%p)\n", c->dwarf.ip, sc); + sigreturn((ucontext_t *)((const char *)sc + FREEBSD_SC_UCONTEXT_OFF)); + abort(); + } else { + Debug (8, "resuming at ip=%x for sigcontext format %d not implemented\n", + c->dwarf.ip, c->sigcontext_format); + abort(); + } + return -UNW_EINVAL; +} + +#endif diff --git a/vendor/libunwind/src/x86/Gos-linux.c b/vendor/libunwind/src/x86/Gos-linux.c new file mode 100644 index 0000000000..725ef73827 --- /dev/null +++ b/vendor/libunwind/src/x86/Gos-linux.c @@ -0,0 +1,301 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" +#include "offsets.h" + +#include + +int +unw_is_signal_frame (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + unw_word_t w0, w1, ip; + unw_addr_space_t as; + unw_accessors_t *a; + void *arg; + int ret; + + as = c->dwarf.as; + a = unw_get_accessors_int (as); + arg = c->dwarf.as_arg; + + /* Check if EIP points at sigreturn() sequence. On Linux, this is: + + __restore: + 0x58 pop %eax + 0xb8 0x77 0x00 0x00 0x00 movl 0x77,%eax + 0xcd 0x80 int 0x80 + + without SA_SIGINFO, and + + __restore_rt: + 0xb8 0xad 0x00 0x00 0x00 movl 0xad,%eax + 0xcd 0x80 int 0x80 + 0x00 + + if SA_SIGINFO is specified. + */ + ip = c->dwarf.ip; + if ((*a->access_mem) (as, ip, &w0, 0, arg) < 0 + || (*a->access_mem) (as, ip + 4, &w1, 0, arg) < 0) + ret = 0; + else + ret = ((w0 == 0x0077b858 && w1 == 0x80cd0000) + || (w0 == 0x0000adb8 && (w1 & 0xffffff) == 0x80cd00)); + Debug (16, "returning %d\n", ret); + return ret; +} + +HIDDEN int +x86_handle_signal_frame (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + int i, ret; + + /* c->esp points at the arguments to the handler. Without + SA_SIGINFO, the arguments consist of a signal number + followed by a struct sigcontext. With SA_SIGINFO, the + arguments consist a signal number, a siginfo *, and a + ucontext *. */ + unw_word_t sc_addr; + unw_word_t siginfo_ptr_addr = c->dwarf.cfa + 4; + unw_word_t sigcontext_ptr_addr = c->dwarf.cfa + 8; + unw_word_t siginfo_ptr, sigcontext_ptr; + struct dwarf_loc esp_loc, siginfo_ptr_loc, sigcontext_ptr_loc; + + siginfo_ptr_loc = DWARF_LOC (siginfo_ptr_addr, 0); + sigcontext_ptr_loc = DWARF_LOC (sigcontext_ptr_addr, 0); + ret = (dwarf_get (&c->dwarf, siginfo_ptr_loc, &siginfo_ptr) + | dwarf_get (&c->dwarf, sigcontext_ptr_loc, &sigcontext_ptr)); + if (ret < 0) + { + Debug (2, "returning 0\n"); + return 0; + } + if (siginfo_ptr < c->dwarf.cfa + || siginfo_ptr > c->dwarf.cfa + 256 + || sigcontext_ptr < c->dwarf.cfa + || sigcontext_ptr > c->dwarf.cfa + 256) + { + /* Not plausible for SA_SIGINFO signal */ + c->sigcontext_format = X86_SCF_LINUX_SIGFRAME; + c->sigcontext_addr = sc_addr = c->dwarf.cfa + 4; + } + else + { + /* If SA_SIGINFO were not specified, we actually read + various segment pointers instead. We believe that at + least fs and _fsh are always zero for linux, so it is + not just unlikely, but impossible that we would end + up here. */ + c->sigcontext_format = X86_SCF_LINUX_RT_SIGFRAME; + c->sigcontext_addr = sigcontext_ptr; + sc_addr = sigcontext_ptr + LINUX_UC_MCONTEXT_OFF; + } + esp_loc = DWARF_LOC (sc_addr + LINUX_SC_ESP_OFF, 0); + ret = dwarf_get (&c->dwarf, esp_loc, &c->dwarf.cfa); + if (ret < 0) + { + Debug (2, "returning 0\n"); + return 0; + } + + for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) + c->dwarf.loc[i] = DWARF_NULL_LOC; + + c->dwarf.loc[EAX] = DWARF_LOC (sc_addr + LINUX_SC_EAX_OFF, 0); + c->dwarf.loc[ECX] = DWARF_LOC (sc_addr + LINUX_SC_ECX_OFF, 0); + c->dwarf.loc[EDX] = DWARF_LOC (sc_addr + LINUX_SC_EDX_OFF, 0); + c->dwarf.loc[EBX] = DWARF_LOC (sc_addr + LINUX_SC_EBX_OFF, 0); + c->dwarf.loc[EBP] = DWARF_LOC (sc_addr + LINUX_SC_EBP_OFF, 0); + c->dwarf.loc[ESI] = DWARF_LOC (sc_addr + LINUX_SC_ESI_OFF, 0); + c->dwarf.loc[EDI] = DWARF_LOC (sc_addr + LINUX_SC_EDI_OFF, 0); + c->dwarf.loc[EIP] = DWARF_LOC (sc_addr + LINUX_SC_EIP_OFF, 0); + c->dwarf.loc[ESP] = DWARF_LOC (sc_addr + LINUX_SC_ESP_OFF, 0); + + ret = dwarf_get (&c->dwarf, c->dwarf.loc[EIP], &c->dwarf.ip); + ret = dwarf_get (&c->dwarf, c->dwarf.loc[ESP], &c->dwarf.cfa); + c->dwarf.use_prev_instr = 0; + + return 0; +} + +HIDDEN dwarf_loc_t +x86_get_scratch_loc (struct cursor *c, unw_regnum_t reg) +{ + unw_word_t addr = c->sigcontext_addr, fpstate_addr, off; + int ret, is_fpstate = 0; + + switch (c->sigcontext_format) + { + case X86_SCF_NONE: + return DWARF_REG_LOC (&c->dwarf, reg); + + case X86_SCF_LINUX_SIGFRAME: + break; + + case X86_SCF_LINUX_RT_SIGFRAME: + addr += LINUX_UC_MCONTEXT_OFF; + break; + + default: + return DWARF_NULL_LOC; + } + + switch (reg) + { + case UNW_X86_GS: off = LINUX_SC_GS_OFF; break; + case UNW_X86_FS: off = LINUX_SC_FS_OFF; break; + case UNW_X86_ES: off = LINUX_SC_ES_OFF; break; + case UNW_X86_DS: off = LINUX_SC_DS_OFF; break; + case UNW_X86_EDI: off = LINUX_SC_EDI_OFF; break; + case UNW_X86_ESI: off = LINUX_SC_ESI_OFF; break; + case UNW_X86_EBP: off = LINUX_SC_EBP_OFF; break; + case UNW_X86_ESP: off = LINUX_SC_ESP_OFF; break; + case UNW_X86_EBX: off = LINUX_SC_EBX_OFF; break; + case UNW_X86_EDX: off = LINUX_SC_EDX_OFF; break; + case UNW_X86_ECX: off = LINUX_SC_ECX_OFF; break; + case UNW_X86_EAX: off = LINUX_SC_EAX_OFF; break; + case UNW_X86_TRAPNO: off = LINUX_SC_TRAPNO_OFF; break; + case UNW_X86_EIP: off = LINUX_SC_EIP_OFF; break; + case UNW_X86_CS: off = LINUX_SC_CS_OFF; break; + case UNW_X86_EFLAGS: off = LINUX_SC_EFLAGS_OFF; break; + case UNW_X86_SS: off = LINUX_SC_SS_OFF; break; + + /* The following is probably not correct for all possible cases. + Somebody who understands this better should review this for + correctness. */ + + case UNW_X86_FCW: is_fpstate = 1; off = LINUX_FPSTATE_CW_OFF; break; + case UNW_X86_FSW: is_fpstate = 1; off = LINUX_FPSTATE_SW_OFF; break; + case UNW_X86_FTW: is_fpstate = 1; off = LINUX_FPSTATE_TAG_OFF; break; + case UNW_X86_FCS: is_fpstate = 1; off = LINUX_FPSTATE_CSSEL_OFF; break; + case UNW_X86_FIP: is_fpstate = 1; off = LINUX_FPSTATE_IPOFF_OFF; break; + case UNW_X86_FEA: is_fpstate = 1; off = LINUX_FPSTATE_DATAOFF_OFF; break; + case UNW_X86_FDS: is_fpstate = 1; off = LINUX_FPSTATE_DATASEL_OFF; break; + case UNW_X86_MXCSR: is_fpstate = 1; off = LINUX_FPSTATE_MXCSR_OFF; break; + + /* stacked fp registers */ + case UNW_X86_ST0: case UNW_X86_ST1: case UNW_X86_ST2: case UNW_X86_ST3: + case UNW_X86_ST4: case UNW_X86_ST5: case UNW_X86_ST6: case UNW_X86_ST7: + is_fpstate = 1; + off = LINUX_FPSTATE_ST0_OFF + 10*(reg - UNW_X86_ST0); + break; + + /* SSE fp registers */ + case UNW_X86_XMM0_lo: case UNW_X86_XMM0_hi: + case UNW_X86_XMM1_lo: case UNW_X86_XMM1_hi: + case UNW_X86_XMM2_lo: case UNW_X86_XMM2_hi: + case UNW_X86_XMM3_lo: case UNW_X86_XMM3_hi: + case UNW_X86_XMM4_lo: case UNW_X86_XMM4_hi: + case UNW_X86_XMM5_lo: case UNW_X86_XMM5_hi: + case UNW_X86_XMM6_lo: case UNW_X86_XMM6_hi: + case UNW_X86_XMM7_lo: case UNW_X86_XMM7_hi: + is_fpstate = 1; + off = LINUX_FPSTATE_XMM0_OFF + 8*(reg - UNW_X86_XMM0_lo); + break; + case UNW_X86_XMM0: + case UNW_X86_XMM1: + case UNW_X86_XMM2: + case UNW_X86_XMM3: + case UNW_X86_XMM4: + case UNW_X86_XMM5: + case UNW_X86_XMM6: + case UNW_X86_XMM7: + is_fpstate = 1; + off = LINUX_FPSTATE_XMM0_OFF + 16*(reg - UNW_X86_XMM0); + break; + + case UNW_X86_FOP: + case UNW_X86_TSS: + case UNW_X86_LDT: + default: + return DWARF_REG_LOC (&c->dwarf, reg); + } + + if (is_fpstate) + { + if ((ret = dwarf_get (&c->dwarf, + DWARF_MEM_LOC (&c->dwarf, + addr + LINUX_SC_FPSTATE_OFF), + &fpstate_addr)) < 0) + return DWARF_NULL_LOC; + + if (!fpstate_addr) + return DWARF_NULL_LOC; + + return DWARF_MEM_LOC (c, fpstate_addr + off); + } + else + return DWARF_MEM_LOC (c, addr + off); +} + +#ifndef UNW_REMOTE_ONLY +HIDDEN void * +x86_r_uc_addr (ucontext_t *uc, int reg) +{ + void *addr; + + switch (reg) + { + case UNW_X86_GS: addr = &uc->uc_mcontext.gregs[REG_GS]; break; + case UNW_X86_FS: addr = &uc->uc_mcontext.gregs[REG_FS]; break; + case UNW_X86_ES: addr = &uc->uc_mcontext.gregs[REG_ES]; break; + case UNW_X86_DS: addr = &uc->uc_mcontext.gregs[REG_DS]; break; + case UNW_X86_EAX: addr = &uc->uc_mcontext.gregs[REG_EAX]; break; + case UNW_X86_EBX: addr = &uc->uc_mcontext.gregs[REG_EBX]; break; + case UNW_X86_ECX: addr = &uc->uc_mcontext.gregs[REG_ECX]; break; + case UNW_X86_EDX: addr = &uc->uc_mcontext.gregs[REG_EDX]; break; + case UNW_X86_ESI: addr = &uc->uc_mcontext.gregs[REG_ESI]; break; + case UNW_X86_EDI: addr = &uc->uc_mcontext.gregs[REG_EDI]; break; + case UNW_X86_EBP: addr = &uc->uc_mcontext.gregs[REG_EBP]; break; + case UNW_X86_EIP: addr = &uc->uc_mcontext.gregs[REG_EIP]; break; + case UNW_X86_ESP: addr = &uc->uc_mcontext.gregs[REG_ESP]; break; + case UNW_X86_TRAPNO: addr = &uc->uc_mcontext.gregs[REG_TRAPNO]; break; + case UNW_X86_CS: addr = &uc->uc_mcontext.gregs[REG_CS]; break; + case UNW_X86_EFLAGS: addr = &uc->uc_mcontext.gregs[REG_EFL]; break; + case UNW_X86_SS: addr = &uc->uc_mcontext.gregs[REG_SS]; break; + + default: + addr = NULL; + } + return addr; +} + +HIDDEN int +x86_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg) +{ + struct cursor *c = (struct cursor *) cursor; + ucontext_t *uc = c->uc; + + Debug (8, "resuming at ip=%x via setcontext()\n", c->dwarf.ip); +#if !defined(__ANDROID__) + setcontext (uc); +#endif + return -UNW_EINVAL; +} + +#endif diff --git a/vendor/libunwind/src/x86/Greg_states_iterate.c b/vendor/libunwind/src/x86/Greg_states_iterate.c new file mode 100644 index 0000000000..a17dc1b561 --- /dev/null +++ b/vendor/libunwind/src/x86/Greg_states_iterate.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +int +unw_reg_states_iterate (unw_cursor_t *cursor, + unw_reg_states_callback cb, void *token) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_reg_states_iterate (&c->dwarf, cb, token); +} diff --git a/vendor/libunwind/src/x86/Gregs.c b/vendor/libunwind/src/x86/Gregs.c new file mode 100644 index 0000000000..9446d6c62c --- /dev/null +++ b/vendor/libunwind/src/x86/Gregs.c @@ -0,0 +1,178 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2004 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "offsets.h" +#include "unwind_i.h" + +HIDDEN dwarf_loc_t +x86_scratch_loc (struct cursor *c, unw_regnum_t reg) +{ + if (c->sigcontext_addr) + return x86_get_scratch_loc (c, reg); + else + return DWARF_REG_LOC (&c->dwarf, reg); +} + +HIDDEN int +tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, + int write) +{ + dwarf_loc_t loc = DWARF_NULL_LOC; + unsigned int mask; + int arg_num; + + switch (reg) + { + + case UNW_X86_EIP: + if (write) + c->dwarf.ip = *valp; /* also update the EIP cache */ + loc = c->dwarf.loc[EIP]; + break; + + case UNW_X86_CFA: + if (write) + return -UNW_EREADONLYREG; + *valp = c->dwarf.cfa; + return 0; + + case UNW_X86_EAX: + case UNW_X86_EDX: + arg_num = reg - UNW_X86_EAX; + mask = (1 << arg_num); + if (write) + { + c->dwarf.eh_args[arg_num] = *valp; + c->dwarf.eh_valid_mask |= mask; + return 0; + } + else if ((c->dwarf.eh_valid_mask & mask) != 0) + { + *valp = c->dwarf.eh_args[arg_num]; + return 0; + } + else + loc = c->dwarf.loc[(reg == UNW_X86_EAX) ? EAX : EDX]; + break; + + case UNW_X86_ECX: loc = c->dwarf.loc[ECX]; break; + case UNW_X86_EBX: loc = c->dwarf.loc[EBX]; break; + + case UNW_X86_ESP: loc = c->dwarf.loc[ESP]; break; + case UNW_X86_EBP: loc = c->dwarf.loc[EBP]; break; + case UNW_X86_ESI: loc = c->dwarf.loc[ESI]; break; + case UNW_X86_EDI: loc = c->dwarf.loc[EDI]; break; + case UNW_X86_EFLAGS: loc = c->dwarf.loc[EFLAGS]; break; + case UNW_X86_TRAPNO: loc = c->dwarf.loc[TRAPNO]; break; + + case UNW_X86_FCW: + case UNW_X86_FSW: + case UNW_X86_FTW: + case UNW_X86_FOP: + case UNW_X86_FCS: + case UNW_X86_FIP: + case UNW_X86_FEA: + case UNW_X86_FDS: + case UNW_X86_MXCSR: + case UNW_X86_GS: + case UNW_X86_FS: + case UNW_X86_ES: + case UNW_X86_DS: + case UNW_X86_SS: + case UNW_X86_CS: + case UNW_X86_TSS: + case UNW_X86_LDT: + loc = x86_scratch_loc (c, reg); + break; + + default: + Debug (1, "bad register number %u\n", reg); + return -UNW_EBADREG; + } + + if (write) + return dwarf_put (&c->dwarf, loc, *valp); + else + return dwarf_get (&c->dwarf, loc, valp); +} + +HIDDEN int +tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, unw_fpreg_t *valp, + int write) +{ + struct dwarf_loc loc = DWARF_NULL_LOC; + + switch (reg) + { + case UNW_X86_ST0: + loc = c->dwarf.loc[ST0]; + break; + + /* stacked fp registers */ + case UNW_X86_ST1: + case UNW_X86_ST2: + case UNW_X86_ST3: + case UNW_X86_ST4: + case UNW_X86_ST5: + case UNW_X86_ST6: + case UNW_X86_ST7: + /* SSE fp registers */ + case UNW_X86_XMM0: + case UNW_X86_XMM1: + case UNW_X86_XMM2: + case UNW_X86_XMM3: + case UNW_X86_XMM4: + case UNW_X86_XMM5: + case UNW_X86_XMM6: + case UNW_X86_XMM7: + case UNW_X86_XMM0_lo: + case UNW_X86_XMM0_hi: + case UNW_X86_XMM1_lo: + case UNW_X86_XMM1_hi: + case UNW_X86_XMM2_lo: + case UNW_X86_XMM2_hi: + case UNW_X86_XMM3_lo: + case UNW_X86_XMM3_hi: + case UNW_X86_XMM4_lo: + case UNW_X86_XMM4_hi: + case UNW_X86_XMM5_lo: + case UNW_X86_XMM5_hi: + case UNW_X86_XMM6_lo: + case UNW_X86_XMM6_hi: + case UNW_X86_XMM7_lo: + case UNW_X86_XMM7_hi: + loc = x86_scratch_loc (c, reg); + break; + + default: + Debug (1, "bad register number %u\n", reg); + return -UNW_EBADREG; + } + + if (write) + return dwarf_putfp (&c->dwarf, loc, *valp); + else + return dwarf_getfp (&c->dwarf, loc, valp); +} diff --git a/vendor/libunwind/src/x86/Gresume.c b/vendor/libunwind/src/x86/Gresume.c new file mode 100644 index 0000000000..5072c4ba08 --- /dev/null +++ b/vendor/libunwind/src/x86/Gresume.c @@ -0,0 +1,91 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2004 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include + +#include "unwind_i.h" +#include "offsets.h" + +/* This routine is responsible for copying the register values in + cursor C and establishing them as the current machine state. */ + +static inline int +establish_machine_state (struct cursor *c) +{ + int (*access_reg) (unw_addr_space_t, unw_regnum_t, unw_word_t *, + int write, void *); + int (*access_fpreg) (unw_addr_space_t, unw_regnum_t, unw_fpreg_t *, + int write, void *); + unw_addr_space_t as = c->dwarf.as; + void *arg = c->dwarf.as_arg; + unw_fpreg_t fpval; + unw_word_t val; + int reg; + + access_reg = as->acc.access_reg; + access_fpreg = as->acc.access_fpreg; + + Debug (8, "copying out cursor state\n"); + + for (reg = 0; reg <= UNW_REG_LAST; ++reg) + { + Debug (16, "copying %s %d\n", unw_regname (reg), reg); + if (unw_is_fpreg (reg)) + { + if (tdep_access_fpreg (c, reg, &fpval, 0) >= 0) + (*access_fpreg) (as, reg, &fpval, 1, arg); + } + else + { + if (tdep_access_reg (c, reg, &val, 0) >= 0) + (*access_reg) (as, reg, &val, 1, arg); + } + } + + if (c->dwarf.args_size) + { + if (tdep_access_reg (c, UNW_X86_ESP, &val, 0) >= 0) + { + val += c->dwarf.args_size; + (*access_reg) (as, UNW_X86_ESP, &val, 1, arg); + } + } + return 0; +} + +int +unw_resume (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + int ret; + + Debug (1, "(cursor=%p)\n", c); + + if ((ret = establish_machine_state (c)) < 0) + return ret; + + return (*c->dwarf.as->acc.resume) (c->dwarf.as, (unw_cursor_t *) c, + c->dwarf.as_arg); +} diff --git a/vendor/libunwind/src/x86/Gstep.c b/vendor/libunwind/src/x86/Gstep.c new file mode 100644 index 0000000000..52e327eded --- /dev/null +++ b/vendor/libunwind/src/x86/Gstep.c @@ -0,0 +1,116 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" +#include "offsets.h" + +int +unw_step (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + int ret, i; + int validate = c->validate; + c->validate = 1; + + Debug (1, "(cursor=%p, ip=0x%08x)\n", c, (unsigned) c->dwarf.ip); + + /* + * Special-case the signal trampoline since on many OS targets it lacks DWARF + * unwind info. + */ + if (unw_is_signal_frame (cursor) > 0) + { + ret = x86_handle_signal_frame(cursor); + return 1; + } + + /* Try DWARF-based unwinding... */ + ret = dwarf_step (&c->dwarf); + c->validate = validate; + + if (ret < 0 && ret != -UNW_ENOINFO) + { + Debug (2, "returning %d\n", ret); + return ret; + } + + if (unlikely (ret < 0)) + { + /* DWARF failed, let's see if we can follow the frame-chain */ + struct dwarf_loc ebp_loc, eip_loc, esp_loc; + + + Debug (13, "dwarf_step() failed (ret=%d), trying frame-chain\n", ret); + + ret = dwarf_get (&c->dwarf, c->dwarf.loc[EBP], &c->dwarf.cfa); + if (ret < 0) + { + Debug (2, "returning %d\n", ret); + return ret; + } + + Debug (13, "[EBP=0x%x] = 0x%x\n", DWARF_GET_LOC (c->dwarf.loc[EBP]), c->dwarf.cfa); + + ebp_loc = DWARF_LOC (c->dwarf.cfa, 0); + esp_loc = DWARF_VAL_LOC (c, c->dwarf.cfa + 8); + eip_loc = DWARF_LOC (c->dwarf.cfa + 4, 0); + c->dwarf.cfa += 8; + + /* + * Mark all registers unsaved, since we don't know where they are saved + * (if at all), except for the EBP and EIP. + */ + for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) + { + c->dwarf.loc[i] = DWARF_NULL_LOC; + } + + c->dwarf.loc[EBP] = ebp_loc; + c->dwarf.loc[ESP] = esp_loc; + c->dwarf.loc[EIP] = eip_loc; + c->dwarf.use_prev_instr = 1; + + if (!DWARF_IS_NULL_LOC (c->dwarf.loc[EBP])) + { + ret = dwarf_get (&c->dwarf, c->dwarf.loc[EIP], &c->dwarf.ip); + if (ret < 0) + { + Debug (13, "dwarf_get([EIP=0x%x]) failed\n", DWARF_GET_LOC (c->dwarf.loc[EIP])); + Debug (2, "returning %d\n", ret); + return ret; + } + else + { + Debug (13, "[EIP=0x%x] = 0x%x\n", DWARF_GET_LOC (c->dwarf.loc[EIP]), + c->dwarf.ip); + } + } + else + c->dwarf.ip = 0; + } + ret = (c->dwarf.ip == 0) ? 0 : 1; + Debug (2, "returning %d\n", ret); + return ret; +} diff --git a/vendor/libunwind/src/x86/Lapply_reg_state.c b/vendor/libunwind/src/x86/Lapply_reg_state.c new file mode 100644 index 0000000000..7ebada480e --- /dev/null +++ b/vendor/libunwind/src/x86/Lapply_reg_state.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gapply_reg_state.c" +#endif diff --git a/vendor/libunwind/src/x86/Lcreate_addr_space.c b/vendor/libunwind/src/x86/Lcreate_addr_space.c new file mode 100644 index 0000000000..0f2dc6be90 --- /dev/null +++ b/vendor/libunwind/src/x86/Lcreate_addr_space.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gcreate_addr_space.c" +#endif diff --git a/vendor/libunwind/src/x86/Lget_proc_info.c b/vendor/libunwind/src/x86/Lget_proc_info.c new file mode 100644 index 0000000000..69028b019f --- /dev/null +++ b/vendor/libunwind/src/x86/Lget_proc_info.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gget_proc_info.c" +#endif diff --git a/vendor/libunwind/src/x86/Lget_save_loc.c b/vendor/libunwind/src/x86/Lget_save_loc.c new file mode 100644 index 0000000000..9ea048a907 --- /dev/null +++ b/vendor/libunwind/src/x86/Lget_save_loc.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gget_save_loc.c" +#endif diff --git a/vendor/libunwind/src/x86/Lglobal.c b/vendor/libunwind/src/x86/Lglobal.c new file mode 100644 index 0000000000..6d7b489e14 --- /dev/null +++ b/vendor/libunwind/src/x86/Lglobal.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gglobal.c" +#endif diff --git a/vendor/libunwind/src/x86/Linit.c b/vendor/libunwind/src/x86/Linit.c new file mode 100644 index 0000000000..e9abfdd46a --- /dev/null +++ b/vendor/libunwind/src/x86/Linit.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Ginit.c" +#endif diff --git a/vendor/libunwind/src/x86/Linit_local.c b/vendor/libunwind/src/x86/Linit_local.c new file mode 100644 index 0000000000..68a1687e85 --- /dev/null +++ b/vendor/libunwind/src/x86/Linit_local.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Ginit_local.c" +#endif diff --git a/vendor/libunwind/src/x86/Linit_remote.c b/vendor/libunwind/src/x86/Linit_remote.c new file mode 100644 index 0000000000..58cb04ab7c --- /dev/null +++ b/vendor/libunwind/src/x86/Linit_remote.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Ginit_remote.c" +#endif diff --git a/vendor/libunwind/src/x86/Los-freebsd.c b/vendor/libunwind/src/x86/Los-freebsd.c new file mode 100644 index 0000000000..a75a205df1 --- /dev/null +++ b/vendor/libunwind/src/x86/Los-freebsd.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gos-freebsd.c" +#endif diff --git a/vendor/libunwind/src/x86/Los-linux.c b/vendor/libunwind/src/x86/Los-linux.c new file mode 100644 index 0000000000..3cc18aabcc --- /dev/null +++ b/vendor/libunwind/src/x86/Los-linux.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gos-linux.c" +#endif diff --git a/vendor/libunwind/src/x86/Lreg_states_iterate.c b/vendor/libunwind/src/x86/Lreg_states_iterate.c new file mode 100644 index 0000000000..f1eb1e79dc --- /dev/null +++ b/vendor/libunwind/src/x86/Lreg_states_iterate.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Greg_states_iterate.c" +#endif diff --git a/vendor/libunwind/src/x86/Lregs.c b/vendor/libunwind/src/x86/Lregs.c new file mode 100644 index 0000000000..2c9c75cd7d --- /dev/null +++ b/vendor/libunwind/src/x86/Lregs.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gregs.c" +#endif diff --git a/vendor/libunwind/src/x86/Lresume.c b/vendor/libunwind/src/x86/Lresume.c new file mode 100644 index 0000000000..41a8cf003d --- /dev/null +++ b/vendor/libunwind/src/x86/Lresume.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gresume.c" +#endif diff --git a/vendor/libunwind/src/x86/Lstep.c b/vendor/libunwind/src/x86/Lstep.c new file mode 100644 index 0000000000..c1ac3c7547 --- /dev/null +++ b/vendor/libunwind/src/x86/Lstep.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gstep.c" +#endif diff --git a/vendor/libunwind/src/x86/getcontext-freebsd.S b/vendor/libunwind/src/x86/getcontext-freebsd.S new file mode 100644 index 0000000000..670eff1ae1 --- /dev/null +++ b/vendor/libunwind/src/x86/getcontext-freebsd.S @@ -0,0 +1,112 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2010 Konstantin Belousov + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "offsets.h" + + .global _Ux86_getcontext + .type _Ux86_getcontext, @function +_Ux86_getcontext: + .cfi_startproc + pushl %eax + .cfi_adjust_cfa_offset 4 + mov 8(%esp),%eax /* ucontext_t* */ + popl FREEBSD_UC_MCONTEXT_EAX_OFF(%eax) + .cfi_adjust_cfa_offset 4 + movl %ebx, FREEBSD_UC_MCONTEXT_EBX_OFF(%eax) + movl %ecx, FREEBSD_UC_MCONTEXT_ECX_OFF(%eax) + movl %edx, FREEBSD_UC_MCONTEXT_EDX_OFF(%eax) + movl %edi, FREEBSD_UC_MCONTEXT_EDI_OFF(%eax) + movl %esi, FREEBSD_UC_MCONTEXT_ESI_OFF(%eax) + movl %ebp, FREEBSD_UC_MCONTEXT_EBP_OFF(%eax) + + movl (%esp), %ecx + movl %ecx, FREEBSD_UC_MCONTEXT_EIP_OFF(%eax) + + leal 4(%esp), %ecx /* Exclude the return address. */ + movl %ecx, FREEBSD_UC_MCONTEXT_ESP_OFF(%eax) + + xorl %ecx, %ecx + movw %fs, %cx + movl %ecx, FREEBSD_UC_MCONTEXT_FS_OFF(%eax) + movw %gs, %cx + movl %ecx, FREEBSD_UC_MCONTEXT_GS_OFF(%eax) + movw %ds, %cx + movl %ecx, FREEBSD_UC_MCONTEXT_DS_OFF(%eax) + movw %es, %cx + movl %ecx, FREEBSD_UC_MCONTEXT_ES_OFF(%eax) + movw %ss, %cx + movl %ecx, FREEBSD_UC_MCONTEXT_SS_OFF(%eax) + movw %cs, %cx + movl %ecx, FREEBSD_UC_MCONTEXT_CS_OFF(%eax) + + pushfl + .cfi_adjust_cfa_offset 4 + popl FREEBSD_UC_MCONTEXT_EFLAGS_OFF(%eax) + .cfi_adjust_cfa_offset -4 + + movl $0, FREEBSD_UC_MCONTEXT_TRAPNO_OFF(%eax) + + movl $FREEBSD_UC_MCONTEXT_FPOWNED_FPU,\ + FREEBSD_UC_MCONTEXT_OWNEDFP_OFF(%eax) + movl $FREEBSD_UC_MCONTEXT_FPFMT_XMM,\ + FREEBSD_UC_MCONTEXT_FPFORMAT_OFF(%eax) + + /* + * Require CPU with fxsave implemented, and enabled by OS. + * + * If passed ucontext is not aligned to 16-byte boundary, + * save fpu context into temporary aligned location on stack + * and then copy. + */ + leal FREEBSD_UC_MCONTEXT_FPSTATE_OFF(%eax), %edx + testl $0xf, %edx + jne 2f + fxsave (%edx) /* fast path, passed ucontext save area was aligned */ +1: movl $FREEBSD_UC_MCONTEXT_MC_LEN_VAL,\ + FREEBSD_UC_MCONTEXT_MC_LEN_OFF(%eax) + + xorl %eax, %eax + ret + +2: movl %edx, %edi /* not aligned, do the dance */ + subl $512 + 16, %esp /* save area and 16 bytes for alignment */ + .cfi_adjust_cfa_offset 512 + 16 + movl %esp, %edx + orl $0xf, %edx /* align *%edx to 16-byte up */ + incl %edx + fxsave (%edx) + movl %edx, %esi /* copy to the final destination */ + movl $512/4,%ecx + rep; movsl + addl $512 + 16, %esp /* restore the stack */ + .cfi_adjust_cfa_offset -512 - 16 + movl FREEBSD_UC_MCONTEXT_ESI_OFF(%eax), %esi + movl FREEBSD_UC_MCONTEXT_EDI_OFF(%eax), %edi + jmp 1b + + .cfi_endproc + .size _Ux86_getcontext, . - _Ux86_getcontext + + /* We do not need executable stack. */ + .section .note.GNU-stack,"",@progbits diff --git a/vendor/libunwind/src/x86/getcontext-linux.S b/vendor/libunwind/src/x86/getcontext-linux.S new file mode 100644 index 0000000000..c469dadbac --- /dev/null +++ b/vendor/libunwind/src/x86/getcontext-linux.S @@ -0,0 +1,74 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2009 Google, Inc + Contributed by Paul Pluzhnikov + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "offsets.h" + +/* int _Ux86_getcontext (ucontext_t *ucp) + + Saves the machine context in UCP necessary for libunwind. + Unlike the libc implementation, we don't save the signal mask + and hence avoid the cost of a system call per unwind. + +*/ + + .global _Ux86_getcontext + .type _Ux86_getcontext, @function +_Ux86_getcontext: + .cfi_startproc + mov 4(%esp),%eax /* ucontext_t* */ + + /* EAX is not preserved. */ + movl $0, (LINUX_UC_MCONTEXT_OFF+LINUX_SC_EAX_OFF)(%eax) + + movl %ebx, (LINUX_UC_MCONTEXT_OFF+LINUX_SC_EBX_OFF)(%eax) + movl %ecx, (LINUX_UC_MCONTEXT_OFF+LINUX_SC_ECX_OFF)(%eax) + movl %edx, (LINUX_UC_MCONTEXT_OFF+LINUX_SC_EDX_OFF)(%eax) + movl %edi, (LINUX_UC_MCONTEXT_OFF+LINUX_SC_EDI_OFF)(%eax) + movl %esi, (LINUX_UC_MCONTEXT_OFF+LINUX_SC_ESI_OFF)(%eax) + movl %ebp, (LINUX_UC_MCONTEXT_OFF+LINUX_SC_EBP_OFF)(%eax) + + movl (%esp), %ecx + movl %ecx, (LINUX_UC_MCONTEXT_OFF+LINUX_SC_EIP_OFF)(%eax) + + leal 4(%esp), %ecx /* Exclude the return address. */ + movl %ecx, (LINUX_UC_MCONTEXT_OFF+LINUX_SC_ESP_OFF)(%eax) + + /* glibc getcontext saves FS, but not GS */ + xorl %ecx, %ecx + movw %fs, %cx + movl %ecx, (LINUX_UC_MCONTEXT_OFF+LINUX_SC_FS_OFF)(%eax) + + leal LINUX_UC_FPREGS_MEM_OFF(%eax), %ecx + movl %ecx, (LINUX_UC_MCONTEXT_OFF+LINUX_SC_FPSTATE_OFF)(%eax) + fnstenv (%ecx) + fldenv (%ecx) + + xor %eax, %eax + ret + .cfi_endproc + .size _Ux86_getcontext, . - _Ux86_getcontext + + /* We do not need executable stack. */ + .section .note.GNU-stack,"",@progbits diff --git a/vendor/libunwind/src/x86/init.h b/vendor/libunwind/src/x86/init.h new file mode 100644 index 0000000000..b0db8d337d --- /dev/null +++ b/vendor/libunwind/src/x86/init.h @@ -0,0 +1,69 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +static inline int +common_init (struct cursor *c, unsigned use_prev_instr) +{ + int ret, i; + + c->dwarf.loc[EAX] = DWARF_REG_LOC (&c->dwarf, UNW_X86_EAX); + c->dwarf.loc[ECX] = DWARF_REG_LOC (&c->dwarf, UNW_X86_ECX); + c->dwarf.loc[EDX] = DWARF_REG_LOC (&c->dwarf, UNW_X86_EDX); + c->dwarf.loc[EBX] = DWARF_REG_LOC (&c->dwarf, UNW_X86_EBX); + c->dwarf.loc[ESP] = DWARF_REG_LOC (&c->dwarf, UNW_X86_ESP); + c->dwarf.loc[EBP] = DWARF_REG_LOC (&c->dwarf, UNW_X86_EBP); + c->dwarf.loc[ESI] = DWARF_REG_LOC (&c->dwarf, UNW_X86_ESI); + c->dwarf.loc[EDI] = DWARF_REG_LOC (&c->dwarf, UNW_X86_EDI); + c->dwarf.loc[EIP] = DWARF_REG_LOC (&c->dwarf, UNW_X86_EIP); + c->dwarf.loc[EFLAGS] = DWARF_REG_LOC (&c->dwarf, UNW_X86_EFLAGS); + c->dwarf.loc[TRAPNO] = DWARF_REG_LOC (&c->dwarf, UNW_X86_TRAPNO); + c->dwarf.loc[ST0] = DWARF_REG_LOC (&c->dwarf, UNW_X86_ST0); + for (i = ST0 + 1; i < DWARF_NUM_PRESERVED_REGS; ++i) + c->dwarf.loc[i] = DWARF_NULL_LOC; + + ret = dwarf_get (&c->dwarf, c->dwarf.loc[EIP], &c->dwarf.ip); + if (ret < 0) + return ret; + + ret = dwarf_get (&c->dwarf, DWARF_REG_LOC (&c->dwarf, UNW_X86_ESP), + &c->dwarf.cfa); + if (ret < 0) + return ret; + + c->sigcontext_format = X86_SCF_NONE; + c->sigcontext_addr = 0; + + c->dwarf.args_size = 0; + c->dwarf.stash_frames = 0; + c->dwarf.use_prev_instr = use_prev_instr; + c->dwarf.pi_valid = 0; + c->dwarf.pi_is_dynamic = 0; + c->dwarf.hint = 0; + c->dwarf.prev_rs = 0; + + return 0; +} diff --git a/vendor/libunwind/src/x86/is_fpreg.c b/vendor/libunwind/src/x86/is_fpreg.c new file mode 100644 index 0000000000..a3a98ac8d3 --- /dev/null +++ b/vendor/libunwind/src/x86/is_fpreg.c @@ -0,0 +1,34 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2004-2005 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +int +unw_is_fpreg (int regnum) +{ + return ((regnum >= UNW_X86_ST0 && regnum <= UNW_X86_ST7) + || (regnum >= UNW_X86_XMM0_lo && regnum <= UNW_X86_XMM7_hi) + || (regnum >= UNW_X86_XMM0 && regnum <= UNW_X86_XMM7)); +} diff --git a/vendor/libunwind/src/x86/longjmp.S b/vendor/libunwind/src/x86/longjmp.S new file mode 100644 index 0000000000..05173d0c10 --- /dev/null +++ b/vendor/libunwind/src/x86/longjmp.S @@ -0,0 +1,39 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + + .globl _UI_longjmp_cont + + .type _UI_longjmp_cont, @function +_UI_longjmp_cont: + .cfi_startproc + .cfi_register 8, 0 /* IP saved in EAX */ + push %eax /* push target IP as return address */ + .cfi_restore 8 + mov %edx, %eax /* set up return-value */ + ret + .cfi_endproc + .size _UI_siglongjmp_cont, .-_UI_longjmp_cont + /* We do not need executable stack. */ + .section .note.GNU-stack,"",@progbits diff --git a/vendor/libunwind/src/x86/offsets.h b/vendor/libunwind/src/x86/offsets.h new file mode 100644 index 0000000000..e5aec7f588 --- /dev/null +++ b/vendor/libunwind/src/x86/offsets.h @@ -0,0 +1,140 @@ +/* Linux-specific definitions: */ + +/* Define various structure offsets to simplify cross-compilation. */ + +/* Offsets for x86 Linux "ucontext_t": */ + +#define LINUX_UC_FLAGS_OFF 0x00 +#define LINUX_UC_LINK_OFF 0x04 +#define LINUX_UC_STACK_OFF 0x08 +#define LINUX_UC_MCONTEXT_OFF 0x14 +#define LINUX_UC_SIGMASK_OFF 0x6c +#define LINUX_UC_FPREGS_MEM_OFF 0xec + +/* The struct sigcontext is located at an offset of 4 + from the stack pointer in the signal frame. */ + +/* Offsets for x86 Linux "struct sigcontext": */ + +#define LINUX_SC_GS_OFF 0x00 +#define LINUX_SC_GSH_OFF 0x02 +#define LINUX_SC_FS_OFF 0x04 +#define LINUX_SC_FSH_OFF 0x06 +#define LINUX_SC_ES_OFF 0x08 +#define LINUX_SC_ESH_OFF 0x0a +#define LINUX_SC_DS_OFF 0x0c +#define LINUX_SC_DSH_OFF 0x0e +#define LINUX_SC_EDI_OFF 0x10 +#define LINUX_SC_ESI_OFF 0x14 +#define LINUX_SC_EBP_OFF 0x18 +#define LINUX_SC_ESP_OFF 0x1c +#define LINUX_SC_EBX_OFF 0x20 +#define LINUX_SC_EDX_OFF 0x24 +#define LINUX_SC_ECX_OFF 0x28 +#define LINUX_SC_EAX_OFF 0x2c +#define LINUX_SC_TRAPNO_OFF 0x30 +#define LINUX_SC_ERR_OFF 0x34 +#define LINUX_SC_EIP_OFF 0x38 +#define LINUX_SC_CS_OFF 0x3c +#define LINUX_SC_CSH_OFF 0x3e +#define LINUX_SC_EFLAGS_OFF 0x40 +#define LINUX_SC_ESP_AT_SIGNAL_OFF 0x44 +#define LINUX_SC_SS_OFF 0x48 +#define LINUX_SC_SSH_OFF 0x4a +#define LINUX_SC_FPSTATE_OFF 0x4c +#define LINUX_SC_OLDMASK_OFF 0x50 +#define LINUX_SC_CR2_OFF 0x54 + +/* Offsets for x86 Linux "struct _fpstate": */ + +#define LINUX_FPSTATE_CW_OFF 0x000 +#define LINUX_FPSTATE_SW_OFF 0x004 +#define LINUX_FPSTATE_TAG_OFF 0x008 +#define LINUX_FPSTATE_IPOFF_OFF 0x00c +#define LINUX_FPSTATE_CSSEL_OFF 0x010 +#define LINUX_FPSTATE_DATAOFF_OFF 0x014 +#define LINUX_FPSTATE_DATASEL_OFF 0x018 +#define LINUX_FPSTATE_ST0_OFF 0x01c +#define LINUX_FPSTATE_ST1_OFF 0x026 +#define LINUX_FPSTATE_ST2_OFF 0x030 +#define LINUX_FPSTATE_ST3_OFF 0x03a +#define LINUX_FPSTATE_ST4_OFF 0x044 +#define LINUX_FPSTATE_ST5_OFF 0x04e +#define LINUX_FPSTATE_ST6_OFF 0x058 +#define LINUX_FPSTATE_ST7_OFF 0x062 +#define LINUX_FPSTATE_STATUS_OFF 0x06c +#define LINUX_FPSTATE_MAGIC_OFF 0x06e +#define LINUX_FPSTATE_FXSR_ENV_OFF 0x070 +#define LINUX_FPSTATE_MXCSR_OFF 0x088 +#define LINUX_FPSTATE_FXSR_ST0_OFF 0x090 +#define LINUX_FPSTATE_FXSR_ST1_OFF 0x0a0 +#define LINUX_FPSTATE_FXSR_ST2_OFF 0x0b0 +#define LINUX_FPSTATE_FXSR_ST3_OFF 0x0c0 +#define LINUX_FPSTATE_FXSR_ST4_OFF 0x0d0 +#define LINUX_FPSTATE_FXSR_ST5_OFF 0x0e0 +#define LINUX_FPSTATE_FXSR_ST6_OFF 0x0f0 +#define LINUX_FPSTATE_FXSR_ST7_OFF 0x100 +#define LINUX_FPSTATE_XMM0_OFF 0x110 +#define LINUX_FPSTATE_XMM1_OFF 0x120 +#define LINUX_FPSTATE_XMM2_OFF 0x130 +#define LINUX_FPSTATE_XMM3_OFF 0x140 +#define LINUX_FPSTATE_XMM4_OFF 0x150 +#define LINUX_FPSTATE_XMM5_OFF 0x160 +#define LINUX_FPSTATE_XMM6_OFF 0x170 +#define LINUX_FPSTATE_XMM7_OFF 0x180 + +/* FreeBSD-specific definitions: */ + +#define FREEBSD_SC_UCONTEXT_OFF 0x20 +#define FREEBSD_UC_MCONTEXT_OFF 0x10 + +#define FREEBSD_UC_MCONTEXT_GS_OFF 0x14 +#define FREEBSD_UC_MCONTEXT_FS_OFF 0x18 +#define FREEBSD_UC_MCONTEXT_ES_OFF 0x1c +#define FREEBSD_UC_MCONTEXT_DS_OFF 0x20 +#define FREEBSD_UC_MCONTEXT_EDI_OFF 0x24 +#define FREEBSD_UC_MCONTEXT_ESI_OFF 0x28 +#define FREEBSD_UC_MCONTEXT_EBP_OFF 0x2c +#define FREEBSD_UC_MCONTEXT_EBX_OFF 0x34 +#define FREEBSD_UC_MCONTEXT_EDX_OFF 0x38 +#define FREEBSD_UC_MCONTEXT_ECX_OFF 0x3c +#define FREEBSD_UC_MCONTEXT_EAX_OFF 0x40 +#define FREEBSD_UC_MCONTEXT_TRAPNO_OFF 0x44 +#define FREEBSD_UC_MCONTEXT_EIP_OFF 0x4c +#define FREEBSD_UC_MCONTEXT_ESP_OFF 0x58 +#define FREEBSD_UC_MCONTEXT_CS_OFF 0x50 +#define FREEBSD_UC_MCONTEXT_EFLAGS_OFF 0x54 +#define FREEBSD_UC_MCONTEXT_SS_OFF 0x5c +#define FREEBSD_UC_MCONTEXT_MC_LEN_OFF 0x60 +#define FREEBSD_UC_MCONTEXT_FPFORMAT_OFF 0x64 +#define FREEBSD_UC_MCONTEXT_OWNEDFP_OFF 0x68 +#define FREEBSD_UC_MCONTEXT_FPSTATE_OFF 0x70 + +#define FREEBSD_UC_MCONTEXT_CW_OFF 0x70 +#define FREEBSD_UC_MCONTEXT_SW_OFF 0x74 +#define FREEBSD_UC_MCONTEXT_TAG_OFF 0x78 +#define FREEBSD_UC_MCONTEXT_IPOFF_OFF 0x7c +#define FREEBSD_UC_MCONTEXT_CSSEL_OFF 0x80 +#define FREEBSD_UC_MCONTEXT_DATAOFF_OFF 0x84 +#define FREEBSD_US_MCONTEXT_DATASEL_OFF 0x88 +#define FREEBSD_UC_MCONTEXT_ST0_OFF 0x8c + +#define FREEBSD_UC_MCONTEXT_CW_XMM_OFF 0x70 +#define FREEBSD_UC_MCONTEXT_SW_XMM_OFF 0x72 +#define FREEBSD_UC_MCONTEXT_TAG_XMM_OFF 0x74 +#define FREEBSD_UC_MCONTEXT_IPOFF_XMM_OFF 0x78 +#define FREEBSD_UC_MCONTEXT_CSSEL_XMM_OFF 0x7c +#define FREEBSD_UC_MCONTEXT_DATAOFF_XMM_OFF 0x80 +#define FREEBSD_US_MCONTEXT_DATASEL_XMM_OFF 0x84 +#define FREEBSD_UC_MCONTEXT_MXCSR_XMM_OFF 0x88 +#define FREEBSD_UC_MCONTEXT_ST0_XMM_OFF 0x90 +#define FREEBSD_UC_MCONTEXT_XMM0_OFF 0x110 + +#define FREEBSD_UC_MCONTEXT_MC_LEN_VAL 0x280 +#define FREEBSD_UC_MCONTEXT_FPFMT_NODEV 0x10000 +#define FREEBSD_UC_MCONTEXT_FPFMT_387 0x10001 +#define FREEBSD_UC_MCONTEXT_FPFMT_XMM 0x10002 +#define FREEBSD_UC_MCONTEXT_FPOWNED_NONE 0x20000 +#define FREEBSD_UC_MCONTEXT_FPOWNED_FPU 0x20001 +#define FREEBSD_UC_MCONTEXT_FPOWNED_PCB 0x20002 + diff --git a/vendor/libunwind/src/x86/regname.c b/vendor/libunwind/src/x86/regname.c new file mode 100644 index 0000000000..11f6228041 --- /dev/null +++ b/vendor/libunwind/src/x86/regname.c @@ -0,0 +1,27 @@ +#include "unwind_i.h" + +static const char *regname[] = + { + "eax", "edx", "ecx", "ebx", "esi", "edi", "ebp", "esp", "eip", + "eflags", "trapno", + "st0", "st1", "st2", "st3", "st4", "st5", "st6", "st7", + "fcw", "fsw", "ftw", "fop", "fcs", "fip", "fea", "fds", + "xmm0_lo", "xmm0_hi", "xmm1_lo", "xmm1_hi", + "xmm2_lo", "xmm2_hi", "xmm3_lo", "xmm3_hi", + "xmm4_lo", "xmm4_hi", "xmm5_lo", "xmm5_hi", + "xmm6_lo", "xmm6_hi", "xmm7_lo", "xmm7_hi", + "mxcsr", + "gs", "fs", "es", "ds", "ss", "cs", + "tss", "ldt", + "cfi", + "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", + }; + +const char * +unw_regname (unw_regnum_t reg) +{ + if (reg < (unw_regnum_t) ARRAY_SIZE (regname)) + return regname[reg]; + else + return "???"; +} diff --git a/vendor/libunwind/src/x86/siglongjmp.S b/vendor/libunwind/src/x86/siglongjmp.S new file mode 100644 index 0000000000..32bba3b3b6 --- /dev/null +++ b/vendor/libunwind/src/x86/siglongjmp.S @@ -0,0 +1,92 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + Copyright (C) 2011 Konstantin Belousov + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + + .globl _UI_siglongjmp_cont + +#if defined(__linux__) +#define SIG_SETMASK 2 +#elif defined(__FreeBSD__) +#define SIG_SETMASK 3 +#endif + + /* Stack layout at this point: + + +------------+ <- original $esp (at time of setjmp() call) + | sigmask[1] | + +------------+ + | sigmask[0] | + +------------+ + */ + + .type _UI_siglongjmp_cont, @function +_UI_siglongjmp_cont: + .cfi_startproc +#ifdef __linux__ + .cfi_register 8, 0 /* IP saved in EAX */ + .cfi_def_cfa_offset 8 + mov %esp, %ecx /* pass address of signal mask in 3rd sc arg */ + push %eax /* save target IP */ + .cfi_adjust_cfa_offset 4 + .cfi_offset 8, -12 + push %edx /* save return value */ + .cfi_adjust_cfa_offset 4 + push %ebx /* save %ebx (preserved) */ + .cfi_adjust_cfa_offset 4 + .cfi_offset 3, -20 + mov $SIG_SETMASK, %ebx /* 1st syscall arg (how) */ + xor %edx, %edx /* pass NULL as 3rd syscall arg (old maskp) */ + int $0x80 + pop %ebx /* restore %ebx */ + .cfi_adjust_cfa_offset -4 + .cfi_restore 3 + pop %eax /* fetch return value */ + .cfi_adjust_cfa_offset -4 + pop %edx /* pop target IP */ + .cfi_adjust_cfa_offset -4 + .cfi_register 8, 2 /* saved IP is now n EDX */ + lea 8(%esp), %esp /* pop sigmask */ + .cfi_adjust_cfa_offset -4 + jmp *%edx +#elif defined(__FreeBSD__) + pushl %eax + pushl %edx + pushl $0 + pushl %ecx + pushl $SIG_SETMASK + movl $340,%eax + pushl %eax + int $0x80 + addl $16,%esp + popl %eax + popl %edx + jmp *%edx +#else +#error Port me +#endif + .cfi_endproc + .size _UI_siglongjmp_cont, .-_UI_siglongjmp_cont + /* We do not need executable stack. */ + .section .note.GNU-stack,"",@progbits diff --git a/vendor/libunwind/src/x86/unwind_i.h b/vendor/libunwind/src/x86/unwind_i.h new file mode 100644 index 0000000000..2acc8cbb6b --- /dev/null +++ b/vendor/libunwind/src/x86/unwind_i.h @@ -0,0 +1,66 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef unwind_i_h +#define unwind_i_h + +#include + +#include + +#include "libunwind_i.h" + +/* DWARF column numbers: */ +#define EAX 0 +#define ECX 1 +#define EDX 2 +#define EBX 3 +#define ESP 4 +#define EBP 5 +#define ESI 6 +#define EDI 7 +#define EIP 8 +#define EFLAGS 9 +#define TRAPNO 10 +#define ST0 11 + +#define x86_lock UNW_OBJ(lock) +#define x86_local_resume UNW_OBJ(local_resume) +#define x86_local_addr_space_init UNW_OBJ(local_addr_space_init) +#define x86_scratch_loc UNW_OBJ(scratch_loc) +#define x86_get_scratch_loc UNW_OBJ(get_scratch_loc) +#define x86_r_uc_addr UNW_OBJ(r_uc_addr) + +extern void x86_local_addr_space_init (void); +extern int x86_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, + void *arg); +extern dwarf_loc_t x86_scratch_loc (struct cursor *c, unw_regnum_t reg); +extern dwarf_loc_t x86_get_scratch_loc (struct cursor *c, unw_regnum_t reg); +extern void *x86_r_uc_addr (ucontext_t *uc, int reg); + +#define x86_handle_signal_frame UNW_OBJ(handle_signal_frame) +extern int x86_handle_signal_frame(unw_cursor_t *cursor); + +#endif /* unwind_i_h */ diff --git a/vendor/libunwind/src/x86_64/Gapply_reg_state.c b/vendor/libunwind/src/x86_64/Gapply_reg_state.c new file mode 100644 index 0000000000..82f056da67 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Gapply_reg_state.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +int +unw_apply_reg_state (unw_cursor_t *cursor, + void *reg_states_data) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_apply_reg_state (&c->dwarf, (dwarf_reg_state_t *)reg_states_data); +} diff --git a/vendor/libunwind/src/x86_64/Gcreate_addr_space.c b/vendor/libunwind/src/x86_64/Gcreate_addr_space.c new file mode 100644 index 0000000000..3618d04eba --- /dev/null +++ b/vendor/libunwind/src/x86_64/Gcreate_addr_space.c @@ -0,0 +1,57 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2003 Hewlett-Packard Co + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + Copyright (C) 2012 Tommi Rantala + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include + +#include "unwind_i.h" + +unw_addr_space_t +unw_create_addr_space (unw_accessors_t *a UNUSED, int byte_order UNUSED) +{ +#ifdef UNW_LOCAL_ONLY + return NULL; +#else + unw_addr_space_t as; + + /* + * x86_64 supports only little-endian. + */ + if (byte_order != 0 && byte_order != UNW_LITTLE_ENDIAN) + return NULL; + + as = malloc (sizeof (*as)); + if (!as) + return NULL; + + memset (as, 0, sizeof (*as)); + + as->acc = *a; + + return as; +#endif +} diff --git a/vendor/libunwind/src/x86_64/Gget_proc_info.c b/vendor/libunwind/src/x86_64/Gget_proc_info.c new file mode 100644 index 0000000000..50de1e423c --- /dev/null +++ b/vendor/libunwind/src/x86_64/Gget_proc_info.c @@ -0,0 +1,48 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +int +unw_get_proc_info (unw_cursor_t *cursor, unw_proc_info_t *pi) +{ + struct cursor *c = (struct cursor *) cursor; + + if (dwarf_make_proc_info (&c->dwarf) < 0) + { + /* On x86-64, some key routines such as _start() and _dl_start() + are missing DWARF unwind info. We don't want to fail in that + case, because those frames are uninteresting and just mark + the end of the frame-chain anyhow. */ + memset (pi, 0, sizeof (*pi)); + pi->start_ip = c->dwarf.ip; + pi->end_ip = c->dwarf.ip + 1; + return 0; + } + *pi = c->dwarf.pi; + return 0; +} diff --git a/vendor/libunwind/src/x86_64/Gget_save_loc.c b/vendor/libunwind/src/x86_64/Gget_save_loc.c new file mode 100644 index 0000000000..40568700e0 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Gget_save_loc.c @@ -0,0 +1,74 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +int +unw_get_save_loc (unw_cursor_t *cursor, int reg, unw_save_loc_t *sloc) +{ + struct cursor *c = (struct cursor *) cursor; + dwarf_loc_t loc; + + loc = DWARF_NULL_LOC; /* default to "not saved" */ + + switch (reg) + { + case UNW_X86_64_RBX: loc = c->dwarf.loc[RBX]; break; + case UNW_X86_64_RSP: loc = c->dwarf.loc[RSP]; break; + case UNW_X86_64_RBP: loc = c->dwarf.loc[RBP]; break; + case UNW_X86_64_R12: loc = c->dwarf.loc[R12]; break; + case UNW_X86_64_R13: loc = c->dwarf.loc[R13]; break; + case UNW_X86_64_R14: loc = c->dwarf.loc[R14]; break; + case UNW_X86_64_R15: loc = c->dwarf.loc[R15]; break; + case UNW_X86_64_RIP: loc = c->dwarf.loc[RIP]; break; + + default: + break; + } + + memset (sloc, 0, sizeof (*sloc)); + + if (DWARF_IS_NULL_LOC (loc)) + { + sloc->type = UNW_SLT_NONE; + return 0; + } + +#if !defined(UNW_LOCAL_ONLY) + if (DWARF_IS_REG_LOC (loc)) + { + sloc->type = UNW_SLT_REG; + sloc->u.regnum = DWARF_GET_LOC (loc); + } + else +#endif + { + sloc->type = UNW_SLT_MEMORY; + sloc->u.addr = DWARF_GET_LOC (loc); + } + return 0; +} diff --git a/vendor/libunwind/src/x86_64/Gglobal.c b/vendor/libunwind/src/x86_64/Gglobal.c new file mode 100644 index 0000000000..0964d5f396 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Gglobal.c @@ -0,0 +1,104 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2003, 2005 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "config.h" +#include "unwind_i.h" +#include "dwarf_i.h" +#include + +HIDDEN define_lock (x86_64_lock); +HIDDEN atomic_bool tdep_init_done = 0; + +/* See comments for svr4_dbx_register_map[] in gcc/config/i386/i386.c. */ + +HIDDEN const uint8_t dwarf_to_unw_regnum_map[DWARF_NUM_PRESERVED_REGS] = + { + UNW_X86_64_RAX, + UNW_X86_64_RDX, + UNW_X86_64_RCX, + UNW_X86_64_RBX, + UNW_X86_64_RSI, + UNW_X86_64_RDI, + UNW_X86_64_RBP, + UNW_X86_64_RSP, + UNW_X86_64_R8, + UNW_X86_64_R9, + UNW_X86_64_R10, + UNW_X86_64_R11, + UNW_X86_64_R12, + UNW_X86_64_R13, + UNW_X86_64_R14, + UNW_X86_64_R15, + UNW_X86_64_RIP, +#ifdef CONFIG_MSABI_SUPPORT + UNW_X86_64_XMM0, + UNW_X86_64_XMM1, + UNW_X86_64_XMM2, + UNW_X86_64_XMM3, + UNW_X86_64_XMM4, + UNW_X86_64_XMM5, + UNW_X86_64_XMM6, + UNW_X86_64_XMM7, + UNW_X86_64_XMM8, + UNW_X86_64_XMM9, + UNW_X86_64_XMM10, + UNW_X86_64_XMM11, + UNW_X86_64_XMM12, + UNW_X86_64_XMM13, + UNW_X86_64_XMM14, + UNW_X86_64_XMM15 +#endif + }; + +HIDDEN void +tdep_init (void) +{ + intrmask_t saved_mask; + intrmask_t full_mask; + sigfillset (&full_mask); + + SIGPROCMASK (SIG_SETMASK, &full_mask, &saved_mask); + mutex_lock (&x86_64_lock); + { + if (atomic_load(&tdep_init_done)) + /* another thread else beat us to it... */ + goto out; + + sigfillset (&unwi_full_mask); + mi_init (); + + dwarf_init (); + +#ifndef UNW_REMOTE_ONLY + x86_64_local_addr_space_init (); +#endif + atomic_store(&tdep_init_done, 1); /* signal that we're initialized... */ + } + out: + mutex_unlock(&x86_64_lock); + SIGPROCMASK (SIG_SETMASK, &saved_mask, NULL); +} diff --git a/vendor/libunwind/src/x86_64/Ginit.c b/vendor/libunwind/src/x86_64/Ginit.c new file mode 100644 index 0000000000..ca3c022809 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Ginit.c @@ -0,0 +1,201 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002 Hewlett-Packard Co + Copyright (C) 2007 David Mosberger-Tang + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#if defined(HAVE_SYS_SYSCALL_H) +# include +#endif +#include + +#include "unwind_i.h" + +#ifdef UNW_REMOTE_ONLY + +/* unw_local_addr_space is a NULL pointer in this case. */ +unw_addr_space_t unw_local_addr_space; + +#else /* !UNW_REMOTE_ONLY */ + +static struct unw_addr_space local_addr_space; + +unw_addr_space_t unw_local_addr_space = &local_addr_space; + +static void +put_unwind_info (unw_addr_space_t as UNUSED, unw_proc_info_t *proc_info UNUSED, void *arg UNUSED) +{ + /* it's a no-op */ +} + +static int +get_dyn_info_list_addr (unw_addr_space_t as UNUSED, unw_word_t *dyn_info_list_addr, + void *arg UNUSED) +{ +#ifndef UNW_LOCAL_ONLY +# pragma weak _U_dyn_info_list_addr + if (!_U_dyn_info_list_addr) + return -UNW_ENOINFO; +#endif + // Access the `_U_dyn_info_list` from `LOCAL_ONLY` library, i.e. libunwind.so. + *dyn_info_list_addr = _U_dyn_info_list_addr (); + return 0; +} + + +static int +access_mem (unw_addr_space_t as UNUSED, unw_word_t addr, unw_word_t *val, int write, + void *arg) +{ + if (unlikely (write)) + { + Debug (16, "mem[%016lx] <- %lx\n", addr, *val); + memcpy ((void *) addr, val, sizeof(unw_word_t)); + } + else + { + /* validate address */ + if (unlikely (AS_ARG_GET_VALIDATE(arg)) + && unlikely (!unw_address_is_valid (addr, sizeof (unw_word_t)))) { + Debug (16, "mem[%016lx] -> invalid\n", addr); + return -1; + } + memcpy (val, (void *) addr, sizeof(unw_word_t)); + Debug (16, "mem[%016lx] -> %lx\n", addr, *val); + } + return 0; +} + +static int +access_reg (unw_addr_space_t as UNUSED, unw_regnum_t reg, unw_word_t *val, int write, + void *arg) +{ + unw_word_t *addr; + ucontext_t *uc = AS_ARG_GET_UC_PTR(arg); + + if (unw_is_fpreg (reg)) + goto badreg; + + if (!(addr = x86_64_r_uc_addr (uc, reg))) + goto badreg; + + if (write) + { + memcpy ((void *) addr, val, sizeof(unw_word_t)); + Debug (12, "%s <- 0x%016lx\n", unw_regname (reg), *val); + } + else + { + memcpy (val, (void *) addr, sizeof(unw_word_t)); + Debug (12, "%s -> 0x%016lx\n", unw_regname (reg), *val); + } + return 0; + + badreg: + Debug (1, "bad register number %u\n", reg); + return -UNW_EBADREG; +} + +static int +access_fpreg (unw_addr_space_t as UNUSED, unw_regnum_t reg, unw_fpreg_t *val, + int write, void *arg) +{ + ucontext_t *uc = AS_ARG_GET_UC_PTR(arg); + unw_fpreg_t *addr; + + if (!unw_is_fpreg (reg)) + goto badreg; + + if (!(addr = x86_64_r_uc_addr (uc, reg))) + goto badreg; + + if (write) + { + Debug (12, "%s <- %08lx.%08lx.%08lx\n", unw_regname (reg), + ((long *)val)[0], ((long *)val)[1], ((long *)val)[2]); + *(unw_fpreg_t *) addr = *val; + } + else + { + *val = *(unw_fpreg_t *) addr; + Debug (12, "%s -> %08lx.%08lx.%08lx\n", unw_regname (reg), + ((long *)val)[0], ((long *)val)[1], ((long *)val)[2]); + } + return 0; + + badreg: + Debug (1, "bad register number %u\n", reg); + /* attempt to access a non-preserved register */ + return -UNW_EBADREG; +} + +static int +get_static_proc_name (unw_addr_space_t as, unw_word_t ip, + char *buf, size_t buf_len, unw_word_t *offp, + void *arg UNUSED) +{ + return _Uelf64_get_proc_name (as, getpid (), ip, buf, buf_len, offp); +} + +static int +get_static_elf_filename (unw_addr_space_t as, unw_word_t ip, + char *buf, size_t buf_len, unw_word_t *offp, + void *arg UNUSED) +{ + return _Uelf64_get_elf_filename (as, getpid (), ip, buf, buf_len, offp); +} + +HIDDEN void +x86_64_local_addr_space_init (void) +{ + memset (&local_addr_space, 0, sizeof (local_addr_space)); +#ifndef UNW_REMOTE_ONLY +# if defined(HAVE_DL_ITERATE_PHDR) + local_addr_space.iterate_phdr_function = dl_iterate_phdr; +# endif +#endif + local_addr_space.caching_policy = UNWI_DEFAULT_CACHING_POLICY; + local_addr_space.acc.find_proc_info = dwarf_find_proc_info; + local_addr_space.acc.put_unwind_info = put_unwind_info; + local_addr_space.acc.get_dyn_info_list_addr = get_dyn_info_list_addr; + local_addr_space.acc.access_mem = access_mem; + local_addr_space.acc.access_reg = access_reg; + local_addr_space.acc.access_fpreg = access_fpreg; + local_addr_space.acc.resume = x86_64_local_resume; + local_addr_space.acc.get_proc_name = get_static_proc_name; + local_addr_space.acc.get_elf_filename = get_static_elf_filename; + unw_flush_cache (&local_addr_space, 0, 0); +} + +#endif /* !UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/src/x86_64/Ginit_local.c b/vendor/libunwind/src/x86_64/Ginit_local.c new file mode 100644 index 0000000000..bf771de384 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Ginit_local.c @@ -0,0 +1,80 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" +#include "unwind_i.h" +#include "init.h" + +#ifdef UNW_REMOTE_ONLY + +int +unw_init_local (unw_cursor_t *cursor, ucontext_t *uc) +{ + return -UNW_EINVAL; +} + +#else /* !UNW_REMOTE_ONLY */ + +static int +unw_init_local_common (unw_cursor_t *cursor, ucontext_t *uc, unsigned use_prev_instr) +{ + struct cursor *c = (struct cursor *) cursor; + + if (unlikely (!atomic_load(&tdep_init_done))) + tdep_init (); + + Debug (1, "(cursor=%p)\n", c); + + c->dwarf.as = unw_local_addr_space; + c->dwarf.as_arg = dwarf_build_as_arg(uc, /*validate*/ 0); + return common_init (c, use_prev_instr); +} + +int +unw_init_local (unw_cursor_t *cursor, ucontext_t *uc) +{ + return unw_init_local_common(cursor, uc, 1); +} + +int +unw_init_local2 (unw_cursor_t *cursor, ucontext_t *uc, int flag) +{ + if (!flag) + { + return unw_init_local_common(cursor, uc, 1); + } + else if (flag == UNW_INIT_SIGNAL_FRAME) + { + return unw_init_local_common(cursor, uc, 0); + } + else + { + return -UNW_EINVAL; + } +} + +#endif /* !UNW_REMOTE_ONLY */ diff --git a/vendor/libunwind/src/x86_64/Ginit_remote.c b/vendor/libunwind/src/x86_64/Ginit_remote.c new file mode 100644 index 0000000000..1675aeb5f1 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Ginit_remote.c @@ -0,0 +1,56 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "init.h" +#include "libunwind_i.h" +#include "unwind_i.h" + +int +unw_init_remote (unw_cursor_t *cursor UNUSED, unw_addr_space_t as UNUSED, void *as_arg UNUSED) +{ +#ifdef UNW_LOCAL_ONLY + return -UNW_EINVAL; +#else /* !UNW_LOCAL_ONLY */ + struct cursor *c = (struct cursor *) cursor; + + if (!atomic_load(&tdep_init_done)) + tdep_init (); + + Debug (1, "(cursor=%p)\n", c); + + c->dwarf.as = as; + if (as == unw_local_addr_space) + { + c->dwarf.as_arg = dwarf_build_as_arg(as_arg, /*validate*/ 0); + } + else + { + c->dwarf.as_arg = as_arg; + } + return common_init (c, 0); +#endif /* !UNW_LOCAL_ONLY */ +} diff --git a/vendor/libunwind/src/x86_64/Gos-freebsd.c b/vendor/libunwind/src/x86_64/Gos-freebsd.c new file mode 100644 index 0000000000..59706b977b --- /dev/null +++ b/vendor/libunwind/src/x86_64/Gos-freebsd.c @@ -0,0 +1,236 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2010 Konstantin Belousov + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include "unwind_i.h" +#include "ucontext_i.h" + +int +unw_is_signal_frame (unw_cursor_t *cursor) +{ + /* XXXKIB */ + struct cursor *c = (struct cursor *) cursor; + unw_word_t w0, w1, w2, ip; + unw_addr_space_t as; + unw_accessors_t *a; + void *arg; + int ret; + + as = c->dwarf.as; + a = unw_get_accessors_int (as); + arg = c->dwarf.as_arg; + + /* Check if RIP points at sigreturn sequence. +48 8d 7c 24 10 lea SIGF_UC(%rsp),%rdi +6a 00 pushq $0 +48 c7 c0 a1 01 00 00 movq $SYS_sigreturn,%rax +0f 05 syscall +f4 0: hlt +eb fd jmp 0b + */ + + ip = c->dwarf.ip; + c->sigcontext_format = X86_64_SCF_NONE; + if ((ret = (*a->access_mem) (as, ip, &w0, 0, arg)) < 0 + || (ret = (*a->access_mem) (as, ip + 8, &w1, 0, arg)) < 0 + || (ret = (*a->access_mem) (as, ip + 16, &w2, 0, arg)) < 0) + return 0; + w2 &= 0xffffff; + if (w0 == 0x48006a10247c8d48 && + w1 == 0x050f000001a1c0c7 && + w2 == 0x0000000000fdebf4) + { + c->sigcontext_format = X86_64_SCF_FREEBSD_SIGFRAME; + return (1); + } + return (0); +} + +HIDDEN int +x86_64_handle_signal_frame (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + unw_word_t ucontext; + int i, ret; + + if (c->sigcontext_format == X86_64_SCF_FREEBSD_SIGFRAME) + { + ucontext = c->dwarf.cfa + offsetof(struct sigframe, sf_uc); + c->sigcontext_addr = c->dwarf.cfa; + Debug(1, "signal frame, skip over trampoline\n"); + + struct dwarf_loc rsp_loc = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RSP, 0); + ret = dwarf_get (&c->dwarf, rsp_loc, &c->dwarf.cfa); + if (ret < 0) + { + Debug (2, "returning %d\n", ret); + return ret; + } + + for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) + c->dwarf.loc[i] = DWARF_NULL_LOC; + + c->dwarf.loc[RAX] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RAX, 0); + c->dwarf.loc[RDX] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RDX, 0); + c->dwarf.loc[RCX] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RCX, 0); + c->dwarf.loc[RBX] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RBX, 0); + c->dwarf.loc[RSI] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RSI, 0); + c->dwarf.loc[RDI] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RDI, 0); + c->dwarf.loc[RBP] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RBP, 0); + c->dwarf.loc[RSP] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RSP, 0); + c->dwarf.loc[ R8] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_R8, 0); + c->dwarf.loc[ R9] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_R9, 0); + c->dwarf.loc[R10] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_R10, 0); + c->dwarf.loc[R11] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_R11, 0); + c->dwarf.loc[R12] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_R12, 0); + c->dwarf.loc[R13] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_R13, 0); + c->dwarf.loc[R14] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_R14, 0); + c->dwarf.loc[R15] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_R15, 0); + c->dwarf.loc[RIP] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RIP, 0); + + return 0; + } + else + return -UNW_EBADFRAME; + +} + +#ifndef UNW_REMOTE_ONLY +HIDDEN void * +x86_64_r_uc_addr (ucontext_t *uc, int reg) +{ + /* NOTE: common_init() in init.h inlines these for fast path access. */ + void *addr; + + switch (reg) + { + case UNW_X86_64_R8: addr = &uc->uc_mcontext.mc_r8; break; + case UNW_X86_64_R9: addr = &uc->uc_mcontext.mc_r9; break; + case UNW_X86_64_R10: addr = &uc->uc_mcontext.mc_r10; break; + case UNW_X86_64_R11: addr = &uc->uc_mcontext.mc_r11; break; + case UNW_X86_64_R12: addr = &uc->uc_mcontext.mc_r12; break; + case UNW_X86_64_R13: addr = &uc->uc_mcontext.mc_r13; break; + case UNW_X86_64_R14: addr = &uc->uc_mcontext.mc_r14; break; + case UNW_X86_64_R15: addr = &uc->uc_mcontext.mc_r15; break; + case UNW_X86_64_RDI: addr = &uc->uc_mcontext.mc_rdi; break; + case UNW_X86_64_RSI: addr = &uc->uc_mcontext.mc_rsi; break; + case UNW_X86_64_RBP: addr = &uc->uc_mcontext.mc_rbp; break; + case UNW_X86_64_RBX: addr = &uc->uc_mcontext.mc_rbx; break; + case UNW_X86_64_RDX: addr = &uc->uc_mcontext.mc_rdx; break; + case UNW_X86_64_RAX: addr = &uc->uc_mcontext.mc_rax; break; + case UNW_X86_64_RCX: addr = &uc->uc_mcontext.mc_rcx; break; + case UNW_X86_64_RSP: addr = &uc->uc_mcontext.mc_rsp; break; + case UNW_X86_64_RIP: addr = &uc->uc_mcontext.mc_rip; break; + + default: + addr = NULL; + } + return addr; +} + +HIDDEN NORETURN void +x86_64_sigreturn (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + ucontext_t *uc = (ucontext_t *)(c->sigcontext_addr + + offsetof(struct sigframe, sf_uc)); + + uc->uc_mcontext.mc_r8 = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_r8; + uc->uc_mcontext.mc_r9 = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_r9; + uc->uc_mcontext.mc_r10 = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_r10; + uc->uc_mcontext.mc_r11 = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_r11; + uc->uc_mcontext.mc_r12 = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_r12; + uc->uc_mcontext.mc_r13 = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_r13; + uc->uc_mcontext.mc_r14 = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_r14; + uc->uc_mcontext.mc_r15 = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_r15; + uc->uc_mcontext.mc_rdi = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_rdi; + uc->uc_mcontext.mc_rsi = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_rsi; + uc->uc_mcontext.mc_rbp = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_rbp; + uc->uc_mcontext.mc_rbx = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_rbx; + uc->uc_mcontext.mc_rdx = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_rdx; + uc->uc_mcontext.mc_rax = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_rax; + uc->uc_mcontext.mc_rcx = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_rcx; + uc->uc_mcontext.mc_rsp = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_rsp; + uc->uc_mcontext.mc_rip = dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_rip; + + Debug (8, "resuming at ip=%llx via sigreturn(%p)\n", + (unsigned long long) c->dwarf.ip, uc); + sigreturn(uc); + abort(); +} +#endif + +HIDDEN int +x86_64_os_step(struct cursor *c) +{ + unw_word_t b0, ip; + unw_addr_space_t as; + unw_accessors_t *a; + void *arg; + int ret; + + as = c->dwarf.as; + a = unw_get_accessors_int (as); + arg = c->dwarf.as_arg; + ip = c->dwarf.ip; + + /* + * Check if RIP points at standard syscall sequence. + * 49 89 ca mov %rcx,%r10 + * 0f 05 syscall + */ + if ((ret = (*a->access_mem) (as, ip - 5, &b0, 0, arg)) < 0) + return (0); + Debug (12, "b0 0x%lx\n", b0); + if ((b0 & 0xffffffffffffff) == 0x050fca89490000 || + (b0 & 0xffffffffff) == 0x050fca8949) + { + c->sigcontext_format = X86_64_SCF_FREEBSD_SYSCALL; + c->dwarf.loc[RCX] = c->dwarf.loc[R10]; + /* rsp_loc = DWARF_LOC(c->dwarf.cfa - 8, 0); */ + /* rbp_loc = c->dwarf.loc[RBP]; */ + c->dwarf.loc[RSP] = DWARF_VAL_LOC (c, c->dwarf.cfa + 8); + c->dwarf.loc[RIP] = DWARF_LOC (c->dwarf.cfa, 0); + ret = dwarf_get (&c->dwarf, c->dwarf.loc[RIP], &c->dwarf.ip); + Debug (1, "Frame Chain [RIP=0x%Lx] = 0x%Lx\n", + (unsigned long long) DWARF_GET_LOC (c->dwarf.loc[RIP]), + (unsigned long long) c->dwarf.ip); + if (ret < 0) + { + Debug (2, "returning %d\n", ret); + return ret; + } + c->dwarf.cfa += 8; + c->dwarf.use_prev_instr = 1; + return 1; + } + return (0); +} diff --git a/vendor/libunwind/src/x86_64/Gos-linux.c b/vendor/libunwind/src/x86_64/Gos-linux.c new file mode 100644 index 0000000000..c10ce6eed2 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Gos-linux.c @@ -0,0 +1,191 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002-2003 Hewlett-Packard Co + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifdef HAVE_ASM_VSYSCALL_H +#include +#endif + +#include "libunwind_i.h" +#include "unwind_i.h" +#include "ucontext_i.h" + +#include + +HIDDEN void +tdep_fetch_frame (struct dwarf_cursor *dw, unw_word_t ip UNUSED, int need_unwind_info UNUSED) +{ + struct cursor *c = (struct cursor *) dw; + assert(! need_unwind_info || dw->pi_valid); + assert(! need_unwind_info || dw->pi.unwind_info); + if (dw->pi_valid + && dw->pi.unwind_info + && ((struct dwarf_cie_info *) dw->pi.unwind_info)->signal_frame) + c->sigcontext_format = X86_64_SCF_LINUX_RT_SIGFRAME; + else + c->sigcontext_format = X86_64_SCF_NONE; + + Debug(5, "fetch frame ip=0x%lx cfa=0x%lx format=%d\n", + dw->ip, dw->cfa, c->sigcontext_format); +} + +HIDDEN int +tdep_cache_frame (struct dwarf_cursor *dw) +{ + struct cursor *c = (struct cursor *) dw; + + Debug(5, "cache frame ip=0x%lx cfa=0x%lx format=%d\n", + dw->ip, dw->cfa, c->sigcontext_format); + return c->sigcontext_format; +} + +HIDDEN void +tdep_reuse_frame (struct dwarf_cursor *dw, int frame) +{ + struct cursor *c = (struct cursor *) dw; + c->sigcontext_format = frame; + if (c->sigcontext_format == X86_64_SCF_LINUX_RT_SIGFRAME) + { + c->frame_info.frame_type = UNW_X86_64_FRAME_SIGRETURN; + /* Offset from cfa to ucontext_t in signal frame. */ + c->frame_info.cfa_reg_offset = 0; + c->sigcontext_addr = dw->cfa; + } + + Debug(5, "reuse frame ip=0x%lx cfa=0x%lx format=%d addr=0x%lx offset=%+d\n", + dw->ip, dw->cfa, c->sigcontext_format, c->sigcontext_addr, + (c->sigcontext_format == X86_64_SCF_LINUX_RT_SIGFRAME + ? c->frame_info.cfa_reg_offset : 0)); +} + +int +unw_is_signal_frame (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + return c->sigcontext_format != X86_64_SCF_NONE; +} + +HIDDEN int +x86_64_handle_signal_frame (unw_cursor_t *cursor UNUSED) +{ +#if UNW_DEBUG /* To silence compiler warnings */ + /* Should not get here because we now use kernel-provided dwarf + information for the signal trampoline and dwarf_step() works. + Hence unw_step() should never call this function. Maybe + restore old non-dwarf signal handling here, but then the + gating on unw_is_signal_frame() needs to be removed. */ + struct cursor *c = (struct cursor *) cursor; + Debug(1, "old format signal frame? format=%d addr=0x%lx cfa=0x%lx\n", + c->sigcontext_format, c->sigcontext_addr, c->dwarf.cfa); +#endif + return -UNW_EBADFRAME; +} + +#ifndef UNW_REMOTE_ONLY +HIDDEN void * +x86_64_r_uc_addr (ucontext_t *uc, int reg) +{ + /* NOTE: common_init() in init.h inlines these for fast path access. */ + void *addr; + + switch (reg) + { + case UNW_X86_64_R8: addr = &uc->uc_mcontext.gregs[REG_R8]; break; + case UNW_X86_64_R9: addr = &uc->uc_mcontext.gregs[REG_R9]; break; + case UNW_X86_64_R10: addr = &uc->uc_mcontext.gregs[REG_R10]; break; + case UNW_X86_64_R11: addr = &uc->uc_mcontext.gregs[REG_R11]; break; + case UNW_X86_64_R12: addr = &uc->uc_mcontext.gregs[REG_R12]; break; + case UNW_X86_64_R13: addr = &uc->uc_mcontext.gregs[REG_R13]; break; + case UNW_X86_64_R14: addr = &uc->uc_mcontext.gregs[REG_R14]; break; + case UNW_X86_64_R15: addr = &uc->uc_mcontext.gregs[REG_R15]; break; + case UNW_X86_64_RDI: addr = &uc->uc_mcontext.gregs[REG_RDI]; break; + case UNW_X86_64_RSI: addr = &uc->uc_mcontext.gregs[REG_RSI]; break; + case UNW_X86_64_RBP: addr = &uc->uc_mcontext.gregs[REG_RBP]; break; + case UNW_X86_64_RBX: addr = &uc->uc_mcontext.gregs[REG_RBX]; break; + case UNW_X86_64_RDX: addr = &uc->uc_mcontext.gregs[REG_RDX]; break; + case UNW_X86_64_RAX: addr = &uc->uc_mcontext.gregs[REG_RAX]; break; + case UNW_X86_64_RCX: addr = &uc->uc_mcontext.gregs[REG_RCX]; break; + case UNW_X86_64_RSP: addr = &uc->uc_mcontext.gregs[REG_RSP]; break; + case UNW_X86_64_RIP: addr = &uc->uc_mcontext.gregs[REG_RIP]; break; + + default: + addr = NULL; + } + return addr; +} + +/* sigreturn() is a no-op on x86_64 glibc. */ +HIDDEN NORETURN void +x86_64_sigreturn (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + struct sigcontext *sc = (struct sigcontext *) c->sigcontext_addr; + mcontext_t *sc_mcontext = &((ucontext_t*)sc)->uc_mcontext; + /* Copy in saved uc - all preserved regs are at the start of sigcontext */ + memcpy(sc_mcontext, &dwarf_get_uc(&c->dwarf)->uc_mcontext, + DWARF_NUM_PRESERVED_REGS * sizeof(unw_word_t)); + + Debug (8, "resuming at ip=%llx via sigreturn(%p)\n", + (unsigned long long) c->dwarf.ip, sc); + __asm__ __volatile__ ("mov %0, %%rsp;" + "mov %1, %%rax;" + "syscall" + :: "r"((uint64_t)sc), "i"(SYS_rt_sigreturn) + : "memory"); + abort(); +} + +#endif + +static int +is_vsyscall (struct dwarf_cursor *c UNUSED) +{ +#if defined(VSYSCALL_START) && defined(VSYSCALL_END) + return c->ip >= VSYSCALL_START && c->ip < VSYSCALL_END; +#elif defined(VSYSCALL_ADDR) + /* Linux 3.16 removes `VSYSCALL_START` and `VSYSCALL_END`. Assume + a single page is mapped for vsyscalls. */ + return c->ip >= VSYSCALL_ADDR && c->ip < VSYSCALL_ADDR + unw_page_size; +#else + return 0; +#endif +} + +HIDDEN int +x86_64_os_step(struct cursor *c) +{ + if (is_vsyscall (&c->dwarf)) + { + Debug (2, "in vsyscall region\n"); + c->frame_info.cfa_reg_offset = 8; + c->frame_info.cfa_reg_rsp = -1; + c->frame_info.frame_type = UNW_X86_64_FRAME_GUESSED; + c->dwarf.loc[RIP] = DWARF_LOC (c->dwarf.cfa, 0); + c->dwarf.cfa += 8; + return (1); + } + return (0); +} diff --git a/vendor/libunwind/src/x86_64/Gos-qnx.c b/vendor/libunwind/src/x86_64/Gos-qnx.c new file mode 100644 index 0000000000..be4e187a11 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Gos-qnx.c @@ -0,0 +1,214 @@ +/* + * Copyright 2022, 2023 BlackBerry Limited. + * + * This file is part of libunwind. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +#include "config.h" + +#include "unwind_i.h" +#include "ucontext_i.h" +#include + + +/** + * @brief Predicate to check if current IP is a signal trampoline. + * @param[in] cursor The current unwinding state. + * + * This function assumes the IP points to the first instruction after the call + * to the signal handler, and the bytes checked are the opcodes dumped by + * objdump between the call and the syscall that returns from the signal. + * + * This is not 100% robust but it's unlikely any other syscall setup is + * identical. + * + * @returns 0 if it does not detect the current function is a signal trampoline, + * 1 if it detects the trampoline. + */ +int +unw_is_signal_frame (unw_cursor_t *cursor) +{ + const unsigned char sig[] = + { + 0x4c, 0x89, 0xef, // mov %r13,%rdi + 0x49, 0x8b, 0x74, 0x24, 0x30, // mov 0x30(%r12),%rsi + 0x49, 0x8b, 0x54, 0x24, 0x38, // mov 0x38(%r12),%rdx + 0x4d, 0x8b, 0x44, 0x24, 0x48, // mov 0x48(%r12),%r8 + 0x4d, 0x8b, 0x4c, 0x24, 0x50, // mov 0x50(%r12),%r9 + 0x49, 0x8b, 0x5c, 0x24, 0x60, // mov 0x60(%r12),%rbx + 0x49, 0x8b, 0x6c, 0x24, 0x68, // mov 0x68(%r12),%rbp + 0x4d, 0x8b, 0xac, 0x24, 0x88, 0x00, 0x00, 0x00, // mov 0x88(%r12),%r13 + 0x4d, 0x8b, 0xb4, 0x24, 0x90, 0x00, 0x00, 0x00, // mov 0x90(%r12),%r14 + 0x4d, 0x8b, 0xbc, 0x24, 0x98, 0x00, 0x00, 0x00, // mov 0x98(%r12),%r15 + 0x4d, 0x8b, 0xa4, 0x24, 0x80, 0x00, 0x00, 0x00, // mov 0x80(%r12),%r12 + 0x48, 0xc7, 0xc0, 0x1b, 0x00, 0x00, 0x00, // mov $0x1b,%rax + 0x0f, 0x05, // syscall + }; + + struct cursor *c = (struct cursor *) cursor; + unw_addr_space_t as = c->dwarf.as; + unw_accessors_t *a = unw_get_accessors_int (as); + unw_word_t ip = c->dwarf.ip; + int retval = 1; + +#if CONSERVATIVE_CHECKS + int val = 0; + if (c->dwarf.as == unw_local_addr_space) { + val = dwarf_get_validate(&c->dwarf); + dwarf_set_validate(&c->dwarf, 1); + } +#endif + + unw_word_t w = 0; + for (size_t i = 0; i != sizeof(sig)/sizeof(sig[0]); ++i) + { + size_t byte_index = i % sizeof(unw_word_t); + if (0 == byte_index) + { + int ret = a->access_mem (as, ip, &w, 0, c->dwarf.as_arg); + if (ret < 0) + { + retval = 0; + break; + } + ip += sizeof(w); + } + + if (sig[i] != (w&0xff)) + { + retval = 0; + break; + } + w >>= 8; + } + +#if CONSERVATIVE_CHECKS + if (c->dwarf.as == unw_local_addr_space) { + dwarf_set_validate(&c->dwarf, val); + } +#endif + + return retval; +} + + +/** + * @brief Special handling when a signal trampoline is detected + * @param[in] cursor The current unwinding state. + * + * If this is a signal trampoline then %rsp points directly at the kernel + * sighandler info so it's easy to get the ucontext. + * + * @returns < 0 on failure, 0 on success. + */ +HIDDEN int +x86_64_handle_signal_frame (unw_cursor_t *cursor) +{ + struct cursor * c = (struct cursor *) cursor; + unw_addr_space_t as = c->dwarf.as; + unw_accessors_t * a = unw_get_accessors_int (as); + unw_word_t sp = c->dwarf.cfa; + unw_word_t uc_ptr_addr = sp + offsetof(struct _sighandler_info, context); + + ucontext_t *context = NULL; + int ret = a->access_mem (as, uc_ptr_addr, (unw_word_t*)&context, 0, c->dwarf.as_arg); + if (ret < 0) + { + return -UNW_EBADFRAME; + } + Debug(3, "unwind context at %#010lx\n", (long)context); + + for (size_t i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) + { + c->dwarf.loc[i] = DWARF_NULL_LOC; + } + + c->dwarf.loc[RAX] = DWARF_VAL_LOC (&c->dwarf, context->uc_mcontext.cpu.rax); + c->dwarf.loc[RDX] = DWARF_VAL_LOC (&c->dwarf, context->uc_mcontext.cpu.rdx); + c->dwarf.loc[RCX] = DWARF_VAL_LOC (&c->dwarf, context->uc_mcontext.cpu.rcx); + c->dwarf.loc[RBX] = DWARF_VAL_LOC (&c->dwarf, context->uc_mcontext.cpu.rbx); + c->dwarf.loc[RSI] = DWARF_VAL_LOC (&c->dwarf, context->uc_mcontext.cpu.rsi); + c->dwarf.loc[RDI] = DWARF_VAL_LOC (&c->dwarf, context->uc_mcontext.cpu.rdi); + c->dwarf.loc[RBP] = DWARF_VAL_LOC (&c->dwarf, context->uc_mcontext.cpu.rbp); + c->dwarf.loc[RSP] = DWARF_VAL_LOC (&c->dwarf, context->uc_mcontext.cpu.rsp); + c->dwarf.loc[ R8] = DWARF_VAL_LOC (&c->dwarf, context->uc_mcontext.cpu.r8); + c->dwarf.loc[ R9] = DWARF_VAL_LOC (&c->dwarf, context->uc_mcontext.cpu.r9); + c->dwarf.loc[R10] = DWARF_VAL_LOC (&c->dwarf, context->uc_mcontext.cpu.r10); + c->dwarf.loc[R11] = DWARF_VAL_LOC (&c->dwarf, context->uc_mcontext.cpu.r11); + c->dwarf.loc[R12] = DWARF_VAL_LOC (&c->dwarf, context->uc_mcontext.cpu.r12); + c->dwarf.loc[R13] = DWARF_VAL_LOC (&c->dwarf, context->uc_mcontext.cpu.r13); + c->dwarf.loc[R14] = DWARF_VAL_LOC (&c->dwarf, context->uc_mcontext.cpu.r14); + c->dwarf.loc[R15] = DWARF_VAL_LOC (&c->dwarf, context->uc_mcontext.cpu.r15); + c->dwarf.loc[RIP] = DWARF_VAL_LOC (&c->dwarf, context->uc_mcontext.cpu.rip); + + dwarf_get (&c->dwarf, c->dwarf.loc[RSP], &c->dwarf.cfa); + dwarf_get (&c->dwarf, c->dwarf.loc[RIP], &c->dwarf.ip); + + return 0; +} + + +#ifndef UNW_REMOTE_ONLY +HIDDEN void * +x86_64_r_uc_addr (ucontext_t *uc, int reg) +{ + void *addr; + + switch (reg) + { + case UNW_X86_64_R8: addr = &uc->uc_mcontext.cpu.r8; break; + case UNW_X86_64_R9: addr = &uc->uc_mcontext.cpu.r9; break; + case UNW_X86_64_R10: addr = &uc->uc_mcontext.cpu.r10; break; + case UNW_X86_64_R11: addr = &uc->uc_mcontext.cpu.r11; break; + case UNW_X86_64_R12: addr = &uc->uc_mcontext.cpu.r12; break; + case UNW_X86_64_R13: addr = &uc->uc_mcontext.cpu.r13; break; + case UNW_X86_64_R14: addr = &uc->uc_mcontext.cpu.r14; break; + case UNW_X86_64_R15: addr = &uc->uc_mcontext.cpu.r15; break; + case UNW_X86_64_RDI: addr = &uc->uc_mcontext.cpu.rdi; break; + case UNW_X86_64_RSI: addr = &uc->uc_mcontext.cpu.rsi; break; + case UNW_X86_64_RBP: addr = &uc->uc_mcontext.cpu.rbp; break; + case UNW_X86_64_RBX: addr = &uc->uc_mcontext.cpu.rbx; break; + case UNW_X86_64_RDX: addr = &uc->uc_mcontext.cpu.rdx; break; + case UNW_X86_64_RAX: addr = &uc->uc_mcontext.cpu.rax; break; + case UNW_X86_64_RCX: addr = &uc->uc_mcontext.cpu.rcx; break; + case UNW_X86_64_RSP: addr = &uc->uc_mcontext.cpu.rsp; break; + case UNW_X86_64_RIP: addr = &uc->uc_mcontext.cpu.rip; break; + + default: + addr = NULL; + } + return addr; +} + +HIDDEN NORETURN void +x86_64_sigreturn (unw_cursor_t *cursor) +{ + Debug(0, "Unsupported function.\n"); + abort(); +} + +#endif + +HIDDEN int +x86_64_os_step(struct cursor *c) +{ + return (0); +} diff --git a/vendor/libunwind/src/x86_64/Gos-solaris.c b/vendor/libunwind/src/x86_64/Gos-solaris.c new file mode 100644 index 0000000000..d570d08e10 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Gos-solaris.c @@ -0,0 +1,143 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002-2003 Hewlett-Packard Co + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" +#include "ucontext_i.h" + +#include + +struct sigframe { + uint64_t signo; + uint64_t sip; +}; + +int +unw_is_signal_frame (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + + c->sigcontext_format = (c->dwarf.ip == (unw_word_t)-1) ? + X86_64_SCF_SOLARIS_SIGFRAME : X86_64_SCF_NONE; + + return (c->sigcontext_format); +} + +HIDDEN int +x86_64_handle_signal_frame (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + unw_word_t ucontext = c->dwarf.cfa + sizeof (struct sigframe); + int i; + + if (c->sigcontext_format != X86_64_SCF_SOLARIS_SIGFRAME) + return -UNW_EBADFRAME; + + c->sigcontext_addr = c->dwarf.cfa; + + Debug(1, "signal frame cfa = %lx ucontext = %lx\n", + (uint64_t)c->dwarf.cfa, (uint64_t)ucontext); + + struct dwarf_loc rsp_loc = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RSP, 0); + int ret = dwarf_get (&c->dwarf, rsp_loc, &c->dwarf.cfa); + + if (ret < 0) + { + Debug (2, "return %d\n", ret); + return ret; + } + + for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) + c->dwarf.loc[i] = DWARF_NULL_LOC; + + c->dwarf.loc[RAX] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RAX, 0); + c->dwarf.loc[RDX] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RDX, 0); + c->dwarf.loc[RCX] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RCX, 0); + c->dwarf.loc[RBX] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RBX, 0); + c->dwarf.loc[RSI] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RSI, 0); + c->dwarf.loc[RDI] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RDI, 0); + c->dwarf.loc[RBP] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RBP, 0); + c->dwarf.loc[RSP] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RSP, 0); + c->dwarf.loc[ R8] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_R8, 0); + c->dwarf.loc[ R9] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_R9, 0); + c->dwarf.loc[R10] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_R10, 0); + c->dwarf.loc[R11] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_R11, 0); + c->dwarf.loc[R12] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_R12, 0); + c->dwarf.loc[R13] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_R13, 0); + c->dwarf.loc[R14] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_R14, 0); + c->dwarf.loc[R15] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_R15, 0); + c->dwarf.loc[RIP] = DWARF_LOC (ucontext + UC_MCONTEXT_GREGS_RIP, 0); + + c->dwarf.use_prev_instr = 1; + return 0; +} + +#ifndef UNW_REMOTE_ONLY +HIDDEN void * +x86_64_r_uc_addr (ucontext_t *uc, int reg) +{ + /* NOTE: common_init() in init.h inlines these for fast path access. */ + void *addr; + + switch (reg) + { + case UNW_X86_64_R8: addr = &uc->uc_mcontext.gregs[REG_R8]; break; + case UNW_X86_64_R9: addr = &uc->uc_mcontext.gregs[REG_R9]; break; + case UNW_X86_64_R10: addr = &uc->uc_mcontext.gregs[REG_R10]; break; + case UNW_X86_64_R11: addr = &uc->uc_mcontext.gregs[REG_R11]; break; + case UNW_X86_64_R12: addr = &uc->uc_mcontext.gregs[REG_R12]; break; + case UNW_X86_64_R13: addr = &uc->uc_mcontext.gregs[REG_R13]; break; + case UNW_X86_64_R14: addr = &uc->uc_mcontext.gregs[REG_R14]; break; + case UNW_X86_64_R15: addr = &uc->uc_mcontext.gregs[REG_R15]; break; + case UNW_X86_64_RDI: addr = &uc->uc_mcontext.gregs[REG_RDI]; break; + case UNW_X86_64_RSI: addr = &uc->uc_mcontext.gregs[REG_RSI]; break; + case UNW_X86_64_RBP: addr = &uc->uc_mcontext.gregs[REG_RBP]; break; + case UNW_X86_64_RBX: addr = &uc->uc_mcontext.gregs[REG_RBX]; break; + case UNW_X86_64_RDX: addr = &uc->uc_mcontext.gregs[REG_RDX]; break; + case UNW_X86_64_RAX: addr = &uc->uc_mcontext.gregs[REG_RAX]; break; + case UNW_X86_64_RCX: addr = &uc->uc_mcontext.gregs[REG_RCX]; break; + case UNW_X86_64_RSP: addr = &uc->uc_mcontext.gregs[REG_RSP]; break; + case UNW_X86_64_RIP: addr = &uc->uc_mcontext.gregs[REG_RIP]; break; + + default: + addr = NULL; + } + return addr; +} + +HIDDEN NORETURN void +x86_64_sigreturn (unw_cursor_t *cursor) +{ + abort(); +} + +#endif + +HIDDEN int +x86_64_os_step(struct cursor *c) +{ + return (0); +} diff --git a/vendor/libunwind/src/x86_64/Greg_states_iterate.c b/vendor/libunwind/src/x86_64/Greg_states_iterate.c new file mode 100644 index 0000000000..a17dc1b561 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Greg_states_iterate.c @@ -0,0 +1,37 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2003 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +int +unw_reg_states_iterate (unw_cursor_t *cursor, + unw_reg_states_callback cb, void *token) +{ + struct cursor *c = (struct cursor *) cursor; + + return dwarf_reg_states_iterate (&c->dwarf, cb, token); +} diff --git a/vendor/libunwind/src/x86_64/Gregs.c b/vendor/libunwind/src/x86_64/Gregs.c new file mode 100644 index 0000000000..88c466b9ec --- /dev/null +++ b/vendor/libunwind/src/x86_64/Gregs.c @@ -0,0 +1,138 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2004 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +#if 0 +static inline dwarf_loc_t +linux_scratch_loc (struct cursor *c, unw_regnum_t reg) +{ + unw_word_t addr = c->sigcontext_addr; + + switch (c->sigcontext_format) + { + case X86_64_SCF_NONE: + return DWARF_REG_LOC (&c->dwarf, reg); + + case X86_64_SCF_LINUX_RT_SIGFRAME: + addr += LINUX_UC_MCONTEXT_OFF; + break; + + case X86_64_SCF_FREEBSD_SIGFRAME: + addr += FREEBSD_UC_MCONTEXT_OFF; + break; + } + + return DWARF_REG_LOC (&c->dwarf, reg); + +} + +HIDDEN dwarf_loc_t +x86_64_scratch_loc (struct cursor *c, unw_regnum_t reg) +{ + if (c->sigcontext_addr) + return linux_scratch_loc (c, reg); + else + return DWARF_REG_LOC (&c->dwarf, reg); +} +#endif + +HIDDEN int +tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp, + int write) +{ + dwarf_loc_t loc = DWARF_NULL_LOC; + unsigned int mask; + int arg_num; + + switch (reg) + { + + case UNW_X86_64_RIP: + if (write) + c->dwarf.ip = *valp; /* also update the RIP cache */ + loc = c->dwarf.loc[RIP]; + break; + + case UNW_X86_64_CFA: + if (write) + return -UNW_EREADONLYREG; + *valp = c->dwarf.cfa; + return 0; + + case UNW_X86_64_RAX: + case UNW_X86_64_RDX: + arg_num = reg - UNW_X86_64_RAX; + mask = (1 << arg_num); + if (write) + { + c->dwarf.eh_args[arg_num] = *valp; + c->dwarf.eh_valid_mask |= mask; + return 0; + } + else if ((c->dwarf.eh_valid_mask & mask) != 0) + { + *valp = c->dwarf.eh_args[arg_num]; + return 0; + } + else + loc = c->dwarf.loc[(reg == UNW_X86_64_RAX) ? RAX : RDX]; + break; + + case UNW_X86_64_RCX: loc = c->dwarf.loc[RCX]; break; + case UNW_X86_64_RBX: loc = c->dwarf.loc[RBX]; break; + + case UNW_X86_64_RSP: loc = c->dwarf.loc[RSP]; break; + case UNW_X86_64_RBP: loc = c->dwarf.loc[RBP]; break; + case UNW_X86_64_RSI: loc = c->dwarf.loc[RSI]; break; + case UNW_X86_64_RDI: loc = c->dwarf.loc[RDI]; break; + case UNW_X86_64_R8: loc = c->dwarf.loc[R8]; break; + case UNW_X86_64_R9: loc = c->dwarf.loc[R9]; break; + case UNW_X86_64_R10: loc = c->dwarf.loc[R10]; break; + case UNW_X86_64_R11: loc = c->dwarf.loc[R11]; break; + case UNW_X86_64_R12: loc = c->dwarf.loc[R12]; break; + case UNW_X86_64_R13: loc = c->dwarf.loc[R13]; break; + case UNW_X86_64_R14: loc = c->dwarf.loc[R14]; break; + case UNW_X86_64_R15: loc = c->dwarf.loc[R15]; break; + + default: + Debug (1, "bad register number %u\n", reg); + return -UNW_EBADREG; + } + + if (write) + return dwarf_put (&c->dwarf, loc, *valp); + else + return dwarf_get (&c->dwarf, loc, valp); +} + +HIDDEN int +tdep_access_fpreg (struct cursor *c UNUSED, unw_regnum_t reg UNUSED, + unw_fpreg_t *valp UNUSED, int write UNUSED) +{ + return -UNW_EBADREG; +} diff --git a/vendor/libunwind/src/x86_64/Gresume.c b/vendor/libunwind/src/x86_64/Gresume.c new file mode 100644 index 0000000000..572e048953 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Gresume.c @@ -0,0 +1,123 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2002-2004 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include + +#include "libunwind_i.h" +#include "unwind_i.h" + +#ifndef UNW_REMOTE_ONLY + +HIDDEN inline int +x86_64_local_resume (unw_addr_space_t as UNUSED, unw_cursor_t *cursor, void *arg UNUSED) +{ + struct cursor *c = (struct cursor *) cursor; + ucontext_t *uc = dwarf_get_uc(&c->dwarf); + + /* Ensure c->pi is up-to-date. On x86-64, it's relatively common to + be missing DWARF unwind info. We don't want to fail in that + case, because the frame-chain still would let us do a backtrace + at least. */ + dwarf_make_proc_info (&c->dwarf); + + if (unlikely (c->sigcontext_addr != X86_64_SCF_NONE)) + { + x86_64_sigreturn(cursor); + abort(); + } + else + { + Debug (8, "resuming at ip=%llx via setcontext()\n", + (unsigned long long) c->dwarf.ip); + setcontext (uc); + } + return -UNW_EINVAL; +} + +#endif /* !UNW_REMOTE_ONLY */ + +/* This routine is responsible for copying the register values in + cursor C and establishing them as the current machine state. */ + +static inline int +establish_machine_state (struct cursor *c) +{ + int (*access_reg) (unw_addr_space_t, unw_regnum_t, unw_word_t *, + int write, void *); + int (*access_fpreg) (unw_addr_space_t, unw_regnum_t, unw_fpreg_t *, + int write, void *); + unw_addr_space_t as = c->dwarf.as; + void *arg = c->dwarf.as_arg; + unw_fpreg_t fpval; + unw_word_t val; + int reg; + + access_reg = as->acc.access_reg; + access_fpreg = as->acc.access_fpreg; + + Debug (8, "copying out cursor state\n"); + + for (reg = 0; reg <= UNW_REG_LAST; ++reg) + { + Debug (16, "copying %s %d\n", unw_regname (reg), reg); + if (unw_is_fpreg (reg)) + { + if (tdep_access_fpreg (c, reg, &fpval, 0) >= 0) + (*access_fpreg) (as, reg, &fpval, 1, arg); + } + else + { + if (tdep_access_reg (c, reg, &val, 0) >= 0) + (*access_reg) (as, reg, &val, 1, arg); + } + } + + if (c->dwarf.args_size) + { + if (tdep_access_reg (c, UNW_X86_64_RSP, &val, 0) >= 0) + { + val += c->dwarf.args_size; + (*access_reg) (as, UNW_X86_64_RSP, &val, 1, arg); + } + } + return 0; +} + +int +unw_resume (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + int ret; + + Debug (1, "(cursor=%p)\n", c); + + if ((ret = establish_machine_state (c)) < 0) + return ret; + + return (*c->dwarf.as->acc.resume) (c->dwarf.as, (unw_cursor_t *) c, + c->dwarf.as_arg); +} diff --git a/vendor/libunwind/src/x86_64/Gstash_frame.c b/vendor/libunwind/src/x86_64/Gstash_frame.c new file mode 100644 index 0000000000..6b980a9830 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Gstash_frame.c @@ -0,0 +1,125 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2010, 2011 by FERMI NATIONAL ACCELERATOR LABORATORY + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" +#include "ucontext_i.h" + +HIDDEN void +tdep_stash_frame (struct dwarf_cursor *d, struct dwarf_reg_state *rs) +{ + struct cursor *c = (struct cursor *) dwarf_to_cursor (d); + unw_tdep_frame_t *f = &c->frame_info; + + Debug (4, "ip=0x%lx cfa=0x%lx type %d cfa [where=%d val=%ld] cfaoff=%ld" + " ra=0x%lx rbp [where=%d val=%ld @0x%lx] rsp [where=%d val=%ld @0x%lx]\n", + d->ip, d->cfa, f->frame_type, + rs->reg.where[DWARF_CFA_REG_COLUMN], + rs->reg.val[DWARF_CFA_REG_COLUMN], + rs->reg.val[DWARF_CFA_OFF_COLUMN], + DWARF_GET_LOC(d->loc[rs->ret_addr_column]), + rs->reg.where[RBP], rs->reg.val[RBP], DWARF_GET_LOC(d->loc[RBP]), + rs->reg.where[RSP], rs->reg.val[RSP], DWARF_GET_LOC(d->loc[RSP])); + + if (rs->reg.where[DWARF_CFA_REG_COLUMN] == DWARF_WHERE_EXPR && + rs->reg.where[RBP] == DWARF_WHERE_EXPR) { + /* Check for GCC generated alignment frame for rsp. A simple + * def_cfa_expr that loads a constant offset from rbp, where the + * address of the rip was pushed on the stack */ + unw_word_t cfa_addr = rs->reg.val[DWARF_CFA_REG_COLUMN]; + unw_word_t rbp_addr = rs->reg.val[RBP]; + unw_word_t cfa_offset; + + int ret = dwarf_stack_aligned(d, cfa_addr, rbp_addr, &cfa_offset); + if (ret) { + f->frame_type = UNW_X86_64_FRAME_ALIGNED; + f->cfa_reg_offset = cfa_offset; + f->cfa_reg_rsp = 0; + } + } + + /* A standard frame is defined as: + - CFA is register-relative offset off RBP or RSP; + - Return address is saved at CFA-8; + - RBP is unsaved or saved at CFA+offset, offset != -1; + - RSP is unsaved or saved at CFA+offset, offset != -1. */ + if (f->frame_type == UNW_X86_64_FRAME_OTHER + && (rs->reg.where[DWARF_CFA_REG_COLUMN] == DWARF_WHERE_REG) + && (rs->reg.val[DWARF_CFA_REG_COLUMN] == RBP + || rs->reg.val[DWARF_CFA_REG_COLUMN] == RSP) + && labs((long) rs->reg.val[DWARF_CFA_OFF_COLUMN]) < (1 << 28) + && DWARF_GET_LOC(d->loc[rs->ret_addr_column]) == d->cfa-8 + && (rs->reg.where[RBP] == DWARF_WHERE_UNDEF + || rs->reg.where[RBP] == DWARF_WHERE_SAME + || rs->reg.where[RBP] == DWARF_WHERE_CFA + || (rs->reg.where[RBP] == DWARF_WHERE_CFAREL + && labs((long) rs->reg.val[RBP]) < (1 << 14) + && rs->reg.val[RBP]+1 != 0)) + && (rs->reg.where[RSP] == DWARF_WHERE_UNDEF + || rs->reg.where[RSP] == DWARF_WHERE_SAME + || rs->reg.where[RSP] == DWARF_WHERE_CFA + || (rs->reg.where[RSP] == DWARF_WHERE_CFAREL + && labs((long) rs->reg.val[RSP]) < (1 << 14) + && rs->reg.val[RSP]+1 != 0))) + { + /* Save information for a standard frame. */ + f->frame_type = UNW_X86_64_FRAME_STANDARD; + f->cfa_reg_rsp = (rs->reg.val[DWARF_CFA_REG_COLUMN] == RSP); + f->cfa_reg_offset = rs->reg.val[DWARF_CFA_OFF_COLUMN]; + if (rs->reg.where[RBP] == DWARF_WHERE_CFAREL) + f->rbp_cfa_offset = rs->reg.val[RBP]; + if (rs->reg.where[RSP] == DWARF_WHERE_CFAREL) + f->rsp_cfa_offset = rs->reg.val[RSP]; + if (rs->reg.where[RBP] == DWARF_WHERE_CFA) + f->rbp_cfa_offset = 0; + if (rs->reg.where[RSP] == DWARF_WHERE_CFA) + f->rsp_cfa_offset = 0; + Debug (4, " standard frame\n"); + } + + /* Signal frame was detected via augmentation in tdep_fetch_frame() */ + else if (f->frame_type == UNW_X86_64_FRAME_SIGRETURN) + { + /* Later we are going to fish out {RBP,RSP,RIP} from sigcontext via + their ucontext_t offsets. Confirm DWARF info agrees with the + offsets we expect. */ + +#ifndef NDEBUG + const unw_word_t uc = c->sigcontext_addr; + + assert (DWARF_GET_LOC(d->loc[RIP]) - uc == UC_MCONTEXT_GREGS_RIP); + assert (DWARF_GET_LOC(d->loc[RBP]) - uc == UC_MCONTEXT_GREGS_RBP); + assert (DWARF_GET_LOC(d->loc[RSP]) - uc == UC_MCONTEXT_GREGS_RSP); +#endif + + Debug (4, " sigreturn frame\n"); + } + + else if (f->frame_type == UNW_X86_64_FRAME_ALIGNED) { + Debug (4, " aligned frame, offset %i\n", f->cfa_reg_offset); + } + /* PLT and guessed RBP-walked frames are handled in unw_step(). */ + else { + Debug (4, " unusual frame\n"); + } +} diff --git a/vendor/libunwind/src/x86_64/Gstep.c b/vendor/libunwind/src/x86_64/Gstep.c new file mode 100644 index 0000000000..00f5e9585b --- /dev/null +++ b/vendor/libunwind/src/x86_64/Gstep.c @@ -0,0 +1,316 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002-2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" +#include "unwind_i.h" +#include + +/* Recognise PLT entries such as: + 3bdf0: ff 25 e2 49 13 00 jmpq *0x1349e2(%rip) + 3bdf6: 68 ae 03 00 00 pushq $0x3ae + 3bdfb: e9 00 c5 ff ff jmpq 38300 <_init+0x18> */ +static int +_is_plt_entry (struct dwarf_cursor *c) +{ + unw_word_t w0, w1; + unw_accessors_t *a; + int ret; + + a = unw_get_accessors_int (c->as); + if ((ret = (*a->access_mem) (c->as, c->ip, &w0, 0, c->as_arg)) < 0 + || (ret = (*a->access_mem) (c->as, c->ip + 8, &w1, 0, c->as_arg)) < 0) + return 0; + + ret = (((w0 & 0xffff) == 0x25ff) + && (((w0 >> 48) & 0xff) == 0x68) + && (((w1 >> 24) & 0xff) == 0xe9)); + + Debug (14, "ip=0x%lx => 0x%016lx 0x%016lx, ret = %d\n", c->ip, w0, w1, ret); + return ret; +} + +int +unw_is_plt_entry (unw_cursor_t *uc) +{ + return _is_plt_entry (&((struct cursor *)uc)->dwarf); +} + +int +unw_step (unw_cursor_t *cursor) +{ + struct cursor *c = (struct cursor *) cursor; + int ret, i; + +#if CONSERVATIVE_CHECKS + int val = 0; + if (c->dwarf.as == unw_local_addr_space) { + val = dwarf_get_validate(&c->dwarf); + dwarf_set_validate(&c->dwarf, 1); + } +#endif + + Debug (1, "(cursor=%p, ip=0x%016lx, cfa=0x%016lx)\n", + c, c->dwarf.ip, c->dwarf.cfa); + + /* Try DWARF-based unwinding... */ + c->sigcontext_format = X86_64_SCF_NONE; + ret = dwarf_step (&c->dwarf); + +#if CONSERVATIVE_CHECKS + if (c->dwarf.as == unw_local_addr_space) { + dwarf_set_validate(&c->dwarf, val); + } +#endif + + if (ret < 0 && ret != -UNW_ENOINFO) + { + Debug (2, "returning %d\n", ret); + return ret; + } + + if (likely (ret >= 0)) + { + /* x86_64 ABI specifies that end of call-chain is marked with a + NULL RBP or undefined return address */ + if (DWARF_IS_NULL_LOC (c->dwarf.loc[RBP])) + { + c->dwarf.ip = 0; + ret = 0; + } + } + else + { + /* DWARF failed. There isn't much of a usable frame-chain on x86-64, + but we do need to handle two special-cases: + + (i) signal trampoline: Old kernels and older libcs don't + export the vDSO needed to get proper unwind info for the + trampoline. Recognize that case by looking at the code + and filling in things by hand. + + (ii) PLT (shared-library) call-stubs: PLT stubs are invoked + via CALLQ. Try this for all non-signal trampoline + code. */ + + unw_word_t invalid_prev_rip = 0; + unw_word_t prev_ip = c->dwarf.ip, prev_cfa = c->dwarf.cfa; + struct dwarf_loc rbp_loc = DWARF_NULL_LOC, rsp_loc = DWARF_NULL_LOC, rip_loc = DWARF_NULL_LOC; + + /* We could get here because of missing/bad unwind information. + Validate all addresses before dereferencing. */ + if (c->dwarf.as == unw_local_addr_space) { + dwarf_set_validate(&c->dwarf, 1); + } + + Debug (13, "dwarf_step() failed (ret=%d), trying frame-chain\n", ret); + + if ((ret = x86_64_os_step (c)) != 0) + { + if (ret < 0) + { + Debug (2, "returning 0\n"); + return 0; + } + } + else if (unw_is_signal_frame (cursor) > 0) + { + ret = x86_64_handle_signal_frame(cursor); + if (ret < 0) + { + Debug (2, "returning 0\n"); + return 0; + } + } + else if (_is_plt_entry (&c->dwarf)) + { + /* Like regular frame, CFA = RSP+8, RA = [CFA-8], no regs saved. */ + Debug (2, "found plt entry\n"); + c->frame_info.cfa_reg_offset = 8; + c->frame_info.cfa_reg_rsp = -1; + c->frame_info.frame_type = UNW_X86_64_FRAME_STANDARD; + c->dwarf.loc[RIP] = DWARF_LOC (c->dwarf.cfa, 0); + c->dwarf.cfa += 8; + } + else if (DWARF_IS_NULL_LOC (c->dwarf.loc[RBP])) + { + for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) + c->dwarf.loc[i] = DWARF_NULL_LOC; + } + else + { + unw_word_t rbp; + + ret = dwarf_get (&c->dwarf, c->dwarf.loc[RBP], &rbp); + if (ret < 0) + { + Debug (2, "returning %d [RBP=0x%lx]\n", ret, + DWARF_GET_LOC (c->dwarf.loc[RBP])); + return ret; + } + + unw_word_t not_used; + invalid_prev_rip = dwarf_get(&c->dwarf, DWARF_MEM_LOC(c->dwarf, prev_ip), ¬_used); + + if (!rbp && invalid_prev_rip == 0) + { + /* Looks like we may have reached the end of the call-chain. */ + rbp_loc = DWARF_NULL_LOC; + rsp_loc = DWARF_NULL_LOC; + rip_loc = DWARF_NULL_LOC; + } + else + { + /* + * Check if previous RIP was invalid + * This could happen if a bad function pointer was + * followed and so the stack wasn't updated by the + * preamble + */ + int rip_fixup_success = 0; + if (invalid_prev_rip != 0) + { + Debug (2, "Previous RIP 0x%lx was invalid, attempting fixup\n", prev_ip); + unw_word_t rsp; + ret = dwarf_get (&c->dwarf, c->dwarf.loc[RSP], &rsp); + + /*Test to see if what we think is the previous RIP is valid*/ + unw_word_t new_ip = 0; + if (dwarf_get(&c->dwarf, DWARF_MEM_LOC(c->dwarf, rsp), &new_ip) == 0) + { + Debug (2, "RSP 0x%lx looks valid\n", rsp); + if ((ret = dwarf_get(&c->dwarf, DWARF_MEM_LOC(c->dwarf, new_ip), ¬_used)) == 0) + { + Debug (2, "new_ip 0x%lx looks valid\n", new_ip); + rip_fixup_success = 1; + c->frame_info.cfa_reg_offset = 8; + c->frame_info.cfa_reg_rsp = -1; + c->frame_info.rbp_cfa_offset = -1; + c->frame_info.rsp_cfa_offset = -1; + c->frame_info.frame_type = UNW_X86_64_FRAME_OTHER; + /* + * The call should have pushed RIP to the stack + * and since there was no preamble RSP hasn't been + * touched so RIP should be at RSP. + */ + c->dwarf.cfa += 8; + /* Optimised x64 binaries don't use RBP it seems? */ + rbp_loc = c->dwarf.loc[RBP]; + rsp_loc = DWARF_VAL_LOC (c, rsp + 8); + rip_loc = DWARF_LOC (rsp, 0); + } + else + { + Debug (2, "new_ip 0x%lx dwarf_get(&c->dwarf, DWARF_MEM_LOC(c->dwarf, new_ip), ¬_used) != 0\n", new_ip); + } + } + else + { + Debug (2, "rsp 0x%lx dwarf_get(&c->dwarf, DWARF_MEM_LOC(c->dwarf, rsp), &new_ip) != 0\n", rsp); + } + } + /* + * If the previous rip we found on the stack didn't look valid fall back + * to the previous method for finding a valid stack frame + */ + if (!rip_fixup_success) + { + Debug (2, "RIP fixup didn't work, falling back\n"); + unw_word_t rbp1 = 0; + rbp_loc = DWARF_LOC(rbp, 0); + rsp_loc = DWARF_VAL_LOC(c, rbp + 16); + rip_loc = DWARF_LOC (rbp + 8, 0); + ret = dwarf_get (&c->dwarf, rbp_loc, &rbp1); + Debug (1, "[RBP=0x%lx] = 0x%lx (cfa = 0x%lx) -> 0x%lx\n", + (unsigned long) DWARF_GET_LOC (c->dwarf.loc[RBP]), + rbp, c->dwarf.cfa, rbp1); + + /* Heuristic to determine incorrect guess. For RBP to be a + valid frame it needs to be above current CFA, but don't + let it go more than a little. Note that we can't deduce + anything about new RBP (rbp1) since it may not be a frame + pointer in the frame above. Just check we get the value. */ + if (ret < 0 + || rbp < c->dwarf.cfa + || (rbp - c->dwarf.cfa) > 0x4000) + { + rip_loc = DWARF_NULL_LOC; + rbp_loc = DWARF_NULL_LOC; + } + + c->frame_info.frame_type = UNW_X86_64_FRAME_GUESSED; + c->frame_info.cfa_reg_rsp = 0; + c->frame_info.cfa_reg_offset = 16; + c->frame_info.rbp_cfa_offset = -16; + c->dwarf.cfa += 16; + + } + } + /* Mark all registers unsaved */ + for (i = 0; i < DWARF_NUM_PRESERVED_REGS; ++i) + c->dwarf.loc[i] = DWARF_NULL_LOC; + + c->dwarf.loc[RBP] = rbp_loc; + c->dwarf.loc[RSP] = rsp_loc; + c->dwarf.loc[RIP] = rip_loc; + c->dwarf.use_prev_instr = 1; + } + + if (DWARF_IS_NULL_LOC (c->dwarf.loc[RBP]) && invalid_prev_rip == 0) + { + ret = 0; + Debug (2, "NULL %%rbp loc, returning %d\n", ret); + return ret; + } + if (!DWARF_IS_NULL_LOC (c->dwarf.loc[RIP])) + { + ret = dwarf_get (&c->dwarf, c->dwarf.loc[RIP], &c->dwarf.ip); + Debug (1, "Frame Chain [RIP=0x%Lx] = 0x%Lx\n", + (unsigned long long) DWARF_GET_LOC (c->dwarf.loc[RIP]), + (unsigned long long) c->dwarf.ip); + if (ret < 0) + { + Debug (2, "returning %d\n", ret); + return ret; + } +#if __sun + if (c->dwarf.ip == 0) + { + Debug (2, "returning 0\n"); + return ret; + } +#endif + ret = 1; + } + else + c->dwarf.ip = 0; + + if (c->dwarf.ip == prev_ip && c->dwarf.cfa == prev_cfa) + return -UNW_EBADFRAME; + } + Debug (2, "returning %d\n", ret); + return ret; +} diff --git a/vendor/libunwind/src/x86_64/Gtrace.c b/vendor/libunwind/src/x86_64/Gtrace.c new file mode 100644 index 0000000000..491085165f --- /dev/null +++ b/vendor/libunwind/src/x86_64/Gtrace.c @@ -0,0 +1,561 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2010, 2011 by FERMI NATIONAL ACCELERATOR LABORATORY + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" +#include "unwind_i.h" +#include "ucontext_i.h" +#include +#include + +#pragma weak pthread_once +#pragma weak pthread_key_create +#pragma weak pthread_getspecific +#pragma weak pthread_setspecific + +/* Initial hash table size. Table expands by 2 bits (times four). */ +#define HASH_MIN_BITS 14 + +typedef struct +{ + unw_tdep_frame_t *frames; + size_t log_size; + size_t used; + size_t dtor_count; /* Counts how many times our destructor has already + been called. */ +} unw_trace_cache_t; + +static const unw_tdep_frame_t empty_frame = { 0, UNW_X86_64_FRAME_OTHER, -1, -1, 0, -1, -1 }; +static define_lock (trace_init_lock); +static pthread_once_t trace_cache_once = PTHREAD_ONCE_INIT; +static sig_atomic_t trace_cache_once_happen; +static pthread_key_t trace_cache_key; +static struct mempool trace_cache_pool; +static _Thread_local unw_trace_cache_t *tls_cache; +static _Thread_local int tls_cache_destroyed; + +/* Free memory for a thread's trace cache. */ +static void +trace_cache_free (void *arg) +{ + unw_trace_cache_t *cache = arg; + if (++cache->dtor_count < PTHREAD_DESTRUCTOR_ITERATIONS) + { + /* Not yet our turn to get destroyed. Re-install ourselves into the key. */ + pthread_setspecific(trace_cache_key, cache); + Debug(5, "delayed freeing cache %p (%zx to go)\n", cache, + PTHREAD_DESTRUCTOR_ITERATIONS - cache->dtor_count); + return; + } + tls_cache_destroyed = 1; + tls_cache = NULL; + mi_munmap (cache->frames, (1u << cache->log_size) * sizeof(unw_tdep_frame_t)); + mempool_free (&trace_cache_pool, cache); + Debug(5, "freed cache %p\n", cache); +} + +/* Initialise frame tracing for threaded use. */ +static void +trace_cache_init_once (void) +{ + pthread_key_create (&trace_cache_key, &trace_cache_free); + mempool_init (&trace_cache_pool, sizeof (unw_trace_cache_t), 0); + trace_cache_once_happen = 1; +} + +static unw_tdep_frame_t * +trace_cache_buckets (size_t n) +{ + unw_tdep_frame_t *frames; + size_t i; + + GET_MEMORY(frames, n * sizeof (unw_tdep_frame_t)); + if (likely(frames != NULL)) + for (i = 0; i < n; ++i) + frames[i] = empty_frame; + + return frames; +} + +/* Allocate and initialise hash table for frame cache lookups. + Returns the cache initialised with (1u << HASH_LOW_BITS) hash + buckets, or NULL if there was a memory allocation problem. */ +static unw_trace_cache_t * +trace_cache_create (void) +{ + unw_trace_cache_t *cache; + + if (tls_cache_destroyed) + { + /* The current thread is in the process of exiting. Don't recreate + cache, as we wouldn't have another chance to free it. */ + Debug(5, "refusing to reallocate cache: " + "thread-locals are being deallocated\n"); + return NULL; + } + + if (! (cache = mempool_alloc(&trace_cache_pool))) + { + Debug(5, "failed to allocate cache\n"); + return NULL; + } + + if (! (cache->frames = trace_cache_buckets(1u << HASH_MIN_BITS))) + { + Debug(5, "failed to allocate buckets\n"); + mempool_free(&trace_cache_pool, cache); + return NULL; + } + + cache->log_size = HASH_MIN_BITS; + cache->used = 0; + cache->dtor_count = 0; + tls_cache_destroyed = 0; /* Paranoia: should already be 0. */ + Debug(5, "allocated cache %p\n", cache); + return cache; +} + +/* Expand the hash table in the frame cache if possible. This always + quadruples the hash size, and clears all previous frame entries. */ +static int +trace_cache_expand (unw_trace_cache_t *cache) +{ + size_t old_size = (1u << cache->log_size); + size_t new_log_size = cache->log_size + 2; + unw_tdep_frame_t *new_frames = trace_cache_buckets (1u << new_log_size); + + if (unlikely(! new_frames)) + { + Debug(5, "failed to expand cache to 2^%lu buckets\n", new_log_size); + return -UNW_ENOMEM; + } + + Debug(5, "expanded cache from 2^%lu to 2^%lu buckets\n", cache->log_size, new_log_size); + mi_munmap(cache->frames, old_size * sizeof(unw_tdep_frame_t)); + cache->frames = new_frames; + cache->log_size = new_log_size; + cache->used = 0; + return 0; +} + +static unw_trace_cache_t * +trace_cache_get_unthreaded (void) +{ + unw_trace_cache_t *cache; + intrmask_t saved_mask; + static unw_trace_cache_t *global_cache = NULL; + lock_acquire (&trace_init_lock, saved_mask); + if (! global_cache) + { + mempool_init (&trace_cache_pool, sizeof (unw_trace_cache_t), 0); + global_cache = trace_cache_create (); + } + cache = global_cache; + lock_release (&trace_init_lock, saved_mask); + Debug(5, "using cache %p\n", cache); + return cache; +} + +/* Get the frame cache for the current thread. Create it if there is none. */ +static unw_trace_cache_t * +trace_cache_get (void) +{ + unw_trace_cache_t *cache; + if (likely (pthread_once != NULL)) + { + pthread_once(&trace_cache_once, &trace_cache_init_once); + if (!trace_cache_once_happen) + { + return trace_cache_get_unthreaded(); + } + if (! (cache = tls_cache)) + { + cache = trace_cache_create(); + pthread_setspecific(trace_cache_key, cache); + tls_cache = cache; + } + Debug(5, "using cache %p\n", cache); + return cache; + } + else + { + return trace_cache_get_unthreaded(); + } +} + +/* Initialise frame properties for address cache slot F at address + RIP using current CFA, RBP and RSP values. Modifies CURSOR to + that location, performs one unw_step(), and fills F with what + was discovered about the location. Returns F. +*/ +static unw_tdep_frame_t * +trace_init_addr (unw_tdep_frame_t *f, + unw_cursor_t *cursor, + unw_word_t cfa, + unw_word_t rip, + unw_word_t rbp, + unw_word_t rsp) +{ + struct cursor *c = (struct cursor *) cursor; + struct dwarf_cursor *d = &c->dwarf; + int ret = -UNW_EINVAL; + + /* Initialise frame properties: unknown, not last. */ + f->virtual_address = rip; + f->frame_type = UNW_X86_64_FRAME_OTHER; + f->last_frame = 0; + f->cfa_reg_rsp = -1; + f->cfa_reg_offset = 0; + f->rbp_cfa_offset = -1; + f->rsp_cfa_offset = -1; + + /* Reinitialise cursor to this instruction - but undo next/prev RIP + adjustment because unw_step will redo it - and force RIP, RBP + RSP into register locations (=~ ucontext we keep), then set + their desired values. Then perform the step. */ + d->ip = rip + d->use_prev_instr; + d->cfa = cfa; + for(int i = 0; i < DWARF_NUM_PRESERVED_REGS; i++) { + d->loc[i] = DWARF_NULL_LOC; + } + d->loc[UNW_X86_64_RIP] = DWARF_REG_LOC (d, UNW_X86_64_RIP); + d->loc[UNW_X86_64_RBP] = DWARF_REG_LOC (d, UNW_X86_64_RBP); + d->loc[UNW_X86_64_RSP] = DWARF_REG_LOC (d, UNW_X86_64_RSP); + c->frame_info = *f; + + if (likely(dwarf_put (d, d->loc[UNW_X86_64_RIP], rip) >= 0) + && likely(dwarf_put (d, d->loc[UNW_X86_64_RBP], rbp) >= 0) + && likely(dwarf_put (d, d->loc[UNW_X86_64_RSP], rsp) >= 0) + && likely((ret = unw_step (cursor)) >= 0)) + *f = c->frame_info; + + /* If unw_step() stopped voluntarily, remember that, even if it + otherwise could not determine anything useful. This avoids + failing trace if we hit frames without unwind info, which is + common for the outermost frame (CRT stuff) on many systems. + This avoids failing trace in very common circumstances; failing + to unw_step() loop wouldn't produce any better result. */ + if (ret == 0) + f->last_frame = -1; + + Debug (3, "frame va %lx type %d last %d cfa %s+%d rbp @ cfa%+d rsp @ cfa%+d\n", + f->virtual_address, f->frame_type, f->last_frame, + f->cfa_reg_rsp ? "rsp" : "rbp", f->cfa_reg_offset, + f->rbp_cfa_offset, f->rsp_cfa_offset); + + return f; +} + +/* Look up and if necessary fill in frame attributes for address RIP + in CACHE using current CFA, RBP and RSP values. Uses CURSOR to + perform any unwind steps necessary to fill the cache. Returns the + frame cache slot which describes RIP. */ +static unw_tdep_frame_t * +trace_lookup (unw_cursor_t *cursor, + unw_trace_cache_t *cache, + unw_word_t cfa, + unw_word_t rip, + unw_word_t rbp, + unw_word_t rsp) +{ + /* First look up for previously cached information using cache as + linear probing hash table with probe step of 1. Majority of + lookups should be completed within few steps, but it is very + important the hash table does not fill up, or performance falls + off the cliff. */ + uint64_t i, addr; + uint64_t cache_size = 1u << cache->log_size; + uint64_t slot = ((rip * 0x9e3779b97f4a7c16) >> 43) & (cache_size-1); + unw_tdep_frame_t *frame; + + for (i = 0; i < 16; ++i) + { + frame = &cache->frames[slot]; + addr = frame->virtual_address; + + /* Return if we found the address. */ + if (likely(addr == rip)) + { + Debug (4, "found address after %ld steps\n", i); + return frame; + } + + /* If slot is empty, reuse it. */ + if (likely(! addr)) + break; + + /* Linear probe to next slot candidate, step = 1. */ + if (++slot >= cache_size) + slot -= cache_size; + } + + /* If we collided after 16 steps, or if the hash is more than half + full, force the hash to expand. Fill the selected slot, whether + it's free or collides. Note that hash expansion drops previous + contents; further lookups will refill the hash. */ + Debug (4, "updating slot %lu after %ld steps, replacing 0x%lx\n", slot, i, addr); + if (unlikely(addr || cache->used >= cache_size / 2)) + { + if (unlikely(trace_cache_expand (cache) < 0)) + return NULL; + + cache_size = 1u << cache->log_size; + slot = ((rip * 0x9e3779b97f4a7c16) >> 43) & (cache_size-1); + frame = &cache->frames[slot]; + addr = frame->virtual_address; + } + + if (! addr) + ++cache->used; + + return trace_init_addr (frame, cursor, cfa, rip, rbp, rsp); +} + +/* Fast stack backtrace for x86-64. + + This is used by backtrace() implementation to accelerate frequent + queries for current stack, without any desire to unwind. It fills + BUFFER with the call tree from CURSOR upwards for at most SIZE + stack levels. The first frame, backtrace itself, is omitted. When + called, SIZE should give the maximum number of entries that can be + stored into BUFFER. Uses an internal thread-specific cache to + accelerate queries. + + The caller should fall back to a unw_step() loop if this function + fails by returning -UNW_ESTOPUNWIND, meaning the routine hit a + stack frame that is too complex to be traced in the fast path. + + This function is tuned for clients which only need to walk the + stack to get the call tree as fast as possible but without any + other details, for example profilers sampling the stack thousands + to millions of times per second. The routine handles the most + common x86-64 ABI stack layouts: CFA is RBP or RSP plus/minus + constant offset, return address is at CFA-8, and RBP and RSP are + either unchanged or saved on stack at constant offset from the CFA; + the signal return frame; and frames without unwind info provided + they are at the outermost (final) frame or can conservatively be + assumed to be frame-pointer based. + + Any other stack layout will cause the routine to give up. There + are only a handful of relatively rarely used functions which do + not have a stack in the standard form: vfork, longjmp, setcontext + and _dl_runtime_profile on common linux systems for example. + + On success BUFFER and *SIZE reflect the trace progress up to *SIZE + stack levels or the outermost frame, which ever is less. It may + stop short of outermost frame if unw_step() loop would also do so, + e.g. if there is no more unwind information; this is not reported + as an error. + + The function returns a negative value for errors, -UNW_ESTOPUNWIND + if tracing stopped because of an unusual frame unwind info. The + BUFFER and *SIZE reflect tracing progress up to the error frame. + + Callers of this function would normally look like this: + + unw_cursor_t cur; + unw_context_t ctx; + void addrs[128]; + int depth = 128; + int ret; + + unw_getcontext(&ctx); + unw_init_local(&cur, &ctx); + if ((ret = unw_tdep_trace(&cur, addrs, &depth)) < 0) + { + depth = 0; + unw_getcontext(&ctx); + unw_init_local(&cur, &ctx); + while ((ret = unw_step(&cur)) > 0 && depth < 128) + { + unw_word_t ip; + unw_get_reg(&cur, UNW_REG_IP, &ip); + addresses[depth++] = (void *) ip; + } + } +*/ +HIDDEN int +tdep_trace (unw_cursor_t *cursor, void **buffer, int *size) +{ + struct cursor *c = (struct cursor *) cursor; + struct dwarf_cursor *d = &c->dwarf; + unw_trace_cache_t *cache; + unw_word_t rbp, rsp, rip, cfa; + int maxdepth = 0; + int depth = 0; + int ret; + int validate UNUSED = 0; + + /* Check input parameters. */ + if (unlikely(! cursor || ! buffer || ! size || (maxdepth = *size) <= 0)) + return -UNW_EINVAL; + + Debug (1, "begin ip 0x%lx cfa 0x%lx\n", d->ip, d->cfa); + + /* Tell core dwarf routines to call back to us. */ + d->stash_frames = 1; + + /* Determine initial register values. These are direct access safe + because we know they come from the initial machine context. */ + rip = d->ip; + rsp = cfa = d->cfa; + ACCESS_MEM_FAST(ret, 0, d, DWARF_GET_LOC(d->loc[UNW_X86_64_RBP]), rbp); + assert(ret == 0); + + /* Get frame cache. */ + if (unlikely(! (cache = trace_cache_get()))) + { + Debug (1, "returning %d, cannot get trace cache\n", -UNW_ENOMEM); + *size = 0; + d->stash_frames = 0; + return -UNW_ENOMEM; + } + + /* Trace the stack upwards, starting from current RIP. Adjust + the RIP address for previous/next instruction as the main + unwinding logic would also do. We undo this before calling + back into unw_step(). */ + while (depth < maxdepth) + { + rip -= d->use_prev_instr; + Debug (2, "depth %d cfa 0x%lx rip 0x%lx rsp 0x%lx rbp 0x%lx\n", + depth, cfa, rip, rsp, rbp); + + /* See if we have this address cached. If not, evaluate enough of + the dwarf unwind information to fill the cache line data, or to + decide this frame cannot be handled in fast trace mode. We + cache negative results too to prevent unnecessary dwarf parsing + for common failures. */ + unw_tdep_frame_t *f = trace_lookup (cursor, cache, cfa, rip, rbp, rsp); + + /* If we don't have information for this frame, give up. */ + if (unlikely(! f)) + { + ret = -UNW_ENOINFO; + break; + } + + Debug (3, "frame va %lx type %d last %d cfa %s+%d rbp @ cfa%+d rsp @ cfa%+d\n", + f->virtual_address, f->frame_type, f->last_frame, + f->cfa_reg_rsp ? "rsp" : "rbp", f->cfa_reg_offset, + f->rbp_cfa_offset, f->rsp_cfa_offset); + + assert (f->virtual_address == rip); + + /* Stop if this was the last frame. In particular don't evaluate + new register values as it may not be safe - we don't normally + run with full validation on, and do not want to - and there's + enough bad unwind info floating around that we need to trust + what unw_step() previously said, in potentially bogus frames. */ + if (f->last_frame) + break; + + /* Evaluate CFA and registers for the next frame. */ + switch (f->frame_type) + { + case UNW_X86_64_FRAME_GUESSED: + /* Fall thru to standard processing after forcing validation. */ + if (d->as == unw_local_addr_space) + dwarf_set_validate(d, 1); + FALLTHROUGH; + + case UNW_X86_64_FRAME_STANDARD: + /* Advance standard traceable frame. */ + cfa = (f->cfa_reg_rsp ? rsp : rbp) + f->cfa_reg_offset; + if (d->as == unw_local_addr_space) + validate = dwarf_get_validate(d); + ACCESS_MEM_FAST(ret, validate, d, cfa - 8, rip); + if (likely(ret >= 0) && likely(f->rbp_cfa_offset != -1)) + ACCESS_MEM_FAST(ret, validate, d, cfa + f->rbp_cfa_offset, rbp); + + /* Don't bother reading RSP from DWARF, CFA becomes new RSP. */ + rsp = cfa; + + /* Next frame needs to back up for unwind info lookup. */ + d->use_prev_instr = 1; + break; + + case UNW_X86_64_FRAME_SIGRETURN: + cfa = cfa + f->cfa_reg_offset; /* cfa now points to ucontext_t. */ + + if (d->as == unw_local_addr_space) + validate = dwarf_get_validate(d); + ACCESS_MEM_FAST(ret, validate, d, cfa + UC_MCONTEXT_GREGS_RIP, rip); + if (likely(ret >= 0)) + ACCESS_MEM_FAST(ret, validate, d, cfa + UC_MCONTEXT_GREGS_RBP, rbp); + if (likely(ret >= 0)) + ACCESS_MEM_FAST(ret, validate, d, cfa + UC_MCONTEXT_GREGS_RSP, rsp); + + /* Resume stack at signal restoration point. The stack is not + necessarily continuous here, especially with sigaltstack(). */ + cfa = rsp; + + /* Next frame should not back up. */ + d->use_prev_instr = 0; + break; + + case UNW_X86_64_FRAME_ALIGNED: + /* Address of RIP was pushed on the stack via a simple + * def_cfa_expr - result stack offset stored in cfa_reg_offset */ + cfa = (f->cfa_reg_rsp ? rsp : rbp) + f->cfa_reg_offset; + if (d->as == unw_local_addr_space) + validate = dwarf_get_validate(d); + ACCESS_MEM_FAST(ret, validate, d, cfa, cfa); + if (likely(ret >= 0)) + ACCESS_MEM_FAST(ret, validate, d, cfa - 8, rip); + if (likely(ret >= 0)) + ACCESS_MEM_FAST(ret, validate, d, rbp, rbp); + + /* Don't bother reading RSP from DWARF, CFA becomes new RSP. */ + rsp = cfa; + + /* Next frame needs to back up for unwind info lookup. */ + d->use_prev_instr = 1; + + break; + + default: + /* We cannot trace through this frame, give up and tell the + caller we had to stop. Data collected so far may still be + useful to the caller, so let it know how far we got. */ + ret = -UNW_ESTOPUNWIND; + break; + } + + Debug (4, "new cfa 0x%lx rip 0x%lx rsp 0x%lx rbp 0x%lx\n", + cfa, rip, rsp, rbp); + + /* If we failed or ended up somewhere bogus, stop. */ + if (unlikely(ret < 0 || rip < 0x4000)) + break; + + /* Record this address in stack trace. We skipped the first address. */ + buffer[depth++] = (void *) rip; + } + +#if UNW_DEBUG + Debug (1, "returning %d, depth %d\n", ret, depth); +#endif + *size = depth; + return ret; +} diff --git a/vendor/libunwind/src/x86_64/Lapply_reg_state.c b/vendor/libunwind/src/x86_64/Lapply_reg_state.c new file mode 100644 index 0000000000..7ebada480e --- /dev/null +++ b/vendor/libunwind/src/x86_64/Lapply_reg_state.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gapply_reg_state.c" +#endif diff --git a/vendor/libunwind/src/x86_64/Lcreate_addr_space.c b/vendor/libunwind/src/x86_64/Lcreate_addr_space.c new file mode 100644 index 0000000000..0f2dc6be90 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Lcreate_addr_space.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gcreate_addr_space.c" +#endif diff --git a/vendor/libunwind/src/x86_64/Lget_proc_info.c b/vendor/libunwind/src/x86_64/Lget_proc_info.c new file mode 100644 index 0000000000..69028b019f --- /dev/null +++ b/vendor/libunwind/src/x86_64/Lget_proc_info.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gget_proc_info.c" +#endif diff --git a/vendor/libunwind/src/x86_64/Lget_save_loc.c b/vendor/libunwind/src/x86_64/Lget_save_loc.c new file mode 100644 index 0000000000..9ea048a907 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Lget_save_loc.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gget_save_loc.c" +#endif diff --git a/vendor/libunwind/src/x86_64/Lglobal.c b/vendor/libunwind/src/x86_64/Lglobal.c new file mode 100644 index 0000000000..8c43a67c0f --- /dev/null +++ b/vendor/libunwind/src/x86_64/Lglobal.c @@ -0,0 +1,6 @@ +#define UNW_LOCAL_ONLY +#include "config.h" +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gglobal.c" +#endif diff --git a/vendor/libunwind/src/x86_64/Linit.c b/vendor/libunwind/src/x86_64/Linit.c new file mode 100644 index 0000000000..e9abfdd46a --- /dev/null +++ b/vendor/libunwind/src/x86_64/Linit.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Ginit.c" +#endif diff --git a/vendor/libunwind/src/x86_64/Linit_local.c b/vendor/libunwind/src/x86_64/Linit_local.c new file mode 100644 index 0000000000..68a1687e85 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Linit_local.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Ginit_local.c" +#endif diff --git a/vendor/libunwind/src/x86_64/Linit_remote.c b/vendor/libunwind/src/x86_64/Linit_remote.c new file mode 100644 index 0000000000..58cb04ab7c --- /dev/null +++ b/vendor/libunwind/src/x86_64/Linit_remote.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Ginit_remote.c" +#endif diff --git a/vendor/libunwind/src/x86_64/Los-freebsd.c b/vendor/libunwind/src/x86_64/Los-freebsd.c new file mode 100644 index 0000000000..a75a205df1 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Los-freebsd.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gos-freebsd.c" +#endif diff --git a/vendor/libunwind/src/x86_64/Los-linux.c b/vendor/libunwind/src/x86_64/Los-linux.c new file mode 100644 index 0000000000..3cc18aabcc --- /dev/null +++ b/vendor/libunwind/src/x86_64/Los-linux.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gos-linux.c" +#endif diff --git a/vendor/libunwind/src/x86_64/Los-qnx.c b/vendor/libunwind/src/x86_64/Los-qnx.c new file mode 100644 index 0000000000..05c771bb94 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Los-qnx.c @@ -0,0 +1,29 @@ +/* + * Copyright 2022 BlackBerry Limited. + * + * This file is part of libunwind. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gos-qnx.c" +#endif diff --git a/vendor/libunwind/src/x86_64/Los-solaris.c b/vendor/libunwind/src/x86_64/Los-solaris.c new file mode 100644 index 0000000000..be64b2c695 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Los-solaris.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gos-solaris.c" +#endif diff --git a/vendor/libunwind/src/x86_64/Lreg_states_iterate.c b/vendor/libunwind/src/x86_64/Lreg_states_iterate.c new file mode 100644 index 0000000000..f1eb1e79dc --- /dev/null +++ b/vendor/libunwind/src/x86_64/Lreg_states_iterate.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Greg_states_iterate.c" +#endif diff --git a/vendor/libunwind/src/x86_64/Lregs.c b/vendor/libunwind/src/x86_64/Lregs.c new file mode 100644 index 0000000000..2c9c75cd7d --- /dev/null +++ b/vendor/libunwind/src/x86_64/Lregs.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gregs.c" +#endif diff --git a/vendor/libunwind/src/x86_64/Lresume.c b/vendor/libunwind/src/x86_64/Lresume.c new file mode 100644 index 0000000000..41a8cf003d --- /dev/null +++ b/vendor/libunwind/src/x86_64/Lresume.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gresume.c" +#endif diff --git a/vendor/libunwind/src/x86_64/Lstash_frame.c b/vendor/libunwind/src/x86_64/Lstash_frame.c new file mode 100644 index 0000000000..77587803d0 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Lstash_frame.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gstash_frame.c" +#endif diff --git a/vendor/libunwind/src/x86_64/Lstep.c b/vendor/libunwind/src/x86_64/Lstep.c new file mode 100644 index 0000000000..c1ac3c7547 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Lstep.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gstep.c" +#endif diff --git a/vendor/libunwind/src/x86_64/Ltrace.c b/vendor/libunwind/src/x86_64/Ltrace.c new file mode 100644 index 0000000000..fcd3f239c9 --- /dev/null +++ b/vendor/libunwind/src/x86_64/Ltrace.c @@ -0,0 +1,5 @@ +#define UNW_LOCAL_ONLY +#include +#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY) +#include "Gtrace.c" +#endif diff --git a/vendor/libunwind/src/x86_64/getcontext.S b/vendor/libunwind/src/x86_64/getcontext.S new file mode 100644 index 0000000000..a08fccd6c3 --- /dev/null +++ b/vendor/libunwind/src/x86_64/getcontext.S @@ -0,0 +1,137 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2008 Google, Inc + Contributed by Paul Pluzhnikov + Copyright (C) 2010 Konstantin Belousov + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "ucontext_i.h" + +/* int _Ux86_64_getcontext (ucontext_t *ucp) + + Saves the machine context in UCP necessary for libunwind. + Unlike the libc implementation, we don't save the signal mask + and hence avoid the cost of a system call per unwind. + +*/ + + .global _Ux86_64_getcontext + .type _Ux86_64_getcontext, @function +_Ux86_64_getcontext: + .cfi_startproc + + /* Callee saved: RBX, RBP, R12-R15 */ + movq %r12, UC_MCONTEXT_GREGS_R12(%rdi) + movq %r13, UC_MCONTEXT_GREGS_R13(%rdi) + movq %r14, UC_MCONTEXT_GREGS_R14(%rdi) + movq %r15, UC_MCONTEXT_GREGS_R15(%rdi) + movq %rbp, UC_MCONTEXT_GREGS_RBP(%rdi) + movq %rbx, UC_MCONTEXT_GREGS_RBX(%rdi) + + /* Save argument registers (not strictly needed, but setcontext + restores them, so don't restore garbage). */ + movq %r8, UC_MCONTEXT_GREGS_R8(%rdi) + movq %r9, UC_MCONTEXT_GREGS_R9(%rdi) + movq %rdi, UC_MCONTEXT_GREGS_RDI(%rdi) + movq %rsi, UC_MCONTEXT_GREGS_RSI(%rdi) + movq %rdx, UC_MCONTEXT_GREGS_RDX(%rdi) + movq %rax, UC_MCONTEXT_GREGS_RAX(%rdi) + movq %rcx, UC_MCONTEXT_GREGS_RCX(%rdi) + +#if defined __linux__ || defined __sun + /* Save fp state (not needed, except for setcontext not + restoring garbage). */ + leaq UC_MCONTEXT_FPREGS_MEM(%rdi),%r8 +#ifdef UC_MCONTEXT_FPREGS_PTR + movq %r8, UC_MCONTEXT_FPREGS_PTR(%rdi) +#endif // UC_MCONTEXT_FPREGS_PTR + fnstenv (%r8) + stmxcsr FPREGS_OFFSET_MXCSR(%r8) +#elif defined __FreeBSD__ + fxsave UC_MCONTEXT_FPSTATE(%rdi) + movq $UC_MCONTEXT_FPOWNED_FPU,UC_MCONTEXT_OWNEDFP(%rdi) + movq $UC_MCONTEXT_FPFMT_XMM,UC_MCONTEXT_FPFORMAT(%rdi) + /* Save rflags and segment registers, so that sigreturn(2) + does not complain. */ + pushfq + .cfi_adjust_cfa_offset 8 + popq UC_MCONTEXT_RFLAGS(%rdi) + .cfi_adjust_cfa_offset -8 + movl $0, UC_MCONTEXT_FLAGS(%rdi) + movw %cs, UC_MCONTEXT_CS(%rdi) + movw %ss, UC_MCONTEXT_SS(%rdi) +#if 0 + /* Setting the flags to 0 above disables restore of segment + registers from the context */ + movw %ds, UC_MCONTEXT_DS(%rdi) + movw %es, UC_MCONTEXT_ES(%rdi) + movw %fs, UC_MCONTEXT_FS(%rdi) + movw %gs, UC_MCONTEXT_GS(%rdi) +#endif + movq $UC_MCONTEXT_MC_LEN_VAL, UC_MCONTEXT_MC_LEN(%rdi) +#elif defined(__QNX__) +#else +#error Port me +#endif + + leaq 8(%rsp), %rax /* exclude this call. */ + movq %rax, UC_MCONTEXT_GREGS_RSP(%rdi) + + movq 0(%rsp), %rax + movq %rax, UC_MCONTEXT_GREGS_RIP(%rdi) + + xorq %rax, %rax + retq + .cfi_endproc + .size _Ux86_64_getcontext, . - _Ux86_64_getcontext + +/* int _Ux86_64_getcontext_trace (ucontext_t *ucp) + + Saves limited machine context in UCP necessary for libunwind. + Unlike _Ux86_64_getcontext, saves only the parts needed for + fast trace. If fast trace fails, caller will have to get the + full context. +*/ + + .global _Ux86_64_getcontext_trace + .hidden _Ux86_64_getcontext_trace + .type _Ux86_64_getcontext_trace, @function +_Ux86_64_getcontext_trace: + .cfi_startproc + + /* Save only RBP, RBX, RSP, RIP - exclude this call. */ + movq %rbp, UC_MCONTEXT_GREGS_RBP(%rdi) + movq %rbx, UC_MCONTEXT_GREGS_RBX(%rdi) + + leaq 8(%rsp), %rax + movq %rax, UC_MCONTEXT_GREGS_RSP(%rdi) + + movq 0(%rsp), %rax + movq %rax, UC_MCONTEXT_GREGS_RIP(%rdi) + + xorq %rax, %rax + retq + .cfi_endproc + .size _Ux86_64_getcontext_trace, . - _Ux86_64_getcontext_trace + + /* We do not need executable stack. */ + .section .note.GNU-stack,"",@progbits diff --git a/vendor/libunwind/src/x86_64/init.h b/vendor/libunwind/src/x86_64/init.h new file mode 100644 index 0000000000..f4b7cf5dc4 --- /dev/null +++ b/vendor/libunwind/src/x86_64/init.h @@ -0,0 +1,89 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002 Hewlett-Packard Co + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +/* Avoid a trip to x86_64_r_uc_addr() for purely local initialisation. */ +#if defined UNW_LOCAL_ONLY && defined __linux__ +# define REG_INIT_LOC(c, rlc, ruc) \ + DWARF_LOC ((unw_word_t) &dwarf_get_uc(&c->dwarf)->uc_mcontext.gregs[REG_ ## ruc], 0) + +#elif defined UNW_LOCAL_ONLY && defined __FreeBSD__ +# define REG_INIT_LOC(c, rlc, ruc) \ + DWARF_LOC ((unw_word_t) &dwarf_get_uc(&c->dwarf)->uc_mcontext.mc_ ## rlc, 0) + +#else +# define REG_INIT_LOC(c, rlc, ruc) \ + DWARF_REG_LOC (&c->dwarf, UNW_X86_64_ ## ruc) +#endif + +static inline int +common_init (struct cursor *c, unsigned use_prev_instr) +{ + int ret; + + c->dwarf.loc[RAX] = REG_INIT_LOC(c, rax, RAX); + c->dwarf.loc[RDX] = REG_INIT_LOC(c, rdx, RDX); + c->dwarf.loc[RCX] = REG_INIT_LOC(c, rcx, RCX); + c->dwarf.loc[RBX] = REG_INIT_LOC(c, rbx, RBX); + c->dwarf.loc[RSI] = REG_INIT_LOC(c, rsi, RSI); + c->dwarf.loc[RDI] = REG_INIT_LOC(c, rdi, RDI); + c->dwarf.loc[RBP] = REG_INIT_LOC(c, rbp, RBP); + c->dwarf.loc[RSP] = REG_INIT_LOC(c, rsp, RSP); + c->dwarf.loc[R8] = REG_INIT_LOC(c, r8, R8); + c->dwarf.loc[R9] = REG_INIT_LOC(c, r9, R9); + c->dwarf.loc[R10] = REG_INIT_LOC(c, r10, R10); + c->dwarf.loc[R11] = REG_INIT_LOC(c, r11, R11); + c->dwarf.loc[R12] = REG_INIT_LOC(c, r12, R12); + c->dwarf.loc[R13] = REG_INIT_LOC(c, r13, R13); + c->dwarf.loc[R14] = REG_INIT_LOC(c, r14, R14); + c->dwarf.loc[R15] = REG_INIT_LOC(c, r15, R15); + c->dwarf.loc[RIP] = REG_INIT_LOC(c, rip, RIP); + + ret = dwarf_get (&c->dwarf, c->dwarf.loc[RIP], &c->dwarf.ip); + if (ret < 0) + return ret; + + ret = dwarf_get (&c->dwarf, DWARF_REG_LOC (&c->dwarf, UNW_X86_64_RSP), + &c->dwarf.cfa); + if (ret < 0) + return ret; + + c->sigcontext_format = X86_64_SCF_NONE; + c->sigcontext_addr = 0; + + c->dwarf.args_size = 0; + c->dwarf.stash_frames = 0; + c->dwarf.use_prev_instr = use_prev_instr; + c->dwarf.pi_valid = 0; + c->dwarf.pi_is_dynamic = 0; + c->dwarf.hint = 0; + c->dwarf.prev_rs = 0; + c->dwarf.eh_valid_mask = 0; + + return 0; +} diff --git a/vendor/libunwind/src/x86_64/is_fpreg.c b/vendor/libunwind/src/x86_64/is_fpreg.c new file mode 100644 index 0000000000..8edf6d3a44 --- /dev/null +++ b/vendor/libunwind/src/x86_64/is_fpreg.c @@ -0,0 +1,38 @@ +/* libunwind - a platform-independent unwind library + Copyright (c) 2004-2005 Hewlett-Packard Development Company, L.P. + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "libunwind_i.h" + +int +unw_is_fpreg (int regnum UNUSED) +{ +#if 0 + return ((regnum >= UNW_X86_ST0 && regnum <= UNW_X86_ST7) + || (regnum >= UNW_X86_XMM0_lo && regnum <= UNW_X86_XMM7_hi)); +#endif + return 0; +} diff --git a/vendor/libunwind/src/x86_64/longjmp.S b/vendor/libunwind/src/x86_64/longjmp.S new file mode 100644 index 0000000000..274778fd80 --- /dev/null +++ b/vendor/libunwind/src/x86_64/longjmp.S @@ -0,0 +1,34 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2004-2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + + .globl _UI_longjmp_cont + .type _UI_longjmp_cont, @function +_UI_longjmp_cont: + push %rax /* push target IP as return address */ + mov %rdx, %rax /* set up return-value */ + retq + .size _UI_longjmp_cont, .-_UI_longjmp_cont + /* We do not need executable stack. */ + .section .note.GNU-stack,"",@progbits diff --git a/vendor/libunwind/src/x86_64/regname.c b/vendor/libunwind/src/x86_64/regname.c new file mode 100644 index 0000000000..77660af4a2 --- /dev/null +++ b/vendor/libunwind/src/x86_64/regname.c @@ -0,0 +1,56 @@ +/* libunwind - a platform-independent unwind library + + Contributed by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "unwind_i.h" + +static const char *regname[] = + { + "RAX", + "RDX", + "RCX", + "RBX", + "RSI", + "RDI", + "RBP", + "RSP", + "R8", + "R9", + "R10", + "R11", + "R12", + "R13", + "R14", + "R15", + "RIP", + }; + +const char * +unw_regname (unw_regnum_t reg) +{ + if (reg < (unw_regnum_t) ARRAY_SIZE (regname)) + return regname[reg]; + else + return "???"; +} diff --git a/vendor/libunwind/src/x86_64/setcontext.S b/vendor/libunwind/src/x86_64/setcontext.S new file mode 100644 index 0000000000..17c4b94ba2 --- /dev/null +++ b/vendor/libunwind/src/x86_64/setcontext.S @@ -0,0 +1,88 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2007 Google, Inc + Contributed by Arun Sharma + Copyright (C) 2010 Konstantin Belousov + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "ucontext_i.h" + +/* int _Ux86_64_setcontext (const ucontext_t *ucp) + + Restores the machine context provided. + Unlike the libc implementation, doesn't clobber %rax + +*/ + .global _Ux86_64_setcontext + .type _Ux86_64_setcontext, @function + +_Ux86_64_setcontext: + +#if defined __linux__ || defined __sun + /* restore fp state */ +#ifdef UC_MCONTEXT_FPREGS_PTR + mov UC_MCONTEXT_FPREGS_PTR(%rdi),%r8 +#else // UC_MCONTEXT_FPREGS_PTR + leaq UC_MCONTEXT_FPREGS_MEM(%rdi),%r8 +#endif // UC_MCONTEXT_FPREGS_PTR + fldenv (%r8) + ldmxcsr FPREGS_OFFSET_MXCSR(%r8) +#elif defined __FreeBSD__ + /* restore fp state */ + cmpq $UC_MCONTEXT_FPOWNED_FPU,UC_MCONTEXT_OWNEDFP(%rdi) + jne 1f + cmpq $UC_MCONTEXT_FPFMT_XMM,UC_MCONTEXT_FPFORMAT(%rdi) + jne 1f + fxrstor UC_MCONTEXT_FPSTATE(%rdi) +1: +#elif defined (__QNX__) +#else +#error Port me +#endif + + /* restore the rest of the state */ + mov UC_MCONTEXT_GREGS_R8(%rdi),%r8 + mov UC_MCONTEXT_GREGS_R9(%rdi),%r9 + mov UC_MCONTEXT_GREGS_RBX(%rdi),%rbx + mov UC_MCONTEXT_GREGS_RBP(%rdi),%rbp + mov UC_MCONTEXT_GREGS_R12(%rdi),%r12 + mov UC_MCONTEXT_GREGS_R13(%rdi),%r13 + mov UC_MCONTEXT_GREGS_R14(%rdi),%r14 + mov UC_MCONTEXT_GREGS_R15(%rdi),%r15 + mov UC_MCONTEXT_GREGS_RSI(%rdi),%rsi + mov UC_MCONTEXT_GREGS_RDX(%rdi),%rdx + mov UC_MCONTEXT_GREGS_RAX(%rdi),%rax + mov UC_MCONTEXT_GREGS_RCX(%rdi),%rcx + mov UC_MCONTEXT_GREGS_RSP(%rdi),%rsp + + /* push the return address on the stack */ + mov UC_MCONTEXT_GREGS_RIP(%rdi),%rcx + push %rcx + + mov UC_MCONTEXT_GREGS_RCX(%rdi),%rcx + mov UC_MCONTEXT_GREGS_RDI(%rdi),%rdi + retq + + .size _Ux86_64_setcontext, . - _Ux86_64_setcontext + + /* We do not need executable stack. */ + .section .note.GNU-stack,"",@progbits diff --git a/vendor/libunwind/src/x86_64/siglongjmp.S b/vendor/libunwind/src/x86_64/siglongjmp.S new file mode 100644 index 0000000000..c75d027c09 --- /dev/null +++ b/vendor/libunwind/src/x86_64/siglongjmp.S @@ -0,0 +1,50 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2004 Hewlett-Packard Co + Contributed by David Mosberger-Tang + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#if defined(__FreeBSD__) +#define SIG_SETMASK 3 +#endif + + .globl _UI_siglongjmp_cont + .type _UI_siglongjmp_cont, @function +_UI_siglongjmp_cont: +#if defined(__linux__) || defined(__QNX__) + retq +#elif defined(__FreeBSD__) + pushq %rax /* return address */ + pushq %rdx /* return value */ + movq $SIG_SETMASK,%rdi + movq %rcx,%rsi + xorq %rdx,%rdx + movq $340,%rax + syscall + popq %rax /* return value */ + retq /* return address on stack */ +#else +#error Port me +#endif + .size _UI_siglongjmp_cont, . - _UI_siglongjmp_cont + /* We do not need executable stack. */ + .section .note.GNU-stack,"",@progbits diff --git a/vendor/libunwind/src/x86_64/ucontext_i.h b/vendor/libunwind/src/x86_64/ucontext_i.h new file mode 100644 index 0000000000..a4c0d34023 --- /dev/null +++ b/vendor/libunwind/src/x86_64/ucontext_i.h @@ -0,0 +1,121 @@ +/* Copyright (C) 2004 Hewlett-Packard Co. + Contributed by David Mosberger-Tang . + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#if defined __linux__ +#define UC_MCONTEXT_GREGS_R8 0x28 +#define UC_MCONTEXT_GREGS_R9 0x30 +#define UC_MCONTEXT_GREGS_R10 0x38 +#define UC_MCONTEXT_GREGS_R11 0x40 +#define UC_MCONTEXT_GREGS_R12 0x48 +#define UC_MCONTEXT_GREGS_R13 0x50 +#define UC_MCONTEXT_GREGS_R14 0x58 +#define UC_MCONTEXT_GREGS_R15 0x60 +#define UC_MCONTEXT_GREGS_RDI 0x68 +#define UC_MCONTEXT_GREGS_RSI 0x70 +#define UC_MCONTEXT_GREGS_RBP 0x78 +#define UC_MCONTEXT_GREGS_RBX 0x80 +#define UC_MCONTEXT_GREGS_RDX 0x88 +#define UC_MCONTEXT_GREGS_RAX 0x90 +#define UC_MCONTEXT_GREGS_RCX 0x98 +#define UC_MCONTEXT_GREGS_RSP 0xa0 +#define UC_MCONTEXT_GREGS_RIP 0xa8 +#define UC_MCONTEXT_FPREGS_PTR 0x1a8 +#define UC_MCONTEXT_FPREGS_MEM 0xe0 +#define UC_SIGMASK 0x128 +#define FPREGS_OFFSET_MXCSR 0x18 +#elif defined __FreeBSD__ +#define UC_SIGMASK 0x0 +#define UC_MCONTEXT_GREGS_RDI 0x18 +#define UC_MCONTEXT_GREGS_RSI 0x20 +#define UC_MCONTEXT_GREGS_RDX 0x28 +#define UC_MCONTEXT_GREGS_RCX 0x30 +#define UC_MCONTEXT_GREGS_R8 0x38 +#define UC_MCONTEXT_GREGS_R9 0x40 +#define UC_MCONTEXT_GREGS_RAX 0x48 +#define UC_MCONTEXT_GREGS_RBX 0x50 +#define UC_MCONTEXT_GREGS_RBP 0x58 +#define UC_MCONTEXT_GREGS_R10 0x60 +#define UC_MCONTEXT_GREGS_R11 0x68 +#define UC_MCONTEXT_GREGS_R12 0x70 +#define UC_MCONTEXT_GREGS_R13 0x78 +#define UC_MCONTEXT_GREGS_R14 0x80 +#define UC_MCONTEXT_GREGS_R15 0x88 +#define UC_MCONTEXT_FS 0x94 +#define UC_MCONTEXT_GS 0x96 +#define UC_MCONTEXT_FLAGS 0xa0 +#define UC_MCONTEXT_ES 0xa4 +#define UC_MCONTEXT_DS 0xa6 +#define UC_MCONTEXT_GREGS_RIP 0xb0 +#define UC_MCONTEXT_CS 0xb8 +#define UC_MCONTEXT_RFLAGS 0xc0 +#define UC_MCONTEXT_GREGS_RSP 0xc8 +#define UC_MCONTEXT_SS 0xd0 +#define UC_MCONTEXT_MC_LEN 0xd8 +#define UC_MCONTEXT_FPFORMAT 0xe0 +#define UC_MCONTEXT_OWNEDFP 0xe8 +#define UC_MCONTEXT_FPSTATE 0xf0 +#define UC_MCONTEXT_FPOWNED_FPU 0x20001 +#define UC_MCONTEXT_FPFMT_XMM 0x10002 +#define UC_MCONTEXT_MC_LEN_VAL 0x320 +#elif defined(__QNX__) +#define UC_SIGMASK 0x0 +#define UC_MCONTEXT_GREGS_R8 0x48 +#define UC_MCONTEXT_GREGS_R9 0x50 +#define UC_MCONTEXT_GREGS_R10 0x40 +#define UC_MCONTEXT_GREGS_R11 0x78 +#define UC_MCONTEXT_GREGS_R12 0x80 +#define UC_MCONTEXT_GREGS_R13 0x88 +#define UC_MCONTEXT_GREGS_R14 0x90 +#define UC_MCONTEXT_GREGS_R15 0x98 +#define UC_MCONTEXT_GREGS_RDI 0x28 +#define UC_MCONTEXT_GREGS_RSI 0x30 +#define UC_MCONTEXT_GREGS_RBP 0x68 +#define UC_MCONTEXT_GREGS_RBX 0x60 +#define UC_MCONTEXT_GREGS_RDX 0x38 +#define UC_MCONTEXT_GREGS_RAX 0x58 +#define UC_MCONTEXT_GREGS_RCX 0x70 +#define UC_MCONTEXT_GREGS_RSP 0xb8 +#define UC_MCONTEXT_GREGS_RIP 0xa0 +#elif defined __sun +#define UC_MCONTEXT_GREGS_R8 0x78 +#define UC_MCONTEXT_GREGS_R9 0x70 +#define UC_MCONTEXT_GREGS_R10 0x68 +#define UC_MCONTEXT_GREGS_R11 0x60 +#define UC_MCONTEXT_GREGS_R12 0x58 +#define UC_MCONTEXT_GREGS_R13 0x50 +#define UC_MCONTEXT_GREGS_R14 0x48 +#define UC_MCONTEXT_GREGS_R15 0x40 +#define UC_MCONTEXT_GREGS_RDI 0x80 +#define UC_MCONTEXT_GREGS_RSI 0x88 +#define UC_MCONTEXT_GREGS_RBP 0x90 +#define UC_MCONTEXT_GREGS_RBX 0x98 +#define UC_MCONTEXT_GREGS_RDX 0xa0 +#define UC_MCONTEXT_GREGS_RAX 0xb0 +#define UC_MCONTEXT_GREGS_RCX 0xa8 +#define UC_MCONTEXT_GREGS_RSP 0xe0 +#define UC_MCONTEXT_GREGS_RIP 0xc8 +#define UC_MCONTEXT_FPREGS_MEM 0x120 +#define FPREGS_OFFSET_MXCSR 0x18 + +#endif diff --git a/vendor/libunwind/src/x86_64/unwind_i.h b/vendor/libunwind/src/x86_64/unwind_i.h new file mode 100644 index 0000000000..a20c22f99d --- /dev/null +++ b/vendor/libunwind/src/x86_64/unwind_i.h @@ -0,0 +1,95 @@ +/* libunwind - a platform-independent unwind library + Copyright (C) 2002, 2005 Hewlett-Packard Co + Contributed by David Mosberger-Tang + + Modified for x86_64 by Max Asbock + +This file is part of libunwind. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef unwind_i_h +#define unwind_i_h + +#include + +#include + +#include "libunwind_i.h" +#include + +/* DWARF column numbers for x86_64: */ +#define RAX 0 +#define RDX 1 +#define RCX 2 +#define RBX 3 +#define RSI 4 +#define RDI 5 +#define RBP 6 +#define RSP 7 +#define R8 8 +#define R9 9 +#define R10 10 +#define R11 11 +#define R12 12 +#define R13 13 +#define R14 14 +#define R15 15 +#define RIP 16 + +#define x86_64_lock UNW_OBJ(lock) +#define x86_64_local_resume UNW_OBJ(local_resume) +#define x86_64_local_addr_space_init UNW_OBJ(local_addr_space_init) +#define setcontext UNW_ARCH_OBJ (setcontext) +#if 0 +#define x86_64_scratch_loc UNW_OBJ(scratch_loc) +#endif +#define x86_64_r_uc_addr UNW_OBJ(r_uc_addr) +#define x86_64_sigreturn UNW_OBJ(sigreturn) + +/* By-pass calls to access_mem() when known to be safe. */ +#ifdef UNW_LOCAL_ONLY +# undef ACCESS_MEM_FAST +# define ACCESS_MEM_FAST(ret,validate,cur,addr,to) \ + do { \ + if (unlikely(validate)) \ + (ret) = dwarf_get ((cur), DWARF_MEM_LOC ((cur), (addr)), &(to)); \ + else \ + (ret) = 0, (to) = *(unw_word_t *)(addr); \ + } while (0) +#endif + +extern void x86_64_local_addr_space_init (void); +extern int x86_64_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, + void *arg); +extern int setcontext (const ucontext_t *ucp); + +#if 0 +extern dwarf_loc_t x86_64_scratch_loc (struct cursor *c, unw_regnum_t reg); +#endif + +extern void *x86_64_r_uc_addr (ucontext_t *uc, int reg); +extern NORETURN void x86_64_sigreturn (unw_cursor_t *cursor); +#define x86_64_handle_signal_frame UNW_OBJ(handle_signal_frame) +extern int x86_64_handle_signal_frame(unw_cursor_t *cursor); +#define x86_64_os_step UNW_OBJ(os_step) +extern HIDDEN int x86_64_os_step(struct cursor *c); + +#endif /* unwind_i_h */