-
Notifications
You must be signed in to change notification settings - Fork 149
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
Support for musl libc and uclibc #1908
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
amadio
commented
Feb 14, 2023
amadio
force-pushed
the
musl
branch
6 times, most recently
from
February 15, 2023 09:02
c0b4692
to
1d69962
Compare
Fixes compilation issue on older gcc ``` /usr/src/xrootd-5.5.2/src/XrdPosix/XrdPosixAdmin.cc: In member function ‘XrdCl::URL* XrdPosixAdmin::FanOut(int&)’: /usr/src/xrootd-5.5.2/src/XrdPosix/XrdPosixAdmin.cc:70:32: error: ‘ptrdiff_t’ was not declared in this scope if (i > std::numeric_limits<ptrdiff_t>::max() / sizeof(XrdCl::URL)) ^ /usr/src/xrootd-5.5.2/src/XrdPosix/XrdPosixAdmin.cc:70:32: note: suggested alternatives: In file included from /usr/include/c++/5/limits:42:0, from /usr/src/xrootd-5.5.2/src/XrdPosix/XrdPosixAdmin.cc:32: /usr/include/x86_64-linux-gnu/c++/5/bits/c++config.h:197:28: note: ‘std::ptrdiff_t’ typedef __PTRDIFF_TYPE__ ptrdiff_t; ^ /usr/include/x86_64-linux-gnu/c++/5/bits/c++config.h:197:28: note: ‘std::ptrdiff_t’ /usr/src/xrootd-5.5.2/src/XrdPosix/XrdPosixAdmin.cc:70:41: error: template argument 1 is invalid if (i > std::numeric_limits<ptrdiff_t>::max() / sizeof(XrdCl::URL)) ^ src/CMakeFiles/XrdPosix.dir/build.make:62: recipe for target 'src/CMakeFiles/XrdPosix.dir/XrdPosix/XrdPosixAdmin.cc.o' failed make[2]: *** [src/CMakeFiles/XrdPosix.dir/XrdPosix/XrdPosixAdmin.cc.o] Error 1 ```
…provides a checksum computation program Solves issue xrootd#1901
…cter." This reverts commit 22d308a.
* Initialize all variables to avoid a potential 'may be used uninitialized' warning that will become an error with `-flto=auto` is used. Co-authored-by: Adrian Sevcenco <adrian.sevcenco@cern.ch>
Out of principle musl libc provides no means for detecting it, leaving developers to figure it out for themselves. The choice here is to use the compiler to print the target triple, which contains the libc implementation as the last part. On Voidlinux it's x86_64-linux-musl, and on Alpine it's x86_64-alpine-linux-musl. This should be reliable enough to not wrongly detect other libc implementations as musl (and failure to detect will only affect platforms based on musl as well). See https://wiki.musl-libc.org/faq.html for more information.
Based on work from pull request xrootd#1632. Co-authored-by: Guilherme Amadio <amadio@cern.ch>
The header execinfo.h is not available on musl, so the #ifdefs needed to be adjusted accordingly. This header is available on macOS, and with both glibc and uclibc on Linux, though.
This covers building with musl libc.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Based on work from and replaces pull request #1632.