Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

guile-3.0: use 3.0.9 on 32-bit archs until 3.0.10 regression is fixed #25883

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions lang/guile-3.0/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

PortSystem 1.0
PortGroup select 1.0
PortGroup legacysupport 1.1

# dprintf
legacysupport.newest_darwin_requires_legacy 10

name guile-3.0
categories lang
Expand All @@ -15,6 +19,18 @@ checksums rmd160 c42990081a8fffaf63874d16f457d8e50db8bc36 \
sha256 2dbdbc97598b2faf31013564efb48e4fed44131d28e996c26abe8a5b23b56c2a \
size 9738824

# At the moment 3.0.10 is broken on 32-bit platforms.
if {${configure.build_arch} in [list i386 ppc]} {
version 3.0.9
revision 0
checksums rmd160 e5c6a757cc188f137edd2046a3d015152efad7fb \
sha256 18525079ad29a0d46d15c76581b5d91c8702301bfd821666d2e1d13726162811 \
size 9734735

depends_build-append port:gmake
build.cmd ${prefix}/bin/gmake
}

compiler.c_standard 2011

universal_variant no
Expand Down Expand Up @@ -43,6 +59,11 @@ master_sites https://ftp.gnu.org/gnu/guile/
# Fix MacOS specific bugs and make the test suite pass.
# Sent to upstream: https://www.mail-archive.com/bug-guile@gnu.org/msg11370.html
use_autoreconf yes
# On legacy systems passing -f is needed:
# autoreconf: error: /opt/local/bin/autopoint failed with exit status: 1
# Since autoreconf is used anyway, we can add these flags unconditionally:
autoreconf.args -fvi

patchfiles \
0001-tests-Check-TCP_NODELAY-for-non-zero-instead-of-1.patch \
0002-tests-Skip-tests-of-abstract-Unix-sockets-on-Darwin.patch \
Expand Down Expand Up @@ -92,6 +113,37 @@ configure.args --program-suffix=-3.0 \
--infodir="${prefix}/share/info/${name}" \
--mandir="${prefix}/share/man"

platform darwin powerpc {
# Do we need this for ppc64 as well?
post-extract {
# the prebuilt guile binaries are broken for Darwin PPC
move ${worksrcpath}/prebuilt/32-bit-big-endian ${worksrcpath}/prebuilt/32-bit-big-endian-disabled
ui_msg "*** This build can take some time, as guile has to do a full bootstrap on PPC."
}
}

if {${configure.build_arch} eq "ppc"} {
# We override patches here on purpose. Test suite will be dealt with once 3.0.10 is fixed.
patchfiles 0009-posix.c-Set-errno-when-pipe2-is-not-available-and-fl.patch \
0010-filesys.patch \
0011-powerpc.patch

configure.args-append --disable-error-on-warning \
--disable-jit \
--without-64-calls \
--without-threads

} elseif {${configure.build_arch} eq "i386"} {
# We override patches here on purpose. Test suite will be dealt with once 3.0.10 is fixed.
patchfiles 0009-posix.c-Set-errno-when-pipe2-is-not-available-and-fl.patch \
0010-filesys.patch

# Notice that i386 build is untested. It may or may not require
# disabling JIT and threads.
configure.args-append --disable-error-on-warning \
--without-64-calls
}

# fixes: sed: -i may not be used with stdin
depends_build-append port:gsed
configure.env-append SED=${prefix}/bin/gsed
Expand Down
13 changes: 13 additions & 0 deletions lang/guile-3.0/files/0010-filesys.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- a/libguile/filesys.c.orig 2024-09-22 13:46:53.000000000 +0800
+++ b/libguile/filesys.c 2024-09-22 14:12:07.000000000 +0800
@@ -46,6 +46,10 @@
#include <unistd.h>
#include <string.h>

+#ifdef __APPLE__
+#include <sys/stdio.h> /* for renameat */
+#endif
+
#ifdef HAVE_DIRECT_H
#include <direct.h>
#endif
30 changes: 30 additions & 0 deletions lang/guile-3.0/files/0011-powerpc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
See: https://issues.guix.gnu.org/47615
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=977223

--- a/am/bootstrap.am 2022-02-02 02:57:14.000000000 +0800
+++ b/am/bootstrap.am 2022-04-16 23:50:55.000000000 +0800
@@ -19,7 +19,8 @@

# These variables can be set before you include bootstrap.am.
GUILE_WARNINGS ?= -W1
-GUILE_OPTIMIZATIONS ?= -O2
+GUILE_OPTIMIZATIONS ?= -O1
+
GUILE_TARGET ?= $(host)
GUILE_BUILD_TAG ?= BOOTSTRAP($(GUILE_BOOTSTRAP_STAGE))


--- a/stage0/Makefile.am 2022-02-02 02:57:14.000000000 +0800
+++ b/stage0/Makefile.am 2022-04-16 23:50:24.000000000 +0800
@@ -22,7 +22,10 @@


GUILE_WARNINGS = -W0
-GUILE_OPTIMIZATIONS = -O1
+
+$(info Note: adjusting GUILE_OPTIMIZATIONS for 32-bit big-endian architecture)
+GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives -Ocps
+
GUILE_BOOTSTRAP_STAGE = stage0

include $(top_srcdir)/am/bootstrap.am