Make libc_scudo always go first.
In addition, add Shared_libs to malloc_not_svelte. Bug: 123689570 Test: Verified that libc_scudo is first wherever it is added. Change-Id: Ibdc5dbd019a382630a727c270f846aa4446f8d99 Merged-In: Ibdc5dbd019a382630a727c270f846aa4446f8d99
This commit is contained in:
@@ -44,6 +44,7 @@ type variableProperties struct {
|
||||
|
||||
Malloc_not_svelte struct {
|
||||
Cflags []string `android:"arch_variant"`
|
||||
Shared_libs []string `android:"arch_variant"`
|
||||
} `android:"arch_variant"`
|
||||
|
||||
Safestack struct {
|
||||
|
11
cc/linker.go
11
cc/linker.go
@@ -255,6 +255,17 @@ func (linker *baseLinker) linkerDeps(ctx DepsContext, deps Deps) Deps {
|
||||
}
|
||||
}
|
||||
|
||||
if inList("libc_scudo", deps.SharedLibs) {
|
||||
// libc_scudo is an alternate implementation of all
|
||||
// allocation functions (malloc, free), that uses
|
||||
// the scudo allocator instead of the default native
|
||||
// allocator. If this library is in the list, make
|
||||
// sure it's first so it properly overrides the
|
||||
// allocation functions of all other shared libraries.
|
||||
_, deps.SharedLibs = removeFromList("libc_scudo", deps.SharedLibs)
|
||||
deps.SharedLibs = append([]string{"libc_scudo"}, deps.SharedLibs...)
|
||||
}
|
||||
|
||||
// If libc and libdl are both in system_shared_libs make sure libdl comes after libc
|
||||
// to avoid loading libdl before libc.
|
||||
if inList("libdl", systemSharedLibs) && inList("libc", systemSharedLibs) &&
|
||||
|
Reference in New Issue
Block a user