Don't pass -Wl,--no-undefined to host targets
Host builds were compiling without -Wl,--no-undefined because of an ASAN issue. Pass -Wl,--no-undefined for host builds unless sanitzers are enabled. Also fix LOCAL_ALLOW_UNDEFINED_SYMBOLS on darwin, where disallowing undefined symbols is the default. Test: m -j host Test: m -j SANITIZE_HOST=address host Bug: 32305815 Change-Id: Ia4bb305a50b1c1048b119f75726d52f82e21438c
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")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user