[PATCH] D144998: [llvm] Prevent building for riscv32-unknown-fuchsia

Leonard Chan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 28 12:20:34 PST 2023


leonardchan created this revision.
leonardchan added reviewers: phosek, asb.
Herald added subscribers: luke, VincentWu, abrachet, vkmr, frasercrmck, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya, arichardson.
Herald added a project: All.
leonardchan requested review of this revision.
Herald added subscribers: pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

Fuchsia is exclusively 64-bit so this throw an error when using this triple.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144998

Files:
  llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
  llvm/test/CodeGen/RISCV/rv32-fuchsia.ll


Index: llvm/test/CodeGen/RISCV/rv32-fuchsia.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/RISCV/rv32-fuchsia.ll
@@ -0,0 +1,6 @@
+; RUN: not --crash llc -mtriple=riscv32-unknown-fuchsia < %s 2>&1 | FileCheck %s
+
+; CHECK: LLVM ERROR: Fuchsia is only supported for 64-bit
+define void @nothing() nounwind {
+  ret void
+}
Index: llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
===================================================================
--- llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
+++ llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
@@ -111,6 +111,9 @@
   // RISC-V supports the MachineOutliner.
   setMachineOutliner(true);
   setSupportsDefaultOutlining(true);
+
+  if (TT.isOSFuchsia() && !TT.isArch64Bit())
+    report_fatal_error("Fuchsia is only supported for 64-bit");
 }
 
 const RISCVSubtarget *


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144998.501258.patch
Type: text/x-patch
Size: 872 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230228/5825e296/attachment.bin>


More information about the llvm-commits mailing list