rust: Pass lld flags from cc to rust linker args.

Rust is not passing the sysroot flag to Clang when invoking it as the
linker. This means files from the host may leak in, and host targets
may fail if sysroot files are not available from the host.

This patch prepends the lld flags from cc into rust linkargs. This
pulls in the sysroots flag, and also ensures that we remain in sync
with linkage flags used in cc.

The '-Wl,--no-undefined-version' from cc is overridden to avoid
missing version assignment errors for rust's generated alloc
functions.

Bug: 167690054
Test: cd external/rust; mma
Test: strace -f -e %file <host libstd.dylib.so build command> pulls
      from correct sysroots.
Change-Id: Ic40597f546f3b112012155614056afed487c6ca1
diff --git a/rust/config/arm_device.go b/rust/config/arm_device.go
index ac2580b..ac4f1c6 100644
--- a/rust/config/arm_device.go
+++ b/rust/config/arm_device.go
@@ -23,10 +23,7 @@
 var (
 	ArmRustFlags            = []string{}
 	ArmArchFeatureRustFlags = map[string][]string{}
-	ArmLinkFlags            = []string{
-		"-Wl,--icf=safe",
-		"-Wl,-m,armelf",
-	}
+	ArmLinkFlags            = []string{}
 
 	ArmArchVariantRustFlags = map[string][]string{
 		"armv7-a":      []string{},
@@ -59,7 +56,8 @@
 }
 
 func (t *toolchainArm) ToolchainLinkFlags() string {
-	return "${config.DeviceGlobalLinkFlags} ${config.ArmToolchainLinkFlags}"
+	// Prepend the lld flags from cc_config so we stay in sync with cc
+	return "${config.DeviceGlobalLinkFlags} ${cc_config.ArmLldflags} ${config.ArmToolchainLinkFlags}"
 }
 
 func (t *toolchainArm) ToolchainRustFlags() string {