aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2018-02-05 12:32:18 -0800
committerDan Albert <danalbert@google.com>2018-02-05 13:21:04 -0800
commit7fe7e8ecfa6e38498b6e3edcac9bd6c145357765 (patch)
tree372e9bef16007d83d589de70a1b3978f8df216ad
parentb551c5cddb5621c83a991a6a35eab35131276d12 (diff)
downloadndk-7fe7e8ecfa6e38498b6e3edcac9bd6c145357765.tar.gz
Fix libc++.a linker script for arm32.
Using libc++ on arm32 involves using the LLVM unwinder, which depends on libdl. Test: ./run_tests.py --rebuild Bug: None Change-Id: I428474c0c13bec87881d08bc1728efd40090fd4a
-rwxr-xr-xsources/cxx-stl/llvm-libc++/build.py2
-rw-r--r--tests/device/static-executable-exceptions/CMakeLists.txt5
2 files changed, 6 insertions, 1 deletions
diff --git a/sources/cxx-stl/llvm-libc++/build.py b/sources/cxx-stl/llvm-libc++/build.py
index cd60c026d..a9679a02e 100755
--- a/sources/cxx-stl/llvm-libc++/build.py
+++ b/sources/cxx-stl/llvm-libc++/build.py
@@ -116,7 +116,7 @@ def main(args):
# other support libraries appropriately.
static_libs = ['-lc++_static', '-lc++abi', '-landroid_support']
if is_arm:
- static_libs.extend(['-lunwind', '-latomic'])
+ static_libs.extend(['-lunwind', '-ldl', '-latomic'])
make_linker_script(os.path.join(install_dir, 'libc++.a'), static_libs)
shared_libs = ['-landroid_support']
diff --git a/tests/device/static-executable-exceptions/CMakeLists.txt b/tests/device/static-executable-exceptions/CMakeLists.txt
new file mode 100644
index 000000000..48c020031
--- /dev/null
+++ b/tests/device/static-executable-exceptions/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.6.0)
+
+add_executable(static-executable jni/main.cpp)
+
+set_target_properties(static-executable PROPERTIES LINK_FLAGS "-static")