Support grouping static libraries
LLVM has complicated static library layering that sometimes changes. The make solution was to list all the static libraries twice, but Soong dedups the list. Add a group_static_libs flag to allow surrounding the static libs with -Wl,--start-group and -Wl,--end-group. Test: mmma -j external/llvm Change-Id: Ic08a183d7def9c9249d4a3014760759f16b68d04
This commit is contained in:
@@ -187,6 +187,8 @@ type builderFlags struct {
|
||||
clang bool
|
||||
tidy bool
|
||||
|
||||
groupStaticLibs bool
|
||||
|
||||
stripKeepSymbols bool
|
||||
stripKeepMiniDebugInfo bool
|
||||
stripAddGnuDebuglink bool
|
||||
@@ -439,7 +441,13 @@ func TransformObjToDynamicBinary(ctx android.ModuleContext,
|
||||
}
|
||||
}
|
||||
|
||||
if flags.groupStaticLibs && len(staticLibs) > 0 {
|
||||
libFlagsList = append(libFlagsList, "-Wl,--start-group")
|
||||
}
|
||||
libFlagsList = append(libFlagsList, staticLibs.Strings()...)
|
||||
if flags.groupStaticLibs && len(staticLibs) > 0 {
|
||||
libFlagsList = append(libFlagsList, "-Wl,--end-group")
|
||||
}
|
||||
|
||||
if groupLate && !ctx.Darwin() && len(lateStaticLibs) > 0 {
|
||||
libFlagsList = append(libFlagsList, "-Wl,--start-group")
|
||||
|
Reference in New Issue
Block a user