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
Allow passing RTLIB=compiler-rt to avoid linking in libatomic even on Linux #3597
Conversation
IIUC this adds an additional flag that the user has to specify. Is there an easy way this could be found automatically? It might not be possible, in which case this seems a reasonable way. |
Nah, if it is unspecified, RTLIB will just be empty and that ifneq will be
trivially true
…On Sat, Jul 3, 2021 at 9:30 AM Joost VandeVondele ***@***.***> wrote:
IIUC this adds an additional flag that the user has to specify. Is there
an easy way this could be found automatically? It might not be possible, in
which case this seems a reasonable way.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3597 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABVHKDIKRITXLB27KOII4LTV24DHANCNFSM47PV4D2A>
.
|
right, but I mean, is there a way so that the user doesn't need to specify the flag, and we just do the right thing. |
Ah, I misread your comment. Apologies. It is hard to conftest for,
usually that will be just be the job of the package maintainer to make
sure RTLIB is set appropriately. It is an extremely niche case, I
would guess less than a 50 people will ever hit this issue (libatomic
and libstdc++ are installed in 99.99% of linux installations)
https://gitlab.exherbo.org/exherbo/games/-/merge_requests/91/diffs
You can see here above how I package stockfish in our distro with this patch.
…On Sat, Jul 3, 2021 at 9:38 AM Joost VandeVondele ***@***.***> wrote:
right, but I mean, is there a way so that the user doesn't need to specify the flag, and we just do the right thing.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
OK, looks good. Always nice to see SF be part of a distro. |
btw, I had this question actually yesterday, what's the distro that doesn't have libstdc++ ? |
On Exherbo Linux (source based distribution), we have libstdc++ (and most exherbo dev/users do have it installed) 'packaged', but we have an alternatives system where you can switch your system compiler toolchain (amongst other things). LLVM's clang is the alternative, and it can be built in such a way to be self-hosting and built against LLVM's libc++ instead of libstdc++. Furthermore, it can be built so it uses the compiler-rt runtime over libgcc, so it doesn't rely on any part of gcc. (A fully libstdc++less system is still experimental by the way, my changes to the gcc toolchain haven't been merged yet, gcc currently has a post-dependency for libstdc++ for convenience). (And libatomic is a dependency of libstdc++, and if you don't have that installed, there's no need to have libatomic either). Hope that clears things up :) |
msys2 provides different clang packages:
|
Not all linux users will have libatomic installed. When using clang as the system compiler with compiler-rt as the default runtime library instead of libgcc, atomic builtins may be provided by compiler-rt. This change allows such users to pass RTLIB=compiler-rt to make sure the build doesn't error out on the missing (unnecessary) libatomic. closes official-stockfish#3597 No functional change
Not all linux users will have libatomic installed. When using clang as the system compiler with compiler-rt as the default runtime library instead of libgcc, atomic builtins may be provided by compiler-rt.
This change allows such users to pass RTLIB=compiler-rt to make sure the build doesn't error out on the missing (unnecessary) libatomic. Needless to say, this commit doesn't change anything if said flag isn't passed