Merge \\"Put shared library ldflags first\\" am: feba062cd5
am: 5aeecea746
Change-Id: Icd88c58cf6d571b8739b8320983622ed6ab70d3d
This commit is contained in:
12
cc/cc.go
12
cc/cc.go
@@ -1613,26 +1613,28 @@ func (library *libraryLinker) flags(ctx ModuleContext, flags Flags) Flags {
|
|||||||
if flags.Clang || ctx.Host() {
|
if flags.Clang || ctx.Host() {
|
||||||
sharedFlag = "-shared"
|
sharedFlag = "-shared"
|
||||||
}
|
}
|
||||||
|
var f []string
|
||||||
if ctx.Device() {
|
if ctx.Device() {
|
||||||
flags.LdFlags = append(flags.LdFlags,
|
f = append(f,
|
||||||
"-nostdlib",
|
"-nostdlib",
|
||||||
"-Wl,--gc-sections",
|
"-Wl,--gc-sections",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ctx.Darwin() {
|
if ctx.Darwin() {
|
||||||
flags.LdFlags = append(flags.LdFlags,
|
f = append(f,
|
||||||
"-dynamiclib",
|
"-dynamiclib",
|
||||||
"-single_module",
|
"-single_module",
|
||||||
//"-read_only_relocs suppress",
|
//"-read_only_relocs suppress",
|
||||||
"-install_name @rpath/"+libName+flags.Toolchain.ShlibSuffix(),
|
"-install_name @rpath/"+libName+flags.Toolchain.ShlibSuffix(),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
flags.LdFlags = append(flags.LdFlags,
|
f = append(f,
|
||||||
sharedFlag,
|
sharedFlag,
|
||||||
"-Wl,-soname,"+libName+flags.Toolchain.ShlibSuffix(),
|
"-Wl,-soname,"+libName+flags.Toolchain.ShlibSuffix())
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flags.LdFlags = append(f, flags.LdFlags...)
|
||||||
}
|
}
|
||||||
|
|
||||||
return flags
|
return flags
|
||||||
|
Reference in New Issue
Block a user