Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcxx/
Date: Sun, 31 Jul 2022 19:44:22
Message-Id: 1659296655.e003b23e8ea781f52a1ffeefb00d1fbd49488335.mgorny@gentoo
1 commit: e003b23e8ea781f52a1ffeefb00d1fbd49488335
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jul 31 18:18:44 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 31 19:44:15 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e003b23e
7
8 sys-libs/libcxx: Remove USE=libunwind
9
10 Following sys-libs/libcxxabi.
11
12 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
13
14 sys-libs/libcxx/libcxx-15.0.0.9999.ebuild | 46 +++++++------------------------
15 1 file changed, 10 insertions(+), 36 deletions(-)
16
17 diff --git a/sys-libs/libcxx/libcxx-15.0.0.9999.ebuild b/sys-libs/libcxx/libcxx-15.0.0.9999.ebuild
18 index 3acf567e062b..d95f996ca33b 100644
19 --- a/sys-libs/libcxx/libcxx-15.0.0.9999.ebuild
20 +++ b/sys-libs/libcxx/libcxx-15.0.0.9999.ebuild
21 @@ -14,16 +14,13 @@ HOMEPAGE="https://libcxx.llvm.org/"
22 LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )"
23 SLOT="0"
24 KEYWORDS=""
25 -IUSE="+clang +libcxxabi +libunwind static-libs test"
26 -REQUIRED_USE="
27 - libunwind? ( libcxxabi )
28 - test? ( clang )
29 -"
30 +IUSE="+clang +libcxxabi static-libs test"
31 +REQUIRED_USE="test? ( clang )"
32 RESTRICT="!test? ( test )"
33
34 RDEPEND="
35 libcxxabi? (
36 - ~sys-libs/libcxxabi-${PV}[libunwind=,static-libs?,${MULTILIB_USEDEP}]
37 + ~sys-libs/libcxxabi-${PV}[static-libs?,${MULTILIB_USEDEP}]
38 )
39 !libcxxabi? ( >=sys-devel/gcc-4.7:=[cxx] )
40 "
41 @@ -104,32 +101,14 @@ multilib_src_configure() {
42 strip-unsupported-flags
43 fi
44
45 - # we want -lgcc_s for unwinder, and for compiler runtime when using
46 - # gcc, clang with gcc runtime (or any unknown compiler)
47 - local extra_libs=() want_gcc_s=ON want_compiler_rt=OFF
48 - if use libunwind; then
49 - # work-around missing -lunwind upstream
50 - extra_libs+=( -lunwind )
51 - # if we're using libunwind and clang with compiler-rt, we want
52 - # to link to compiler-rt instead of -lgcc_s
53 - if tc-is-clang; then
54 - local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
55 - ${LDFLAGS} -print-libgcc-file-name)
56 - if [[ ${compiler_rt} == *libclang_rt* ]]; then
57 - want_gcc_s=OFF
58 - want_compiler_rt=ON
59 - extra_libs+=( "${compiler_rt}" )
60 - fi
61 + # link against compiler-rt instead of libgcc if this is what clang does
62 + local want_compiler_rt=OFF
63 + if tc-is-clang; then
64 + local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
65 + ${LDFLAGS} -print-libgcc-file-name)
66 + if [[ ${compiler_rt} == *libclang_rt* ]]; then
67 + want_compiler_rt=ON
68 fi
69 - elif [[ ${CHOST} == *-darwin* ]] && tc-is-clang; then
70 - # clang-based darwin prefix disables libunwind useflag during
71 - # bootstrap, because libunwind is not in the prefix yet.
72 - # override the default, though, because clang based libcxx
73 - # should never use gcc_s on Darwin.
74 - want_gcc_s=OFF
75 - # compiler_rt is not available in EPREFIX during bootstrap,
76 - # so we cannot link to it yet anyway, so keep the defaults
77 - # of want_compiler_rt=OFF and extra_libs=()
78 fi
79
80 # bootstrap: cmake is unhappy if compiler can't link to stdlib
81 @@ -156,12 +135,9 @@ multilib_src_configure() {
82 # we're using our own mechanism for generating linker scripts
83 -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
84 -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
85 - -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s}
86 -DLIBCXX_INCLUDE_BENCHMARKS=OFF
87 -DLIBCXX_INCLUDE_TESTS=$(usex test)
88 -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt}
89 - -DLIBCXX_HAS_ATOMIC_LIB=${want_gcc_s}
90 - -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}"
91 )
92
93 if use test; then
94 @@ -223,7 +199,6 @@ gen_static_ldscript() {
95 local deps=(
96 libc++_static.a
97 $(usex libcxxabi libc++abi.a libsupc++.a)
98 - $(usex libunwind libunwind.a libgcc_eh.a)
99 )
100 # On Linux/glibc it does not link without libpthread or libdl. It is
101 # fine on FreeBSD.
102 @@ -239,7 +214,6 @@ gen_shared_ldscript() {
103 libc++_shared.so
104 # libsupc++ doesn't have a shared version
105 $(usex libcxxabi libc++abi.so libsupc++.a)
106 - $(usex libunwind libunwind.so libgcc_s.so)
107 )
108
109 gen_ldscript "${deps[*]}" > lib/libc++.so || die