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

__atomic_is_lock_free undefined on clang #28231

Closed
devsnek opened this issue Jun 14, 2019 · 3 comments
Closed

__atomic_is_lock_free undefined on clang #28231

devsnek opened this issue Jun 14, 2019 · 3 comments
Labels
c++ Issues and PRs that require attention from people who are familiar with C++.

Comments

@devsnek
Copy link
Member

devsnek commented Jun 14, 2019

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.

@devsnek
Copy link
Member Author

devsnek commented Jun 14, 2019

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'],
+      }],
     ],
   },

@addaleax
Copy link
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…

@addaleax addaleax added the c++ Issues and PRs that require attention from people who are familiar with C++. label Jun 14, 2019
devsnek added a commit that referenced this issue Jun 14, 2019
devsnek added a commit that referenced this issue Jun 18, 2019
@devsnek devsnek changed the title __atomic_is_lock_free undefined __atomic_is_lock_free undefined on clang Jun 18, 2019
targos pushed a commit that referenced this issue Jul 2, 2019
Fixes #28231

PR-URL: #28232
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@zombieleet
Copy link
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
Labels
c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants