Updates from make
Contains equivalent changes for: 561b4c1 Set mcpu targets based on cpu variant. 6a66a88 Stop encoding absolute paths in symbols 63e3b02 Enable color output from gcc and clang eb3e3fa Use exported includes for libc++. 3a0a891 Link libgtest_main before libgtest Change-Id: I45a06c02e9af1d40f0c52f1e6a20d6cd382a27fb
This commit is contained in:
@@ -203,6 +203,8 @@ var (
|
|||||||
"cortex-a7": "${armCortexA7Cflags}",
|
"cortex-a7": "${armCortexA7Cflags}",
|
||||||
"cortex-a8": "${armCortexA8Cflags}",
|
"cortex-a8": "${armCortexA8Cflags}",
|
||||||
"cortex-a15": "${armCortexA15Cflags}",
|
"cortex-a15": "${armCortexA15Cflags}",
|
||||||
|
"cortex-a53": "${armCortexA7Cflags}",
|
||||||
|
"cortex-a53.a57": "${armCortexA7Cflags}",
|
||||||
"krait": "${armCortexA15Cflags}",
|
"krait": "${armCortexA15Cflags}",
|
||||||
"denver": "${armCortexA15Cflags}",
|
"denver": "${armCortexA15Cflags}",
|
||||||
}
|
}
|
||||||
@@ -218,6 +220,8 @@ var (
|
|||||||
"cortex-a7": "${armClangCortexA7Cflags}",
|
"cortex-a7": "${armClangCortexA7Cflags}",
|
||||||
"cortex-a8": "${armClangCortexA8Cflags}",
|
"cortex-a8": "${armClangCortexA8Cflags}",
|
||||||
"cortex-a15": "${armClangCortexA15Cflags}",
|
"cortex-a15": "${armClangCortexA15Cflags}",
|
||||||
|
"cortex-a53": "${armClangCortexA7Cflags}",
|
||||||
|
"cortex-a53.a57": "${armClangCortexA7Cflags}",
|
||||||
"krait": "${armClangKraitCflags}",
|
"krait": "${armClangKraitCflags}",
|
||||||
"denver": "${armClangCortexA15Cflags}",
|
"denver": "${armClangCortexA15Cflags}",
|
||||||
}
|
}
|
||||||
|
@@ -44,10 +44,10 @@ var (
|
|||||||
blueprint.RuleParams{
|
blueprint.RuleParams{
|
||||||
Depfile: "${out}.d",
|
Depfile: "${out}.d",
|
||||||
Deps: blueprint.DepsGCC,
|
Deps: blueprint.DepsGCC,
|
||||||
Command: "$ccCmd -c $cFlags -MD -MF ${out}.d -o $out $in",
|
Command: "$relPwd $ccCmd -c $cFlags -MD -MF ${out}.d -o $out $in",
|
||||||
Description: "cc $out",
|
Description: "cc $out",
|
||||||
},
|
},
|
||||||
"ccCmd", "cFlags")
|
"relPwd", "ccCmd", "cFlags")
|
||||||
|
|
||||||
ld = pctx.StaticRule("ld",
|
ld = pctx.StaticRule("ld",
|
||||||
blueprint.RuleParams{
|
blueprint.RuleParams{
|
||||||
@@ -128,6 +128,15 @@ func TransformSourceToObj(ctx common.AndroidModuleContext, subdir string, srcFil
|
|||||||
srcRoot := ctx.AConfig().SrcDir()
|
srcRoot := ctx.AConfig().SrcDir()
|
||||||
intermediatesRoot := ctx.AConfig().IntermediatesDir()
|
intermediatesRoot := ctx.AConfig().IntermediatesDir()
|
||||||
|
|
||||||
|
// We run gcc/clang with PWD=/proc/self/cwd to remove $TOP from the
|
||||||
|
// debug output. That way two builds in two different directories will
|
||||||
|
// create the same output.
|
||||||
|
relPwd := "PWD=/proc/self/cwd"
|
||||||
|
if ctx.Darwin() {
|
||||||
|
// /proc doesn't exist on Darwin
|
||||||
|
relPwd = ""
|
||||||
|
}
|
||||||
|
|
||||||
objFiles = make([]string, len(srcFiles))
|
objFiles = make([]string, len(srcFiles))
|
||||||
objDir := common.ModuleObjDir(ctx)
|
objDir := common.ModuleObjDir(ctx)
|
||||||
if subdir != "" {
|
if subdir != "" {
|
||||||
@@ -200,6 +209,7 @@ func TransformSourceToObj(ctx common.AndroidModuleContext, subdir string, srcFil
|
|||||||
Args: map[string]string{
|
Args: map[string]string{
|
||||||
"cFlags": moduleCflags,
|
"cFlags": moduleCflags,
|
||||||
"ccCmd": ccCmd,
|
"ccCmd": ccCmd,
|
||||||
|
"relPwd": relPwd,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
5
cc/cc.go
5
cc/cc.go
@@ -79,6 +79,8 @@ var (
|
|||||||
"-Wno-unused",
|
"-Wno-unused",
|
||||||
"-Winit-self",
|
"-Winit-self",
|
||||||
"-Wpointer-arith",
|
"-Wpointer-arith",
|
||||||
|
"-fdiagnostics-color",
|
||||||
|
"-fdebug-prefix-map=/proc/self/cwd=",
|
||||||
|
|
||||||
// COMMON_RELEASE_CFLAGS
|
// COMMON_RELEASE_CFLAGS
|
||||||
"-DNDEBUG",
|
"-DNDEBUG",
|
||||||
@@ -838,7 +840,6 @@ func (c *CCLinked) flags(ctx common.AndroidModuleContext, flags CCFlags) CCFlags
|
|||||||
switch stl {
|
switch stl {
|
||||||
case "libc++", "libc++_static":
|
case "libc++", "libc++_static":
|
||||||
flags.CFlags = append(flags.CFlags, "-D_USING_LIBCXX")
|
flags.CFlags = append(flags.CFlags, "-D_USING_LIBCXX")
|
||||||
flags.CFlags = append(flags.CFlags, "-I${SrcDir}/external/libcxx/include")
|
|
||||||
if ctx.Host() {
|
if ctx.Host() {
|
||||||
flags.CppFlags = append(flags.CppFlags, "-nostdinc++")
|
flags.CppFlags = append(flags.CppFlags, "-nostdinc++")
|
||||||
flags.LdFlags = append(flags.LdFlags, "-nodefaultlibs")
|
flags.LdFlags = append(flags.LdFlags, "-nodefaultlibs")
|
||||||
@@ -1551,7 +1552,7 @@ func (c *CCTest) flags(ctx common.AndroidModuleContext, flags CCFlags) CCFlags {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *CCTest) depNames(ctx common.AndroidBaseContext, depNames CCDeps) CCDeps {
|
func (c *CCTest) depNames(ctx common.AndroidBaseContext, depNames CCDeps) CCDeps {
|
||||||
depNames.StaticLibs = append(depNames.StaticLibs, "libgtest", "libgtest_main")
|
depNames.StaticLibs = append(depNames.StaticLibs, "libgtest_main", "libgtest")
|
||||||
depNames = c.CCBinary.depNames(ctx, depNames)
|
depNames = c.CCBinary.depNames(ctx, depNames)
|
||||||
return depNames
|
return depNames
|
||||||
}
|
}
|
||||||
|
17
cc/clang.go
17
cc/clang.go
@@ -6,7 +6,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Cflags that should be filtered out when compiling with clang
|
// Cflags that should be filtered out when compiling with clang
|
||||||
var clangUnknownCflags = []string{
|
var clangUnknownCflags = sorted([]string{
|
||||||
"-finline-functions",
|
"-finline-functions",
|
||||||
"-finline-limit=64",
|
"-finline-limit=64",
|
||||||
"-fno-canonical-system-headers",
|
"-fno-canonical-system-headers",
|
||||||
@@ -30,6 +30,8 @@ var clangUnknownCflags = []string{
|
|||||||
"-Wno-unused-local-typedefs",
|
"-Wno-unused-local-typedefs",
|
||||||
"-Wunused-but-set-parameter",
|
"-Wunused-but-set-parameter",
|
||||||
"-Wunused-but-set-variable",
|
"-Wunused-but-set-variable",
|
||||||
|
"-fdiagnostics-color",
|
||||||
|
"-fdebug-prefix-map=/proc/self/cwd=",
|
||||||
|
|
||||||
// arm + arm64 + mips + mips64
|
// arm + arm64 + mips + mips64
|
||||||
"-fgcse-after-reload",
|
"-fgcse-after-reload",
|
||||||
@@ -61,11 +63,9 @@ var clangUnknownCflags = []string{
|
|||||||
"-fno-inline-functions-called-once",
|
"-fno-inline-functions-called-once",
|
||||||
"-mfpmath=sse",
|
"-mfpmath=sse",
|
||||||
"-mbionic",
|
"-mbionic",
|
||||||
}
|
})
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
sort.Strings(clangUnknownCflags)
|
|
||||||
|
|
||||||
pctx.StaticVariable("clangExtraCflags", strings.Join([]string{
|
pctx.StaticVariable("clangExtraCflags", strings.Join([]string{
|
||||||
"-D__compiler_offsetof=__builtin_offsetof",
|
"-D__compiler_offsetof=__builtin_offsetof",
|
||||||
|
|
||||||
@@ -88,6 +88,10 @@ func init() {
|
|||||||
// Disable -Winconsistent-missing-override until we can clean up the existing
|
// Disable -Winconsistent-missing-override until we can clean up the existing
|
||||||
// codebase for it.
|
// codebase for it.
|
||||||
"-Wno-inconsistent-missing-override",
|
"-Wno-inconsistent-missing-override",
|
||||||
|
|
||||||
|
// Force clang to always output color diagnostics. Ninja will strip the ANSI
|
||||||
|
// color codes if it is not running in a terminal.
|
||||||
|
"-fcolor-diagnostics",
|
||||||
}, " "))
|
}, " "))
|
||||||
|
|
||||||
pctx.StaticVariable("clangExtraConlyflags", strings.Join([]string{
|
pctx.StaticVariable("clangExtraConlyflags", strings.Join([]string{
|
||||||
@@ -120,3 +124,8 @@ func inListSorted(s string, list []string) bool {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func sorted(list []string) []string {
|
||||||
|
sort.Strings(list)
|
||||||
|
return list
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user