From 00ced7675cdc6b6512213c2772ea716283a6f433 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Tue, 10 May 2016 17:31:21 -0700 Subject: 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 --- cc/cc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cc/cc.go b/cc/cc.go index a599bfb8..db2066ab 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -1258,8 +1258,6 @@ func (linker *baseLinker) deps(ctx BaseModuleContext, deps Deps) Deps { 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 @@ func (linker *baseLinker) flags(ctx ModuleContext, flags Flags) Flags { } } + flags.LdFlags = append(flags.LdFlags, linker.Properties.Ldflags...) + if ctx.Host() && !linker.static() { rpath_prefix := `\$$ORIGIN/` if ctx.Darwin() { -- cgit v1.2.3