-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
build: link libatomic on gcc or clang on linux #28532
Conversation
@nodejs/node-gyp |
node-gyp only uses common.gypi so this change should be harmless in that respect. |
node.gyp
Outdated
@@ -289,7 +289,7 @@ | |||
'-Wl,-bnoerrmsg', | |||
], | |||
}], | |||
['(OS=="linux" or OS=="mac") and llvm_version!=0', { | |||
['llvm_version==0 or (llvm_version!=0 and OS=="linux")', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having trouble understanding what problem this fixes. This is adding -latomic
for all platforms when gcc is used, why? It is also removing -latomic
on Macs when clang is used, but wasn't one of the bugs in the linked reports explicitly about needing -latomic
with clang on Mac?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically clang always needs libatomic, but node only uses it on mac and linux for the v8 sigsegv handlers.
I don't believe it's ever needed on GCC, but I could be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is adding -latomic for all platforms when gcc is used, why?
I assumed this was implicitly required by the previous state. I've replace it with:
OS=="linux" and llvm_version!=0
to only add it on cllang+linux
but wasn't one of the bugs in the linked reports explicitly about needing -latomic with clang on Mac?
no, the #28231 mention clang+linux, it fails on clang+darwin NixOS/nixpkgs#64253 (comment)
technically clang always needs libatomic
not quite, libatomic
is a gcc library. Clang by default is to be built to use it on Linux, and to use compiler-rt
on darwin
004c76a
to
9398c7b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will fail on mac+clang now
@devsnek I've tested on clang+darwin https://hatebin.com/vrlbbcwsia and gcc+linux (both with nix) |
@marsam on example error:
|
AFAIK
I think adding |
I don't really know what any of the stuff you linked means, but you have an alternative to -latomic that doesn't break macos+clang, please include it in this pr. |
Ping @marsam |
@BridgeAR sorry for the delay, I'm not sure how to solve @devsnek's issue. I'm not familiar with gyp, and I could patch it downstream, hence I will not be working on this PR any further. Feel free to close it, thanks. |
Closed in favor of #30099 |
See: #28231 #28232
libatomic is a gcc library. Clang default is to be built to use it on Linux.
cc: @devsnek @addaleax
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes