Revert "Prevent clang from using the x18 register on arm64."
This reverts commit 98d8580c3a96c672687dd95f1fb1ee534ed36c90.
Change no longer needed with the new LLVM toolchain update.
Bug: 112907825
Bug: 111759196
Change-Id: Ife3ce47a602dd850ac84bb51abc70c0ca157776e
diff --git a/cc/config/arm64_device.go b/cc/config/arm64_device.go
index bcff775..6a63828 100644
--- a/cc/config/arm64_device.go
+++ b/cc/config/arm64_device.go
@@ -25,11 +25,6 @@
arm64Cflags = []string{
// Help catch common 32/64-bit errors.
"-Werror=implicit-function-declaration",
-
- // Prevent use of x18 register.
- // TODO(pcc): Remove this flag once we upgrade past LLVM r340889
- // which does this by default on Android.
- "-ffixed-x18",
}
arm64ArchVariantCflags = map[string][]string{
diff --git a/cc/lto.go b/cc/lto.go
index d9d2662..52b9a34 100644
--- a/cc/lto.go
+++ b/cc/lto.go
@@ -113,13 +113,6 @@
flags.LdFlags = append(flags.LdFlags, "-Wl,-plugin-opt,-inline-threshold=0")
flags.LdFlags = append(flags.LdFlags, "-Wl,-plugin-opt,-unroll-threshold=0")
}
-
- if ctx.Arch().ArchType == android.Arm64 {
- // Prevent use of x18 register on arm64.
- // TODO(pcc): Remove this flag once we upgrade past LLVM r340889
- // which does this by default on Android.
- flags.LdFlags = append(flags.LdFlags, "-Wl,-plugin-opt,-mattr=+reserve-x18")
- }
}
return flags
}
diff --git a/cc/sanitize.go b/cc/sanitize.go
index 527ae33..330a5e3 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -471,13 +471,6 @@
diagSanitizers = append(diagSanitizers, "cfi")
}
- if ctx.Arch().ArchType == android.Arm64 {
- // Prevent use of x18 register on arm64.
- // TODO(pcc): Remove this flag once we upgrade past LLVM r340889
- // which does this by default on Android.
- flags.LdFlags = append(flags.LdFlags, "-Wl,-plugin-opt,-mattr=+reserve-x18")
- }
-
if ctx.staticBinary() {
_, flags.CFlags = removeFromList("-fsanitize-cfi-cross-dso", flags.CFlags)
_, flags.LdFlags = removeFromList("-fsanitize-cfi-cross-dso", flags.LdFlags)