Export rust flags to bazel

Bug: 290790800
Test: Inspect out/soong/soong_inspection folder after running `m bp2build`
Change-Id: Iffc43a540f67e5f07d109a0a87f3248fae035267
diff --git a/rust/config/global.go b/rust/config/global.go
index f397ce9..c37ac4e 100644
--- a/rust/config/global.go
+++ b/rust/config/global.go
@@ -52,11 +52,22 @@
 		"-C force-unwind-tables=yes",
 		// Use v0 mangling to distinguish from C++ symbols
 		"-C symbol-mangling-version=v0",
-		"--color always",
+		// This flag requires to have no space so that when it's exported to bazel
+		// it can be removed. See aosp/2768339
+		"--color=always",
 		"-Zdylib-lto",
 		"-Z link-native-libraries=no",
 	}
 
+	LinuxHostGlobalLinkFlags = []string{
+		"-lc",
+		"-lrt",
+		"-ldl",
+		"-lpthread",
+		"-lm",
+		"-lgcc_s",
+	}
+
 	deviceGlobalRustFlags = []string{
 		"-C panic=abort",
 		// Generate additional debug info for AutoFDO
@@ -101,6 +112,8 @@
 	pctx.StaticVariable("DeviceGlobalLinkFlags", strings.Join(deviceGlobalLinkFlags, " "))
 
 	exportedVars.ExportStringStaticVariable("RUST_DEFAULT_VERSION", RustDefaultVersion)
+	exportedVars.ExportStringListStaticVariable("GLOBAL_RUSTC_FLAGS", GlobalRustFlags)
+	exportedVars.ExportStringListStaticVariable("LINUX_HOST_GLOBAL_LINK_FLAGS", LinuxHostGlobalLinkFlags)
 }
 
 func HostPrebuiltTag(config android.Config) string {