Support sanitizer builds inside make
Make expects libraries built with address sanitizer to be installed into /data, and can't handle multiple variants of modules. Change-Id: Ice575ff6f0788a88f296e7b3ee521a2b9771f55f
This commit is contained in:
12
cc/cc.go
12
cc/cc.go
@@ -1482,7 +1482,7 @@ func (library *libraryLinker) flags(ctx ModuleContext, flags Flags) Flags {
|
||||
flags.Nocrt = Bool(library.Properties.Nocrt)
|
||||
|
||||
if !library.static() {
|
||||
libName := ctx.ModuleName()
|
||||
libName := ctx.ModuleName() + library.Properties.VariantName
|
||||
// GCC for Android assumes that -shared means -Bsymbolic, use -Wl,-shared instead
|
||||
sharedFlag := "-Wl,-shared"
|
||||
if flags.Clang || ctx.Host() {
|
||||
@@ -1663,7 +1663,8 @@ func (library *libraryLinker) appendVariantName(variant string) {
|
||||
type libraryInstaller struct {
|
||||
baseInstaller
|
||||
|
||||
linker *libraryLinker
|
||||
linker *libraryLinker
|
||||
sanitize *sanitize
|
||||
}
|
||||
|
||||
func (library *libraryInstaller) install(ctx ModuleContext, file common.Path) {
|
||||
@@ -1672,6 +1673,10 @@ func (library *libraryInstaller) install(ctx ModuleContext, file common.Path) {
|
||||
}
|
||||
}
|
||||
|
||||
func (library *libraryInstaller) inData() bool {
|
||||
return library.baseInstaller.inData() || library.sanitize.inData()
|
||||
}
|
||||
|
||||
func NewLibrary(hod common.HostOrDeviceSupported, shared, static bool) *Module {
|
||||
module := newModule(hod, common.MultilibBoth)
|
||||
|
||||
@@ -1688,7 +1693,8 @@ func NewLibrary(hod common.HostOrDeviceSupported, shared, static bool) *Module {
|
||||
dir: "lib",
|
||||
dir64: "lib64",
|
||||
},
|
||||
linker: linker,
|
||||
linker: linker,
|
||||
sanitize: module.sanitize,
|
||||
}
|
||||
|
||||
return module
|
||||
|
Reference in New Issue
Block a user