Update flags to match make
Change-Id: I8ba24723d5b507fa178255c124b11356719700cb
This commit is contained in:
@@ -21,7 +21,6 @@ var (
|
|||||||
"-fno-short-enums",
|
"-fno-short-enums",
|
||||||
"-no-canonical-prefixes",
|
"-no-canonical-prefixes",
|
||||||
"-fno-canonical-system-headers",
|
"-fno-canonical-system-headers",
|
||||||
"-include ${SrcDir}/build/core/combo/include/arch/linux-arm64/AndroidConfig.h",
|
|
||||||
|
|
||||||
// Help catch common 32/64-bit errors.
|
// Help catch common 32/64-bit errors.
|
||||||
"-Werror=pointer-to-int-cast",
|
"-Werror=pointer-to-int-cast",
|
||||||
@@ -47,6 +46,7 @@ var (
|
|||||||
"-Wl,--fatal-warnings",
|
"-Wl,--fatal-warnings",
|
||||||
"-Wl,-maarch64linux",
|
"-Wl,-maarch64linux",
|
||||||
"-Wl,--hash-style=gnu",
|
"-Wl,--hash-style=gnu",
|
||||||
|
"-Wl,--fix-cortex-a53-843419",
|
||||||
|
|
||||||
// Disable transitive dependency library symbol resolving.
|
// Disable transitive dependency library symbol resolving.
|
||||||
"-Wl,--allow-shlib-undefined",
|
"-Wl,--allow-shlib-undefined",
|
||||||
|
@@ -22,7 +22,6 @@ var (
|
|||||||
"-fno-short-enums",
|
"-fno-short-enums",
|
||||||
"-no-canonical-prefixes",
|
"-no-canonical-prefixes",
|
||||||
"-fno-canonical-system-headers",
|
"-fno-canonical-system-headers",
|
||||||
"-include ${SrcDir}/build/core/combo/include/arch/linux-arm/AndroidConfig.h",
|
|
||||||
|
|
||||||
"-fno-builtin-sin",
|
"-fno-builtin-sin",
|
||||||
"-fno-strict-volatile-bitfields",
|
"-fno-strict-volatile-bitfields",
|
||||||
@@ -130,6 +129,7 @@ func init() {
|
|||||||
replaceFirst(armClangArchVariantCflags["armv5te"], "-march=armv5te", "-march=armv5t")
|
replaceFirst(armClangArchVariantCflags["armv5te"], "-march=armv5te", "-march=armv5t")
|
||||||
armClangCpuVariantCflags["krait"] = []string{
|
armClangCpuVariantCflags["krait"] = []string{
|
||||||
"-mcpu=krait",
|
"-mcpu=krait",
|
||||||
|
"-mfpu=neon-vfpv4",
|
||||||
}
|
}
|
||||||
|
|
||||||
pctx.StaticVariable("armGccVersion", "4.9")
|
pctx.StaticVariable("armGccVersion", "4.9")
|
||||||
|
23
cc/cc.go
23
cc/cc.go
@@ -97,7 +97,10 @@ var (
|
|||||||
|
|
||||||
commonGlobalCppflags = []string{
|
commonGlobalCppflags = []string{
|
||||||
"-Wsign-promo",
|
"-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)
|
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
|
// Optimization to reduce size of build.ninja
|
||||||
// Replace the long list of flags for each file with a module-local variable
|
// Replace the long list of flags for each file with a module-local variable
|
||||||
ctx.Variable(pctx, "cflags", strings.Join(flags.CFlags, " "))
|
ctx.Variable(pctx, "cflags", strings.Join(flags.CFlags, " "))
|
||||||
@@ -822,6 +839,10 @@ func (c *CCLinked) flags(ctx common.AndroidModuleContext, flags CCFlags) CCFlags
|
|||||||
} else {
|
} else {
|
||||||
flags.LdFlags = append(flags.LdFlags, hostDynamicGccLibs...)
|
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":
|
case "stlport", "stlport_static":
|
||||||
if ctx.Device() {
|
if ctx.Device() {
|
||||||
|
@@ -10,10 +10,13 @@ var clangUnknownCflags = []string{
|
|||||||
"-finline-functions",
|
"-finline-functions",
|
||||||
"-finline-limit=64",
|
"-finline-limit=64",
|
||||||
"-fno-canonical-system-headers",
|
"-fno-canonical-system-headers",
|
||||||
|
"-Wno-clobbered",
|
||||||
|
"-fno-devirtualize",
|
||||||
"-fno-tree-sra",
|
"-fno-tree-sra",
|
||||||
"-fprefetch-loop-arrays",
|
"-fprefetch-loop-arrays",
|
||||||
"-funswitch-loops",
|
"-funswitch-loops",
|
||||||
"-Wmaybe-uninitialized",
|
"-Wmaybe-uninitialized",
|
||||||
|
"-Wno-error=clobbered",
|
||||||
"-Wno-error=maybe-uninitialized",
|
"-Wno-error=maybe-uninitialized",
|
||||||
"-Wno-error=unused-but-set-parameter",
|
"-Wno-error=unused-but-set-parameter",
|
||||||
"-Wno-error=unused-but-set-variable",
|
"-Wno-error=unused-but-set-variable",
|
||||||
@@ -50,6 +53,7 @@ var clangUnknownCflags = []string{
|
|||||||
|
|
||||||
// mips + mips64
|
// mips + mips64
|
||||||
"-msynci",
|
"-msynci",
|
||||||
|
"-mno-synci",
|
||||||
"-mno-fused-madd",
|
"-mno-fused-madd",
|
||||||
|
|
||||||
// x86 + x86_64
|
// x86 + x86_64
|
||||||
@@ -70,6 +74,7 @@ func init() {
|
|||||||
|
|
||||||
// Disable overly aggressive warning for macros defined with a leading underscore
|
// Disable overly aggressive warning for macros defined with a leading underscore
|
||||||
// This happens in AndroidConfig.h, which is included nearly everywhere.
|
// This happens in AndroidConfig.h, which is included nearly everywhere.
|
||||||
|
// TODO: can we remove this now?
|
||||||
"-Wno-reserved-id-macro",
|
"-Wno-reserved-id-macro",
|
||||||
|
|
||||||
// Disable overly aggressive warning for format strings.
|
// Disable overly aggressive warning for format strings.
|
||||||
|
@@ -14,7 +14,6 @@ var (
|
|||||||
|
|
||||||
"-fPIC",
|
"-fPIC",
|
||||||
"-funwind-tables",
|
"-funwind-tables",
|
||||||
"-include ${SrcDir}/build/core/combo/include/arch/darwin-x86/AndroidConfig.h",
|
|
||||||
|
|
||||||
// Workaround differences in inttypes.h between host and target.
|
// Workaround differences in inttypes.h between host and target.
|
||||||
//See bug 12708004.
|
//See bug 12708004.
|
||||||
@@ -52,11 +51,13 @@ var (
|
|||||||
darwinX86Ldflags = []string{
|
darwinX86Ldflags = []string{
|
||||||
"-m32",
|
"-m32",
|
||||||
"-Wl,-rpath,@loader_path/../lib",
|
"-Wl,-rpath,@loader_path/../lib",
|
||||||
|
"-Wl,-rpath,@loader_path/lib",
|
||||||
}
|
}
|
||||||
|
|
||||||
darwinX8664Ldflags = []string{
|
darwinX8664Ldflags = []string{
|
||||||
"-m64",
|
"-m64",
|
||||||
"-Wl,-rpath,@loader_path/../lib64",
|
"-Wl,-rpath,@loader_path/../lib64",
|
||||||
|
"-Wl,-rpath,@loader_path/lib64",
|
||||||
}
|
}
|
||||||
|
|
||||||
darwinClangCflags = append([]string{
|
darwinClangCflags = append([]string{
|
||||||
|
@@ -16,11 +16,9 @@ var (
|
|||||||
|
|
||||||
"-fPIC",
|
"-fPIC",
|
||||||
"-no-canonical-prefixes",
|
"-no-canonical-prefixes",
|
||||||
"-include ${SrcDir}/build/core/combo/include/arch/linux-x86/AndroidConfig.h",
|
|
||||||
|
|
||||||
// TODO: Set _FORTIFY_SOURCE=2. Bug 20558757.
|
|
||||||
"-U_FORTIFY_SOURCE",
|
"-U_FORTIFY_SOURCE",
|
||||||
"-D_FORTIFY_SOURCE=0",
|
"-D_FORTIFY_SOURCE=2",
|
||||||
"-fstack-protector",
|
"-fstack-protector",
|
||||||
|
|
||||||
// Workaround differences in inttypes.h between host and target.
|
// Workaround differences in inttypes.h between host and target.
|
||||||
@@ -46,6 +44,8 @@ var (
|
|||||||
"-mfpmath=sse",
|
"-mfpmath=sse",
|
||||||
"-m32",
|
"-m32",
|
||||||
"-march=prescott",
|
"-march=prescott",
|
||||||
|
"-D_FILE_OFFSET_BITS=64",
|
||||||
|
"-D_LARGEFILE_SOURCE=1",
|
||||||
}
|
}
|
||||||
|
|
||||||
linuxX8664Cflags = []string{
|
linuxX8664Cflags = []string{
|
||||||
@@ -55,11 +55,13 @@ var (
|
|||||||
linuxX86Ldflags = []string{
|
linuxX86Ldflags = []string{
|
||||||
"-m32",
|
"-m32",
|
||||||
`-Wl,-rpath,\$$ORIGIN/../lib`,
|
`-Wl,-rpath,\$$ORIGIN/../lib`,
|
||||||
|
`-Wl,-rpath,\$$ORIGIN/lib`,
|
||||||
}
|
}
|
||||||
|
|
||||||
linuxX8664Ldflags = []string{
|
linuxX8664Ldflags = []string{
|
||||||
"-m64",
|
"-m64",
|
||||||
`-Wl,-rpath,\$$ORIGIN/../lib64`,
|
`-Wl,-rpath,\$$ORIGIN/../lib64`,
|
||||||
|
`-Wl,-rpath,\$$ORIGIN/lib64`,
|
||||||
}
|
}
|
||||||
|
|
||||||
linuxClangCflags = append([]string{
|
linuxClangCflags = append([]string{
|
||||||
|
Reference in New Issue
Block a user