commit: 502e5f649c1f68a28cb9aa26b3ad5b7f6ab4cd99
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 6 19:53:46 2022 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Oct 6 20:11:19 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=502e5f64
sys-devel/clang-common: Multiple config improvements
- explicitly use binutils/GCC runtime defaults when default-*
flags are disabled instead of relying on implicit platform defaults
- add explicit dependencies on binutils/GCC when the respective runtimes
or tools are used
- use long option forms
- explicitly use ld.bfd instead of ld, when lld is not used
Notably, this resolves a problem of clang implicitly choosing ld.lld
when sys-devel/lld-toolchain-symlinks[native-symlinks] is installed.
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
sys-devel/clang-common/clang-common-15.0.2.9999.ebuild | 15 +++++++--------
sys-devel/clang-common/clang-common-16.0.0.9999.ebuild | 15 +++++++--------
.../clang-common/clang-common-16.0.0_pre20221006.ebuild | 15 +++++++--------
3 files changed, 21 insertions(+), 24 deletions(-)
diff --git a/sys-devel/clang-common/clang-common-15.0.2.9999.ebuild
b/sys-devel/clang-common/clang-common-15.0.2.9999.ebuild
index db83638be497..7fc966f60858 100644
--- a/sys-devel/clang-common/clang-common-15.0.2.9999.ebuild
+++ b/sys-devel/clang-common/clang-common-15.0.2.9999.ebuild
@@ -20,8 +20,11 @@ PDEPEND="
llvm-libunwind? ( sys-libs/llvm-libunwind )
!llvm-libunwind? ( sys-libs/libunwind )
)
+ !default-compiler-rt? ( sys-devel/gcc )
default-libcxx? ( >=sys-libs/libcxx-${PV} )
+ !default-libcxx? ( sys-devel/gcc )
default-lld? ( sys-devel/lld )
+ !default-lld? ( sys-devel/binutils )
"
LLVM_COMPONENTS=( clang/utils )
@@ -53,10 +56,6 @@ pkg_pretend() {
fi
}
-usec() {
- usex "default-${1}" "" "# "
-}
-
src_install() {
newbashcomp bash-autocomplete.sh clang
@@ -65,10 +64,10 @@ src_install() {
# This file is initially generated by sys-devel/clang-runtime.
# It is used to control the default runtimes using by clang.
- $(usec compiler-rt)-rtlib=compiler-rt
- $(usec compiler-rt)-unwindlib=libunwind
- $(usec libcxx)-stdlib=libc++
- $(usec lld)-fuse-ld=lld
+ --rtlib=$(usex default-compiler-rt compiler-rt libgcc)
+ --unwindlib=$(usex default-compiler-rt libunwind libgcc)
+ --stdlib=$(usex default-libcxx libc++ libstdc++)
+ -fuse-ld=$(usex default-lld lld bfd)
EOF
newins - gentoo-gcc-install.cfg <<-EOF
diff --git a/sys-devel/clang-common/clang-common-16.0.0.9999.ebuild
b/sys-devel/clang-common/clang-common-16.0.0.9999.ebuild
index db83638be497..7fc966f60858 100644
--- a/sys-devel/clang-common/clang-common-16.0.0.9999.ebuild
+++ b/sys-devel/clang-common/clang-common-16.0.0.9999.ebuild
@@ -20,8 +20,11 @@ PDEPEND="
llvm-libunwind? ( sys-libs/llvm-libunwind )
!llvm-libunwind? ( sys-libs/libunwind )
)
+ !default-compiler-rt? ( sys-devel/gcc )
default-libcxx? ( >=sys-libs/libcxx-${PV} )
+ !default-libcxx? ( sys-devel/gcc )
default-lld? ( sys-devel/lld )
+ !default-lld? ( sys-devel/binutils )
"
LLVM_COMPONENTS=( clang/utils )
@@ -53,10 +56,6 @@ pkg_pretend() {
fi
}
-usec() {
- usex "default-${1}" "" "# "
-}
-
src_install() {
newbashcomp bash-autocomplete.sh clang
@@ -65,10 +64,10 @@ src_install() {
# This file is initially generated by sys-devel/clang-runtime.
# It is used to control the default runtimes using by clang.
- $(usec compiler-rt)-rtlib=compiler-rt
- $(usec compiler-rt)-unwindlib=libunwind
- $(usec libcxx)-stdlib=libc++
- $(usec lld)-fuse-ld=lld
+ --rtlib=$(usex default-compiler-rt compiler-rt libgcc)
+ --unwindlib=$(usex default-compiler-rt libunwind libgcc)
+ --stdlib=$(usex default-libcxx libc++ libstdc++)
+ -fuse-ld=$(usex default-lld lld bfd)
EOF
newins - gentoo-gcc-install.cfg <<-EOF
diff --git a/sys-devel/clang-common/clang-common-16.0.0_pre20221006.ebuild
b/sys-devel/clang-common/clang-common-16.0.0_pre20221006.ebuild
index db83638be497..7fc966f60858 100644
--- a/sys-devel/clang-common/clang-common-16.0.0_pre20221006.ebuild
+++ b/sys-devel/clang-common/clang-common-16.0.0_pre20221006.ebuild
@@ -20,8 +20,11 @@ PDEPEND="
llvm-libunwind? ( sys-libs/llvm-libunwind )
!llvm-libunwind? ( sys-libs/libunwind )
)
+ !default-compiler-rt? ( sys-devel/gcc )
default-libcxx? ( >=sys-libs/libcxx-${PV} )
+ !default-libcxx? ( sys-devel/gcc )
default-lld? ( sys-devel/lld )
+ !default-lld? ( sys-devel/binutils )
"
LLVM_COMPONENTS=( clang/utils )
@@ -53,10 +56,6 @@ pkg_pretend() {
fi
}
-usec() {
- usex "default-${1}" "" "# "
-}
-
src_install() {
newbashcomp bash-autocomplete.sh clang
@@ -65,10 +64,10 @@ src_install() {
# This file is initially generated by sys-devel/clang-runtime.
# It is used to control the default runtimes using by clang.
- $(usec compiler-rt)-rtlib=compiler-rt
- $(usec compiler-rt)-unwindlib=libunwind
- $(usec libcxx)-stdlib=libc++
- $(usec lld)-fuse-ld=lld
+ --rtlib=$(usex default-compiler-rt compiler-rt libgcc)
+ --unwindlib=$(usex default-compiler-rt libunwind libgcc)
+ --stdlib=$(usex default-libcxx libc++ libstdc++)
+ -fuse-ld=$(usex default-lld lld bfd)
EOF
newins - gentoo-gcc-install.cfg <<-EOF