Bug 12166 - Compiling nodejs for SAMA5D3 always crash with illegal instruction
Summary: Compiling nodejs for SAMA5D3 always crash with illegal instruction
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2019.05.1
Hardware: Other Linux
: P5 normal
Target Milestone: ---
Assignee: Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-02 18:43 UTC by Dan Smolik
Modified: 2019-11-28 22:01 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Smolik 2019-09-02 18:43:39 UTC
I compile buildroot with attached config for SAMA5D3 ARM CPU. When I enable EABIHF and VFPv3-D16  (I test all combination of VFP)  nodejs always crash with illegal instruction. I test many combination of version buildroot but always crash. But I found solution. When I compile nodejs ouside buidroot but using buildroot toolchain. All works perfect. When I backtrace and disassemble code I found
that nodejs crash here:

 0x0073ddec <+160>:   vldr    d17, [r2]

If I understand this well that when I compile for VFPv3-D16 there should not be 
register D17 used. This generate illegal instruction. 

When I use this configure:

export CC=arm-buildroot-linux-uclibcgnueabihf-gcc  
export CXX=arm-buildroot-linux-uclibcgnueabihf-g++ 
export  CC_host="gcc -m32" 
export CXX_host="g++ -m32" 


/configure --prefix=../install --dest-cpu=arm --cross-compiling --dest-os=linux   --with-arm-float-abi=hard --with-arm-fpu=vfpv3-d16

I mean then inside buidroot is to configure  passed wrong options with-arm-fpu=vfpv3-d16.

Don't  hestiate contact me.

Dan
Comment 1 Dan Smolik 2019-09-02 18:49:38 UTC
URL form my buildrootconfig

https://drive.google.com/open?id=1gvl2QoB-F1lK1mJPjnj1U2hsE9G-QlQT
Comment 2 Thomas Petazzoni 2019-11-27 08:35:33 UTC
It seems like the nodejs build system is overriding the mfpu flag, and OpenEmbedded has a patch to remove this logic, see https://github.com/openembedded/meta-openembedded/blob/master/meta-oe/recipes-devtools/nodejs/nodejs/0007-v8-don-t-override-ARM-CFLAGS.patch.

Could you try to apply this patch to nodejs, and see if it fixes the issue for you ?
Comment 3 Dan Smolik 2019-11-27 08:46:43 UTC
Yes I can. I test it and report back.
Comment 4 Thomas Petazzoni 2019-11-27 20:37:42 UTC
I have submitted a fix at https://patchwork.ozlabs.org/patch/1201811/
Comment 6 Dan Smolik 2019-11-28 22:01:14 UTC
Thank you.
Regards  from Prague