From a5b629933e7bca55afa397b18488cd4e09c18197 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Thu, 25 Jan 2018 15:54:17 -0800 Subject: [PATCH] Work around Clang not passing --eh-frame-hdr. Clang doesn't pass this automatically for static executables for some reason, and libgcc can't unwind without a .eh_frame_hdr section. Also move the test to libc++ since gnustl is going away soon. Test: ./run_tests.py --filter static-executable-exceptions Bug: http://b/24468267 Bug: http://b/30101473 Bug: http://b/72512648 Bug: https://github.com/android-ndk/ndk/issues/593 Change-Id: I153dfee4d22082560833517f1ee575742da21e21 (cherry picked from commit 2f7aa277079f13e431f355c33ccf1ab601d3e947) --- tests/device/static-executable-exceptions/jni/Android.mk | 4 ++-- tests/device/static-executable-exceptions/test_config.py | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/device/static-executable-exceptions/jni/Android.mk b/tests/device/static-executable-exceptions/jni/Android.mk index 3b722a1b..90141e89 100644 --- a/tests/device/static-executable-exceptions/jni/Android.mk +++ b/tests/device/static-executable-exceptions/jni/Android.mk @@ -3,6 +3,6 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := static-executable LOCAL_SRC_FILES := main.cpp -LOCAL_CFLAGS += -fexceptions -LOCAL_LDFLAGS += -static +LOCAL_CPPFLAGS := -fexceptions +LOCAL_LDFLAGS := -static -Wl,--eh-frame-hdr include $(BUILD_EXECUTABLE) diff --git a/tests/device/static-executable-exceptions/test_config.py b/tests/device/static-executable-exceptions/test_config.py index 379350db..dfa83b5d 100644 --- a/tests/device/static-executable-exceptions/test_config.py +++ b/tests/device/static-executable-exceptions/test_config.py @@ -4,9 +4,4 @@ def run_broken(abi, _device_api, toolchain, _subtest): # update to the static libraries to fix this. return abi, 'https://github.com/android-ndk/ndk/issues/593' - if toolchain == 'clang': - # Clang doesn't pass --eh-frame-hdr to the linker for static - # executables. - return ' '.join([abi, toolchain]), 'http://b/30101473' - return None, None