Skip to content

12.13.0 build from scratch fails on RPi3 Raspian #30174

@btsimonh

Description

@btsimonh

In order to build NodeJS from scratch on raspbian, libatomic is needed in v8.gyp so that makesnapshot links.

I believe Raspian has an arm6l kernel, even thought the CPU reports as arm7l.

I also understand that arm6l is no longer built as an official binary, and that I should not expect to build without some pain :).

I am testing a change in v8.gyp:
line 796:

        # Platforms that don't have Compare-And-Swap (CAS) support need to link atomic library
        # to implement atomic memory access
        ['v8_current_cpu in ["mips", "mipsel", "mips64", "mips64el", "ppc"]', {
          'link_settings': {
            'libraries': ['-latomic', ],
          },
        }],

to

        # Platforms that don't have Compare-And-Swap (CAS) support need to link atomic library
        # to implement atomic memory access
        ['v8_current_cpu in ["mips", "mipsel", "mips64", "mips64el", "ppc", "arm"]', {
          'link_settings': {
            'libraries': ['-latomic', ],
          },
        }],

I am no expert on this, so I'm not sure that including "arm" covers too many platforms....

Compilation now continues - I will report final results in some hours (build is slow on RPi...).

Failure was when linking v8's mksnapshot.

I also note that the NodeJS makefiles also lack -latomic, and so have temporarily modified node.gyp to enable it:
line 295:

      ['(OS=="linux" or OS=="mac")', {
        'libraries': ['-latomic'],
      }],

to

      ['(OS=="linux" or OS=="mac") and llvm_version!=0', {
        'libraries': ['-latomic'],
      }],

I know this is an unsuitable mod - Advice on a better cross platform mod appreciated.

p.s. the armv7 binary runs happily on Raspbian on RPi3 - but is unlikely to work on RPiZero or Rpi1 (please correct me if I am wrong...)? There are millions of these devices out in the wild, and continued NodeJS support for them would be nice - e.g. for Node-Red use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    armIssues and PRs related to the ARM platform.buildIssues and PRs related to build files or the CI.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions