Move local ldflags after the toolchain ldflags
This way a local module can override a global flag (like libm
overriding -Wl,--hash-style=)
Change-Id: If32774381fc46b5767f2c13bf45c3a84acb2697e
diff --git a/cc/cc.go b/cc/cc.go
index a599bfb..db2066a 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -1258,8 +1258,6 @@
func (linker *baseLinker) flags(ctx ModuleContext, flags Flags) Flags {
toolchain := ctx.toolchain()
- flags.LdFlags = append(flags.LdFlags, linker.Properties.Ldflags...)
-
if !ctx.noDefaultCompilerFlags() {
if ctx.Device() && !Bool(linker.Properties.Allow_undefined_symbols) {
flags.LdFlags = append(flags.LdFlags, "-Wl,--no-undefined")
@@ -1276,6 +1274,8 @@
}
}
+ flags.LdFlags = append(flags.LdFlags, linker.Properties.Ldflags...)
+
if ctx.Host() && !linker.static() {
rpath_prefix := `\$$ORIGIN/`
if ctx.Darwin() {