xref: /OK3568_Linux_fs/buildroot/package/guile/0001-fix_arm_endianness.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1Fix support for ARM endianness, otherwise it gives the error
2"unknown CPU endianness"
3
4Signed-off-by: Pedro Aguilar <paguilar@paguilar.org>
5
6diff -Nau guile-2.0.11.orig/module/system/base/target.scm guile-2.0.11/module/system/base/target.scm
7--- guile-2.0.11.orig/module/system/base/target.scm	2013-02-28 09:42:45.000000000 +0100
8+++ guile-2.0.11/module/system/base/target.scm	2014-11-03 23:05:01.789338997 +0100
9@@ -70,7 +70,15 @@
10             ((member cpu '("sparc" "sparc64" "powerpc" "powerpc64" "spu"
11                            "mips" "mips64"))
12              (endianness big))
13-            ((string-match "^arm.*el" cpu)
14+            ((string-match "^arm.*el" cpu)
15+             (endianness little))
16+            ((string-match "^arm.*eb" cpu)
17+             (endianness big))
18+            ((string-prefix? "arm" cpu)          ;ARMs are LE by default
19+             (endianness little))
20+            ((string-match "^aarch64.*be" cpu)
21+             (endianness big))
22+            ((string=? "aarch64" cpu)
23              (endianness little))
24             (else
25              (error "unknown CPU endianness" cpu)))))
26