Loading cc/androidmk.go +7 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,13 @@ func (c *Module) AndroidMkEntries() []android.AndroidMkEntries { if len(c.Properties.Logtags) > 0 { entries.AddStrings("LOCAL_LOGTAGS_FILES", c.Properties.Logtags...) } // Note: Pass the exact value of AndroidMkSystemSharedLibs to the Make // world, even if it is an empty list. In the Make world, // LOCAL_SYSTEM_SHARED_LIBRARIES defaults to "none", which is expanded // to the default list of system shared libs by the build system. // Soong computes the exact list of system shared libs, so we have to // override the default value when the list of libs is actually empty. entries.SetString("LOCAL_SYSTEM_SHARED_LIBRARIES", strings.Join(c.Properties.AndroidMkSystemSharedLibs, " ")) if len(c.Properties.AndroidMkSharedLibs) > 0 { entries.AddStrings("LOCAL_SHARED_LIBRARIES", c.Properties.AndroidMkSharedLibs...) } Loading cc/cc.go +8 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,9 @@ type Deps struct { // Used for data dependencies adjacent to tests DataLibs []string // Used by DepsMutator to pass system_shared_libs information to check_elf_file.py. SystemSharedLibs []string StaticUnwinderIfLegacy bool ReexportSharedLibHeaders, ReexportStaticLibHeaders, ReexportHeaderLibHeaders []string Loading Loading @@ -238,6 +241,9 @@ type BaseProperties struct { PreventInstall bool `blueprint:"mutated"` ApexesProvidingSharedLibs []string `blueprint:"mutated"` // Set by DepsMutator. AndroidMkSystemSharedLibs []string `blueprint:"mutated"` ImageVariationPrefix string `blueprint:"mutated"` VndkVersion string `blueprint:"mutated"` SubName string `blueprint:"mutated"` Loading Loading @@ -1839,6 +1845,8 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) { deps := c.deps(ctx) c.Properties.AndroidMkSystemSharedLibs = deps.SystemSharedLibs variantNdkLibs := []string{} variantLateNdkLibs := []string{} if ctx.Os() == android.Android { Loading cc/linker.go +8 −8 Original line number Diff line number Diff line Loading @@ -278,19 +278,19 @@ func (linker *baseLinker) linkerDeps(ctx DepsContext, deps Deps) Deps { deps.LateStaticLibs = append(deps.LateStaticLibs, "libatomic") } systemSharedLibs := linker.Properties.System_shared_libs if systemSharedLibs == nil { deps.SystemSharedLibs = linker.Properties.System_shared_libs if deps.SystemSharedLibs == nil { // Provide a default system_shared_libs if it is unspecified. Note: If an // empty list [] is specified, it implies that the module declines the // default system_shared_libs. systemSharedLibs = []string{"libc", "libm", "libdl"} deps.SystemSharedLibs = []string{"libc", "libm", "libdl"} } if inList("libdl", deps.SharedLibs) { // If system_shared_libs has libc but not libdl, make sure shared_libs does not // have libdl to avoid loading libdl before libc. if inList("libc", systemSharedLibs) { if !inList("libdl", systemSharedLibs) { if inList("libc", deps.SystemSharedLibs) { if !inList("libdl", deps.SystemSharedLibs) { ctx.PropertyErrorf("shared_libs", "libdl must be in system_shared_libs, not shared_libs") } Loading @@ -300,12 +300,12 @@ func (linker *baseLinker) linkerDeps(ctx DepsContext, deps Deps) Deps { // If libc and libdl are both in system_shared_libs make sure libdl comes after libc // to avoid loading libdl before libc. if inList("libdl", systemSharedLibs) && inList("libc", systemSharedLibs) && indexList("libdl", systemSharedLibs) < indexList("libc", systemSharedLibs) { if inList("libdl", deps.SystemSharedLibs) && inList("libc", deps.SystemSharedLibs) && indexList("libdl", deps.SystemSharedLibs) < indexList("libc", deps.SystemSharedLibs) { ctx.PropertyErrorf("system_shared_libs", "libdl must be after libc") } deps.LateSharedLibs = append(deps.LateSharedLibs, systemSharedLibs...) deps.LateSharedLibs = append(deps.LateSharedLibs, deps.SystemSharedLibs...) } if ctx.Fuchsia() { Loading Loading
cc/androidmk.go +7 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,13 @@ func (c *Module) AndroidMkEntries() []android.AndroidMkEntries { if len(c.Properties.Logtags) > 0 { entries.AddStrings("LOCAL_LOGTAGS_FILES", c.Properties.Logtags...) } // Note: Pass the exact value of AndroidMkSystemSharedLibs to the Make // world, even if it is an empty list. In the Make world, // LOCAL_SYSTEM_SHARED_LIBRARIES defaults to "none", which is expanded // to the default list of system shared libs by the build system. // Soong computes the exact list of system shared libs, so we have to // override the default value when the list of libs is actually empty. entries.SetString("LOCAL_SYSTEM_SHARED_LIBRARIES", strings.Join(c.Properties.AndroidMkSystemSharedLibs, " ")) if len(c.Properties.AndroidMkSharedLibs) > 0 { entries.AddStrings("LOCAL_SHARED_LIBRARIES", c.Properties.AndroidMkSharedLibs...) } Loading
cc/cc.go +8 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,9 @@ type Deps struct { // Used for data dependencies adjacent to tests DataLibs []string // Used by DepsMutator to pass system_shared_libs information to check_elf_file.py. SystemSharedLibs []string StaticUnwinderIfLegacy bool ReexportSharedLibHeaders, ReexportStaticLibHeaders, ReexportHeaderLibHeaders []string Loading Loading @@ -238,6 +241,9 @@ type BaseProperties struct { PreventInstall bool `blueprint:"mutated"` ApexesProvidingSharedLibs []string `blueprint:"mutated"` // Set by DepsMutator. AndroidMkSystemSharedLibs []string `blueprint:"mutated"` ImageVariationPrefix string `blueprint:"mutated"` VndkVersion string `blueprint:"mutated"` SubName string `blueprint:"mutated"` Loading Loading @@ -1839,6 +1845,8 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) { deps := c.deps(ctx) c.Properties.AndroidMkSystemSharedLibs = deps.SystemSharedLibs variantNdkLibs := []string{} variantLateNdkLibs := []string{} if ctx.Os() == android.Android { Loading
cc/linker.go +8 −8 Original line number Diff line number Diff line Loading @@ -278,19 +278,19 @@ func (linker *baseLinker) linkerDeps(ctx DepsContext, deps Deps) Deps { deps.LateStaticLibs = append(deps.LateStaticLibs, "libatomic") } systemSharedLibs := linker.Properties.System_shared_libs if systemSharedLibs == nil { deps.SystemSharedLibs = linker.Properties.System_shared_libs if deps.SystemSharedLibs == nil { // Provide a default system_shared_libs if it is unspecified. Note: If an // empty list [] is specified, it implies that the module declines the // default system_shared_libs. systemSharedLibs = []string{"libc", "libm", "libdl"} deps.SystemSharedLibs = []string{"libc", "libm", "libdl"} } if inList("libdl", deps.SharedLibs) { // If system_shared_libs has libc but not libdl, make sure shared_libs does not // have libdl to avoid loading libdl before libc. if inList("libc", systemSharedLibs) { if !inList("libdl", systemSharedLibs) { if inList("libc", deps.SystemSharedLibs) { if !inList("libdl", deps.SystemSharedLibs) { ctx.PropertyErrorf("shared_libs", "libdl must be in system_shared_libs, not shared_libs") } Loading @@ -300,12 +300,12 @@ func (linker *baseLinker) linkerDeps(ctx DepsContext, deps Deps) Deps { // If libc and libdl are both in system_shared_libs make sure libdl comes after libc // to avoid loading libdl before libc. if inList("libdl", systemSharedLibs) && inList("libc", systemSharedLibs) && indexList("libdl", systemSharedLibs) < indexList("libc", systemSharedLibs) { if inList("libdl", deps.SystemSharedLibs) && inList("libc", deps.SystemSharedLibs) && indexList("libdl", deps.SystemSharedLibs) < indexList("libc", deps.SystemSharedLibs) { ctx.PropertyErrorf("system_shared_libs", "libdl must be after libc") } deps.LateSharedLibs = append(deps.LateSharedLibs, systemSharedLibs...) deps.LateSharedLibs = append(deps.LateSharedLibs, deps.SystemSharedLibs...) } if ctx.Fuchsia() { Loading