Attach arm issues with C++ exception unwinding

See https://github.com/android-ndk/ndk/issues/379

Fixes #1163

Fixes issues with gdb segfaulting on arm on an unrecognized command.
This commit is contained in:
Fredrik Fornwall 2017-07-27 02:06:37 +02:00
parent a29e9f25dc
commit 95e6f9429a
4 changed files with 27 additions and 4 deletions

View File

@ -562,6 +562,22 @@ termux_step_setup_toolchain() {
$_TERMUX_TOOLCHAIN_TMPDIR/aarch64-linux-android/bin/ld
fi
if [ "$TERMUX_ARCH" = "arm" ]; then
# Linker wrapper script to add '--exclude-libs libgcc.a', see
# https://github.com/android-ndk/ndk/issues/379
# https://android-review.googlesource.com/#/c/389852/
local linker
for linker in ld ld.bfd ld.gold; do
local wrap_linker=$_TERMUX_TOOLCHAIN_TMPDIR/$TERMUX_HOST_PLATFORM/bin/$linker
local real_linker=$_TERMUX_TOOLCHAIN_TMPDIR/$TERMUX_HOST_PLATFORM/bin/$linker.real
cp $wrap_linker $real_linker
echo '#!/bin/bash' > $wrap_linker
echo -n '`dirname $0`/' >> $wrap_linker
echo -n $linker.real >> $wrap_linker
echo ' --exclude-libs libgcc.a "$@"' >> $wrap_linker
done
fi
cd $_TERMUX_TOOLCHAIN_TMPDIR/sysroot
for f in $TERMUX_SCRIPTDIR/ndk-patches/*.patch; do
@ -598,8 +614,8 @@ termux_step_setup_toolchain() {
fi
local _STL_LIBFILE_NAME=libc++_shared.so
if [ ! -f $TERMUX_PREFIX/lib/libstdc++.so ] || [ `readlink $TERMUX_PREFIX/lib/libstdc++.so` != $_STL_LIBFILE_NAME ]; then
# Setup libgnustl_shared.so in $PREFIX/lib and libstdc++.so as a symlink to it,
if [ ! -f $TERMUX_PREFIX/lib/libstdc++.so ]; then
# Setup libgnustl_shared.so in $PREFIX/lib and libstdc++.so as a link to it,
# so that other C++ using packages links to it instead of the default android
# C++ library which does not support exceptions or STL:
# https://developer.android.com/ndk/guides/cpp-support.html
@ -622,7 +638,12 @@ termux_step_setup_toolchain() {
cp "$_STL_LIBFILE" .
$STRIP --strip-unneeded $_STL_LIBFILE_NAME
$TERMUX_ELF_CLEANER $_STL_LIBFILE_NAME
ln -f -s $_STL_LIBFILE_NAME libstdc++.so
if [ $TERMUX_ARCH = "arm" ]; then
# Use a linker script to get libunwind.a.
echo 'INPUT(-lunwind -lc++_shared)' > libstdc++.so
else
ln -f $_STL_LIBFILE_NAME libstdc++.so
fi
fi
export PKG_CONFIG_LIBDIR="$TERMUX_PKG_CONFIG_LIBDIR"

View File

@ -2,6 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gdb/
TERMUX_PKG_DESCRIPTION="The standard GNU Debugger that runs on many Unix-like systems and works for many programming languages"
TERMUX_PKG_DEPENDS="liblzma, libexpat, readline"
TERMUX_PKG_VERSION=8.0
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/gdb/gdb-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=f6a24ffe4917e67014ef9273eb8b547cb96a13e5ca74895b06d683b391f3f4ee
# gdb can not build with our normal --disable-static: https://sourceware.org/bugzilla/show_bug.cgi?id=15916

View File

@ -1,7 +1,7 @@
TERMUX_PKG_HOMEPAGE=https://github.com/google/protobuf
TERMUX_PKG_DESCRIPTION="Protocol buffers C++ library"
TERMUX_PKG_VERSION=3.3.2
TERMUX_PKG_REVISION=1
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://github.com/google/protobuf/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=8b8e442becbeff637f160c1ef4a3a56769c50ba7c9ff939ccc94086530ff00e4
TERMUX_PKG_FOLDERNAME=protobuf-$TERMUX_PKG_VERSION

View File

@ -1,6 +1,7 @@
TERMUX_PKG_HOMEPAGE=https://mosh.org
TERMUX_PKG_DESCRIPTION="Mobile shell that supports roaming and intelligent local echo"
TERMUX_PKG_VERSION=1.3.2
TERMUX_PKG_REVISION=1
TERMUX_PKG_SHA256=da600573dfa827d88ce114e0fed30210689381bbdcff543c931e4d6a2e851216
TERMUX_PKG_SRCURL=https://github.com/mobile-shell/mosh/releases/download/mosh-${TERMUX_PKG_VERSION}/mosh-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_FOLDERNAME=mosh-$TERMUX_PKG_VERSION