Skip to content

build fails on systems where libatomic.so is provided by compiler-rt #39546

Closed
@dylanaraps

Description

@dylanaraps

Version

v16.5.0

Platform

Linux desert 5.12.6 #14 SMP Thu Jul 8 23:57:15 EEST 2021 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

  1. Attempt to build nodejs in an environment without libatomic (where libatomic is provided by compiler-rt).
  2. Build fails due to missing libatomic.

In this environment, no linker flags are needed as compiler-rt provides libatomic implicitly.

The following workaround is used to get builds working:

# When libatomic does not exist, remove the linker argument which tries to use it.
[ -r /usr/lib/libatomic.so ] || {
    sed 's/-latomic//' node.gyp > _ 
    mv -f _ node.gyp
}

How often does it reproduce? Is there a required condition?

This is always reproducible in an environment without libatomic (where libatomic is provided by compiler-rt).

What is the expected behavior?

The build succeeds and libatomic is not linked when unneeded.

What do you see instead?

The build attempts to link to libatomic and fails due to the library not existing in the filesystem. The library is provided by compiler-rt in this environment.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    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