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:
@@ -199,12 +199,14 @@ var (
|
||||
}
|
||||
|
||||
armCpuVariantCflagsVar = map[string]string{
|
||||
"": "",
|
||||
"cortex-a7": "${armCortexA7Cflags}",
|
||||
"cortex-a8": "${armCortexA8Cflags}",
|
||||
"cortex-a15": "${armCortexA15Cflags}",
|
||||
"krait": "${armCortexA15Cflags}",
|
||||
"denver": "${armCortexA15Cflags}",
|
||||
"": "",
|
||||
"cortex-a7": "${armCortexA7Cflags}",
|
||||
"cortex-a8": "${armCortexA8Cflags}",
|
||||
"cortex-a15": "${armCortexA15Cflags}",
|
||||
"cortex-a53": "${armCortexA7Cflags}",
|
||||
"cortex-a53.a57": "${armCortexA7Cflags}",
|
||||
"krait": "${armCortexA15Cflags}",
|
||||
"denver": "${armCortexA15Cflags}",
|
||||
}
|
||||
|
||||
armClangArchVariantCflagsVar = map[string]string{
|
||||
@@ -214,12 +216,14 @@ var (
|
||||
}
|
||||
|
||||
armClangCpuVariantCflagsVar = map[string]string{
|
||||
"": "",
|
||||
"cortex-a7": "${armClangCortexA7Cflags}",
|
||||
"cortex-a8": "${armClangCortexA8Cflags}",
|
||||
"cortex-a15": "${armClangCortexA15Cflags}",
|
||||
"krait": "${armClangKraitCflags}",
|
||||
"denver": "${armClangCortexA15Cflags}",
|
||||
"": "",
|
||||
"cortex-a7": "${armClangCortexA7Cflags}",
|
||||
"cortex-a8": "${armClangCortexA8Cflags}",
|
||||
"cortex-a15": "${armClangCortexA15Cflags}",
|
||||
"cortex-a53": "${armClangCortexA7Cflags}",
|
||||
"cortex-a53.a57": "${armClangCortexA7Cflags}",
|
||||
"krait": "${armClangKraitCflags}",
|
||||
"denver": "${armClangCortexA15Cflags}",
|
||||
}
|
||||
)
|
||||
|
||||
|
@@ -44,10 +44,10 @@ var (
|
||||
blueprint.RuleParams{
|
||||
Depfile: "${out}.d",
|
||||
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",
|
||||
},
|
||||
"ccCmd", "cFlags")
|
||||
"relPwd", "ccCmd", "cFlags")
|
||||
|
||||
ld = pctx.StaticRule("ld",
|
||||
blueprint.RuleParams{
|
||||
@@ -128,6 +128,15 @@ func TransformSourceToObj(ctx common.AndroidModuleContext, subdir string, srcFil
|
||||
srcRoot := ctx.AConfig().SrcDir()
|
||||
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))
|
||||
objDir := common.ModuleObjDir(ctx)
|
||||
if subdir != "" {
|
||||
@@ -200,6 +209,7 @@ func TransformSourceToObj(ctx common.AndroidModuleContext, subdir string, srcFil
|
||||
Args: map[string]string{
|
||||
"cFlags": moduleCflags,
|
||||
"ccCmd": ccCmd,
|
||||
"relPwd": relPwd,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
5
cc/cc.go
5
cc/cc.go
@@ -79,6 +79,8 @@ var (
|
||||
"-Wno-unused",
|
||||
"-Winit-self",
|
||||
"-Wpointer-arith",
|
||||
"-fdiagnostics-color",
|
||||
"-fdebug-prefix-map=/proc/self/cwd=",
|
||||
|
||||
// COMMON_RELEASE_CFLAGS
|
||||
"-DNDEBUG",
|
||||
@@ -838,7 +840,6 @@ func (c *CCLinked) flags(ctx common.AndroidModuleContext, flags CCFlags) CCFlags
|
||||
switch stl {
|
||||
case "libc++", "libc++_static":
|
||||
flags.CFlags = append(flags.CFlags, "-D_USING_LIBCXX")
|
||||
flags.CFlags = append(flags.CFlags, "-I${SrcDir}/external/libcxx/include")
|
||||
if ctx.Host() {
|
||||
flags.CppFlags = append(flags.CppFlags, "-nostdinc++")
|
||||
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 {
|
||||
depNames.StaticLibs = append(depNames.StaticLibs, "libgtest", "libgtest_main")
|
||||
depNames.StaticLibs = append(depNames.StaticLibs, "libgtest_main", "libgtest")
|
||||
depNames = c.CCBinary.depNames(ctx, 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
|
||||
var clangUnknownCflags = []string{
|
||||
var clangUnknownCflags = sorted([]string{
|
||||
"-finline-functions",
|
||||
"-finline-limit=64",
|
||||
"-fno-canonical-system-headers",
|
||||
@@ -30,6 +30,8 @@ var clangUnknownCflags = []string{
|
||||
"-Wno-unused-local-typedefs",
|
||||
"-Wunused-but-set-parameter",
|
||||
"-Wunused-but-set-variable",
|
||||
"-fdiagnostics-color",
|
||||
"-fdebug-prefix-map=/proc/self/cwd=",
|
||||
|
||||
// arm + arm64 + mips + mips64
|
||||
"-fgcse-after-reload",
|
||||
@@ -61,11 +63,9 @@ var clangUnknownCflags = []string{
|
||||
"-fno-inline-functions-called-once",
|
||||
"-mfpmath=sse",
|
||||
"-mbionic",
|
||||
}
|
||||
})
|
||||
|
||||
func init() {
|
||||
sort.Strings(clangUnknownCflags)
|
||||
|
||||
pctx.StaticVariable("clangExtraCflags", strings.Join([]string{
|
||||
"-D__compiler_offsetof=__builtin_offsetof",
|
||||
|
||||
@@ -88,6 +88,10 @@ func init() {
|
||||
// Disable -Winconsistent-missing-override until we can clean up the existing
|
||||
// codebase for it.
|
||||
"-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{
|
||||
@@ -120,3 +124,8 @@ func inListSorted(s string, list []string) bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func sorted(list []string) []string {
|
||||
sort.Strings(list)
|
||||
return list
|
||||
}
|
||||
|
Reference in New Issue
Block a user