Make rust builds hermetic
Rust builds were picking up the crt objects and system libraries like
libc.so from /usr/lib/x86_64-linux-gnu/Scrt1.o and
/lib/x86_64-linux-gnu/libc.so.6. Pass --sysroot to the linker to
point it to the glibc prebuilts.
Test: manual
Change-Id: I6540df8aef0e5c2258de77456d18a6052db627d4
diff --git a/rust/config/x86_linux_host.go b/rust/config/x86_linux_host.go
index 0aa534f..c10afd8 100644
--- a/rust/config/x86_linux_host.go
+++ b/rust/config/x86_linux_host.go
@@ -26,6 +26,7 @@
"-B${cc_config.ClangBin}",
"-fuse-ld=lld",
"-Wl,--undefined-version",
+ "--sysroot ${cc_config.LinuxGccRoot}/sysroot",
}
linuxX86Rustflags = []string{}
linuxX86Linkflags = []string{}