镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

__atomic_is_lock_free undefined on clang #28231

Description

@devsnek

cc @addaleax

out/Release/obj.target/libnode/src/node.o: In function `node::RegisterSignalHandler(int, void (*)(int, siginfo_t*, void*), bool)':
node.cc:(.text+0x17b4): undefined reference to `__atomic_is_lock_free'

i'm on debian+wsl

update: adding -latomic fixes this, but i'm not sure where to put that within our build tooling.

Activity

  1. devsnek commented on Jun 14, 2019

    @devsnek
    MemberAuthor

    this appears to fix it, is this correct?

    diff --git a/node.gyp b/node.gyp
    index 56377d6a0c..7913599e4e 100644
    --- a/node.gyp
    +++ b/node.gyp
    @@ -289,6 +289,9 @@
               '-Wl,-bnoerrmsg',
             ],
           }],
    +      ['OS=="linux" or OS=="mac"', {
    +        'libraries': ['-latomic'],
    +      }],
         ],
       },
  2. addaleax commented on Jun 14, 2019

    @addaleax
    Member

    @devsnek Yeah, if it passes CI then that looks good to me :) I’m surprised that CI for #27775 passed without it, though, and we didn’t really need it so far even though we (and V8) use atomic operations a lot…

  3. added
    c++Issues and PRs that require attention from people who are familiar with C++.
    on Jun 14, 2019
  4. changed the title [-]`__atomic_is_lock_free` undefined[/-] [+]`__atomic_is_lock_free` undefined on clang[/+] on Jun 18, 2019
  5. added a commit that references this issue on Jun 21, 2019
  6. added a commit that references this issue on Jul 2, 2019
  7. zombieleet commented on Oct 11, 2022

    @zombieleet
    Contributor

    I just stumbled into this exact issue as well, the PR that fixes this issue did not work for me, removing llvm_version!=0.0 (I have llvm installed on my computer) from node.gyp fixes the issue for me.

    Kernel: 5.18.0-14parrot1-amd64
    Arch: X86_64

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

    c++Issues and PRs that require attention from people who are familiar with C++.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions