Merge "Normalize LANG / LC_* environment"
diff --git a/OWNERS b/OWNERS
index 004d638..c0c3762 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,7 +1,9 @@
ccross@android.com
dwillemsen@google.com
+nanzhang@google.com
per-file * = ccross@android.com
per-file * = dwillemsen@google.com
+per-file * = nanzhang@google.com
per-file *gen_stub_libs.py = danalbert@google.com
per-file ndk_*.go = danalbert@google.com
diff --git a/android/config.go b/android/config.go
index 5d38d71..43d743b 100644
--- a/android/config.go
+++ b/android/config.go
@@ -712,13 +712,6 @@
return PrefixInList(path, *c.ProductVariables.CFIExcludePaths)
}
-func (c *config) IntegerOverflowEnabledForPath(path string) bool {
- if c.ProductVariables.IntegerOverflowIncludePaths == nil {
- return false
- }
- return PrefixInList(path, *c.ProductVariables.IntegerOverflowIncludePaths)
-}
-
func (c *config) CFIEnabledForPath(path string) bool {
if c.ProductVariables.CFIIncludePaths == nil {
return false
diff --git a/android/variable.go b/android/variable.go
index aa751a0..d58ed6a 100644
--- a/android/variable.go
+++ b/android/variable.go
@@ -167,7 +167,6 @@
MinimizeJavaDebugInfo *bool `json:",omitempty"`
IntegerOverflowExcludePaths *[]string `json:",omitempty"`
- IntegerOverflowIncludePaths *[]string `json:",omitempty"`
EnableCFI *bool `json:",omitempty"`
CFIExcludePaths *[]string `json:",omitempty"`
diff --git a/cc/config/global.go b/cc/config/global.go
index ef710c8..5e99cde 100644
--- a/cc/config/global.go
+++ b/cc/config/global.go
@@ -112,7 +112,7 @@
ExperimentalCStdVersion = "gnu11"
ExperimentalCppStdVersion = "gnu++1z"
- NdkMaxPrebuiltVersionInt = 24
+ NdkMaxPrebuiltVersionInt = 27
// prebuilts/clang default settings.
ClangDefaultBase = "prebuilts/clang/host"
diff --git a/cc/library.go b/cc/library.go
index 0ed1848..9661f44 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -729,7 +729,8 @@
}
if Bool(library.Properties.Static_ndk_lib) && library.static() &&
- !ctx.useVndk() && ctx.Device() {
+ !ctx.useVndk() && ctx.Device() &&
+ library.sanitize.isUnsanitizedVariant() {
installPath := getNdkSysrootBase(ctx).Join(
ctx, "usr/lib", ctx.toolchain().ClangTriple(), file.Base())
diff --git a/cc/sanitize.go b/cc/sanitize.go
index 859478b..02aedc8 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -232,14 +232,6 @@
}
}
- // Enable Integer Overflow for all components in the include paths
- if !ctx.Host() && ctx.Config().IntegerOverflowEnabledForPath(ctx.ModuleDir()) && s.Integer_overflow == nil {
- s.Integer_overflow = boolPtr(true)
- if inList("integer_overflow", ctx.Config().SanitizeDeviceDiag()) {
- s.Diag.Integer_overflow = boolPtr(true)
- }
- }
-
// CFI needs gold linker, and mips toolchain does not have one.
if !ctx.Config().EnableCFI() || ctx.Arch().ArchType == android.Mips || ctx.Arch().ArchType == android.Mips64 {
s.Cfi = nil
@@ -425,7 +417,6 @@
sanitizers = append(sanitizers, "unsigned-integer-overflow")
sanitizers = append(sanitizers, "signed-integer-overflow")
flags.CFlags = append(flags.CFlags, intOverflowCflags...)
-
if Bool(sanitize.Properties.Sanitize.Diag.Integer_overflow) {
diagSanitizers = append(diagSanitizers, "unsigned-integer-overflow")
diagSanitizers = append(diagSanitizers, "signed-integer-overflow")
@@ -433,8 +424,6 @@
}
}
- diagSanitizeArgs := "-fno-sanitize-trap=" + strings.Join(diagSanitizers, ",")
-
if len(sanitizers) > 0 {
sanitizeArg := "-fsanitize=" + strings.Join(sanitizers, ",")
flags.CFlags = append(flags.CFlags, sanitizeArg)
@@ -447,19 +436,10 @@
} else {
flags.CFlags = append(flags.CFlags, "-fsanitize-trap=all", "-ftrap-function=abort")
}
-
- // Specific settings for userdebug and eng builds
- if Bool(ctx.Config().ProductVariables.Debuggable) {
- // TODO(ivanlozano): uncomment after switch to clang-4536805.
- // Run integer overflow sanitizers with the minimal runtime diagnostics.
- if strings.Contains(sanitizeArg, "integer") && !strings.Contains(diagSanitizeArgs, "integer") && !Bool(sanitize.Properties.Sanitize.Address) {
- //flags.CFlags = append(flags.CFlags, "-fsanitize-minimal-runtime")
- }
- }
}
if len(diagSanitizers) > 0 {
- flags.CFlags = append(flags.CFlags, diagSanitizeArgs)
+ flags.CFlags = append(flags.CFlags, "-fno-sanitize-trap="+strings.Join(diagSanitizers, ","))
}
// FIXME: enable RTTI if diag + (cfi or vptr)
@@ -534,6 +514,12 @@
}
}
+func (sanitize *sanitize) isUnsanitizedVariant() bool {
+ return !sanitize.isSanitizerEnabled(asan) &&
+ !sanitize.isSanitizerEnabled(tsan) &&
+ !sanitize.isSanitizerEnabled(cfi)
+}
+
func (sanitize *sanitize) SetSanitizer(t sanitizerType, b bool) {
switch t {
case asan: