Summary: | sys-libs/glibc[static-libs] (and probably virtual/libc[static-libs]) should provide enough libraries to make simple static linking work | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Sergei Trofimovich <slyich> |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | josh, llvm, sam |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://github.com/trofi/nix-guix-gentoo/issues/28 https://bugs.gentoo.org/show_bug.cgi?id=893132 https://bugs.gentoo.org/show_bug.cgi?id=899582 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 893932 |
Description
Sergei Trofimovich
2023-02-02 18:52:05 UTC
FWIW the LLVM/Clang profiles are considered pretty experimental still. For Clang, it's tricky because it depends on configuration and the (default) flags passed. Ionen points out it should be harmless dep-wise (non-invasive to users, no need to then enable static-libs for its deps) to default to +static-libs on llvm-libunwind, which would cover most cases here. I think that generally makes sense. I see three options: 1. Adding IUSE=llvm-libunwind to virtual/libc 2. Defaulting on (which doesn't feel like a full solution alone) +static-libs in llvm-libunwind 3. Making clang-common[default-compiler-rt] depend on libunwind[static-libs] (or correspondingly llvm-libunwind[static-libs] if USE=llvm-libunwind) I think 2+3 is probably a good fit?
>
> I see three options:
> 1. Adding IUSE=llvm-libunwind to virtual/libc
> 2. Defaulting on (which doesn't feel like a full solution alone)
> +static-libs in llvm-libunwind
> 3. Making clang-common[default-compiler-rt] depend on libunwind[static-libs]
> (or correspondingly llvm-libunwind[static-libs] if USE=llvm-libunwind)
>
> I think 2+3 is probably a good fit?
Yes.
We need to keep in mind that there are other library candidates too (unfortunately). Things like libatomic for example ...
*** Bug 893132 has been marked as a duplicate of this bug. *** The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5618033009fedcbe3a0491552cf296faade27087 commit 5618033009fedcbe3a0491552cf296faade27087 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-03-03 22:21:49 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-03-03 22:21:49 +0000 sys-devel/clang-common: require *unwind[static-libs] for USE=default-compiler-rt Builtins don't work correctly without this. Closes: https://bugs.gentoo.org/892956 Signed-off-by: Sam James <sam@gentoo.org> .../{clang-common-15.0.7-r2.ebuild => clang-common-15.0.7-r3.ebuild} | 4 ++-- sys-devel/clang-common/clang-common-16.0.0.9999.ebuild | 4 ++-- ...ang-common-16.0.0_rc3.ebuild => clang-common-16.0.0_rc3-r1.ebuild} | 4 ++-- sys-devel/clang-common/clang-common-17.0.0.9999.ebuild | 4 ++-- sys-devel/clang-common/clang-common-17.0.0_pre20230225.ebuild | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ec0857c1f4b448861a54ad185c79528c070776e2 commit ec0857c1f4b448861a54ad185c79528c070776e2 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-03-03 22:15:03 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-03-03 22:15:17 +0000 profiles/features/llvm: default sys-libs/llvm-libunwind[static-libs] on Without this, statically linking even a basic example fails because we're using llvm-libunwind rather than GCC's internals. Quoting myself on the bug: """ FWIW the LLVM/Clang profiles are considered pretty experimental still. For Clang, it's tricky because it depends on configuration and the (default) flags passed. Ionen points out it should be harmless dep-wise (non-invasive to users, no need to then enable static-libs for its deps) to default to +static-libs on llvm-libunwind, which would cover most cases here. I think that generally makes sense. I see three options: 1. Adding IUSE=llvm-libunwind to virtual/libc 2. Defaulting on (which doesn't feel like a full solution alone) +static-libs in llvm-libunwind 3. Making clang-common[default-compiler-rt] depend on libunwind[static-libs] (or correspondingly llvm-libunwind[static-libs] if USE=llvm-libunwind) I think 2+3 is probably a good fit? """ Bug: https://bugs.gentoo.org/892956 Signed-off-by: Sam James <sam@gentoo.org> profiles/features/llvm/package.use | 3 +++ 1 file changed, 3 insertions(+) It's not obvious from the closed bug. Is one expected to write DEPEND=" elibc_glibc? ( sys-libs/glibc[static-libs(+)] ) " (and whatever is required for other libcs) to pull in static libraries enough for linking libc statically? I don't think DEPEND="virtual/libc" guarantees presence of enough static libraries. I'll reopen so I don't forget to revisit. |