Loading cc/cc_test.go +14 −6 Original line number Diff line number Diff line Loading @@ -2734,6 +2734,11 @@ func TestIncludeDirsExporting(t *testing.T) { func TestIncludeDirectoryOrdering(t *testing.T) { t.Parallel() expectedPlatformFlags := []string{ "-nostdlibinc", } baseExpectedFlags := []string{ "${config.ArmThumbCflags}", "${config.ArmCflags}", Loading Loading @@ -2795,9 +2800,9 @@ func TestIncludeDirectoryOrdering(t *testing.T) { cstd := []string{"-std=gnu17", "-std=conly"} cppstd := []string{"-std=gnu++20", "-std=cpp", "-fno-rtti"} lastNDKIncludes := []string{ "out/soong/ndk/sysroot/usr/include", "out/soong/ndk/sysroot/usr/include/arm-linux-androideabi", lastNDKFlags := []string{ "--sysroot", "out/soong/ndk/sysroot", } lastPlatformIncludes := []string{ Loading @@ -2821,10 +2826,11 @@ func TestIncludeDirectoryOrdering(t *testing.T) { expectedNDKSTLIncludes, cflags, cstd, lastNDKIncludes, lastNDKFlags, []string{"${config.NoOverrideGlobalCflags}", "${config.NoOverrideExternalGlobalCflags}"}, ), expectedPlatform: slices.Concat( expectedPlatformFlags, baseExpectedFlags, expectedTargetPlatformFlags, conly, Loading @@ -2846,10 +2852,11 @@ func TestIncludeDirectoryOrdering(t *testing.T) { expectedNDKSTLIncludes, cflags, cppstd, lastNDKIncludes, lastNDKFlags, []string{"${config.NoOverrideGlobalCflags}", "${config.NoOverrideExternalGlobalCflags}"}, ), expectedPlatform: slices.Concat( expectedPlatformFlags, baseExpectedFlags, expectedTargetPlatformFlags, cppOnly, Loading @@ -2869,9 +2876,10 @@ func TestIncludeDirectoryOrdering(t *testing.T) { []string{"${config.CommonGlobalAsflags}"}, expectedIncludes, expectedNDKSTLIncludes, lastNDKIncludes, lastNDKFlags, ), expectedPlatform: slices.Concat( expectedPlatformFlags, baseExpectedFlags, expectedTargetPlatformFlags, []string{"${config.CommonGlobalAsflags}"}, Loading cc/compiler.go +3 −3 Original line number Diff line number Diff line Loading @@ -430,14 +430,14 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps } 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, "-isystem "+getCurrentIncludePath(ctx).String(), "-isystem "+getCurrentIncludePath(ctx).Join(ctx, config.NDKTriple(tc)).String()) "--sysroot "+getNdkSysrootBase(ctx).String()) } else if ctx.Device() { flags.Global.CommonFlags = append(flags.Global.CFlags, "-nostdlibinc") } if ctx.InVendorOrProduct() { Loading cc/config/global.go +0 −1 Original line number Diff line number Diff line Loading @@ -172,7 +172,6 @@ var ( "-Werror=address", "-Werror=sequence-point", "-Werror=format-security", "-nostdlibinc", } commonGlobalLldflags = []string{ Loading Loading
cc/cc_test.go +14 −6 Original line number Diff line number Diff line Loading @@ -2734,6 +2734,11 @@ func TestIncludeDirsExporting(t *testing.T) { func TestIncludeDirectoryOrdering(t *testing.T) { t.Parallel() expectedPlatformFlags := []string{ "-nostdlibinc", } baseExpectedFlags := []string{ "${config.ArmThumbCflags}", "${config.ArmCflags}", Loading Loading @@ -2795,9 +2800,9 @@ func TestIncludeDirectoryOrdering(t *testing.T) { cstd := []string{"-std=gnu17", "-std=conly"} cppstd := []string{"-std=gnu++20", "-std=cpp", "-fno-rtti"} lastNDKIncludes := []string{ "out/soong/ndk/sysroot/usr/include", "out/soong/ndk/sysroot/usr/include/arm-linux-androideabi", lastNDKFlags := []string{ "--sysroot", "out/soong/ndk/sysroot", } lastPlatformIncludes := []string{ Loading @@ -2821,10 +2826,11 @@ func TestIncludeDirectoryOrdering(t *testing.T) { expectedNDKSTLIncludes, cflags, cstd, lastNDKIncludes, lastNDKFlags, []string{"${config.NoOverrideGlobalCflags}", "${config.NoOverrideExternalGlobalCflags}"}, ), expectedPlatform: slices.Concat( expectedPlatformFlags, baseExpectedFlags, expectedTargetPlatformFlags, conly, Loading @@ -2846,10 +2852,11 @@ func TestIncludeDirectoryOrdering(t *testing.T) { expectedNDKSTLIncludes, cflags, cppstd, lastNDKIncludes, lastNDKFlags, []string{"${config.NoOverrideGlobalCflags}", "${config.NoOverrideExternalGlobalCflags}"}, ), expectedPlatform: slices.Concat( expectedPlatformFlags, baseExpectedFlags, expectedTargetPlatformFlags, cppOnly, Loading @@ -2869,9 +2876,10 @@ func TestIncludeDirectoryOrdering(t *testing.T) { []string{"${config.CommonGlobalAsflags}"}, expectedIncludes, expectedNDKSTLIncludes, lastNDKIncludes, lastNDKFlags, ), expectedPlatform: slices.Concat( expectedPlatformFlags, baseExpectedFlags, expectedTargetPlatformFlags, []string{"${config.CommonGlobalAsflags}"}, Loading
cc/compiler.go +3 −3 Original line number Diff line number Diff line Loading @@ -430,14 +430,14 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps } 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, "-isystem "+getCurrentIncludePath(ctx).String(), "-isystem "+getCurrentIncludePath(ctx).Join(ctx, config.NDKTriple(tc)).String()) "--sysroot "+getNdkSysrootBase(ctx).String()) } else if ctx.Device() { flags.Global.CommonFlags = append(flags.Global.CFlags, "-nostdlibinc") } if ctx.InVendorOrProduct() { Loading
cc/config/global.go +0 −1 Original line number Diff line number Diff line Loading @@ -172,7 +172,6 @@ var ( "-Werror=address", "-Werror=sequence-point", "-Werror=format-security", "-nostdlibinc", } commonGlobalLldflags = []string{ Loading