Use our own XLEN macro.
authorTim Newsome <tim@sifive.com>
Thu, 8 Dec 2016 04:03:36 +0000 (20:03 -0800)
committerTim Newsome <tim@sifive.com>
Thu, 8 Dec 2016 04:03:36 +0000 (20:03 -0800)
Relying on something that the compiler automatically sets is apparently
not reliable.

debug/programs/regs.S
debug/targets.py

index 5c4f4629a92ada233f79185b8d6851e181b432f0..200184ddc1bfb519a55158cd5d7e6ac63a745dc8 100644 (file)
@@ -1,4 +1,4 @@
-#if __riscv_xlen == 64
+#if XLEN == 64
 # define LREG ld
 # define SREG sd
 # define REGBYTES 8
index d1ba96430d845bcd2195454da7dce1fa5957d98e..8c725c4ebdec6bbb749e23b924d32fedde7b5a11 100644 (file)
@@ -49,6 +49,7 @@ class Target(object):
                     "-T", "targets/%s/link.lds" % (self.directory or self.name),
                     "-nostartfiles",
                     "-mcmodel=medany",
+                    "-DXLEN=%d" % self.xlen,
                     "-o", binary_name),
                 xlen=self.xlen)
         return binary_name