1 |
commit: 48f0e9ff67868013bcf43f044b297425ae451117 |
2 |
Author: Cyprien Nicolas (fulax) <gentoo <AT> fulax <DOT> fr> |
3 |
AuthorDate: Sun Jun 23 15:58:55 2019 +0000 |
4 |
Commit: Cyprien Nicolas <c.nicolas+gentoo <AT> gmail <DOT> com> |
5 |
CommitDate: Sun Jun 23 15:58:55 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/lisp.git/commit/?id=48f0e9ff |
7 |
|
8 |
dev-scheme/guile: append -fno-fast-math to cflags, bug #598986 |
9 |
|
10 |
Package-Manager: Portage-2.3.66, Repoman-2.3.11 |
11 |
|
12 |
dev-scheme/guile/files/guile-2-snarf.patch | 47 ++++++++++++++++ |
13 |
dev-scheme/guile/files/guile-2.0.14-darwin.patch | 38 +++++++++++++ |
14 |
...0.14-ia64-fix-crash-thread-context-switch.patch | 63 ++++++++++++++++++++++ |
15 |
.../files/guile-2.0.14-tests-repl-server.patch | 25 +++++++++ |
16 |
.../{guile-2.2.5.ebuild => guile-2.0.14-r4.ebuild} | 54 ++++++++++--------- |
17 |
dev-scheme/guile/guile-2.2.5.ebuild | 2 + |
18 |
dev-scheme/guile/guile-2.9.2.ebuild | 2 + |
19 |
dev-scheme/guile/guile-9999.ebuild | 2 + |
20 |
8 files changed, 209 insertions(+), 24 deletions(-) |
21 |
|
22 |
diff --git a/dev-scheme/guile/files/guile-2-snarf.patch b/dev-scheme/guile/files/guile-2-snarf.patch |
23 |
new file mode 100644 |
24 |
index 00000000..c6ab5cd4 |
25 |
--- /dev/null |
26 |
+++ b/dev-scheme/guile/files/guile-2-snarf.patch |
27 |
@@ -0,0 +1,47 @@ |
28 |
+From f775ab3654357fcaad294b95efb0b1c16de1eda8 Mon Sep 17 00:00:00 2001 |
29 |
+From: Sergei Trofimovich <slyfox@g.o> |
30 |
+Date: Sun, 19 Feb 2017 22:58:40 +0000 |
31 |
+Subject: guile-snarf: skip -g* arguments to avoid build failure |
32 |
+ |
33 |
+* libguile/guile-snarf.in: skip -g* arguments to avoid failure on |
34 |
+ -ggdb3. |
35 |
+ |
36 |
+Bug: https://bugs.gentoo.org/608190 |
37 |
+Bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25803 |
38 |
+Signed-off-by: Sergei Trofimovich <slyfox@g.o> |
39 |
+--- |
40 |
+ libguile/guile-snarf.in | 16 ++++++++++++++-- |
41 |
+ 1 file changed, 14 insertions(+), 2 deletions(-) |
42 |
+ |
43 |
+diff --git a/libguile/guile-snarf.in b/libguile/guile-snarf.in |
44 |
+index 47bbc04..22dc1d3 100644 |
45 |
+--- a/libguile/guile-snarf.in |
46 |
++++ b/libguile/guile-snarf.in |
47 |
+@@ -95,10 +95,22 @@ if [ x"$CPP" = x ] ; then cpp="@CPP@" ; else cpp="$CPP" ; fi |
48 |
+ |
49 |
+ trap "rm -rf $tempdir" 0 1 2 15 |
50 |
+ |
51 |
++# filter out -g* flags from commandline |
52 |
++# as some flags like -ggdb3 cause CPP |
53 |
++ |
54 |
++cpp_args="" |
55 |
++for arg in "$@" |
56 |
++do |
57 |
++ case "$arg" in |
58 |
++ -g*) ;; # skip debug flag |
59 |
++ *) cpp_args="$cpp_args $arg" ;; |
60 |
++ esac |
61 |
++done |
62 |
++ |
63 |
+ if [ ! "$outfile" = "-" ] ; then |
64 |
+- modern_snarf "$@" > $outfile |
65 |
++ modern_snarf $cpp_args > $outfile |
66 |
+ else |
67 |
+- modern_snarf "$@" |
68 |
++ modern_snarf $cpp_args |
69 |
+ fi |
70 |
+ |
71 |
+ # zonk outfile if errors occurred |
72 |
+-- |
73 |
+cgit v1.0-41-gc330 |
74 |
+ |
75 |
|
76 |
diff --git a/dev-scheme/guile/files/guile-2.0.14-darwin.patch b/dev-scheme/guile/files/guile-2.0.14-darwin.patch |
77 |
new file mode 100644 |
78 |
index 00000000..17741ae3 |
79 |
--- /dev/null |
80 |
+++ b/dev-scheme/guile/files/guile-2.0.14-darwin.patch |
81 |
@@ -0,0 +1,38 @@ |
82 |
+fix compilation on Darwin |
83 |
+ |
84 |
+https://debbugs.gnu.org/cgi/bugreport.cgi?bug=24862#23 |
85 |
+https://bugs.gentoo.org/show_bug.cgi?id=612338 |
86 |
+ |
87 |
+--- guile-2.0.14/libguile/filesys.c |
88 |
++++ guile-2.0.14/libguile/filesys.c |
89 |
+@@ -1486,6 +1486,9 @@ |
90 |
+ mode_bits = scm_i_mode_bits (mode); |
91 |
+ } |
92 |
+ |
93 |
++#ifdef __APPLE__ |
94 |
++ open_flags &= O_APPEND|O_SHLOCK|O_EXLOCK|O_CLOEXEC; |
95 |
++#endif |
96 |
+ SCM_SYSCALL (rv = mkostemp (c_tmpl, open_flags)); |
97 |
+ if (rv == -1) |
98 |
+ SCM_SYSERROR; |
99 |
+--- guile-2.0.14/libguile/stime.c |
100 |
++++ guile-2.0.14/libguile/stime.c |
101 |
+@@ -830,6 +830,10 @@ |
102 |
+ |
103 |
+ #ifdef HAVE_POSIX_CPUTIME |
104 |
+ { |
105 |
++#ifdef __APPLE__ |
106 |
++ if (clock_gettime (CLOCK_PROCESS_CPUTIME_ID, &posix_run_time_base) == 0) |
107 |
++ get_internal_run_time = get_internal_run_time_posix_timer; |
108 |
++#else |
109 |
+ clockid_t dummy; |
110 |
+ |
111 |
+ /* Only use the _POSIX_CPUTIME clock if it's going to work across |
112 |
+@@ -839,6 +843,7 @@ |
113 |
+ get_internal_run_time = get_internal_run_time_posix_timer; |
114 |
+ else |
115 |
+ errno = 0; |
116 |
++#endif |
117 |
+ } |
118 |
+ #endif /* HAVE_POSIX_CPUTIME */ |
119 |
+ #endif /* HAVE_CLOCKTIME */ |
120 |
|
121 |
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 |
122 |
new file mode 100644 |
123 |
index 00000000..c2f136dd |
124 |
--- /dev/null |
125 |
+++ b/dev-scheme/guile/files/guile-2.0.14-ia64-fix-crash-thread-context-switch.patch |
126 |
@@ -0,0 +1,63 @@ |
127 |
+From f92888853439a8ded221f3423865c78de2a96a14 Mon Sep 17 00:00:00 2001 |
128 |
+From: Sergei Trofimovich <slyfox@g.o> |
129 |
+Date: Sun, 5 Nov 2017 09:30:45 +0000 |
130 |
+Subject: ia64: Fix crash in thread context switch. |
131 |
+MIME-Version: 1.0 |
132 |
+Content-Type: text/plain; charset=UTF-8 |
133 |
+Content-Transfer-Encoding: 8bit |
134 |
+ |
135 |
+Fixes <https://bugs.gnu.org/29151> and <https://bugs.gentoo.org/613986>. |
136 |
+ |
137 |
+Backtrace looks like that: |
138 |
+ |
139 |
+ Program terminated with signal SIGSEGV, Segmentation fault. |
140 |
+ #0 0x200000000014a5c0 in scm_ia64_longjmp (JB=0x6000000000817020, VAL=1) at continuations.c:372 |
141 |
+ 372 t->pending_rbs_continuation->backing_store, |
142 |
+ [Current thread is 1 (Thread 0x2000000000049340 (LWP 8190))] |
143 |
+ (gdb) bt |
144 |
+ #0 0x200000000014a5c0 in scm_ia64_longjmp (JB=0x6000000000817020, VAL=1) at continuations.c:372 |
145 |
+ #1 0x2000000000148e00 in scm_c_abort (vm=0x60000000000edea0, tag=0x6000000000795ba0, n=0, argv=0x60000fffff7f0ce0, cookie=-1) at control.c:239 |
146 |
+ #2 0x2000000000149070 in scm_at_abort (tag=0x6000000000795ba0, args=0x304) at control.c:258 |
147 |
+ (gdb) print t |
148 |
+ $2 = (scm_i_thread *) 0x6000000000068000 |
149 |
+ (gdb) print t->pending_rbs_continuation |
150 |
+ $3 = (scm_t_contregs *) 0xffeb |
151 |
+ |
152 |
+The problem here is the value of 't->pending_rbs_continuation' pointer. |
153 |
+It's supposed to poin to a register stack pointer or be NULL if not yet |
154 |
+backed up. |
155 |
+ |
156 |
+The problem is it is never initialized to NULL at creation time and |
157 |
+contained garbage on stack. Sometimes people are lucky and have zeros |
158 |
+on stack and guile works. But sometimes there is something and guile |
159 |
+crashes. |
160 |
+ |
161 |
+The fix is trivial: initialize 'pending_rbs_continuation = NULL' |
162 |
+at thread registration time (the same way other threads are registered). |
163 |
+ |
164 |
+Reported-by: Matt Turner |
165 |
+ |
166 |
+* libguile/threads.c (guilify_self_1): Initialize pending_rbs_continuation |
167 |
+to avoid crash on ia64. |
168 |
+ |
169 |
+Signed-off-by: Sergei Trofimovich <slyfox@g.o> |
170 |
+Signed-off-by: Ludovic Courtès <ludo@×××.org> |
171 |
+--- |
172 |
+ libguile/threads.c | 1 + |
173 |
+ 1 file changed, 1 insertion(+) |
174 |
+ |
175 |
+diff --git a/libguile/threads.c b/libguile/threads.c |
176 |
+index 9ceb5b8..770f62c 100644 |
177 |
+--- a/libguile/threads.c |
178 |
++++ b/libguile/threads.c |
179 |
+@@ -395,6 +395,7 @@ guilify_self_1 (struct GC_stack_base *base, int needs_unregister) |
180 |
+ t.base = base->mem_base; |
181 |
+ #ifdef __ia64__ |
182 |
+ t.register_backing_store_base = base->reg_base; |
183 |
++ t.pending_rbs_continuation = 0; |
184 |
+ #endif |
185 |
+ t.continuation_root = SCM_EOL; |
186 |
+ t.continuation_base = t.base; |
187 |
+-- |
188 |
+cgit v1.0-41-gc330 |
189 |
+ |
190 |
|
191 |
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 |
192 |
new file mode 100644 |
193 |
index 00000000..15c78a46 |
194 |
--- /dev/null |
195 |
+++ b/dev-scheme/guile/files/guile-2.0.14-tests-repl-server.patch |
196 |
@@ -0,0 +1,25 @@ |
197 |
+--- guile-2.2.5/test-suite/tests/00-repl-server.test.old 2017-04-14 23:26:40.000000000 +0200 |
198 |
++++ guile-2.2.5/test-suite/tests/00-repl-server.test 2019-06-23 12:16:10.624115938 +0200 |
199 |
+@@ -27,7 +27,7 @@ |
200 |
+ (define (call-with-repl-server proc) |
201 |
+ "Set up a REPL server in a separate process and call PROC with a |
202 |
+ socket connected to that server." |
203 |
+- (let ((sockaddr (make-socket-address AF_UNIX "/tmp/repl-server")) |
204 |
++ (let ((sockaddr (make-test-socket-address)) |
205 |
+ (client-socket (socket AF_UNIX SOCK_STREAM 0))) |
206 |
+ (false-if-exception |
207 |
+ (delete-file (sockaddr:path sockaddr))) |
208 |
+@@ -86,6 +86,13 @@ |
209 |
+ (lambda (client-socket) |
210 |
+ body ...))) |
211 |
+ |
212 |
++(define (make-test-socket-address) |
213 |
++ (catch 'unbound-variable |
214 |
++ (lambda () |
215 |
++ (make-socket-address AF_UNIX "/tmp/repl-server")) |
216 |
++ (lambda (key . args) |
217 |
++ (throw 'unresolved)))) |
218 |
++ |
219 |
+ (define (read-until-prompt port str) |
220 |
+ "Read from PORT until STR has been read or the end-of-file was |
221 |
+ reached." |
222 |
|
223 |
diff --git a/dev-scheme/guile/guile-2.2.5.ebuild b/dev-scheme/guile/guile-2.0.14-r4.ebuild |
224 |
similarity index 66% |
225 |
copy from dev-scheme/guile/guile-2.2.5.ebuild |
226 |
copy to dev-scheme/guile/guile-2.0.14-r4.ebuild |
227 |
index 2e0088b0..f68b2613 100644 |
228 |
--- a/dev-scheme/guile/guile-2.2.5.ebuild |
229 |
+++ b/dev-scheme/guile/guile-2.0.14-r4.ebuild |
230 |
@@ -1,47 +1,58 @@ |
231 |
# Copyright 1999-2019 Gentoo Authors |
232 |
# Distributed under the terms of the GNU General Public License v2 |
233 |
|
234 |
-EAPI=7 |
235 |
+EAPI=6 |
236 |
+inherit flag-o-matic autotools ltprune |
237 |
|
238 |
-inherit flag-o-matic |
239 |
- |
240 |
-MAJOR="2.2" |
241 |
DESCRIPTION="GNU Ubiquitous Intelligent Language for Extensions" |
242 |
HOMEPAGE="https://www.gnu.org/software/guile/" |
243 |
SRC_URI="mirror://gnu/guile/${P}.tar.gz" |
244 |
- |
245 |
+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" |
246 |
LICENSE="LGPL-3+" |
247 |
-SLOT="2.2/2.2-1" # libguile-2.2.so.1 => 2.2-1 |
248 |
-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" |
249 |
IUSE="debug debug-malloc +deprecated +networking +nls +regex +threads" # upstream recommended +networking +nls |
250 |
-REQUIRED_USE="regex" # workaround for bug 596322 |
251 |
-RESTRICT="strip" |
252 |
+# emacs useflag removal not working |
253 |
+ |
254 |
+# workaround for bug 596322 |
255 |
+REQUIRED_USE="regex" |
256 |
|
257 |
RDEPEND=" |
258 |
- !>=dev-scheme/guile-2.2:12 |
259 |
>=dev-libs/boehm-gc-7.0:=[threads?] |
260 |
dev-libs/gmp:= |
261 |
virtual/libffi:= |
262 |
dev-libs/libltdl:= |
263 |
dev-libs/libunistring:0= |
264 |
+ sys-devel/libtool |
265 |
sys-libs/ncurses:0= |
266 |
sys-libs/readline:0=" |
267 |
-DEPEND="${RDEPEND}" |
268 |
-BDEPEND=" |
269 |
+DEPEND="${RDEPEND} |
270 |
virtual/pkgconfig |
271 |
- sys-devel/libtool |
272 |
+ sys-apps/texinfo |
273 |
sys-devel/gettext" |
274 |
|
275 |
-PATCHES=( "${FILESDIR}/${PN}-2.2.3-gentoo-sandbox.patch" ) |
276 |
+SLOT="12/22" # subslot is soname version |
277 |
+MAJOR="2.0" |
278 |
+ |
279 |
DOCS=( GUILE-VERSION HACKING README ) |
280 |
|
281 |
+PATCHES=( |
282 |
+ "${FILESDIR}/${PN}-2-snarf.patch" |
283 |
+ "${FILESDIR}/${P}-darwin.patch" |
284 |
+ "${FILESDIR}/${P}-ia64-fix-crash-thread-context-switch.patch" |
285 |
+ "${FILESDIR}/${P}-tests-repl-server.patch" |
286 |
+) |
287 |
+ |
288 |
+src_prepare() { |
289 |
+ default |
290 |
+ eautoreconf |
291 |
+} |
292 |
+ |
293 |
src_configure() { |
294 |
# see bug #178499 |
295 |
filter-flags -ftree-vectorize |
296 |
+ # see bug #598986 |
297 |
+ append-cflags $(test-flags-CC -fno-fast-math) |
298 |
|
299 |
econf \ |
300 |
- --program-suffix="-${MAJOR}" \ |
301 |
- --infodir="${EPREFIX}"/usr/share/info/guile-${MAJOR} \ |
302 |
--disable-error-on-warning \ |
303 |
--disable-rpath \ |
304 |
--disable-static \ |
305 |
@@ -63,13 +74,7 @@ src_configure() { |
306 |
|
307 |
src_install() { |
308 |
default |
309 |
- |
310 |
- # The guile.m4 macro files conflicts with other slots |
311 |
- mv "${ED}"/usr/share/aclocal/guile.m4 "${ED}"/usr/share/aclocal/guile-${MAJOR}.m4 || die "rename of guile.m4 failed" |
312 |
- |
313 |
- # Bug #590904, LDFLAGS are copied within the pkg-config gile |
314 |
- sed -i "${ED}"/usr/$(get_libdir)/pkgconfig/guile-${MAJOR}.pc \ |
315 |
- -e s:"${LDFLAGS}":: |
316 |
+ prune_libtool_files |
317 |
|
318 |
# From Novell |
319 |
# https://bugzilla.novell.com/show_bug.cgi?id=874028#c0 |
320 |
@@ -79,5 +84,6 @@ src_install() { |
321 |
# necessary for registering slib, see bug 206896 |
322 |
keepdir /usr/share/guile/site |
323 |
|
324 |
- find "${D}" -name '*.la' -delete || die |
325 |
+ # Dark magic necessary for some deps |
326 |
+ dosym libguile-2.0.so /usr/$(get_libdir)/libguile.so |
327 |
} |
328 |
|
329 |
diff --git a/dev-scheme/guile/guile-2.2.5.ebuild b/dev-scheme/guile/guile-2.2.5.ebuild |
330 |
index 2e0088b0..23095046 100644 |
331 |
--- a/dev-scheme/guile/guile-2.2.5.ebuild |
332 |
+++ b/dev-scheme/guile/guile-2.2.5.ebuild |
333 |
@@ -38,6 +38,8 @@ DOCS=( GUILE-VERSION HACKING README ) |
334 |
src_configure() { |
335 |
# see bug #178499 |
336 |
filter-flags -ftree-vectorize |
337 |
+ # see bug #598986 |
338 |
+ append-cflags $(test-flags-CC -fno-fast-math) |
339 |
|
340 |
econf \ |
341 |
--program-suffix="-${MAJOR}" \ |
342 |
|
343 |
diff --git a/dev-scheme/guile/guile-2.9.2.ebuild b/dev-scheme/guile/guile-2.9.2.ebuild |
344 |
index f15a1db5..852109f4 100644 |
345 |
--- a/dev-scheme/guile/guile-2.9.2.ebuild |
346 |
+++ b/dev-scheme/guile/guile-2.9.2.ebuild |
347 |
@@ -37,6 +37,8 @@ DOCS=( GUILE-VERSION HACKING README ) |
348 |
src_configure() { |
349 |
# see bug #178499 |
350 |
filter-flags -ftree-vectorize |
351 |
+ # see bug #598986 |
352 |
+ append-cflags $(test-flags-CC -fno-fast-math) |
353 |
|
354 |
econf \ |
355 |
--program-suffix="-${MAJOR}" \ |
356 |
|
357 |
diff --git a/dev-scheme/guile/guile-9999.ebuild b/dev-scheme/guile/guile-9999.ebuild |
358 |
index 8feb94b2..f571ceed 100644 |
359 |
--- a/dev-scheme/guile/guile-9999.ebuild |
360 |
+++ b/dev-scheme/guile/guile-9999.ebuild |
361 |
@@ -44,6 +44,8 @@ src_prepare() { |
362 |
src_configure() { |
363 |
# see bug #178499 |
364 |
filter-flags -ftree-vectorize |
365 |
+ # see bug #598986 |
366 |
+ append-cflags $(test-flags-CC -fno-fast-math) |
367 |
|
368 |
econf \ |
369 |
--program-suffix="-${MAJOR}" \ |