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
This commit is contained in:
Colin Cross 2022-02-11 13:43:21 -08:00
parent a2bcf2c4b8
commit 6745a8ef1d

View file

@ -47,6 +47,7 @@ var (
"-D_LIBCPP_HAS_MUSL_LIBC",
"-DANDROID_HOST_MUSL",
"-nostdlibinc",
"--sysroot /dev/null",
}
linuxLdflags = []string{
@ -65,6 +66,7 @@ var (
linuxMuslLdflags = []string{
"-nostdlib",
"-lgcc", "-lgcc_eh",
"--sysroot /dev/null",
}
// Extended cflags