Merge "Switch to clang 7.0"
am: 055fa01693
Change-Id: Ic14a560f3f3cb99765dd68aec99b946bc9054907
This commit is contained in:
@@ -67,7 +67,9 @@ var (
|
||||
|
||||
partialLd = pctx.AndroidStaticRule("partialLd",
|
||||
blueprint.RuleParams{
|
||||
Command: "$ldCmd -nostdlib -Wl,-r ${in} -o ${out} ${ldFlags}",
|
||||
// Without -no-pie, clang 7.0 adds -pie to link Android files,
|
||||
// but -r and -pie cannot be used together.
|
||||
Command: "$ldCmd -nostdlib -no-pie -Wl,-r ${in} -o ${out} ${ldFlags}",
|
||||
CommandDeps: []string{"$ldCmd"},
|
||||
},
|
||||
"ldCmd", "ldFlags")
|
||||
|
@@ -36,6 +36,7 @@ var ClangUnknownCflags = sorted([]string{
|
||||
"-Wno-error=maybe-uninitialized",
|
||||
"-Wno-error=unused-but-set-parameter",
|
||||
"-Wno-error=unused-but-set-variable",
|
||||
"-Wno-extended-offsetof",
|
||||
"-Wno-free-nonheap-object",
|
||||
"-Wno-literal-suffix",
|
||||
"-Wno-maybe-uninitialized",
|
||||
@@ -116,6 +117,10 @@ func init() {
|
||||
|
||||
// http://b/68236239 Allow 0/NULL instead of using nullptr everywhere.
|
||||
"-Wno-zero-as-null-pointer-constant",
|
||||
|
||||
// Warnings from clang-7.0
|
||||
"-Wno-deprecated-register",
|
||||
"-Wno-sign-compare",
|
||||
}, " "))
|
||||
|
||||
pctx.StaticVariable("ClangExtraCppflags", strings.Join([]string{
|
||||
@@ -151,6 +156,9 @@ func init() {
|
||||
// http://b/72331526 Disable -Wtautological-* until the instances detected by these
|
||||
// new warnings are fixed.
|
||||
"-Wno-tautological-constant-compare",
|
||||
"-Wno-tautological-type-limit-compare",
|
||||
"-Wno-tautological-unsigned-enum-zero-compare",
|
||||
"-Wno-tautological-unsigned-zero-compare",
|
||||
|
||||
// http://b/72331524 Allow null pointer arithmetic until the instances detected by
|
||||
// this new warning are fixed.
|
||||
|
@@ -116,8 +116,8 @@ var (
|
||||
|
||||
// prebuilts/clang default settings.
|
||||
ClangDefaultBase = "prebuilts/clang/host"
|
||||
ClangDefaultVersion = "clang-4639204"
|
||||
ClangDefaultShortVersion = "6.0.1"
|
||||
ClangDefaultVersion = "clang-4679922"
|
||||
ClangDefaultShortVersion = "7.0.1"
|
||||
|
||||
// Directories with warnings from Android.bp files.
|
||||
WarningAllowedProjects = []string{
|
||||
|
@@ -95,12 +95,6 @@ func (lto *lto) flags(ctx BaseModuleContext, flags Flags) Flags {
|
||||
flags.LdFlags = append(flags.LdFlags, cachePolicyFormat+policy)
|
||||
}
|
||||
|
||||
if ctx.Device() {
|
||||
// Work around bug in Clang that doesn't pass correct emulated
|
||||
// TLS option to target. See b/72706604 or
|
||||
// https://github.com/android-ndk/ndk/issues/498.
|
||||
flags.LdFlags = append(flags.LdFlags, "-Wl,-plugin-opt,-emulated-tls")
|
||||
}
|
||||
flags.ArGoldPlugin = true
|
||||
|
||||
// If the module does not have a profile, be conservative and do not inline
|
||||
|
@@ -407,12 +407,6 @@ func (sanitize *sanitize) flags(ctx ModuleContext, flags Flags) Flags {
|
||||
flags.CFlags = append(flags.CFlags, "-fvisibility=default")
|
||||
}
|
||||
flags.LdFlags = append(flags.LdFlags, cfiLdflags...)
|
||||
if ctx.Device() {
|
||||
// Work around a bug in Clang. The CFI sanitizer requires LTO, and when
|
||||
// LTO is enabled, the Clang driver fails to enable emutls for Android.
|
||||
// See b/72706604 or https://github.com/android-ndk/ndk/issues/498.
|
||||
flags.LdFlags = append(flags.LdFlags, "-Wl,-plugin-opt,-emulated-tls")
|
||||
}
|
||||
flags.ArGoldPlugin = true
|
||||
if Bool(sanitize.Properties.Sanitize.Diag.Cfi) {
|
||||
diagSanitizers = append(diagSanitizers, "cfi")
|
||||
|
Reference in New Issue
Block a user