Repack libgcc.a to only include required objects
Previous solution by using objcopy uses a quirky behaviour of the GNU objcopy and there is no equivalent option in llvm-objcopy. Instead of removing symbols, extract and repack libgcc to only include required objects. Bug: 142585047 Test: presubmit Change-Id: I58af74c18838f797e481da38c3265f0624fddf99
This commit is contained in:
91
Android.bp
91
Android.bp
@@ -579,104 +579,21 @@ toolchain_library {
|
||||
arch: {
|
||||
arm: {
|
||||
src: "prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/lib/gcc/arm-linux-androideabi/4.9.x/libgcc.a",
|
||||
strip: {
|
||||
keep_symbols_list: [
|
||||
// unwind-arm.o
|
||||
"_Unwind_Complete",
|
||||
"_Unwind_DeleteException",
|
||||
"_Unwind_GetCFA",
|
||||
"_Unwind_VRS_Get",
|
||||
"_Unwind_VRS_Pop",
|
||||
"_Unwind_VRS_Set",
|
||||
"__aeabi_unwind_cpp_pr0",
|
||||
"__aeabi_unwind_cpp_pr1",
|
||||
"__aeabi_unwind_cpp_pr2",
|
||||
"__gnu_Unwind_Backtrace",
|
||||
"__gnu_Unwind_ForcedUnwind",
|
||||
"__gnu_Unwind_RaiseException",
|
||||
"__gnu_Unwind_Resume",
|
||||
"__gnu_Unwind_Resume_or_Rethrow",
|
||||
|
||||
// libunwind.o
|
||||
"_Unwind_Backtrace",
|
||||
"_Unwind_ForcedUnwind",
|
||||
"_Unwind_RaiseException",
|
||||
"_Unwind_Resume",
|
||||
"_Unwind_Resume_or_Rethrow",
|
||||
"___Unwind_Backtrace",
|
||||
"___Unwind_ForcedUnwind",
|
||||
"___Unwind_RaiseException",
|
||||
"___Unwind_Resume",
|
||||
"___Unwind_Resume_or_Rethrow",
|
||||
"__gnu_Unwind_Restore_VFP",
|
||||
"__gnu_Unwind_Restore_VFP_D",
|
||||
"__gnu_Unwind_Restore_VFP_D_16_to_31",
|
||||
"__gnu_Unwind_Restore_WMMXC",
|
||||
"__gnu_Unwind_Restore_WMMXD",
|
||||
"__gnu_Unwind_Save_VFP",
|
||||
"__gnu_Unwind_Save_VFP_D",
|
||||
"__gnu_Unwind_Save_VFP_D_16_to_31",
|
||||
"__gnu_Unwind_Save_WMMXC",
|
||||
"__gnu_Unwind_Save_WMMXD",
|
||||
"__restore_core_regs",
|
||||
"restore_core_regs",
|
||||
|
||||
// pr-support.o
|
||||
"_Unwind_GetDataRelBase",
|
||||
"_Unwind_GetLanguageSpecificData",
|
||||
"_Unwind_GetRegionStart",
|
||||
"_Unwind_GetTextRelBase",
|
||||
"__gnu_unwind_execute",
|
||||
"__gnu_unwind_frame",
|
||||
],
|
||||
},
|
||||
repack_objects_to_keep: ["unwind-arm.o", "libunwind.o", "pr-support.o"],
|
||||
},
|
||||
arm64: {
|
||||
src: "prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/lib/gcc/aarch64-linux-android/4.9.x/libgcc.a",
|
||||
repack_objects_to_keep: ["unwind-dw2.o", "unwind-dw2-fde-dip.o"],
|
||||
},
|
||||
x86: {
|
||||
src: "prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/lib/gcc/x86_64-linux-android/4.9.x/32/libgcc.a",
|
||||
|
||||
repack_objects_to_keep: ["unwind-dw2.o", "unwind-dw2-fde-dip.o"],
|
||||
},
|
||||
x86_64: {
|
||||
src: "prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/lib/gcc/x86_64-linux-android/4.9.x/libgcc.a",
|
||||
repack_objects_to_keep: ["unwind-dw2.o", "unwind-dw2-fde-dip.o"],
|
||||
},
|
||||
},
|
||||
strip: {
|
||||
keep_symbols_list: [
|
||||
// unwind-dw2.o
|
||||
"_Unwind_Backtrace",
|
||||
"_Unwind_DeleteException",
|
||||
"_Unwind_FindEnclosingFunction",
|
||||
"_Unwind_ForcedUnwind",
|
||||
"_Unwind_GetCFA",
|
||||
"_Unwind_GetDataRelBase",
|
||||
"_Unwind_GetGR",
|
||||
"_Unwind_GetIP",
|
||||
"_Unwind_GetIPInfo",
|
||||
"_Unwind_GetLanguageSpecificData",
|
||||
"_Unwind_GetRegionStart",
|
||||
"_Unwind_GetTextRelBase",
|
||||
"_Unwind_RaiseException",
|
||||
"_Unwind_Resume",
|
||||
"_Unwind_Resume_or_Rethrow",
|
||||
"_Unwind_SetGR",
|
||||
"_Unwind_SetIP",
|
||||
"__frame_state_for",
|
||||
|
||||
// unwind-dw2-fde-dip.o
|
||||
"_Unwind_Find_FDE",
|
||||
"__deregister_frame",
|
||||
"__deregister_frame_info",
|
||||
"__deregister_frame_info_bases",
|
||||
"__register_frame",
|
||||
"__register_frame_info",
|
||||
"__register_frame_info_bases",
|
||||
"__register_frame_info_table",
|
||||
"__register_frame_info_table_bases",
|
||||
"__register_frame_table",
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
toolchain_library {
|
||||
|
Reference in New Issue
Block a user