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
Detect whether libatomic should be linked in when using CXX linker. #11818
Conversation
There was already a check for this when building with the bundled protobuf. Considering that we needed the same check when building for ML, I moved the check so that it can happen in either case when a C++ linker is required for the build to succeed.
@vkalintiris seems to break on CentOS7? |
IIUC,
TBH, I don't know what is the best approach here. |
632fbda
# all the atomic ops with builtins then, the library will be left unused. | ||
# Otherwise, some ops will be covered by the compiler's intrinsics and some | ||
# will be picked up by the linker from -latomic. In the later case, if | ||
# -latomic is not available there will be a build failure, which would |
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 think in future the correct way would be:
- detect if latomic is there
- detect if it is needed
if needed and not present then error in configure step with user friendly explanation to install libatomic instead of build failure
and in detect mode - disable all CXX features instead of failure
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.
needs to be finalised in the future (see comments above)
@stelfrag overview here:
|
Lets merge this |
Summary
There was already a check for this when building with the bundled
protobuf. Considering that we needed the same check when building for
ML, I moved the check so that it can happen in either case when a
C++ linker is required for the build to succeed.
Test Plan
CI jobs
Additional Information
This should fix #11812