Add --sysroot /dev/null to musl compiles
Prevent linking against host glibc libraries by passing
--sysroot /dev/null to compile and link rules targeting musl.
Bug: 190084016
Test: m USE_HOST_MUSL=true host-native
Change-Id: Ief2c9507af9ae7cf5376cb874fcef0f2cbaf9994
diff --git a/cc/config/x86_linux_host.go b/cc/config/x86_linux_host.go
index 60f03c2..ce6836b 100644
--- a/cc/config/x86_linux_host.go
+++ b/cc/config/x86_linux_host.go
@@ -47,6 +47,7 @@
"-D_LIBCPP_HAS_MUSL_LIBC",
"-DANDROID_HOST_MUSL",
"-nostdlibinc",
+ "--sysroot /dev/null",
}
linuxLdflags = []string{
@@ -65,6 +66,7 @@
linuxMuslLdflags = []string{
"-nostdlib",
"-lgcc", "-lgcc_eh",
+ "--sysroot /dev/null",
}
// Extended cflags