Move libgcc to libcrt.builtins

libgcc is kept behind libcrt.builtins to provide unwinder symbols and
any other missing symbols.

libc and libm are excluded from the switch due to some symbols being
hidden in libcrt.builtins but not in libgcc. These will be addressed in
a separate CL.

Bug: 29275768
Test: checkbuild and bionic native tests on arm/arm64/x86/x86_64
Change-Id: Icc85bf88513e989a4b1547564405a22cf847db8a
This commit is contained in:
Yi Kong 2018-08-09 14:04:37 -07:00
parent e944600978
commit 77e62dbf59
2 changed files with 31 additions and 5 deletions

View file

@ -84,6 +84,30 @@ func createTestContext(t *testing.T, config android.Config, bp string) *android.
recovery_available: true, recovery_available: true,
} }
toolchain_library {
name: "libclang_rt.builtins-arm-android",
vendor_available: true,
recovery_available: true,
}
toolchain_library {
name: "libclang_rt.builtins-aarch64-android",
vendor_available: true,
recovery_available: true,
}
toolchain_library {
name: "libclang_rt.builtins-i686-android",
vendor_available: true,
recovery_available: true,
}
toolchain_library {
name: "libclang_rt.builtins-x86_64-android",
vendor_available: true,
recovery_available: true,
}
toolchain_library { toolchain_library {
name: "libgcc", name: "libgcc",
vendor_available: true, vendor_available: true,

View file

@ -16,6 +16,7 @@ package cc
import ( import (
"android/soong/android" "android/soong/android"
"android/soong/cc/config"
"fmt" "fmt"
"github.com/google/blueprint" "github.com/google/blueprint"
@ -214,12 +215,13 @@ func (linker *baseLinker) linkerDeps(ctx DepsContext, deps Deps) Deps {
deps.WholeStaticLibs = removeListFromList(deps.WholeStaticLibs, linker.Properties.Target.Recovery.Exclude_static_libs) deps.WholeStaticLibs = removeListFromList(deps.WholeStaticLibs, linker.Properties.Target.Recovery.Exclude_static_libs)
} }
if ctx.ModuleName() != "libcompiler_rt-extras" {
deps.LateStaticLibs = append(deps.LateStaticLibs, "libcompiler_rt-extras")
}
if ctx.toolchain().Bionic() { if ctx.toolchain().Bionic() {
// libgcc and libatomic have to be last on the command line // libclang_rt.builtins, libgcc and libatomic have to be last on the command line
// TODO: Also enable for libc and libm
if ctx.ModuleName() != "libc" && ctx.ModuleName() != "libm" {
deps.LateStaticLibs = append(deps.LateStaticLibs, config.BuiltinsRuntimeLibrary(ctx.toolchain()))
}
deps.LateStaticLibs = append(deps.LateStaticLibs, "libatomic") deps.LateStaticLibs = append(deps.LateStaticLibs, "libatomic")
if !Bool(linker.Properties.No_libgcc) { if !Bool(linker.Properties.No_libgcc) {
deps.LateStaticLibs = append(deps.LateStaticLibs, "libgcc") deps.LateStaticLibs = append(deps.LateStaticLibs, "libgcc")