Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
glaubitz opened this issue Feb 11, 2019 · 0 comments
Open

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

glaubitz opened this issue Feb 11, 2019 · 0 comments

Comments

@glaubitz
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant