Fix handling of the *-gnux32 target.
authorLudovic Courtès <ludo@gnu.org>
Thu, 28 Feb 2013 08:42:31 +0000 (09:42 +0100)
committerLudovic Courtès <ludo@gnu.org>
Thu, 28 Feb 2013 08:42:45 +0000 (09:42 +0100)
* module/system/base/target.scm (triplet-pointer-size): Fix typo in the
  x32 triplet name.
* test-suite/tests/asm-to-bytecode.test (native-os): New procedure.
  (test-target): Use (native-word-size) only when both the CPU and OS
  match.

module/system/base/target.scm
test-suite/tests/asm-to-bytecode.test

index 762894c..c74ae67 100644 (file)
@@ -92,7 +92,7 @@
           ((string-match "^mips64.*-gnuabi64" triplet) 8) ; n64 ABI
           ((string-match "^mips64" cpu) 4)                ; n32 or o32
 
-          ((string-match "^x64_64-.*-gnux32" triplet) 4)  ; x32
+          ((string-match "^x86_64-.*-gnux32" triplet) 4)  ; x32
 
           ((string-match "64$" cpu) 8)
           ((string-match "64[lbe][lbe]$" cpu) 8)
index 3bd8a92..6d2f20e 100644 (file)
 (define (native-cpu)
   (with-target %host-type target-cpu))
 
+(define (native-os)
+  (with-target %host-type target-os))
+
 (define (native-word-size)
   ((@ (system foreign) sizeof) '*))
 
                    ;; actually has a 32-bit user-land, for instance (see
                    ;; <http://www.debian.org/ports/sparc/#sparc64bit>
                    ;; for details.)
-                   (if (string=? (native-cpu) (target-cpu))
+                   (if (and (string=? (native-cpu) (target-cpu))
+                            (string=? (native-os) (target-os)))
                        (native-word-size)
                        word-size))
                   (b (compile-bytecode