Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 134f8f6f authored by Christopher Ferris's avatar Christopher Ferris
Browse files

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
parent b007b2bd
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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 −0
Original line number Diff line number Diff line
@@ -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) &&