diff --git a/module/system/base/target.scm b/module/system/base/target.scm index cefa951a3..31e3fea79 100644 --- a/module/system/base/target.scm +++ b/module/system/base/target.scm @@ -72,7 +72,13 @@ (endianness big)) ((string-match "^arm.*el" cpu) (endianness little)) - ((string=? "arm" cpu) ;ARMs are LE by default + ((string-match "^arm.*eb" cpu) + (endianness big)) + ((string-prefix? "arm" cpu) ;ARMs are LE by default + (endianness little)) + ((string-match "^aarch64.*be" cpu) + (endianness big)) + ((string=? "aarch64" cpu) (endianness little)) (else (error "unknown CPU endianness" cpu))))) @@ -97,7 +103,7 @@ ((string-match "^x86_64-.*-gnux32" triplet) 4) ; x32 ((string-match "64$" cpu) 8) - ((string-match "64[lbe][lbe]$" cpu) 8) + ((string-match "64_?[lbe][lbe]$" cpu) 8) ((member cpu '("sparc" "powerpc" "mips" "mipsel")) 4) ((string-match "^arm.*" cpu) 4) (else (error "unknown CPU word size" cpu))))) diff --git a/test-suite/tests/asm-to-bytecode.test b/test-suite/tests/asm-to-bytecode.test index 62ea0ed9e..8aeba84f7 100644 --- a/test-suite/tests/asm-to-bytecode.test +++ b/test-suite/tests/asm-to-bytecode.test @@ -207,6 +207,12 @@ (test-target "arm-unknown-linux-androideabi" (endianness little) 4) + (test-target "armeb-unknown-linux-gnu" + (endianness big) 4) + (test-target "aarch64-linux-gnu" + (endianness little) 8) + (test-target "aarch64_be-linux-gnu" + (endianness big) 8) (pass-if-exception "unknown target" exception:miscellaneous-error