Thanks to visit codestin.com
Credit goes to github.com

Skip to content

M680x0-llvm should understand the m68k-*-*-* triplet #57

@glaubitz

Description

@glaubitz

While working on the Rust backend for m68k based on the M680x0-llvm project, I ran into the problem that the LLVM target m68k-unknown-linux-gnu as I used in [1] was not understood by M680x0-llvm.

Since m68k-*-*-* is the common and widely used triplet name for m68k on Linux and other operating systems, I suggest the following change to the triplet code so that the logic matches the one for SystemZ/s390x:

diff --git a/lib/Support/Triple.cpp b/lib/Support/Triple.cpp
index aea18102646..71017cb8daf 100644
--- a/lib/Support/Triple.cpp
+++ b/lib/Support/Triple.cpp
@@ -69,7 +69,7 @@ StringRef Triple::getArchTypeName(ArchType Kind) {
   case shave:          return "shave";
   case wasm32:         return "wasm32";
   case wasm64:         return "wasm64";
-  case m680x0:         return "m680x0";
+  case m680x0:         return "m68k";
   case renderscript32: return "renderscript32";
   case renderscript64: return "renderscript64";
   }
@@ -391,7 +391,7 @@ static Triple::ArchType parseArch(StringRef ArchName) {
     .Cases("powerpc", "ppc", "ppc32", Triple::ppc)
     .Cases("powerpc64", "ppu", "ppc64", Triple::ppc64)
     .Cases("powerpc64le", "ppc64le", Triple::ppc64le)
-    .Case("m680x0", Triple::m680x0)
+    .Cases("m680x0", "m68k", Triple::m680x0)
     .Case("xscale", Triple::arm)
     .Case("xscaleeb", Triple::armeb)
     .Case("aarch64", Triple::aarch64)

[1] https://github.com/glaubitz/rust/blob/m68k-linux/src/librustc_target/spec/m68k_unknown_linux_gnu.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions