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 · 2 comments

Comments

@devsnek
Copy link
Member

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

This comment has been minimized.

Copy link
Member Author

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

This comment has been minimized.

Copy link
Member

commented Jun 14, 2019

@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++ label Jun 14, 2019
devsnek added a commit that referenced this issue Jun 14, 2019
Fixes #28231
@devsnek devsnek referenced this issue Jun 14, 2019
2 of 2 tasks complete
devsnek added a commit that referenced this issue Jun 18, 2019
Fixes #28231
@devsnek devsnek changed the title `__atomic_is_lock_free` undefined `__atomic_is_lock_free` undefined on clang Jun 18, 2019
@devsnek devsnek closed this in ab3174c Jun 21, 2019
targos added 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.