Merge "Scudo minimal runtime support for Soong"
This commit is contained in:
@@ -220,6 +220,10 @@ func ScudoRuntimeLibrary(t Toolchain) string {
|
||||
return LibclangRuntimeLibrary(t, "scudo")
|
||||
}
|
||||
|
||||
func ScudoMinimalRuntimeLibrary(t Toolchain) string {
|
||||
return LibclangRuntimeLibrary(t, "scudo_minimal")
|
||||
}
|
||||
|
||||
func ToolPath(t Toolchain) string {
|
||||
if p := t.ToolPath(); p != "" {
|
||||
return p
|
||||
|
@@ -281,6 +281,7 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string,
|
||||
ctx.Strict(secondPrefix+"UBSAN_MINIMAL_RUNTIME_LIBRARY", strings.TrimSuffix(config.UndefinedBehaviorSanitizerMinimalRuntimeLibrary(toolchain), ".a"))
|
||||
ctx.Strict(secondPrefix+"TSAN_RUNTIME_LIBRARY", strings.TrimSuffix(config.ThreadSanitizerRuntimeLibrary(toolchain), ".so"))
|
||||
ctx.Strict(secondPrefix+"SCUDO_RUNTIME_LIBRARY", strings.TrimSuffix(config.ScudoRuntimeLibrary(toolchain), ".so"))
|
||||
ctx.Strict(secondPrefix+"SCUDO_MINIMAL_RUNTIME_LIBRARY", strings.TrimSuffix(config.ScudoMinimalRuntimeLibrary(toolchain), ".so"))
|
||||
}
|
||||
|
||||
// This is used by external/gentoo/...
|
||||
|
@@ -531,7 +531,11 @@ func (sanitize *sanitize) flags(ctx ModuleContext, flags Flags) Flags {
|
||||
} else if Bool(sanitize.Properties.Sanitize.Thread) {
|
||||
runtimeLibrary = config.ThreadSanitizerRuntimeLibrary(ctx.toolchain())
|
||||
} else if Bool(sanitize.Properties.Sanitize.Scudo) {
|
||||
runtimeLibrary = config.ScudoRuntimeLibrary(ctx.toolchain())
|
||||
if len(diagSanitizers) == 0 && !sanitize.Properties.UbsanRuntimeDep {
|
||||
runtimeLibrary = config.ScudoMinimalRuntimeLibrary(ctx.toolchain())
|
||||
} else {
|
||||
runtimeLibrary = config.ScudoRuntimeLibrary(ctx.toolchain())
|
||||
}
|
||||
} else if len(diagSanitizers) > 0 || sanitize.Properties.UbsanRuntimeDep {
|
||||
runtimeLibrary = config.UndefinedBehaviorSanitizerRuntimeLibrary(ctx.toolchain())
|
||||
}
|
||||
@@ -831,7 +835,6 @@ func hwasanVendorStaticLibs(config android.Config) *[]string {
|
||||
func enableMinimalRuntime(sanitize *sanitize) bool {
|
||||
if !Bool(sanitize.Properties.Sanitize.Address) &&
|
||||
!Bool(sanitize.Properties.Sanitize.Hwaddress) &&
|
||||
!Bool(sanitize.Properties.Sanitize.Scudo) &&
|
||||
(Bool(sanitize.Properties.Sanitize.Integer_overflow) ||
|
||||
len(sanitize.Properties.Sanitize.Misc_undefined) > 0) &&
|
||||
!(Bool(sanitize.Properties.Sanitize.Diag.Integer_overflow) ||
|
||||
|
Reference in New Issue
Block a user