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

Commit f3b190f8 authored by Ivan Lozano's avatar Ivan Lozano
Browse files

Fix UBSanitized host binaries missing runtime.

Host binaries by default use the UBSan runtime whether or not
diagnostics are requested in the module definition. The rest of the code
assumes the runtime is only needed when diag properties are set.

This makes sure to add the runtime to the dependency graph of host
binaries that are UBSanitized.

Bug: 150336284
Test: ./art/tools/dist_linux_bionic.sh com.android.art.host
Test: runtime appropriately identified as a dependency of libziparchive
Change-Id: I2704aaba4abc7f4e6d96747917c77b5147fd1d56
parent 8c3fec4c
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -900,6 +900,11 @@ func sanitizerRuntimeMutator(mctx android.BottomUpMutatorContext) {
		c.sanitize.Properties.Sanitizers = sanitizers
		c.sanitize.Properties.Sanitizers = sanitizers
		c.sanitize.Properties.DiagSanitizers = diagSanitizers
		c.sanitize.Properties.DiagSanitizers = diagSanitizers


		// TODO(b/150822854) Hosts have a different default behavior and assume the runtime library is used.
		if c.Host() {
			diagSanitizers = sanitizers
		}

		// Determine the runtime library required
		// Determine the runtime library required
		runtimeLibrary := ""
		runtimeLibrary := ""
		var extraStaticDeps []string
		var extraStaticDeps []string