[PATCH] D88393: [cfe][M68k] (Patch 7/8) Basic Clang support

Jessica Clarke via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 20 10:56:59 PST 2020


jrtc27 added inline comments.


================
Comment at: clang/lib/Basic/Targets/M68k.cpp:38-50
+  // M68k pointers are always 32 bit wide even for 16 bit cpus
+  Layout += "-p:32:32";
+
+  // M68k integer data types
+  Layout += "-i8:8:8-i16:16:16-i32:32:32";
+
+  // FIXME no floats at the moment
----------------
If we're in SysV psABI land, then the stack is 32-bit aligned.

If we're in actual ABI used by everyone out there, i.e. GCC's default, then it's only 16-bit aligned, and your integer types also have the wrong alignment, so you will get ABI incompatibility with GCC-built binaries as provided by distributions like Debian.


================
Comment at: clang/lib/Basic/Targets/M68k.cpp:63
+            .Case("generic", CK_68000)
+            .Case("M68000", CK_68000)
+            .Case("M68010", CK_68010)
----------------
GCC's -mcpu excludes any M prefix and is just the number.


================
Comment at: clang/lib/Basic/Targets/M68k.cpp:77-79
+  Builder.defineMacro("M68k");
+  Builder.defineMacro("__M68k__");
+  Builder.defineMacro("__M68K__");
----------------
Where are these coming from? GCC only defines `__m68k__`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88393/new/

https://reviews.llvm.org/D88393



More information about the cfe-commits mailing list