android/build.py: link ARMv7 binary with libunwind

Fixes nullptr dereference when an exception gets thrown because there
is no ".eh_frame" section for unwinding.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/543
This commit is contained in:
Max Kellermann 2019-05-03 20:15:30 +02:00
parent 478cedcadf
commit 36dec47bf7
2 changed files with 8 additions and 0 deletions

2
NEWS
View File

@ -1,4 +1,6 @@
ver 0.21.9 (not yet released) ver 0.21.9 (not yet released)
* Android
- fix crash on ARMv7
ver 0.21.8 (2019/04/23) ver 0.21.8 (2019/04/23)
* input * input

View File

@ -138,6 +138,12 @@ class AndroidNdkToolchain:
libstdcxx_ldflags = libstdcxx_flags + ' -L' + libcxx_libs_path libstdcxx_ldflags = libstdcxx_flags + ' -L' + libcxx_libs_path
libstdcxx_libs = '-lc++_static -lc++abi' libstdcxx_libs = '-lc++_static -lc++abi'
if self.is_armv7:
# On 32 bit ARM, clang generates no ".eh_frame" section;
# instead, the LLVM unwinder library is used for unwinding
# the stack after a C++ exception was thrown
libstdcxx_libs += ' -lunwind'
if use_cxx: if use_cxx:
self.cxxflags += ' ' + libstdcxx_cxxflags self.cxxflags += ' ' + libstdcxx_cxxflags
self.ldflags += ' ' + libstdcxx_ldflags self.ldflags += ' ' + libstdcxx_ldflags