GNU bug report logs - #79595
guile-3.0.10 fails to build on armv7 and i386 FreeBSD

Previous Next

Package: guile;

Reported by: Robert Clausecker <fuz <at> fuz.su>

Date: Tue, 7 Oct 2025 10:02:02 UTC

Severity: normal

To reply to this bug, email your comments to 79595 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#79595; Package guile. (Tue, 07 Oct 2025 10:02:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Robert Clausecker <fuz <at> fuz.su>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Tue, 07 Oct 2025 10:02:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Robert Clausecker <fuz <at> fuz.su>
To: bug-guile <at> gnu.org
Cc: bofh <at> freebsd.org
Subject: guile-3.0.10 fails to build on armv7 and i386 FreeBSD
Date: Tue, 7 Oct 2025 12:01:21 +0200
[Message part 1 (text/plain, inline)]
Greetings!

I am a FreeBSD ports contributor who carries out QA for the armv7
platform.  After an update of our port lang/guile3 to 3.0.10, it was
observed that guile3 would faile to build on armv7 and i386.  Here
is the build failure:

GUILE_BOOTSTRAP_STAGE=stage1 ../meta/build-env guild compile --target="armv7-portbld-freebsd14.3" -W1 -O2 -Ono-cross-module-inlining -L "/usr/home/ports/main.ports/lang/guile3/work/guile-3.0.10/module" -o "language/cps/guile-vm/reify-primitives.go" "../module/language/cps/guile-vm/reify-primitives.scm"
Backtrace:
In ice-9/boot-9.scm:
  1755:12 19 (with-exception-handler _ _ #:unwind? _ # _)
In system/base/compile.scm:
    69:11 18 (_)
   190:11 17 (_ #<closed: file 20c40ea8>)
    309:6 16 (read-and-compile #<closed: file 20c40ee0> #:from _ #:to ?)
   352:28 15 (compile #<tree-il (seq (let (m) (m-182b3cf1-2) ((call?> ?)
   265:44 14 (_ #<tree-il (seq (let (m) (m-182b3cf1-2) ((call (@@ (?> ?)
   261:33 13 (_ #<intmap 0-11706> #<directory (language cps guile-vm?>)
In language/cps/optimize.scm:
    136:2 12 (_ _ #<directory (language cps guile-vm reify-primitive?>)
    111:3 11 (optimize-first-order-cps _ _)
In language/cps/switch.scm:
    414:6 10 (optimize-branch-chains _)
In language/cps/intmap.scm:
    519:6  9 (visit-branch #(#(#(#<intset 0-273> (absent) # ?) ?) ?) ?)
    519:6  8 (visit-branch #((absent) (absent) #((absent) (#) # ?) ?) ?)
    519:6  7 (visit-branch #((absent) (absent) (absent) (absent) # ?) ?)
In language/cps/switch.scm:
    99:36  6 (fold-branch-chains #<intmap 0-8003> _ _ #<procedure o?> ?)
    343:8  5 (optimize-branch-chain 3346 7427 (6771 6772 6773 6901 ?) ?)
In ice-9/boot-9.scm:
   260:13  4 (for-each #<procedure 2567c180 at language/cps/switch.?> ?)
In language/cps/switch.scm:
   340:32  3 (_ (u64-imm-< . 7428))
In language/cps/guile-vm.scm:
    89:31  2 (target-symbol-hash _)
    41:18  1 (jenkins-lookup3-hashword2 "u64-imm-<")
In ice-9/boot-9.scm:
  1676:22  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1676:22: In procedure raise-exception:
Value out of range 0 to< 18446744073709551615: -505802029
gmake[2]: *** [Makefile:2515: language/cps/guile-vm/reify-primitives.go] Error 1
gmake[2]: Leaving directory '/usr/home/ports/main.ports/lang/guile3/work/guile-3.0.10/stage1'
gmake[1]: *** [Makefile:2180: all-recursive] Error 1
gmake[1]: Leaving directory '/usr/home/ports/main.ports/lang/guile3/work/guile-3.0.10'
gmake: *** [Makefile:2065: all] Error 2
*** Error code 1

Stop.
make[1]: stopped in /usr/home/ports/main.ports/lang/guile3
*** Error code 1

To reproduce this error:

 - install FreeBSD 14.3 on an armv7 system such as a Raspberry Pi 2
 - obtain a recent copy of the ports tree and place it in /usr/ports
 - go to /usr/port/lang/guile3 and edit the Makefile there to remove
   the "NOT_FOR_ARCHS" line; this permits a build on armv7.
 - type "make" to attempt a build of the port.

It may suffice to simply extract the guile3 tarball and build it,
but I didn't test that yet.

Please note that we include some distribution patches, which you can
find in the files directory of the port, or here:

https://cgit.freebsd.org/ports/tree/lang/guile3/files

Yours,
Robert Clausecker

-- 
()  ascii ribbon campaign - for an encoding-agnostic world
/\  - against html email  - against proprietary attachments
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guile <at> gnu.org:
bug#79595; Package guile. (Sun, 26 Oct 2025 13:54:03 GMT) Full text and rfc822 format available.

Message #8 received at 79595 <at> debbugs.gnu.org (full text, mbox):

From: "Robert Kirkman" <rkirkman <at> termux.dev>
To: 79595 <at> debbugs.gnu.org
Subject: Re: guile-3.0.10 fails to build on armv7 and i386 FreeBSD
Date: Sat, 25 Oct 2025 19:53:14 +0000
Hello, I have been troubleshooting this error for a while now, and I have collected some further information.

Here is a summary of some of the information I have collected:

- I have determined that this error does not require FreeBSD to reproduce, and is actually also reproducible under certain controlled conditions on multiple operating systems that are not FreeBSD, including but not limited to GNU/Linux

- Indeed, in certain real-world situations, it's possible to encounter this error without using FreeBSD at any point, indicating that this error is affecting more environments generally than just FreeBSD alone (I first experienced this error in a non-FreeBSD environment, and since I found this report of the same error on FreeBSD when looking for my issue in the Guile mailing list, I am commenting on the same issue rather than opening a separate issue, since I believe that the issue affects multiple operating systems and I believe I am experiencing the same issue on a different operating system)

- However, just compiling Guile 3.0.10 on any normal 32-bit GNU/Linux installation is not sufficient to consistently reproduce the error

- To reproduce the error consistently on GNU/Linux, it is necessary to perform a contrived and obscure series of setup steps and build settings that could be described as "cross-compiling Guile 3.0.10 from 64-bit x86 GNU/Linux to 32-bit x86 GNU/Linux"

- Due to the inherent difficulty, danger and unreliability of modifying one's preexisting GNU/Linux installation to be capable of consistently reproducing the error, I have carefully written a Dockerfile for 64-bit x86 Linux PCs that have Docker installed, which can consistently reproduce the same exact error described in this issue if it is placed in an empty folder and the command 'docker build .' is used in that folder on any 64-bit x86 Linux PC that has Docker installed.

- In the process of troubleshooting this issue, I have also confirmed that, as implied by the original report, Guile 3.0.9 was not affected by the issue, and I have bisected the exact commit which introduced the error to this commit which was created in between the release of Guile 3.0.9 and the release of Guile 3.0.10: https://cgit.git.savannah.gnu.org/cgit/guile.git/commit/?id=d579848cb5d65440af5afd9c8968628665554c22

- I have also confirmed that using the source code of Guile 3.0.10, but locally reverting that commit in it via the command 'patch -p1 -R < d579848c.patch' or an equivalent way of reverting individual commits does work to work around the error and prevent it from occurring successfully in all of the situations where I know the issue to be reproducible, including within the Dockerfile I am providing below, and because of that, even though I don't personally use FreeBSD, I assume that users of 32-bit FreeBSD wanting to build Guile 3.0.10 would be able to as well, if desired, by locally reverting that commit.

- However, despite it being possible to reproduce the error on GNU/Linux under certain conditions, I have already tested every single relevant patch for Guile 3.0.10 that I found in Debian sid's current guile 3.0.10 package, here, https://sources.debian.org/src/guile-3.0/3.0.10%2Breally3.0.10-6/debian/patches , and I have determined that none of the currently-available Debian patches for Guile located there are capable of preventing this error from occurring under its reproduction conditions. The only patch I have personally been able to find or create so far that is capable of completely preventing the error is reverting Guile upstream commit d579848cb5d65440af5afd9c8968628665554c22.

Here is the Dockerfile I have created to help to document and provide a consistent reproduction environment for this issue to users of 64-bit x86 GNU/Linux who have Docker installed, but who might not have 32-bit FreeBSD or other affected alternative operating systems conveniently available to them:

```
FROM --platform=linux/amd64 debian:trixie

ADD https://mirrors.kernel.org/gnu/guile/guile-3.0.10.tar.gz /tmp/guile.tar.gz

ADD https://cgit.git.savannah.gnu.org/cgit/guile.git/patch/?id=d579848cb5d65440af5afd9c8968628665554c22 /tmp/d579848c.patch

WORKDIR /root

ENV CFLAGS=-m32

ENV PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig

RUN dpkg --add-architecture i386

RUN apt update

RUN apt install -y build-essential \
                    gcc-multilib \
                    pkg-config \
                    libffi-dev:i386 \
                    libgc-dev:i386 \
                    libgmp-dev:i386 \
                    libreadline-dev:i386 \
                    libncurses-dev:i386 \
                    libunistring-dev:i386

RUN tar xf /tmp/guile.tar.gz --strip-components=1

# before d579848c, this worked, and it still works if that commit is reverted
RUN patch -p1 -R < /tmp/d579848c.patch

RUN ./configure --host=i386-linux-gnu

# successful
RUN make

RUN make distclean

# if d579848c is reapplied and another build performed, it will fail!
RUN patch -p1 < /tmp/d579848c.patch

RUN ./configure --host=i386-linux-gnu

# build will fail here!
RUN make
```




Information forwarded to bug-guile <at> gnu.org:
bug#79595; Package guile. (Fri, 31 Oct 2025 12:39:02 GMT) Full text and rfc822 format available.

Message #11 received at 79595 <at> debbugs.gnu.org (full text, mbox):

From: Paul Bolle <pebolle <at> tiscali.nl>
To: Robert Kirkman <rkirkman <at> termux.dev>, 79595 <at> debbugs.gnu.org
Subject: Re: bug#79595: guile-3.0.10 fails to build on armv7 and i386 FreeBSD
Date: Fri, 31 Oct 2025 13:37:58 +0100
Robert Kirkman schreef op za 25-10-2025 om 19:53 [+0000]:
> [...] I have bisected the exact commit which introduced the error to
> this commit [...]:
> https://cgit.git.savannah.gnu.org/cgit/guile.git/commit/?id=d579848cb5d65440af5afd9c8968628665554c22

I can confirm this, see
https://bugzilla.redhat.com/show_bug.cgi?id=2294649#c8 

(My impression was that this was an issue for all 32 bit builds, even
native, and that it was already fixed in the main branch. So I was a
bit surprised to see that GNU Guile hadn't shipped an updated release.
Perhaps my impression was wrong...)


Paul Bolle




This bug report was last modified 5 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.