Merge "Allow SCS for riscv64 too."
This commit is contained in:
@@ -26,12 +26,16 @@ var (
|
|||||||
// Help catch common 32/64-bit errors.
|
// Help catch common 32/64-bit errors.
|
||||||
"-Werror=implicit-function-declaration",
|
"-Werror=implicit-function-declaration",
|
||||||
"-fno-emulated-tls",
|
"-fno-emulated-tls",
|
||||||
|
// For -fsanitize=shadow-call-stack.
|
||||||
|
"-ffixed-x18",
|
||||||
}
|
}
|
||||||
|
|
||||||
riscv64ArchVariantCflags = map[string][]string{}
|
riscv64ArchVariantCflags = map[string][]string{}
|
||||||
|
|
||||||
riscv64Ldflags = []string{
|
riscv64Ldflags = []string{
|
||||||
"-Wl,--hash-style=gnu",
|
"-Wl,--hash-style=gnu",
|
||||||
|
// For -fsanitize=shadow-call-stack.
|
||||||
|
"-ffixed-x18",
|
||||||
}
|
}
|
||||||
|
|
||||||
riscv64Lldflags = append(riscv64Ldflags,
|
riscv64Lldflags = append(riscv64Ldflags,
|
||||||
|
@@ -254,7 +254,7 @@ type SanitizeUserProps struct {
|
|||||||
// This should not be used in Android 11+ : https://source.android.com/devices/tech/debug/scudo
|
// This should not be used in Android 11+ : https://source.android.com/devices/tech/debug/scudo
|
||||||
// deprecated
|
// deprecated
|
||||||
Scudo *bool `android:"arch_variant"`
|
Scudo *bool `android:"arch_variant"`
|
||||||
// shadow-call-stack sanitizer, only available on arm64
|
// shadow-call-stack sanitizer, only available on arm64/riscv64.
|
||||||
Scs *bool `android:"arch_variant"`
|
Scs *bool `android:"arch_variant"`
|
||||||
// Memory-tagging, only available on arm64
|
// Memory-tagging, only available on arm64
|
||||||
// if diag.memtag unset or false, enables async memory tagging
|
// if diag.memtag unset or false, enables async memory tagging
|
||||||
@@ -593,8 +593,8 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) {
|
|||||||
s.Hwaddress = nil
|
s.Hwaddress = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// SCS is only implemented on AArch64.
|
// SCS is only implemented on AArch64/riscv64.
|
||||||
if ctx.Arch().ArchType != android.Arm64 || !ctx.toolchain().Bionic() {
|
if (ctx.Arch().ArchType != android.Arm64 && ctx.Arch().ArchType != android.Riscv64) || !ctx.toolchain().Bionic() {
|
||||||
s.Scs = nil
|
s.Scs = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user