Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node.js doesn't run on AR9331 : SIGILL , Illegal instruction #2633

Closed
captcha1 opened this issue Apr 28, 2016 · 10 comments
Closed

node.js doesn't run on AR9331 : SIGILL , Illegal instruction #2633

captcha1 opened this issue Apr 28, 2016 · 10 comments

Comments

@captcha1
Copy link

I think this is an "endian" issue. AR9331 is big endian. I tried on an "Linkit Smart 7688" (MediaTek) with CC 15.05.1, which is little endian, and it runs fine.

I tried in on an "Onion Omega" running CC 15.05.1 and a Carambola2 running "Bleeding Edge r49221" and both give SIGILL .

I tried to compile it myself with various endian flags, but still get SIGILL. I'll keep trying...

@jow-
Copy link
Contributor

jow- commented Apr 28, 2016

It can also be related to floating point instructions. If it would be an endian issue you wouldn't even be able to run the binary up to the point that it throws a SIGILL.

@captcha1
Copy link
Author

@nxhack
Copy link
Contributor

nxhack commented May 2, 2016

Is "/sys/kernel/debug/mips/fpuemustats" directory exists?
If not exist, MIPS_FPU_EMULATOR is not enabled.

@captcha1
Copy link
Author

captcha1 commented May 4, 2016

Yes, I think that's the problem : to run node.js , I need to make a kernel
w/ CONFIG_MIPS_FPU_EMULATOR=y (this web page confirms this :
http://www.egrep.jp/wiki/index.php/OpenWrt_for_Arduino_Yun_cheat_sheet ).

On Mon, May 2, 2016 at 1:16 AM, Hirokazu MORIKAWA notifications@github.com
wrote:

Is "/sys/kernel/debug/mips/fpuemustats" directory exists?
If not exist, MIPS_FPU_EMULATOR is not enabled.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#2633 (comment)

@captcha1
Copy link
Author

captcha1 commented May 5, 2016

BTW, I also filed a bug at https://dev.openwrt.org/ticket/22293 . Dunno
which is a better place for this.

As discussed in this web page : nodejs/node#4818
, I ran "make kernel_menuconfig" and selected the "Enable FPU emulation".
Built it and node.js worked (I used the node.js v4.3.1 from Onion :
http://repo.onion.io/omega/packages/nodejs_v4.3.1-1_ar71xx.ipk ).

However, in linux-3.18.29/arch/mips/math-emu/cp1emu.c , I found this
comment :

Note if you know that you won't have an FPU, then you'll get much better
performance by compiling with -msoft-float

So a better fix is to compile node.js with -msoft-float .

Though I suppose it would nice to have both -msoft-float and
MIPS_FPU_EMULATOR=y so that it runs one way or the other.

I don't know why the Linkit 7688 builds with MIPS_FPU_EMULATOR=y , but the
AR9331 does not.

Thanks,
Ken

On Tue, May 3, 2016 at 8:50 PM, Ken Harris kjh@hokulea.org wrote:

Yes, I think that's the problem : to run node.js , I need to make a kernel
w/ CONFIG_MIPS_FPU_EMULATOR=y (this web page confirms this :
http://www.egrep.jp/wiki/index.php/OpenWrt_for_Arduino_Yun_cheat_sheet ).

On Mon, May 2, 2016 at 1:16 AM, Hirokazu MORIKAWA <
notifications@github.com> wrote:

Is "/sys/kernel/debug/mips/fpuemustats" directory exists?
If not exist, MIPS_FPU_EMULATOR is not enabled.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#2633 (comment)

@JohannesRudolph
Copy link

Has anyone tried compiling node.js with -msoft-float instead an run on AR9331 board without MIPS_FPU_EMULATOR=y yet?

@eynol
Copy link

eynol commented Apr 15, 2017

@diizzyy
Copy link
Contributor

diizzyy commented Jun 2, 2017

@captcha1 @vankai
Is this still an issue?

@neocturne
Copy link
Member

NodeJS has dropped MIPS soft-float support long ago. Running a kernel with FPU emulation is the only way to use node on ar71xx.

@diizzyy
Copy link
Contributor

diizzyy commented Jun 2, 2017

@thess @hnyman
Can you close this as @NeoRaider has explained the issue?

yousong added a commit to yousong/packages that referenced this issue Jan 26, 2018
It requires a hardware or software emulated fpu, otherwise the program
can fail with SIGILL.  See openwrt#1937, openwrt#2633, openwrt#2442, FS#1257 for details

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
yousong added a commit to yousong/packages that referenced this issue Jan 27, 2018
It requires either hardware or software emulated fpu, otherwise program
can fail with SIGILL for fp instructions emitted by the JIT compiler

See openwrt#1937, openwrt#2633, openwrt#2442, FS#1257 for details

From code snippet at deps/v8/src/mips/constants-mips.h

    #elif(defined(__mips_soft_float) && __mips_soft_float != 0)
    // This flag is raised when -msoft-float is passed to the compiler.
    // // Although FPU is a base requirement for v8, soft-float ABI is used
    // // on soft-float systems with FPU kernel emulation.
    // const bool IsMipsSoftFloatABI = true;

[1] https://bugs.chromium.org/p/v8/issues/detail?id=4704

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
yousong added a commit to yousong/packages that referenced this issue Jan 29, 2018
It requires either hardware or software emulated fpu, otherwise program
can fail with SIGILL for fp instructions emitted by the JIT compiler

See openwrt#1937, openwrt#2633, openwrt#2442, FS#1257 for details

From code snippet at deps/v8/src/mips/constants-mips.h

    #elif(defined(__mips_soft_float) && __mips_soft_float != 0)
    // This flag is raised when -msoft-float is passed to the compiler.
    // // Although FPU is a base requirement for v8, soft-float ABI is used
    // // on soft-float systems with FPU kernel emulation.
    // const bool IsMipsSoftFloatABI = true;

[1] https://bugs.chromium.org/p/v8/issues/detail?id=4704

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
yousong added a commit to yousong/packages that referenced this issue Jan 30, 2018
It requires either hardware or software emulated fpu, otherwise program
can fail with SIGILL for fp instructions emitted by the JIT compiler

See openwrt#1937, openwrt#2633, openwrt#2442, FS#1257 for details

From code snippet at deps/v8/src/mips/constants-mips.h

    #elif(defined(__mips_soft_float) && __mips_soft_float != 0)
    // This flag is raised when -msoft-float is passed to the compiler.
    // // Although FPU is a base requirement for v8, soft-float ABI is used
    // // on soft-float systems with FPU kernel emulation.
    // const bool IsMipsSoftFloatABI = true;

[1] https://bugs.chromium.org/p/v8/issues/detail?id=4704

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
yousong added a commit that referenced this issue Feb 9, 2018
It requires either hardware or software emulated fpu, otherwise program
can fail with SIGILL for fp instructions emitted by the JIT compiler

See #1937, #2633, #2442, FS#1257 for details

From code snippet at deps/v8/src/mips/constants-mips.h

    #elif(defined(__mips_soft_float) && __mips_soft_float != 0)
    // This flag is raised when -msoft-float is passed to the compiler.
    // // Although FPU is a base requirement for v8, soft-float ABI is used
    // // on soft-float systems with FPU kernel emulation.
    // const bool IsMipsSoftFloatABI = true;

[1] https://bugs.chromium.org/p/v8/issues/detail?id=4704

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
lynxis pushed a commit to lynxis/packages that referenced this issue Jan 3, 2019
It requires either hardware or software emulated fpu, otherwise program
can fail with SIGILL for fp instructions emitted by the JIT compiler

See openwrt#1937, openwrt#2633, openwrt#2442, FS#1257 for details

From code snippet at deps/v8/src/mips/constants-mips.h

    #elif(defined(__mips_soft_float) && __mips_soft_float != 0)
    // This flag is raised when -msoft-float is passed to the compiler.
    // // Although FPU is a base requirement for v8, soft-float ABI is used
    // // on soft-float systems with FPU kernel emulation.
    // const bool IsMipsSoftFloatABI = true;

[1] https://bugs.chromium.org/p/v8/issues/detail?id=4704

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants