Revert "Use --sysroot when compiling against the NDK"
Revert submission 3312372-ndk_sysroot
Reason for revert: b/374513613
Reverted changes: /q/submissionid:3312372-ndk_sysroot
Bug: 374513613
Bug: 374130155
Change-Id: I2c17d085d090fd5a9b8bae4bf6c3a0e43128ad4c
diff --git a/cc/compiler.go b/cc/compiler.go
index e49de6f..7bba962 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -430,14 +430,14 @@
}
if ctx.useSdk() {
+ // TODO: Switch to --sysroot.
// The NDK headers are installed to a common sysroot. While a more
// typical Soong approach would be to only make the headers for the
// library you're using available, we're trying to emulate the NDK
// behavior here, and the NDK always has all the NDK headers available.
flags.SystemIncludeFlags = append(flags.SystemIncludeFlags,
- "--sysroot "+getNdkSysrootBase(ctx).String())
- } else if ctx.Device() {
- flags.Global.CommonFlags = append(flags.Global.CFlags, "-nostdlibinc")
+ "-isystem "+getCurrentIncludePath(ctx).String(),
+ "-isystem "+getCurrentIncludePath(ctx).Join(ctx, config.NDKTriple(tc)).String())
}
if ctx.InVendorOrProduct() {