From edc385f5ebac53d180c41c61206c8ba9718b74b7 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Wed, 8 Jul 2015 13:02:23 -0700 Subject: [PATCH] Fix libgcc/libatomic link order This is the equivalent commit to https://android-review.googlesource.com/144749 Change-Id: I79374f33766fa307fd031ffd0cbd9e9d37848324 --- cc/builder.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cc/builder.go b/cc/builder.go index e35cebb42..d6d1a02c7 100644 --- a/cc/builder.go +++ b/cc/builder.go @@ -302,6 +302,14 @@ func TransformObjToDynamicBinary(ctx common.AndroidModuleContext, libFlagsList = append(libFlagsList, staticLibs...) + if groupLate && len(lateStaticLibs) > 0 { + libFlagsList = append(libFlagsList, "-Wl,--start-group") + } + libFlagsList = append(libFlagsList, lateStaticLibs...) + if groupLate && len(lateStaticLibs) > 0 { + libFlagsList = append(libFlagsList, "-Wl,--end-group") + } + for _, lib := range sharedLibs { dir, file := filepath.Split(lib) if !strings.HasPrefix(file, "lib") { @@ -315,14 +323,6 @@ func TransformObjToDynamicBinary(ctx common.AndroidModuleContext, ldDirs = append(ldDirs, dir) } - if groupLate && len(lateStaticLibs) > 0 { - libFlagsList = append(libFlagsList, "-Wl,--start-group") - } - libFlagsList = append(libFlagsList, lateStaticLibs...) - if groupLate && len(lateStaticLibs) > 0 { - libFlagsList = append(libFlagsList, "-Wl,--end-group") - } - deps = append(deps, ldCmd) deps = append(deps, sharedLibs...) deps = append(deps, staticLibs...)