Switch libc to libcrt.builtins

With the switch to libcrt.builtins, some symbols no longer becomes
exported. Add dummy references to them to force them to be exported.
This is to maintain backwards binary compatibility with ancient Android
versions.

x86 and x86_64 crashes with libcrt, keep using libgcc for now.

Test: bionic-unit-tests
Bug: 29275768
Bug: 122993569
Change-Id: Ieab5af354e3924af4a03d888b28c6e75090cb613
This commit is contained in:
Yi Kong 2019-02-13 14:10:10 -08:00
parent be9b7240c2
commit 165b1cf57b
5 changed files with 21 additions and 8 deletions

View file

@ -77,8 +77,15 @@ cc_defaults {
native_coverage: false,
recovery_available: true,
arch: {
x86: {
no_libcrt: true,
},
x86_64: {
no_libcrt: true,
},
},
// TODO(ivanlozano): Remove after b/118321713
no_libcrt: true,
xom: false,
}
@ -765,7 +772,7 @@ cc_library_static {
"arch-arm/bionic/atomics_arm.c",
"arch-arm/bionic/__bionic_clone.S",
"arch-arm/bionic/_exit_with_stack_teardown.S",
"arch-arm/bionic/libgcc_compat.c",
"arch-arm/bionic/libcrt_compat.c",
"arch-arm/bionic/popcount_tab.c",
"arch-arm/bionic/__restore.S",
"arch-arm/bionic/setjmp.S",
@ -849,7 +856,7 @@ cc_library_static {
"arch-mips/bionic/__bionic_clone.S",
"arch-mips/bionic/cacheflush.cpp",
"arch-mips/bionic/_exit_with_stack_teardown.S",
"arch-mips/bionic/libgcc_compat.c",
"arch-mips/bionic/libcrt_compat.c",
"arch-mips/bionic/setjmp.S",
"arch-mips/bionic/syscall.S",
"arch-mips/bionic/vfork.S",
@ -919,7 +926,7 @@ cc_library_static {
"arch-x86/bionic/__bionic_clone.S",
"arch-x86/bionic/_exit_with_stack_teardown.S",
"arch-x86/bionic/libgcc_compat.c",
"arch-x86/bionic/libcrt_compat.c",
"arch-x86/bionic/__restore.S",
"arch-x86/bionic/setjmp.S",
"arch-x86/bionic/syscall.S",

View file

@ -90,6 +90,8 @@ extern char __floatunsidf;
extern char __floatunsisf;
extern char __gedf2;
extern char __gtdf2;
extern char __gnu_ldivmod_helper;
extern char __gnu_uldivmod_helper;
extern char __ledf2;
extern char __ltdf2;
extern char __muldf3;
@ -101,10 +103,11 @@ extern char __popcountsi2;
extern char __subdf3;
extern char __subsf3;
extern char __truncdfsf2;
extern char __udivdi3;
extern char __unorddf2;
extern char __unordsf2;
void* __bionic_libgcc_compat_symbols[] = {
void* __bionic_libcrt_compat_symbols[] = {
&__adddf3,
&__addsf3,
&__aeabi_cdcmpeq,
@ -169,6 +172,8 @@ void* __bionic_libgcc_compat_symbols[] = {
&__floatunsisf,
&__gedf2,
&__gtdf2,
&__gnu_ldivmod_helper,
&__gnu_uldivmod_helper,
&__ledf2,
&__ltdf2,
&__muldf3,
@ -180,6 +185,7 @@ void* __bionic_libgcc_compat_symbols[] = {
&__subdf3,
&__subsf3,
&__truncdfsf2,
&__udivdi3,
&__unorddf2,
&__unordsf2,
};

View file

@ -32,7 +32,7 @@ extern char __popcountsi2;
extern char __udivdi3;
extern char __umoddi3;
void* __bionic_libgcc_compat_symbols[] = {
void* __bionic_libcrt_compat_symbols[] = {
&__divdi3,
&__moddi3,
&__popcountsi2,

View file

@ -32,7 +32,7 @@ extern char __popcountsi2;
extern char __udivdi3;
extern char __umoddi3;
void* __bionic_libgcc_compat_symbols[] = {
void* __bionic_libcrt_compat_symbols[] = {
&__divdi3,
&__moddi3,
&__popcountsi2,

View file

@ -1561,7 +1561,7 @@ LIBC_PRIVATE {
__ashldi3; # arm
__ashrdi3; # arm
__bionic_brk; # arm x86 mips
__bionic_libgcc_compat_symbols; # arm x86
__bionic_libcrt_compat_symbols; # arm x86
__cmpdf2; # arm
__divdf3; # arm
__divdi3; # arm x86 mips