[clang] [llvm] riscv: Support -mstack-protector-guard=tls (PR #108942)

Keith Packard via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 19 13:05:59 PDT 2024


================
@@ -3644,13 +3645,28 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC,
           << A->getOption().getName() << Value << "sysreg global";
       return;
     }
+    if (EffectiveTriple.isRISCV()) {
+      if (Value != "tls" && Value != "global") {
+        D.Diag(diag::err_drv_invalid_value_with_suggestion)
+            << A->getOption().getName() << Value << "tls global";
+        return;
+      }
+      if (Value == "tls") {
----------------
keith-packard wrote:

Could probably be, but I felt it would be easier to review if I didn't attempt to refactor the code at the same time new functionality was being added.

https://github.com/llvm/llvm-project/pull/108942


More information about the cfe-commits mailing list