diff mbox

[1/1] package/nodejs: fix hard float error

Message ID 1421010259-10281-1-git-send-email-jkrause@posteo.de
State Changes Requested
Headers show

Commit Message

Jörg Krause Jan. 11, 2015, 9:04 p.m. UTC
Add support for building nodejs with hard floating ABI if supported by the
target and remove bogus comment. Buildroot does propose this tuning.

Basically, you have three cases of floating point strategies:

 * soft float, i.e 'soft' in nodejs speak. This is enabled in Buildroot
   when BR2_ARM_EABI=y and BR2_SOFT_FLOAT=y.

 * hard float using integer registers to pass floating point arguments,
   i.e 'softfp' in nodejs speak. This is enabled in Buildroot when
   BR2_ARM_EABI=y and BR2_SOFT_FLOAT is disabled.

 * hard float using floating pointer registers to pass floating point
   arguments, i.e 'hard' in nodejs speak. This is enabled in Buildroot
   when BR2_ARM_EABIHF=y.

This patch fixes "[Buildroot] Float error on SAMA5D3 Xplained using nodejs":
http://lists.busybox.net/pipermail/buildroot/2014-December/114254.html

Tested at run-time by me on a TI Beaglebone Black.

Signed-off-by: Jörg Krause <jkrause@posteo.de>
Reported-by: Cédric Heyman <c.heyman@til-technologies.fr>
Suggested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/nodejs/nodejs.mk | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Thomas Petazzoni Jan. 12, 2015, 11:33 a.m. UTC | #1
Dear Jörg Krause,

On Sun, 11 Jan 2015 22:04:19 +0100, Jörg Krause wrote:

> diff --git a/package/nodejs/nodejs.mk b/package/nodejs/nodejs.mk
> index ad598d9..3389c3c 100644
> --- a/package/nodejs/nodejs.mk
> +++ b/package/nodejs/nodejs.mk
> @@ -56,14 +56,16 @@ else ifeq ($(BR2_mipsel),y)
>  NODEJS_CPU = mipsel
>  else ifeq ($(BR2_arm),y)
>  NODEJS_CPU = arm
> -# V8 needs to know what floating point ABI the target is using.  There's also
> -# a 'hard' option which we're not exposing here at the moment, because
> -# buildroot itself doesn't really support it at present.
> +# V8 needs to know what floating point ABI the target is using.
> +ifeq ($(BR2_ARM_EABIHF),y)
> +NODEJS_ARM_FP = hard
> +else
>  ifeq ($(BR2_SOFT_FLOAT),y)
>  NODEJS_ARM_FP = soft
>  else
>  NODEJS_ARM_FP = softfp
> -endif
> +endif # BR2_SOFT_FLOAT
> +endif # BR2_ARM_EABIHF
>  endif

Why don't we simply do:

NODEJS_ARM_FP = $(BR2_GCC_TARGET_FLOAT_ABI)

 ?

Best regards,

Thomas
Jörg Krause Jan. 12, 2015, 8:42 p.m. UTC | #2
Hello Thomas,

On Mo, 2015-01-12 at 12:33 +0100, Thomas Petazzoni wrote:
> Dear Jörg Krause,
> 
> On Sun, 11 Jan 2015 22:04:19 +0100, Jörg Krause wrote:
> 
> > diff --git a/package/nodejs/nodejs.mk b/package/nodejs/nodejs.mk
> > index ad598d9..3389c3c 100644
> > --- a/package/nodejs/nodejs.mk
> > +++ b/package/nodejs/nodejs.mk
> > @@ -56,14 +56,16 @@ else ifeq ($(BR2_mipsel),y)
> >  NODEJS_CPU = mipsel
> >  else ifeq ($(BR2_arm),y)
> >  NODEJS_CPU = arm
> > -# V8 needs to know what floating point ABI the target is using.  There's also
> > -# a 'hard' option which we're not exposing here at the moment, because
> > -# buildroot itself doesn't really support it at present.
> > +# V8 needs to know what floating point ABI the target is using.
> > +ifeq ($(BR2_ARM_EABIHF),y)
> > +NODEJS_ARM_FP = hard
> > +else
> >  ifeq ($(BR2_SOFT_FLOAT),y)
> >  NODEJS_ARM_FP = soft
> >  else
> >  NODEJS_ARM_FP = softfp
> > -endif
> > +endif # BR2_SOFT_FLOAT
> > +endif # BR2_ARM_EABIHF
> >  endif
> 
> Why don't we simply do:
> 
> NODEJS_ARM_FP = $(BR2_GCC_TARGET_FLOAT_ABI)

Nice, I one-liner :-) Didn't know about BR2_GCC_TARGET_FLOAT_ABI, but
it's exactly what we need. I submit a second version soon.

Best regards
Jörg
diff mbox

Patch

diff --git a/package/nodejs/nodejs.mk b/package/nodejs/nodejs.mk
index ad598d9..3389c3c 100644
--- a/package/nodejs/nodejs.mk
+++ b/package/nodejs/nodejs.mk
@@ -56,14 +56,16 @@  else ifeq ($(BR2_mipsel),y)
 NODEJS_CPU = mipsel
 else ifeq ($(BR2_arm),y)
 NODEJS_CPU = arm
-# V8 needs to know what floating point ABI the target is using.  There's also
-# a 'hard' option which we're not exposing here at the moment, because
-# buildroot itself doesn't really support it at present.
+# V8 needs to know what floating point ABI the target is using.
+ifeq ($(BR2_ARM_EABIHF),y)
+NODEJS_ARM_FP = hard
+else
 ifeq ($(BR2_SOFT_FLOAT),y)
 NODEJS_ARM_FP = soft
 else
 NODEJS_ARM_FP = softfp
-endif
+endif # BR2_SOFT_FLOAT
+endif # BR2_ARM_EABIHF
 endif
 
 define NODEJS_CONFIGURE_CMDS