commit: 48f0e9ff67868013bcf43f044b297425ae451117
Author: Cyprien Nicolas (fulax) <gentoo <AT> fulax <DOT> fr>
AuthorDate: Sun Jun 23 15:58:55 2019 +0000
Commit: Cyprien Nicolas <c.nicolas+gentoo <AT> gmail <DOT> com>
CommitDate: Sun Jun 23 15:58:55 2019 +0000
URL: https://gitweb.gentoo.org/proj/lisp.git/commit/?id=48f0e9ff
dev-scheme/guile: append -fno-fast-math to cflags, bug #598986
Package-Manager: Portage-2.3.66, Repoman-2.3.11
dev-scheme/guile/files/guile-2-snarf.patch | 47 ++++++++++++++++
dev-scheme/guile/files/guile-2.0.14-darwin.patch | 38 +++++++++++++
...0.14-ia64-fix-crash-thread-context-switch.patch | 63 ++++++++++++++++++++++
.../files/guile-2.0.14-tests-repl-server.patch | 25 +++++++++
.../{guile-2.2.5.ebuild => guile-2.0.14-r4.ebuild} | 54 ++++++++++---------
dev-scheme/guile/guile-2.2.5.ebuild | 2 +
dev-scheme/guile/guile-2.9.2.ebuild | 2 +
dev-scheme/guile/guile-9999.ebuild | 2 +
8 files changed, 209 insertions(+), 24 deletions(-)
diff --git a/dev-scheme/guile/files/guile-2-snarf.patch
b/dev-scheme/guile/files/guile-2-snarf.patch
new file mode 100644
index 00000000..c6ab5cd4
--- /dev/null
+++ b/dev-scheme/guile/files/guile-2-snarf.patch
@@ -0,0 +1,47 @@
+From f775ab3654357fcaad294b95efb0b1c16de1eda8 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <[email protected]>
+Date: Sun, 19 Feb 2017 22:58:40 +0000
+Subject: guile-snarf: skip -g* arguments to avoid build failure
+
+* libguile/guile-snarf.in: skip -g* arguments to avoid failure on
+ -ggdb3.
+
+Bug: https://bugs.gentoo.org/608190
+Bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25803
+Signed-off-by: Sergei Trofimovich <[email protected]>
+---
+ libguile/guile-snarf.in | 16 ++++++++++++++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/libguile/guile-snarf.in b/libguile/guile-snarf.in
+index 47bbc04..22dc1d3 100644
+--- a/libguile/guile-snarf.in
++++ b/libguile/guile-snarf.in
+@@ -95,10 +95,22 @@ if [ x"$CPP" = x ] ; then cpp="@CPP@" ; else cpp="$CPP" ;
fi
+
+ trap "rm -rf $tempdir" 0 1 2 15
+
++# filter out -g* flags from commandline
++# as some flags like -ggdb3 cause CPP
++
++cpp_args=""
++for arg in "$@"
++do
++ case "$arg" in
++ -g*) ;; # skip debug flag
++ *) cpp_args="$cpp_args $arg" ;;
++ esac
++done
++
+ if [ ! "$outfile" = "-" ] ; then
+- modern_snarf "$@" > $outfile
++ modern_snarf $cpp_args > $outfile
+ else
+- modern_snarf "$@"
++ modern_snarf $cpp_args
+ fi
+
+ # zonk outfile if errors occurred
+--
+cgit v1.0-41-gc330
+
diff --git a/dev-scheme/guile/files/guile-2.0.14-darwin.patch
b/dev-scheme/guile/files/guile-2.0.14-darwin.patch
new file mode 100644
index 00000000..17741ae3
--- /dev/null
+++ b/dev-scheme/guile/files/guile-2.0.14-darwin.patch
@@ -0,0 +1,38 @@
+fix compilation on Darwin
+
+https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24862#23
+https://bugs.gentoo.org/show_bug.cgi?id=612338
+
+--- guile-2.0.14/libguile/filesys.c
++++ guile-2.0.14/libguile/filesys.c
+@@ -1486,6 +1486,9 @@
+ mode_bits = scm_i_mode_bits (mode);
+ }
+
++#ifdef __APPLE__
++ open_flags &= O_APPEND|O_SHLOCK|O_EXLOCK|O_CLOEXEC;
++#endif
+ SCM_SYSCALL (rv = mkostemp (c_tmpl, open_flags));
+ if (rv == -1)
+ SCM_SYSERROR;
+--- guile-2.0.14/libguile/stime.c
++++ guile-2.0.14/libguile/stime.c
+@@ -830,6 +830,10 @@
+
+ #ifdef HAVE_POSIX_CPUTIME
+ {
++#ifdef __APPLE__
++ if (clock_gettime (CLOCK_PROCESS_CPUTIME_ID, &posix_run_time_base) == 0)
++ get_internal_run_time = get_internal_run_time_posix_timer;
++#else
+ clockid_t dummy;
+
+ /* Only use the _POSIX_CPUTIME clock if it's going to work across
+@@ -839,6 +843,7 @@
+ get_internal_run_time = get_internal_run_time_posix_timer;
+ else
+ errno = 0;
++#endif
+ }
+ #endif /* HAVE_POSIX_CPUTIME */
+ #endif /* HAVE_CLOCKTIME */
diff --git
a/dev-scheme/guile/files/guile-2.0.14-ia64-fix-crash-thread-context-switch.patch
b/dev-scheme/guile/files/guile-2.0.14-ia64-fix-crash-thread-context-switch.patch
new file mode 100644
index 00000000..c2f136dd
--- /dev/null
+++
b/dev-scheme/guile/files/guile-2.0.14-ia64-fix-crash-thread-context-switch.patch
@@ -0,0 +1,63 @@
+From f92888853439a8ded221f3423865c78de2a96a14 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <[email protected]>
+Date: Sun, 5 Nov 2017 09:30:45 +0000
+Subject: ia64: Fix crash in thread context switch.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes <https://bugs.gnu.org/29151> and <https://bugs.gentoo.org/613986>.
+
+Backtrace looks like that:
+
+ Program terminated with signal SIGSEGV, Segmentation fault.
+ #0 0x200000000014a5c0 in scm_ia64_longjmp (JB=0x6000000000817020, VAL=1) at
continuations.c:372
+ 372 t->pending_rbs_continuation->backing_store,
+ [Current thread is 1 (Thread 0x2000000000049340 (LWP 8190))]
+ (gdb) bt
+ #0 0x200000000014a5c0 in scm_ia64_longjmp (JB=0x6000000000817020, VAL=1) at
continuations.c:372
+ #1 0x2000000000148e00 in scm_c_abort (vm=0x60000000000edea0,
tag=0x6000000000795ba0, n=0, argv=0x60000fffff7f0ce0, cookie=-1) at
control.c:239
+ #2 0x2000000000149070 in scm_at_abort (tag=0x6000000000795ba0, args=0x304)
at control.c:258
+ (gdb) print t
+ $2 = (scm_i_thread *) 0x6000000000068000
+ (gdb) print t->pending_rbs_continuation
+ $3 = (scm_t_contregs *) 0xffeb
+
+The problem here is the value of 't->pending_rbs_continuation' pointer.
+It's supposed to poin to a register stack pointer or be NULL if not yet
+backed up.
+
+The problem is it is never initialized to NULL at creation time and
+contained garbage on stack. Sometimes people are lucky and have zeros
+on stack and guile works. But sometimes there is something and guile
+crashes.
+
+The fix is trivial: initialize 'pending_rbs_continuation = NULL'
+at thread registration time (the same way other threads are registered).
+
+Reported-by: Matt Turner
+
+* libguile/threads.c (guilify_self_1): Initialize pending_rbs_continuation
+to avoid crash on ia64.
+
+Signed-off-by: Sergei Trofimovich <[email protected]>
+Signed-off-by: Ludovic Courtès <[email protected]>
+---
+ libguile/threads.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libguile/threads.c b/libguile/threads.c
+index 9ceb5b8..770f62c 100644
+--- a/libguile/threads.c
++++ b/libguile/threads.c
+@@ -395,6 +395,7 @@ guilify_self_1 (struct GC_stack_base *base, int
needs_unregister)
+ t.base = base->mem_base;
+ #ifdef __ia64__
+ t.register_backing_store_base = base->reg_base;
++ t.pending_rbs_continuation = 0;
+ #endif
+ t.continuation_root = SCM_EOL;
+ t.continuation_base = t.base;
+--
+cgit v1.0-41-gc330
+
diff --git a/dev-scheme/guile/files/guile-2.0.14-tests-repl-server.patch
b/dev-scheme/guile/files/guile-2.0.14-tests-repl-server.patch
new file mode 100644
index 00000000..15c78a46
--- /dev/null
+++ b/dev-scheme/guile/files/guile-2.0.14-tests-repl-server.patch
@@ -0,0 +1,25 @@
+--- guile-2.2.5/test-suite/tests/00-repl-server.test.old 2017-04-14
23:26:40.000000000 +0200
++++ guile-2.2.5/test-suite/tests/00-repl-server.test 2019-06-23
12:16:10.624115938 +0200
+@@ -27,7 +27,7 @@
+ (define (call-with-repl-server proc)
+ "Set up a REPL server in a separate process and call PROC with a
+ socket connected to that server."
+- (let ((sockaddr (make-socket-address AF_UNIX "/tmp/repl-server"))
++ (let ((sockaddr (make-test-socket-address))
+ (client-socket (socket AF_UNIX SOCK_STREAM 0)))
+ (false-if-exception
+ (delete-file (sockaddr:path sockaddr)))
+@@ -86,6 +86,13 @@
+ (lambda (client-socket)
+ body ...)))
+
++(define (make-test-socket-address)
++ (catch 'unbound-variable
++ (lambda ()
++ (make-socket-address AF_UNIX "/tmp/repl-server"))
++ (lambda (key . args)
++ (throw 'unresolved))))
++
+ (define (read-until-prompt port str)
+ "Read from PORT until STR has been read or the end-of-file was
+ reached."
diff --git a/dev-scheme/guile/guile-2.2.5.ebuild
b/dev-scheme/guile/guile-2.0.14-r4.ebuild
similarity index 66%
copy from dev-scheme/guile/guile-2.2.5.ebuild
copy to dev-scheme/guile/guile-2.0.14-r4.ebuild
index 2e0088b0..f68b2613 100644
--- a/dev-scheme/guile/guile-2.2.5.ebuild
+++ b/dev-scheme/guile/guile-2.0.14-r4.ebuild
@@ -1,47 +1,58 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=6
+inherit flag-o-matic autotools ltprune
-inherit flag-o-matic
-
-MAJOR="2.2"
DESCRIPTION="GNU Ubiquitous Intelligent Language for Extensions"
HOMEPAGE="https://www.gnu.org/software/guile/"
SRC_URI="mirror://gnu/guile/${P}.tar.gz"
-
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390
~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux
~ppc-macos ~x64-macos ~x86-macos"
LICENSE="LGPL-3+"
-SLOT="2.2/2.2-1" # libguile-2.2.so.1 => 2.2-1
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv
~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux
~ppc-macos ~x64-macos ~x86-macos"
IUSE="debug debug-malloc +deprecated +networking +nls +regex +threads" #
upstream recommended +networking +nls
-REQUIRED_USE="regex" # workaround for bug 596322
-RESTRICT="strip"
+# emacs useflag removal not working
+
+# workaround for bug 596322
+REQUIRED_USE="regex"
RDEPEND="
- !>=dev-scheme/guile-2.2:12
>=dev-libs/boehm-gc-7.0:=[threads?]
dev-libs/gmp:=
virtual/libffi:=
dev-libs/libltdl:=
dev-libs/libunistring:0=
+ sys-devel/libtool
sys-libs/ncurses:0=
sys-libs/readline:0="
-DEPEND="${RDEPEND}"
-BDEPEND="
+DEPEND="${RDEPEND}
virtual/pkgconfig
- sys-devel/libtool
+ sys-apps/texinfo
sys-devel/gettext"
-PATCHES=( "${FILESDIR}/${PN}-2.2.3-gentoo-sandbox.patch" )
+SLOT="12/22" # subslot is soname version
+MAJOR="2.0"
+
DOCS=( GUILE-VERSION HACKING README )
+PATCHES=(
+ "${FILESDIR}/${PN}-2-snarf.patch"
+ "${FILESDIR}/${P}-darwin.patch"
+ "${FILESDIR}/${P}-ia64-fix-crash-thread-context-switch.patch"
+ "${FILESDIR}/${P}-tests-repl-server.patch"
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
src_configure() {
# see bug #178499
filter-flags -ftree-vectorize
+ # see bug #598986
+ append-cflags $(test-flags-CC -fno-fast-math)
econf \
- --program-suffix="-${MAJOR}" \
- --infodir="${EPREFIX}"/usr/share/info/guile-${MAJOR} \
--disable-error-on-warning \
--disable-rpath \
--disable-static \
@@ -63,13 +74,7 @@ src_configure() {
src_install() {
default
-
- # The guile.m4 macro files conflicts with other slots
- mv "${ED}"/usr/share/aclocal/guile.m4
"${ED}"/usr/share/aclocal/guile-${MAJOR}.m4 || die "rename of guile.m4 failed"
-
- # Bug #590904, LDFLAGS are copied within the pkg-config gile
- sed -i "${ED}"/usr/$(get_libdir)/pkgconfig/guile-${MAJOR}.pc \
- -e s:"${LDFLAGS}"::
+ prune_libtool_files
# From Novell
# https://bugzilla.novell.com/show_bug.cgi?id=874028#c0
@@ -79,5 +84,6 @@ src_install() {
# necessary for registering slib, see bug 206896
keepdir /usr/share/guile/site
- find "${D}" -name '*.la' -delete || die
+ # Dark magic necessary for some deps
+ dosym libguile-2.0.so /usr/$(get_libdir)/libguile.so
}
diff --git a/dev-scheme/guile/guile-2.2.5.ebuild
b/dev-scheme/guile/guile-2.2.5.ebuild
index 2e0088b0..23095046 100644
--- a/dev-scheme/guile/guile-2.2.5.ebuild
+++ b/dev-scheme/guile/guile-2.2.5.ebuild
@@ -38,6 +38,8 @@ DOCS=( GUILE-VERSION HACKING README )
src_configure() {
# see bug #178499
filter-flags -ftree-vectorize
+ # see bug #598986
+ append-cflags $(test-flags-CC -fno-fast-math)
econf \
--program-suffix="-${MAJOR}" \
diff --git a/dev-scheme/guile/guile-2.9.2.ebuild
b/dev-scheme/guile/guile-2.9.2.ebuild
index f15a1db5..852109f4 100644
--- a/dev-scheme/guile/guile-2.9.2.ebuild
+++ b/dev-scheme/guile/guile-2.9.2.ebuild
@@ -37,6 +37,8 @@ DOCS=( GUILE-VERSION HACKING README )
src_configure() {
# see bug #178499
filter-flags -ftree-vectorize
+ # see bug #598986
+ append-cflags $(test-flags-CC -fno-fast-math)
econf \
--program-suffix="-${MAJOR}" \
diff --git a/dev-scheme/guile/guile-9999.ebuild
b/dev-scheme/guile/guile-9999.ebuild
index 8feb94b2..f571ceed 100644
--- a/dev-scheme/guile/guile-9999.ebuild
+++ b/dev-scheme/guile/guile-9999.ebuild
@@ -44,6 +44,8 @@ src_prepare() {
src_configure() {
# see bug #178499
filter-flags -ftree-vectorize
+ # see bug #598986
+ append-cflags $(test-flags-CC -fno-fast-math)
econf \
--program-suffix="-${MAJOR}" \