diff --git a/cc/builder.go b/cc/builder.go index d0b21edaf..c9a6722b1 100644 --- a/cc/builder.go +++ b/cc/builder.go @@ -466,11 +466,11 @@ func TransformObjToDynamicBinary(ctx android.ModuleContext, } } - if flags.groupStaticLibs && len(staticLibs) > 0 { + if flags.groupStaticLibs && !ctx.Darwin() && len(staticLibs) > 0 { libFlagsList = append(libFlagsList, "-Wl,--start-group") } libFlagsList = append(libFlagsList, staticLibs.Strings()...) - if flags.groupStaticLibs && len(staticLibs) > 0 { + if flags.groupStaticLibs && !ctx.Darwin() && len(staticLibs) > 0 { libFlagsList = append(libFlagsList, "-Wl,--end-group") }