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
diff --git a/cc/sanitize.go b/cc/sanitize.go
index 6e809bf..252c9e7 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -900,6 +900,11 @@
 		c.sanitize.Properties.Sanitizers = sanitizers
 		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
 		runtimeLibrary := ""
 		var extraStaticDeps []string