Loading cc/compiler.go +1 −1 Original line number Diff line number Diff line Loading @@ -283,7 +283,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps // 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, tc.ClangTriple()).String()) "-isystem "+getCurrentIncludePath(ctx).Join(ctx, config.NDKTriple(tc)).String()) // Traditionally this has come from android/api-level.h, but with the // libc headers unified it must be set by the build system since we Loading cc/config/arm_device.go +6 −0 Original line number Diff line number Diff line Loading @@ -325,6 +325,12 @@ func (t *toolchainArm) InstructionSetFlags(isa string) (string, error) { } func (t *toolchainArm) ClangTriple() string { // http://b/72619014 work around llvm LTO bug. return "armv7a-linux-androideabi" } func (t *toolchainArm) ndkTriple() string { // Use current NDK include path, while ClangTriple is changed. return t.GccTriple() } Loading cc/config/toolchain.go +15 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,8 @@ type Toolchain interface { ClangLdflags() string ClangInstructionSetFlags(string) (string, error) ndkTriple() string YasmFlags() string WindresFlags() string Loading @@ -87,6 +89,19 @@ type Toolchain interface { type toolchainBase struct { } func (t *toolchainBase) ndkTriple() string { return "" } func NDKTriple(toolchain Toolchain) string { triple := toolchain.ndkTriple() if triple == "" { // Use the clang triple if there is no explicit NDK triple triple = toolchain.ClangTriple() } return triple } func (toolchainBase) InstructionSetFlags(s string) (string, error) { if s != "" { return "", fmt.Errorf("instruction_set: %s is not a supported instruction set", s) Loading cc/makevars.go +1 −1 Original line number Diff line number Diff line Loading @@ -307,7 +307,7 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string, ctx.Strict(makePrefix+"STRIP", gccCmd(toolchain, "strip")) ctx.Strict(makePrefix+"GCC_VERSION", toolchain.GccVersion()) ctx.Strict(makePrefix+"NDK_GCC_VERSION", toolchain.GccVersion()) ctx.Strict(makePrefix+"NDK_TRIPLE", toolchain.ClangTriple()) ctx.Strict(makePrefix+"NDK_TRIPLE", config.NDKTriple(toolchain)) } if target.Os.Class == android.Host || target.Os.Class == android.HostCross { Loading Loading
cc/compiler.go +1 −1 Original line number Diff line number Diff line Loading @@ -283,7 +283,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps // 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, tc.ClangTriple()).String()) "-isystem "+getCurrentIncludePath(ctx).Join(ctx, config.NDKTriple(tc)).String()) // Traditionally this has come from android/api-level.h, but with the // libc headers unified it must be set by the build system since we Loading
cc/config/arm_device.go +6 −0 Original line number Diff line number Diff line Loading @@ -325,6 +325,12 @@ func (t *toolchainArm) InstructionSetFlags(isa string) (string, error) { } func (t *toolchainArm) ClangTriple() string { // http://b/72619014 work around llvm LTO bug. return "armv7a-linux-androideabi" } func (t *toolchainArm) ndkTriple() string { // Use current NDK include path, while ClangTriple is changed. return t.GccTriple() } Loading
cc/config/toolchain.go +15 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,8 @@ type Toolchain interface { ClangLdflags() string ClangInstructionSetFlags(string) (string, error) ndkTriple() string YasmFlags() string WindresFlags() string Loading @@ -87,6 +89,19 @@ type Toolchain interface { type toolchainBase struct { } func (t *toolchainBase) ndkTriple() string { return "" } func NDKTriple(toolchain Toolchain) string { triple := toolchain.ndkTriple() if triple == "" { // Use the clang triple if there is no explicit NDK triple triple = toolchain.ClangTriple() } return triple } func (toolchainBase) InstructionSetFlags(s string) (string, error) { if s != "" { return "", fmt.Errorf("instruction_set: %s is not a supported instruction set", s) Loading
cc/makevars.go +1 −1 Original line number Diff line number Diff line Loading @@ -307,7 +307,7 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string, ctx.Strict(makePrefix+"STRIP", gccCmd(toolchain, "strip")) ctx.Strict(makePrefix+"GCC_VERSION", toolchain.GccVersion()) ctx.Strict(makePrefix+"NDK_GCC_VERSION", toolchain.GccVersion()) ctx.Strict(makePrefix+"NDK_TRIPLE", toolchain.ClangTriple()) ctx.Strict(makePrefix+"NDK_TRIPLE", config.NDKTriple(toolchain)) } if target.Os.Class == android.Host || target.Os.Class == android.HostCross { Loading