diff mbox

Float error on SAMA5D3 Xplained using nodejs

Message ID 20141205140135.606fff5a@free-electrons.com
State Not Applicable
Headers show

Commit Message

Thomas Petazzoni Dec. 5, 2014, 1:01 p.m. UTC
Dear Cédric HEYMAN,

On Fri, 05 Dec 2014 13:11:12 +0100, Cédric HEYMAN wrote:

> Trying to use nodejs's npm (built with buildroot 2014.11) on SAMA5D3 
> Xplained returns following error : 'ERROR: Binary compiled with 
> -mfloat-abi=hard but without -DUSE_EABI_HARDFLOAT'

Thanks for your bug report.

> 
> Looking in nodejs.mk shows that : 
> '....
> 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.

This comment seems bogus. I don't remember if it used to be true back
when nodejs was added, but Buildroot definitely has support for 'hard'.

> ifeq ($(BR2_SOFT_FLOAT),y)
> NODEJS_ARM_FP = soft
> else
> NODEJS_ARM_FP = softfp
> endif
> ....'
> 
> It seems there is no support for 'hard' floating point for now.
> 
> To solve that, I intend to force '-DUSE_EABI_HARDFLOAT' in nodejs 
> compilation package, but I don't know the way to do that; any advice ?
> 
> Another way to solve the problem could be to use 'soft' or 'softfp' floating 
> point strategy but menuconfig does not propose this tuning, maybe...

It does propose this tuning. Basically, you have three cases:

 * 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.

So I assume that you got this error in a BR2_ARM_EABIHF=y build,
correct?

Can you try the completely untested patch below?


Thanks,

Thomas

Comments

Thomas Petazzoni Dec. 5, 2014, 2:39 p.m. UTC | #1
Dear Cédric HEYMAN,

Please keep the list in Cc, thanks.

On Fri, 05 Dec 2014 15:28:13 +0100, Cédric HEYMAN wrote:
> This patch solves the bug, thanks for your efficient support. 
> 
> npm command result is now OK : 
> # npm
> 
> Usage: npm <command>
> 
> where <command> is one of:
>     add-user, adduser, apihelp, author, bin, bugs, c, cache,
>     completion, config, ddp, dedupe, deprecate, docs, edit,
>     explore, faq, find, find-dupes, get, help, help-search,
>     home, i, info, init, install, isntall, issues, la, link,
>     list, ll, ln, login, ls, outdated, owner, pack, prefix,
>     prune, publish, r, rb, rebuild, remove, repo, restart, rm,
>     root, run-script, s, se, search, set, show, shrinkwrap,
>     star, stars, start, stop, submodule, t, tag, test, tst, un,
>     uninstall, unlink, unpublish, unstar, up, update, v,
>     version, view, whoami
> 
> npm <cmd> -h     quick help on <cmd>
> npm -l           display full usage info
> npm faq          commonly asked questions
> npm help <term>  search for help on <term>
> npm help npm     involved overview
> 
> Specify configs in the ini-formatted file:
>     /root/.npmrc
> or on the command line via: npm <command> --key value
> Config info can be viewed via: npm help config
> 
> npm@1.4.28 /usr/lib/node_modules/npm

Cool, nice to see that it works!

> Do I or do you submit patch ? (if me, please briefly indicate me how).

Feel free to submit a patch. You will find some guidelines at
http://buildroot.org/downloads/manual/manual.html#submitting-patches.

Thanks!

Thomas
Cédric HEYMAN Dec. 8, 2014, 11:30 a.m. UTC | #2
Hello,

Unfortunately, we are not using git on our buildroot-2014.11 repository as I 
got the corresponding tarball to install it, and we actually archive under 
SVN on an internal server.

Is there another simple way to submit patch ?

Thanks
  	
Cédric HEYMAN
Ingénieur en Développement embarqué

Tél : 04.42.37.17.10| Fax : 04.42.24.28.98
Siège social : 350 rue de la Lauzière - Parc du Golf Bât 43 - CS 60481 - 
13592 AIX-EN-PROVENCE CEDEX 3



-----Original Message-----
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: "Cédric HEYMAN" <c.heyman@til-technologies.fr>
Cc: "buildroot@uclibc.org" <buildroot@uclibc.org>
Date: Fri, 5 Dec 2014 15:39:31 +0100
Subject: Re: [Buildroot] Float error on SAMA5D3 Xplained using nodejs

Dear Cédric HEYMAN,

Please keep the list in Cc, thanks.

On Fri, 05 Dec 2014 15:28:13 +0100, Cédric HEYMAN wrote:
> This patch solves the bug, thanks for your efficient support.
>
> npm command result is now OK :
> # npm
>
> Usage: npm <command>
>
> where <command> is one of:
>     add-user, adduser, apihelp, author, bin, bugs, c, cache,
>     completion, config, ddp, dedupe, deprecate, docs, edit,
>     explore, faq, find, find-dupes, get, help, help-search,
>     home, i, info, init, install, isntall, issues, la, link,
>     list, ll, ln, login, ls, outdated, owner, pack, prefix,
>     prune, publish, r, rb, rebuild, remove, repo, restart, rm,
>     root, run-script, s, se, search, set, show, shrinkwrap,
>     star, stars, start, stop, submodule, t, tag, test, tst, un,
>     uninstall, unlink, unpublish, unstar, up, update, v,
>     version, view, whoami
>
> npm <cmd> -h     quick help on <cmd>
> npm -l           display full usage info
> npm faq          commonly asked questions
> npm help <term>  search for help on <term>
> npm help npm     involved overview
>
> Specify configs in the ini-formatted file:
>     /root/.npmrc
> or on the command line via: npm <command> --key value
> Config info can be viewed via: npm help config
>
> npm@1.4.28 /usr/lib/node_modules/npm

Cool, nice to see that it works!

> Do I or do you submit patch ? (if me, please briefly indicate me how).

Feel free to submit a patch. You will find some guidelines at
http://buildroot.org/downloads/manual/manual.html#submitting-patches.

Thanks!

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

<font face="Tahoma" size="1" color="#575F5E">
<a href="http://www.til-technologies.fr/bandeau_signature/redirection.html" target="_blank">
<img src="http://www.til-technologies.fr/bandeau_signature/bandeau.jpg" width="600" height="80" border="0" alt="Plus d'actualités sur www.til-technologies.fr" />
</a>
<br>
Les informations précédentes peuvent être confidentielles ou privilégiées. Si vous n'êtes pas le destinataire prévu de ce mail, veuillez en notifier l'expéditeur en répondant à ce message puis supprimez-en toute trace de vos systèmes.
</font>
Thomas Petazzoni Feb. 7, 2015, 10:15 a.m. UTC | #3
Dear Cédric HEYMAN,

On Mon, 08 Dec 2014 12:30:28 +0100, Cédric HEYMAN wrote:

> Unfortunately, we are not using git on our buildroot-2014.11 repository as I 
> got the corresponding tarball to install it, and we actually archive under 
> SVN on an internal server.
> 
> Is there another simple way to submit patch ?

This issue has been fixed in commit
4f09b5b484af374b86af0db9e171f22fffffc8f0.

Thomas
diff mbox

Patch

diff --git a/package/nodejs/nodejs.mk b/package/nodejs/nodejs.mk
index 312aaa9..a776d5e 100644
--- a/package/nodejs/nodejs.mk
+++ b/package/nodejs/nodejs.mk
@@ -59,11 +59,15 @@  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.
+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