Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] ruby: assume we always have finite, isinf and isnan for uClibc
@ 2017-02-07  9:47 Vicente Olivert Riera
  2017-02-07 10:18 ` Baruch Siach
  2017-02-07 10:40 ` Peter Korsgaard
  0 siblings, 2 replies; 4+ messages in thread
From: Vicente Olivert Riera @ 2017-02-07  9:47 UTC (permalink / raw)
  To: buildroot

uClibc has __finite, __isinf and __isnan, and Ruby's configure script
checks for finite, isinf and isnan (note the missing leading __).
Because of the naming difference the checks fail, therefore the symbols
HAVE_FINITE, HAVE_ISINF and HAVE_ISNAN are not defined.
Ruby code relies on those symbols in order to define its own version of
the finite, isinf and isnan functions. Since the symbols haven't been
defined, those definitions cause conflicts with the already-existing
functions.

Fixes:
  http://autobuild.buildroot.net/results/f34/f34dc20749c6f6d12c51eddf3ee6c2ef41d7c13d/

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
---
 package/ruby/ruby.mk | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/package/ruby/ruby.mk b/package/ruby/ruby.mk
index 4c6459b..30b53d7 100644
--- a/package/ruby/ruby.mk
+++ b/package/ruby/ruby.mk
@@ -29,6 +29,13 @@ RUBY_CFLAGS += -O2
 endif
 RUBY_CONF_ENV = CFLAGS="$(RUBY_CFLAGS)"
 
+ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
+RUBY_CONF_ENV += \
+	ac_cv_func_finite=yes \
+	ac_cv_func_isinf=yes \
+	ac_cv_func_isnan=yes
+endif
+
 ifeq ($(BR2_bfin),y)
 RUBY_CONF_ENV += ac_cv_func_dl_iterate_phdr=no
 # Blackfin doesn't have FFI closure support, needed by the fiddle
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] ruby: assume we always have finite, isinf and isnan for uClibc
  2017-02-07  9:47 [Buildroot] [PATCH] ruby: assume we always have finite, isinf and isnan for uClibc Vicente Olivert Riera
@ 2017-02-07 10:18 ` Baruch Siach
  2017-02-07 11:08   ` Peter Korsgaard
  2017-02-07 10:40 ` Peter Korsgaard
  1 sibling, 1 reply; 4+ messages in thread
From: Baruch Siach @ 2017-02-07 10:18 UTC (permalink / raw)
  To: buildroot

Hi Vicente,

On Tue, Feb 07, 2017 at 09:47:59AM +0000, Vicente Olivert Riera wrote:
> uClibc has __finite, __isinf and __isnan, and Ruby's configure script
> checks for finite, isinf and isnan (note the missing leading __).
> Because of the naming difference the checks fail, therefore the symbols
> HAVE_FINITE, HAVE_ISINF and HAVE_ISNAN are not defined.
> Ruby code relies on those symbols in order to define its own version of
> the finite, isinf and isnan functions. Since the symbols haven't been
> defined, those definitions cause conflicts with the already-existing
> functions.
> 
> Fixes:
>   http://autobuild.buildroot.net/results/f34/f34dc20749c6f6d12c51eddf3ee6c2ef41d7c13d/
> 
> Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
> ---
>  package/ruby/ruby.mk | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/package/ruby/ruby.mk b/package/ruby/ruby.mk
> index 4c6459b..30b53d7 100644
> --- a/package/ruby/ruby.mk
> +++ b/package/ruby/ruby.mk
> @@ -29,6 +29,13 @@ RUBY_CFLAGS += -O2
>  endif
>  RUBY_CONF_ENV = CFLAGS="$(RUBY_CFLAGS)"
>  
> +ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)

IIUC these symbols are always defined (either as macros or as functions), so 
why not make this unconditional?

> +RUBY_CONF_ENV += \
> +	ac_cv_func_finite=yes \
> +	ac_cv_func_isinf=yes \
> +	ac_cv_func_isnan=yes
> +endif
> +
>  ifeq ($(BR2_bfin),y)
>  RUBY_CONF_ENV += ac_cv_func_dl_iterate_phdr=no
>  # Blackfin doesn't have FFI closure support, needed by the fiddle

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] ruby: assume we always have finite, isinf and isnan for uClibc
  2017-02-07  9:47 [Buildroot] [PATCH] ruby: assume we always have finite, isinf and isnan for uClibc Vicente Olivert Riera
  2017-02-07 10:18 ` Baruch Siach
@ 2017-02-07 10:40 ` Peter Korsgaard
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2017-02-07 10:40 UTC (permalink / raw)
  To: buildroot

>>>>> "Vicente" == Vicente Olivert Riera <Vincent.Riera@imgtec.com> writes:

 > uClibc has __finite, __isinf and __isnan, and Ruby's configure script
 > checks for finite, isinf and isnan (note the missing leading __).
 > Because of the naming difference the checks fail, therefore the symbols
 > HAVE_FINITE, HAVE_ISINF and HAVE_ISNAN are not defined.
 > Ruby code relies on those symbols in order to define its own version of
 > the finite, isinf and isnan functions. Since the symbols haven't been
 > defined, those definitions cause conflicts with the already-existing
 > functions.

 > Fixes:
 >   http://autobuild.buildroot.net/results/f34/f34dc20749c6f6d12c51eddf3ee6c2ef41d7c13d/

 > Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>

Committed after extending the description and adding a comment in the
.mk file, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] ruby: assume we always have finite, isinf and isnan for uClibc
  2017-02-07 10:18 ` Baruch Siach
@ 2017-02-07 11:08   ` Peter Korsgaard
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2017-02-07 11:08 UTC (permalink / raw)
  To: buildroot

>>>>> "Baruch" == Baruch Siach <baruch@tkos.co.il> writes:

Hi,

 >> +ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)

 > IIUC these symbols are always defined (either as macros or as functions), so 
 > why not make this unconditional?

True, but it is really a workaround for uClibc, so I've kept it like
this.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-02-07 11:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-07  9:47 [Buildroot] [PATCH] ruby: assume we always have finite, isinf and isnan for uClibc Vicente Olivert Riera
2017-02-07 10:18 ` Baruch Siach
2017-02-07 11:08   ` Peter Korsgaard
2017-02-07 10:40 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox