Skip to content

compile error ,target=arm7 #3224

Description

@solzoc

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

Activity

  1. added
    buildIssues and PRs related to Node.js builds or CI infrastructure.
    on Oct 6, 2015
  2. added
    armIssues and PRs related to the ARM architecture.
    on Oct 6, 2015
  3. mscdex commented on Oct 6, 2015

    @mscdex
    Contributor

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

  4. solzoc commented on Oct 7, 2015

    @solzoc
    Author

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

  5. bnoordhuis commented on Oct 7, 2015

    @bnoordhuis
    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++.

  6. solzoc commented on Oct 8, 2015

    @solzoc
    Author

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

  7. solzoc commented on Oct 8, 2015

    @solzoc
    Author

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

    $ ./node
     Illegal instruction
    $
    
  8. bnoordhuis commented on Oct 8, 2015

    @bnoordhuis
    Member

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

  9. kvic-z commented on Oct 27, 2015

    @kvic-z

    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?)
    
  10. bnoordhuis commented on Oct 27, 2015

    @bnoordhuis
    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.

  11. kvic-z commented on Oct 27, 2015

    @kvic-z

    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?

  12. bnoordhuis commented on Oct 27, 2015

    @bnoordhuis
    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.

  13. bnoordhuis commented on Feb 12, 2016

    @bnoordhuis
    Member

    Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    armIssues and PRs related to the ARM architecture.buildIssues and PRs related to Node.js builds or CI infrastructure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions