From 76e1cbca75e9fdaf7a7943f2c58e65433b283f4a Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 3 Apr 2015 11:27:53 -0700 Subject: [PATCH] Fix volantis boot. NVIDIA binary blobs are assuming that __cache_clear, _Unwind_Backtrace, and _Unwind_GetIP are all in some library that they link, but now we've cleaned up this leakage, they're no longer getting it. Deliberately leak the symbols from libc.so until we get new blobs. Bug: http://b/20065774 Change-Id: I92ef07b2bce8d1ad719bf40dab41d745cd6904d4 --- libc/Android.mk | 3 ++- libc/arch-arm64/arm64.mk | 2 ++ libc/arch-arm64/bionic/libgcc_compat.c | 11 +++++++++++ libc/version_script.txt | 5 +++++ 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 libc/arch-arm64/bionic/libgcc_compat.c diff --git a/libc/Android.mk b/libc/Android.mk index 0de0fb21c..e632ee72f 100644 --- a/libc/Android.mk +++ b/libc/Android.mk @@ -1384,7 +1384,8 @@ LOCAL_LDFLAGS := -Wl,--version-script,$(LOCAL_PATH)/version_script.txt # We'd really like to do this for all architectures, but since this wasn't done # before, these symbols must continue to be exported on LP32 for binary # compatibility. -LOCAL_LDFLAGS_64 := -Wl,--exclude-libs,libgcc.a +# TODO: disabled for http://b/20065774. +#LOCAL_LDFLAGS_64 := -Wl,--exclude-libs,libgcc.a # TODO: This is to work around b/19059885. Remove after root cause is fixed LOCAL_LDFLAGS_arm := -Wl,--hash-style=sysv diff --git a/libc/arch-arm64/arm64.mk b/libc/arch-arm64/arm64.mk index 470a03838..6a2f31378 100644 --- a/libc/arch-arm64/arm64.mk +++ b/libc/arch-arm64/arm64.mk @@ -40,6 +40,8 @@ libc_bionic_src_files_arm64 += \ arch-arm64/bionic/syscall.S \ arch-arm64/bionic/vfork.S \ +# Work around for http://b/20065774. +libc_bionic_src_files_arm64 += arch-arm64/bionic/libgcc_compat.c libc_crt_target_cflags_arm64 := \ -I$(LOCAL_PATH)/arch-arm64/include diff --git a/libc/arch-arm64/bionic/libgcc_compat.c b/libc/arch-arm64/bionic/libgcc_compat.c new file mode 100644 index 000000000..35158cef6 --- /dev/null +++ b/libc/arch-arm64/bionic/libgcc_compat.c @@ -0,0 +1,11 @@ +/* STOPSHIP: remove this once the flounder blobs have been rebuilt (http://b/20065774). */ + +extern void __clear_cache(char*, char*); +extern char _Unwind_Backtrace; +extern char _Unwind_GetIP; + +void* __bionic_libgcc_compat_symbols[] = { + &__clear_cache, + &_Unwind_Backtrace, + &_Unwind_GetIP, +}; diff --git a/libc/version_script.txt b/libc/version_script.txt index afc5e5c47..349a2fc2c 100644 --- a/libc/version_script.txt +++ b/libc/version_script.txt @@ -1,4 +1,9 @@ LIBC { + global: + /* Work-around for http://b/20065774. */ + __clear_cache; + _Unwind_Backtrace; + _Unwind_GetIP; local: _ZSt7nothrow; _ZdaPv;