Don't pass -Wl,--no-undefined to host targets
am: 46974e2457
Change-Id: I9505981ac11fffc033eccb31f01b9669a9234d96
This commit is contained in:
@@ -150,7 +150,12 @@ func (linker *baseLinker) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
||||
toolchain := ctx.toolchain()
|
||||
|
||||
if !ctx.noDefaultCompilerFlags() {
|
||||
if ctx.Device() && !Bool(linker.Properties.Allow_undefined_symbols) {
|
||||
if Bool(linker.Properties.Allow_undefined_symbols) {
|
||||
if ctx.Darwin() {
|
||||
// darwin defaults to treating undefined symbols as errors
|
||||
flags.LdFlags = append(flags.LdFlags, "-Wl,-undefined,dynamic_lookup")
|
||||
}
|
||||
} else if !ctx.Darwin() {
|
||||
flags.LdFlags = append(flags.LdFlags, "-Wl,--no-undefined")
|
||||
}
|
||||
|
||||
|
@@ -255,6 +255,9 @@ func (sanitize *sanitize) flags(ctx ModuleContext, flags Flags) Flags {
|
||||
// libraries needed with -fsanitize=address. http://b/18650275 (WAI)
|
||||
flags.LdFlags = append(flags.LdFlags, "-lm", "-lpthread")
|
||||
flags.LdFlags = append(flags.LdFlags, "-Wl,--no-as-needed")
|
||||
// Host ASAN only links symbols in the final executable, so
|
||||
// there will always be undefined symbols in intermediate libraries.
|
||||
_, flags.LdFlags = removeFromList("-Wl,--no-undefined", flags.LdFlags)
|
||||
} else {
|
||||
flags.CFlags = append(flags.CFlags, "-mllvm", "-asan-globals=0")
|
||||
flags.DynamicLinker = "/system/bin/linker_asan"
|
||||
|
Reference in New Issue
Block a user