All of lore.kernel.org
 help / color / mirror / Atom feed
From: "André Draszik" <git@andred.net>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH v3 2/4] ruby: configure mis-detects isnan/isinf on musl
Date: Tue,  1 Oct 2019 10:54:50 +0100	[thread overview]
Message-ID: <20191001095452.37335-3-git@andred.net> (raw)
In-Reply-To: <20191001095452.37335-1-git@andred.net>

From: André Draszik <andre.draszik@jci.com>

The configure script does not detect isnan/isinf as macros
as is the case in musl:
    checking for isinf... no
    checking for isnan... no

Backport an upstream patch from 2.7.0-preview1 to address this:
    checking whether isinf is declared... yes
    checking whether isnan is declared... yes

Signed-off-by: André Draszik <andre.draszik@jci.com>

---
v3:
* use upstream patch instead of setting CACHED_CONFIGUREVARS
* rebase on top of CVE duplication patches removal
---
 ...ck-finite-isinf-isnan-as-macros-firs.patch | 101 ++++++++++++++++++
 meta/recipes-devtools/ruby/ruby_2.5.5.bb      |   1 +
 2 files changed, 102 insertions(+)
 create mode 100644 meta/recipes-devtools/ruby/ruby/0001-configure.ac-check-finite-isinf-isnan-as-macros-firs.patch

diff --git a/meta/recipes-devtools/ruby/ruby/0001-configure.ac-check-finite-isinf-isnan-as-macros-firs.patch b/meta/recipes-devtools/ruby/ruby/0001-configure.ac-check-finite-isinf-isnan-as-macros-firs.patch
new file mode 100644
index 0000000000..4cc1fa027f
--- /dev/null
+++ b/meta/recipes-devtools/ruby/ruby/0001-configure.ac-check-finite-isinf-isnan-as-macros-firs.patch
@@ -0,0 +1,101 @@
+From 3a8189530312e81d6c005c396565f985a47f3383 Mon Sep 17 00:00:00 2001
+From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
+Date: Fri, 8 Feb 2019 07:22:55 +0000
+Subject: [PATCH] configure.ac: check finite,isinf,isnan as macros first
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+[ruby-core:91487] [Bug #15595]
+
+git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
+
+---
+Upstream-Status: Backport [https://github.com/ruby/ruby/commit/74f94b3e6ebf15b76f3b357e754095412b006e94]
+(modified so as to apply cleanly here)
+Signed-off-by: André Draszik <andre.draszik@jci.com>
+---
+ aclocal.m4                    |  1 +
+ configure.ac                  | 13 ++++---------
+ tool/m4/ruby_replace_funcs.m4 | 13 +++++++++++++
+ 3 files changed, 18 insertions(+), 9 deletions(-)
+ create mode 100644 tool/m4/ruby_replace_funcs.m4
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index 18ba297b05..2a907b3467 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -13,3 +13,4 @@
+ 
+ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
+ m4_include([acinclude.m4])
++m4_include([tool/m4/ruby_replace_funcs.m4])
+diff --git a/configure.ac b/configure.ac
+index 8a7cee55b8..b97c5b3cc9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1189,9 +1189,6 @@ main()
+ 		ac_cv_func_fsync=yes
+ 		ac_cv_func_seekdir=yes
+ 		ac_cv_func_telldir=yes
+-		ac_cv_func_isinf=yes
+-		ac_cv_func_isnan=yes
+-		ac_cv_func_finite=yes
+ 		ac_cv_func_lchown=yes
+ 		ac_cv_func_link=yes
+ 		ac_cv_func_readlink=yes
+@@ -1239,9 +1236,6 @@ main()
+ [netbsd*], [	LIBS="-lm $LIBS"
+ 		],
+ [dragonfly*], [	LIBS="-lm $LIBS"
+-		# isinf() and isnan() are macros on DragonFly.
+-		ac_cv_func_isinf=yes
+-		ac_cv_func_isnan=yes
+ 		],
+ [aix*],[	LIBS="-lm $LIBS"
+ 		ac_cv_func_round=no
+@@ -2213,11 +2207,8 @@ AC_REPLACE_FUNCS(dup2)
+ AC_REPLACE_FUNCS(erf)
+ AC_REPLACE_FUNCS(explicit_bzero)
+ AC_REPLACE_FUNCS(ffs)
+-AC_REPLACE_FUNCS(finite)
+ AC_REPLACE_FUNCS(flock)
+ AC_REPLACE_FUNCS(hypot)
+-AC_REPLACE_FUNCS(isinf)
+-AC_REPLACE_FUNCS(isnan)
+ AC_REPLACE_FUNCS(lgamma_r)
+ AC_REPLACE_FUNCS(memmove)
+ AC_REPLACE_FUNCS(nextafter)
+@@ -2229,6 +2220,10 @@ AC_REPLACE_FUNCS(strlcpy)
+ AC_REPLACE_FUNCS(strstr)
+ AC_REPLACE_FUNCS(tgamma)
+ 
++RUBY_REPLACE_FUNC([finite], [@%:@include <math.h>])
++RUBY_REPLACE_FUNC([isinf], [@%:@include <math.h>])
++RUBY_REPLACE_FUNC([isnan], [@%:@include <math.h>])
++
+ # for missing/setproctitle.c
+ AS_CASE(["$target_os"],
+ [aix* | k*bsd*-gnu | kopensolaris*-gnu | linux* | darwin*], [AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)],
+diff --git a/tool/m4/ruby_replace_funcs.m4 b/tool/m4/ruby_replace_funcs.m4
+new file mode 100644
+index 0000000000..d0612e29a0
+--- /dev/null
++++ b/tool/m4/ruby_replace_funcs.m4
+@@ -0,0 +1,13 @@
++# -*- Autoconf -*-
++dnl RUBY_REPLACE_FUNC [func] [included]
++AC_DEFUN([RUBY_REPLACE_FUNC], [dnl
++    AC_CHECK_DECL([$1],dnl
++        [AC_DEFINE(AS_TR_CPP(HAVE_[$1]))],dnl
++        [AC_REPLACE_FUNCS($1)],dnl
++        [$2])dnl
++])
++
++dnl RUBY_REPLACE_FUNCS [funcs] [included]
++AC_DEFUN([RUBY_REPLACE_FUNCS] [dnl
++    m4_map_args_w([$1], [RUBY_REPLACE_FUNC(], [), [$2]])dnl
++])
+-- 
+2.23.0.rc1
+
diff --git a/meta/recipes-devtools/ruby/ruby_2.5.5.bb b/meta/recipes-devtools/ruby/ruby_2.5.5.bb
index 4082b02f14..341329a6a1 100644
--- a/meta/recipes-devtools/ruby/ruby_2.5.5.bb
+++ b/meta/recipes-devtools/ruby/ruby_2.5.5.bb
@@ -1,6 +1,7 @@
 require ruby.inc
 
 SRC_URI += " \
+           file://0001-configure.ac-check-finite-isinf-isnan-as-macros-firs.patch \
            file://run-ptest \
            "
 
-- 
2.23.0.rc1



  parent reply	other threads:[~2019-10-01  9:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01  9:54 [PATCH v3 0/4] ruby recipe updates André Draszik
2019-10-01  9:54 ` [PATCH v3 1/4] ruby: drop long-merged CVE patches André Draszik
2019-10-01  9:54 ` André Draszik [this message]
2019-10-01  9:54 ` [PATCH v3 3/4] ruby: fix non-IPv6 support André Draszik
2019-10-01  9:54 ` [PATCH v3 4/4] ruby: update to v2.6.4 André Draszik
2019-10-01 14:29   ` [PATCH] ruby: some ptest fixes André Draszik
2019-10-01 11:55 ` [PATCH v3 0/4] ruby recipe updates Ross Burton
2019-10-01 15:02 ` ✗ patchtest: failure for ruby recipe updates (rev2) Patchwork
2019-10-01 15:24   ` André Draszik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191001095452.37335-3-git@andred.net \
    --to=git@andred.net \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.