Skip to content

Commit

Permalink
Work around Clang not passing --eh-frame-hdr.
Browse files Browse the repository at this point in the history
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: android/ndk#593
Change-Id: I153dfee4d22082560833517f1ee575742da21e21
(cherry picked from commit 2f7aa277079f13e431f355c33ccf1ab601d3e947)
  • Loading branch information
DanAlbert committed Feb 13, 2018
1 parent b292d4f commit a5b6299
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tests/device/static-executable-exceptions/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 0 additions & 5 deletions tests/device/static-executable-exceptions/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a5b6299

Please sign in to comment.