commit:     ec0857c1f4b448861a54ad185c79528c070776e2
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Mar  3 22:15:03 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Mar  3 22:15:17 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ec0857c1

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 <AT> gentoo.org>

 profiles/features/llvm/package.use | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/profiles/features/llvm/package.use 
b/profiles/features/llvm/package.use
index 5e1bbab42414..e878f28f7454 100644
--- a/profiles/features/llvm/package.use
+++ b/profiles/features/llvm/package.use
@@ -1,3 +1,6 @@
+# Make static linking work by default for simple binaries (bug #892956)
+sys-libs/llvm-libunwind static-libs
+
 # use lld by default
 sys-devel/llvm -binutils-plugin
 

Reply via email to