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

compile error ,target=arm7 #3224

Closed
solzoc opened this issue Oct 6, 2015 · 11 comments
Closed

compile error ,target=arm7 #3224

solzoc opened this issue Oct 6, 2015 · 11 comments
Labels
arm Issues and PRs related to the ARM platform. build Issues and PRs related to build files or the CI.

Comments

@solzoc
Copy link

solzoc commented Oct 6, 2015

I'm trying to compile nodejs v4.1.0 with gcc version 4.8 for arm v7 platform. but I've got an error:

../deps/v8/src/base/lazy-instance.h:96:10: error: field 'T' has incomplete type
struct V8_ALIGNAS(T, 16) StorageType {
       ^

V8_ALIGNAS is defined in deps/v8/include/v8config.h

...
#if V8_HAS_CXX11_ALIGNAS
# define V8_ALIGNAS(type, alignment) alignas(type)
#elif V8_HAS_ATTRIBUTE_ALIGNED
...
@jbergstroem jbergstroem added the build Issues and PRs related to build files or the CI. label Oct 6, 2015
@mscdex mscdex added the arm Issues and PRs related to the ARM platform. label Oct 6, 2015
@mscdex
Copy link
Contributor

mscdex commented Oct 6, 2015

Can you show how you're configuring and building (specifically what commands)? Additionally, are you cross-compiling or compiling on-device?

@solzoc
Copy link
Author

solzoc commented Oct 7, 2015

I used script on this post: https://gist.github.com/Gioyik/7895192
And I'm cross-compiling on linux pc.

@bnoordhuis
Copy link
Member

It looks like you're hitting a compiler bug, not much we can do about that. See if you can upgrade to g++ 4.9 or 5.1 or try using clang++.

@solzoc
Copy link
Author

solzoc commented Oct 8, 2015

Thank you for your comment.
gcc 4.8.2 resolves the error .
I guess early 4.8 gcc version might have the problem

@solzoc
Copy link
Author

solzoc commented Oct 8, 2015

I compiled successfully, but when I download cross-compiled node* to arm board and execute it, I've got error

$ ./node
 Illegal instruction
$

@bnoordhuis
Copy link
Member

Does node --noenable_vfp3 work? If so, you may need to configure the FPU. A patch for that landed just yesterday, commit 17665af.

@kvic-z
Copy link

kvic-z commented Oct 27, 2015

Same situation of Illegal Instruction here. Tried with --noenable_vfp3. Any ideas what else to try? My SoC is a Cortex-A9 (Broadcom 4708) without a FPU. Here is the backtrace.

(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /tmp/mnt/sandisk/entware.arm/local/node-v4.2.1/bin/node "--noenable_vfp3"
warning: File "/tmp/mnt/sandisk/entware.arm/lib/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
[New LWP 4707]
[New LWP 4708]
[New LWP 4709]
[New LWP 4710]

Program received signal SIGILL, Illegal instruction.
0x55e1e284 in ?? ()
(gdb) bt
#0  0x55e1e284 in ?? ()
#1  0x003addb0 in v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*, bool) ()
#2  0x0026a214 in v8::internal::Genesis::CompileNative(v8::internal::Isolate*, v8::internal::Vector<char const>, v8::internal::Handle<v8::internal::String>, int, v8::internal::Handle<v8::internal::Object>*) ()
#3  0x0026ee00 in v8::internal::Genesis::CompileBuiltin(v8::internal::Isolate*, int) ()
#4  0x0027259c in v8::internal::Genesis::InstallNatives() ()
#5  0x002744d4 in v8::internal::Genesis::Genesis(v8::internal::Isolate*, v8::internal::MaybeHandle<v8::internal::JSGlobalProxy>, v8::Local<v8::ObjectTemplate>, v8::ExtensionConfiguration*) ()
#6  0x002748f0 in v8::internal::Bootstrapper::CreateEnvironment(v8::internal::MaybeHandle<v8::internal::JSGlobalProxy>, v8::Local<v8::ObjectTemplate>, v8::ExtensionConfiguration*) ()
#7  0x002426c8 in v8::Context::New(v8::Isolate*, v8::ExtensionConfiguration*, v8::Local<v8::ObjectTemplate>, v8::Local<v8::Value>)
    ()
#8  0x0072c7c4 in node::Start(int, char**) ()
#9  0x402681bc in __libc_start_main () from /opt/lib/libc.so.6
#10 0x00213634 in _start ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

@bnoordhuis
Copy link
Member

What does disassemble $pc,$pc+16 print?

PS: I don't think node.js and V8 support nofpu mode as such but I would expect the kernel to emulate floating point instructions.

@kvic-z
Copy link

kvic-z commented Oct 27, 2015

Here you're (thanks for the speedy response btw:)

(gdb) disassemble $pc,$pc+16
Dump of assembler code from 0x3cf1e284 to 0x3cf1e294:
=> 0x3cf1e284:  vpush   {d8-d15}
   0x3cf1e288:  mov r12, #0
   0x3cf1e28c:  vmov    d14, r12, r12
   0x3cf1e290:  vmrs    r4, fpscr
End of assembler dump.

My kernel perhaps doesn't have FPU emulation compiled in. I'll need to check. I compiled node.js+v8 with -mfloat-abi=soft. I thought FPU emulation handled by c/c++ libraries without kernel involvement?

@bnoordhuis
Copy link
Member

Right, it looks like emulation is indeed disabled.

I compiled node.js+v8 with -mfloat-abi=soft. I thought FPU emulation handled by c/c++ libraries without kernel involvement?

For C and C++ code, yes. V8 is a JIT compiler however, it generates machine code at run-time, and I'm almost positive it doesn't support FPU-less mode.

@bnoordhuis
Copy link
Member

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arm Issues and PRs related to the ARM platform. build Issues and PRs related to build files or the CI.
Projects
None yet
Development

No branches or pull requests

5 participants