Update flags to match make

Change-Id: I8ba24723d5b507fa178255c124b11356719700cb
This commit is contained in:
Dan Willemsen 2015-09-11 17:41:10 -07:00
parent c3c7556924
commit 3bf6b47229
6 changed files with 36 additions and 7 deletions

View file

@ -21,7 +21,6 @@ var (
"-fno-short-enums",
"-no-canonical-prefixes",
"-fno-canonical-system-headers",
"-include ${SrcDir}/build/core/combo/include/arch/linux-arm64/AndroidConfig.h",
// Help catch common 32/64-bit errors.
"-Werror=pointer-to-int-cast",
@ -47,6 +46,7 @@ var (
"-Wl,--fatal-warnings",
"-Wl,-maarch64linux",
"-Wl,--hash-style=gnu",
"-Wl,--fix-cortex-a53-843419",
// Disable transitive dependency library symbol resolving.
"-Wl,--allow-shlib-undefined",

View file

@ -22,7 +22,6 @@ var (
"-fno-short-enums",
"-no-canonical-prefixes",
"-fno-canonical-system-headers",
"-include ${SrcDir}/build/core/combo/include/arch/linux-arm/AndroidConfig.h",
"-fno-builtin-sin",
"-fno-strict-volatile-bitfields",
@ -130,6 +129,7 @@ func init() {
replaceFirst(armClangArchVariantCflags["armv5te"], "-march=armv5te", "-march=armv5t")
armClangCpuVariantCflags["krait"] = []string{
"-mcpu=krait",
"-mfpu=neon-vfpv4",
}
pctx.StaticVariable("armGccVersion", "4.9")

View file

@ -97,7 +97,10 @@ var (
commonGlobalCppflags = []string{
"-Wsign-promo",
"-std=gnu++11",
}
illegalFlags = []string{
"-w",
}
)
@ -560,6 +563,20 @@ func (c *CCBase) collectFlags(ctx common.AndroidModuleContext, toolchain Toolcha
flags = c.ccModuleType().flags(ctx, flags)
if c.Properties.Sdk_version == "" {
if ctx.Host() && !flags.Clang {
// The host GCC doesn't support C++14 (and is deprecated, so likely
// never will). Build these modules with C++11.
flags.CppFlags = append(flags.CppFlags, "-std=gnu++11")
} else {
flags.CppFlags = append(flags.CppFlags, "-std=gnu++14")
}
}
flags.CFlags, _ = filterList(flags.CFlags, illegalFlags)
flags.CppFlags, _ = filterList(flags.CppFlags, illegalFlags)
flags.ConlyFlags, _ = filterList(flags.ConlyFlags, illegalFlags)
// Optimization to reduce size of build.ninja
// Replace the long list of flags for each file with a module-local variable
ctx.Variable(pctx, "cflags", strings.Join(flags.CFlags, " "))
@ -822,6 +839,10 @@ func (c *CCLinked) flags(ctx common.AndroidModuleContext, flags CCFlags) CCFlags
} else {
flags.LdFlags = append(flags.LdFlags, hostDynamicGccLibs...)
}
} else {
if ctx.Arch().ArchType == common.Arm {
flags.LdFlags = append(flags.LdFlags, "-Wl,--exclude-libs,libunwind_llvm.a")
}
}
case "stlport", "stlport_static":
if ctx.Device() {

View file

@ -10,10 +10,13 @@ var clangUnknownCflags = []string{
"-finline-functions",
"-finline-limit=64",
"-fno-canonical-system-headers",
"-Wno-clobbered",
"-fno-devirtualize",
"-fno-tree-sra",
"-fprefetch-loop-arrays",
"-funswitch-loops",
"-Wmaybe-uninitialized",
"-Wno-error=clobbered",
"-Wno-error=maybe-uninitialized",
"-Wno-error=unused-but-set-parameter",
"-Wno-error=unused-but-set-variable",
@ -50,6 +53,7 @@ var clangUnknownCflags = []string{
// mips + mips64
"-msynci",
"-mno-synci",
"-mno-fused-madd",
// x86 + x86_64
@ -70,6 +74,7 @@ func init() {
// Disable overly aggressive warning for macros defined with a leading underscore
// This happens in AndroidConfig.h, which is included nearly everywhere.
// TODO: can we remove this now?
"-Wno-reserved-id-macro",
// Disable overly aggressive warning for format strings.

View file

@ -14,7 +14,6 @@ var (
"-fPIC",
"-funwind-tables",
"-include ${SrcDir}/build/core/combo/include/arch/darwin-x86/AndroidConfig.h",
// Workaround differences in inttypes.h between host and target.
//See bug 12708004.
@ -52,11 +51,13 @@ var (
darwinX86Ldflags = []string{
"-m32",
"-Wl,-rpath,@loader_path/../lib",
"-Wl,-rpath,@loader_path/lib",
}
darwinX8664Ldflags = []string{
"-m64",
"-Wl,-rpath,@loader_path/../lib64",
"-Wl,-rpath,@loader_path/lib64",
}
darwinClangCflags = append([]string{

View file

@ -16,11 +16,9 @@ var (
"-fPIC",
"-no-canonical-prefixes",
"-include ${SrcDir}/build/core/combo/include/arch/linux-x86/AndroidConfig.h",
// TODO: Set _FORTIFY_SOURCE=2. Bug 20558757.
"-U_FORTIFY_SOURCE",
"-D_FORTIFY_SOURCE=0",
"-D_FORTIFY_SOURCE=2",
"-fstack-protector",
// Workaround differences in inttypes.h between host and target.
@ -46,6 +44,8 @@ var (
"-mfpmath=sse",
"-m32",
"-march=prescott",
"-D_FILE_OFFSET_BITS=64",
"-D_LARGEFILE_SOURCE=1",
}
linuxX8664Cflags = []string{
@ -55,11 +55,13 @@ var (
linuxX86Ldflags = []string{
"-m32",
`-Wl,-rpath,\$$ORIGIN/../lib`,
`-Wl,-rpath,\$$ORIGIN/lib`,
}
linuxX8664Ldflags = []string{
"-m64",
`-Wl,-rpath,\$$ORIGIN/../lib64`,
`-Wl,-rpath,\$$ORIGIN/lib64`,
}
linuxClangCflags = append([]string{