Skip to content

Commit

Permalink
Fork static executable test into two.
Browse files Browse the repository at this point in the history
The static-executable test couldn't have caught
android/ndk#132 because it's already
marked broken for a different issue (duplicate symbols caused by L's
libc.a including new/delete and friends colliding with libsupc++ for
exception support).

To make our test suite marginally less useless, split this into two
tests. static-executable will be the bare minimum static executable
test, and static-executable-exceptions will make sure exception
support works (or, for now, doesn't).

Test: Applied with other patches in topic (one of which removes the
      broken annotation for static-executable), static-executable
      passes for ARM android-21 and static-executable-exceptions
      remains a known failure.
Bug: http://b/24468267
Bug: android/ndk#132

Change-Id: Ib83c8f01974db5139ab4069996a6bf2187e51a94
  • Loading branch information
DanAlbert committed Jun 28, 2016
1 parent e26e3d8 commit 0e75a4b
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 22 deletions.
8 changes: 8 additions & 0 deletions tests/device/static-executable-exceptions/jni/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := static-executable
LOCAL_SRC_FILES := main.cpp
LOCAL_CFLAGS += -fexceptions
LOCAL_LDFLAGS += -static
include $(BUILD_EXECUTABLE)
File renamed without changes.
4 changes: 4 additions & 0 deletions tests/device/static-executable-exceptions/test_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
def match_broken(abi, platform, device_platform, toolchain, subtest=None):
if platform >= 21:
return 'android-{}'.format(platform), 'http://b/24468267'
return None, None
16 changes: 2 additions & 14 deletions tests/device/static-executable/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@ LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE := static-executable
LOCAL_SRC_FILES := main.cxx
LOCAL_CFLAGS += -fexceptions

# Note that by default ndk-build system doesn't support static executable,
# but option "-static" can instruct gcc to link with proper crt*o files to
# generate static executable.
LOCAL_LDFLAGS += -static

# Be aware that -Wl,--eh-frame-hdr is also needed for "-static" (at least for
# x86 and mips which use eh frames) since crt files are now in C, and the trick
# in the previous *S file to iterate all eh frames and record ranges is gone
LOCAL_LDFLAGS += -Wl,--eh-frame-hdr

LOCAL_SRC_FILES := main.cpp
LOCAL_LDFLAGS := -static
include $(BUILD_EXECUTABLE)

1 change: 0 additions & 1 deletion tests/device/static-executable/jni/Application.mk

This file was deleted.

3 changes: 3 additions & 0 deletions tests/device/static-executable/jni/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int main() {
return 0;
}
9 changes: 2 additions & 7 deletions tests/device/static-executable/test_config.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
def match_broken(abi, platform, device_platform, toolchain, subtest=None):
lp64_abis = ('arm64-v8a', 'mips64', 'x86_64')
bug = 'https://github.com/android-ndk/ndk/issues/132'
if platform >= 21:
return 'android-{}'.format(platform), 'http://b/24468267'
elif abi in lp64_abis:
# If platform isn't provided we're going to use the default platform
# level. For 32-bit ABIs the default is old enough that we'll pass, but
# 64-bit ABIs will fail.
return 'android-21', 'http://b/24468267'
return 'android-{}'.format(platform), bug
return None, None

0 comments on commit 0e75a4b

Please sign in to comment.