Package: guile-2.0
Version: 2.0.11+1
Severity: normal
User: [email protected]
Usertag: arm64
Guile can cross-build scheme scripts, but if you try to cross-build scheme for
arm or arm64, it fails:
Making all in module
make[3]: Entering directory '/tmp/buildd/guile-2.0/guile-2.0-2.0.11+1/module'
GUILEC ice-9/eval.go
Backtrace:
In ice-9/boot-9.scm:
157: 8 [catch #t #<catch-closure 1111620> ...]
In unknown file:
?: 7 [apply-smob/1 #<catch-closure 1111620>]
In ice-9/boot-9.scm:
63: 6 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
432: 5 [eval # #]
387: 4 [eval # #]
In srfi/srfi-1.scm:
619: 3 [for-each #<procedure 121cf00 at scripts/compile.scm:179:14 (file)> #]
In scripts/compile.scm:
182: 2 [#<procedure 121cf00 at scripts/compile.scm:179:14 (file)>
"ice-9/eval.scm"]
In system/base/target.scm:
57: 1 [with-target "arm-unknown-linux-gnueabihf" ...]
In unknown file:
?: 0 [scm-error misc-error #f "~A ~S" ("unknown CPU endianness" "arm") #f]
ERROR: In procedure scm-error:
ERROR: unknown CPU endianness "arm"
Makefile:2167: recipe for target 'ice-9/eval.go' failed
This turns out to be because the runtime detection of endianness in
the build-arch version of the guile compiler is broken. The code is
horrible and tries a lot of dubious substring matching on the host
triplet in order to decide the endianness and word size. This is going
to go wrong in all sorts of circumstances, and should really use a
more robust mechanism such as dpkg-architecture (but that would depend
on dpkg-dev, which might not be ideal).
Anyway I have added arm and aarch64 (arm64) to the substring search
which will, at least on debian produce working results.
This has been tested and guile can now cross-build itself for armhf,
fixing the above error.
Patch attached.
--
Wookey
diff -Nru guile-2.0-2.0.11+1/debian/changelog guile-2.0-2.0.11+1/debian/changelog
--- guile-2.0-2.0.11+1/debian/changelog 2014-04-23 18:19:00.000000000 +0100
+++ guile-2.0-2.0.11+1/debian/changelog 2014-08-17 18:35:59.000000000 +0100
@@ -1,3 +1,9 @@
+guile-2.0 (2.0.11+1-1.1) UNRELEASED; urgency=medium
+
+ * Fix runtime arm architecture endianness/wordsize detection
+
+ -- wookey <[email protected]> Sun, 17 Aug 2014 17:35:19 +0000
+
guile-2.0 (2.0.11+1-1) unstable; urgency=low
* Incorporate upstream version 2.0.11.
diff -Nru guile-2.0-2.0.11+1/debian/patches/arm-arches-runtime-detection.patch guile-2.0-2.0.11+1/debian/patches/arm-arches-runtime-detection.patch
--- guile-2.0-2.0.11+1/debian/patches/arm-arches-runtime-detection.patch 1970-01-01 01:00:00.000000000 +0100
+++ guile-2.0-2.0.11+1/debian/patches/arm-arches-runtime-detection.patch 2014-08-17 18:48:45.000000000 +0100
@@ -0,0 +1,36 @@
+Description: Correctly find endianness on arm and arm64/aarch64
+ The guile runtime detection of the arch using the triplet is
+ a really bad plan, and this patch is horrible, but it does at
+ least mean that the arches are detected and not just 'unknown'
+ We should really use dpkg-architecture to get it right under all circs
+ but that means depending on dpkg-dev, which might be a problem.
+Author: wookey <[email protected]>
+Last-Update: 2014-08-17
+
+--- guile-2.0-2.0.11+1.orig/module/system/base/target.scm
++++ guile-2.0-2.0.11+1/module/system/base/target.scm
+@@ -65,13 +65,12 @@
+ (cond ((string-match "^i[0-9]86$" cpu)
+ (endianness little))
+ ((member cpu '("x86_64" "ia64"
+- "powerpcle" "powerpc64le" "mipsel" "mips64el"))
++ "powerpcle" "powerpc64le" "mipsel" "mips64el"
++ "aarch64" "arm"))
+ (endianness little))
+ ((member cpu '("sparc" "sparc64" "powerpc" "powerpc64" "spu"
+- "mips" "mips64"))
++ "mips" "mips64" "aarch64_be"))
+ (endianness big))
+- ((string-match "^arm.*el" cpu)
+- (endianness little))
+ (else
+ (error "unknown CPU endianness" cpu)))))
+
+@@ -97,6 +96,7 @@
+ ((string-match "64$" cpu) 8)
+ ((string-match "64[lbe][lbe]$" cpu) 8)
+ ((member cpu '("sparc" "powerpc" "mips" "mipsel")) 4)
++ ((string-match "^aarch64.*" cpu) 8)
+ ((string-match "^arm.*" cpu) 4)
+ (else (error "unknown CPU word size" cpu)))))
+
diff -Nru guile-2.0-2.0.11+1/debian/patches/series guile-2.0-2.0.11+1/debian/patches/series
--- guile-2.0-2.0.11+1/debian/patches/series 2014-04-23 18:11:29.000000000 +0100
+++ guile-2.0-2.0.11+1/debian/patches/series 2014-08-17 18:45:20.000000000 +0100
@@ -1,2 +1,3 @@
0001-Change-guile-to-guile-X.Y-for-info-pages.patch
0002-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch
+arm-arches-runtime-detection.patch