On Thu, 26 Dec 2019 21:58:36 +0100 Jeremie Courreges-Anglas <j...@wxcvbn.org> wrote:
> On Wed, Dec 25 2019, Jeremy Evans <jer...@openbsd.org> wrote: > > Tested on amd64, for about 9 months starting with the first preview > > release. OK to import? > > This fails on sparc64, log attached. It *seems* that the configure > tests are picky because of APIWARN and libgmp. And indeed the build > fails similarly on amd64 with USE_LLD=No (only ld.bfd warns about unsafe > functions, ld.lld does not). I built ruby-2.7.0 on macppc/powerpc with the diff below. The ld.bfd warning from libgmp broke the configure test for __func__, so RUBY_FUNCTION_NAME_STRING went missing. This test might have been broken for a long time, but RUBY_FUNCTION_NAME_STRING was optional until Nov 17 [1], so it didn't break the build before 2.7.0. Some other tests in my config.log get the same warning from libgmp, but seem to ignore the warning. For upstream Ruby, I suggest to check if __func__ can become an allowed C99 feature [2]. If so, Ruby can remove this configure test and always use __func__. I got another error where coroutine/copy/Context.h included <alloca.h>, so I deleted the include. OpenBSD (except amd64, i386) is the only system where Ruby enables --with-coroutine=copy by default, so this code is mostly for OpenBSD, but didn't work on OpenBSD, because we have no <alloca.h>! I don't check HAVE_ALLOCA_H because the coroutine code doesn't include the Ruby header for HAVE_ALLOCA_H. I have not reported these bugs to https://bugs.ruby-lang.org/ but might report them tomorrow. --George [1] https://github.com/ruby/ruby/commit/57cd462 [2] https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/C99 --- patches/patch-configure.orig Thu Dec 19 19:35:50 2019 +++ patches/patch-configure Thu Dec 26 20:49:24 2019 @@ -1,5 +1,8 @@ $OpenBSD: patch-configure,v 1.2 2019/02/01 16:24:59 jeremy Exp $ +Ignore ".../libgmp.so.*: warning: vsprintf() is often misused..." +from ld.bfd when trying __func__. + Set correct shared library name. Override the arch setting to remove OpenBSD version from it, @@ -8,6 +11,15 @@ Index: configure --- configure.orig +++ configure +@@ -18679,7 +18679,7 @@ else + unset rb_c_werror_flag + + fi +-ac_c_werror_flag=yes ++unset ac_c_werror_flag + + for func in __func__ __FUNCTION__; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -28712,7 +28712,7 @@ fi ;; #( openbsd*|mirbsd*) : --- /dev/null Thu Dec 26 22:49:53 2019 +++ patches/patch-coroutine_copy_Context_h Thu Dec 26 21:07:11 2019 @@ -0,0 +1,13 @@ +$OpenBSD$ + +Index: coroutine/copy/Context.h +--- coroutine/copy/Context.h.orig ++++ coroutine/copy/Context.h +@@ -12,7 +12,6 @@ + #include <setjmp.h> + #include <string.h> + #include <stdlib.h> +-#include <alloca.h> + + #define COROUTINE __attribute__((noreturn)) void +