On Wed, Apr 24 2019, Todd Mortimer <[email protected]> wrote:
> Hello,
>
> Recently we found that lang/guile does not work with frame pointer
> omission. The patch below adds the compiler option to always include the
> frame pointer.
>
> I found when adding this option that the guile runtime would stack
> overflow, which is remedied by increasing the default stack size.
>
> With this, guile will build and run on platforms which have
> -fomit-frame-pointer on by default.
>
> Any objections? We don't have to apply this now, but if we want to
> enable frame pointer elimination again then it would be needed.
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/lang/guile/Makefile,v
> retrieving revision 1.47
> diff -u -p -u -r1.47 Makefile
> --- Makefile 2 Nov 2018 18:48:39 -0000 1.47
> +++ Makefile 25 Apr 2019 01:00:30 -0000
> @@ -36,6 +36,7 @@ USE_GMAKE= Yes
> # warning: format '%ji' expects type 'intmax_t', but argument 4 has type
> 'scm_t_intmax'
> CONFIGURE_ARGS+= --disable-error-on-warning
> CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
> + CFLAGS="-fno-omit-frame-pointer" \
Here you're clobbering CFLAGS ("-O2 -pipe" by default) instead of amending
it; the resulting guile program is thus built using -O0, triggering the
stack exhaustion. This happens even with patches/patch-libguile_eval_c
with the default 4M stack size set from login.conf.
Please use the diff below and it's ok jca@. No need for a REVISION
bump.
Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/guile/Makefile,v
retrieving revision 1.47
diff -u -p -r1.47 Makefile
--- Makefile 2 Nov 2018 18:48:39 -0000 1.47
+++ Makefile 25 Apr 2019 14:39:19 -0000
@@ -36,6 +36,7 @@ USE_GMAKE= Yes
# warning: format '%ji' expects type 'intmax_t', but argument 4 has type
'scm_t_intmax'
CONFIGURE_ARGS+= --disable-error-on-warning
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
+ CFLAGS="-fno-omit-frame-pointer ${CFLAGS}" \
LDFLAGS="-L${LOCALBASE}/lib" \
PTHREAD_CFLAGS=-pthread \
PTHREAD_LIBS=-pthread
--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE