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: Sat, 20 Apr 2019 23:27:33
Message-Id: 1555704654.16da16daadda372eea5ae2548b9be67c6556317d.mgorny@gentoo
1 commit: 16da16daadda372eea5ae2548b9be67c6556317d
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 19 19:48:48 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 19 20:10:54 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=16da16da
7
8 sys-libs/libcxx: Remove 7.0.9999
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 sys-libs/libcxx/libcxx-7.0.9999.ebuild | 227 ---------------------------------
13 1 file changed, 227 deletions(-)
14
15 diff --git a/sys-libs/libcxx/libcxx-7.0.9999.ebuild b/sys-libs/libcxx/libcxx-7.0.9999.ebuild
16 deleted file mode 100644
17 index 536457a1380..00000000000
18 --- a/sys-libs/libcxx/libcxx-7.0.9999.ebuild
19 +++ /dev/null
20 @@ -1,227 +0,0 @@
21 -# Copyright 1999-2018 Gentoo Foundation
22 -# Distributed under the terms of the GNU General Public License v2
23 -
24 -EAPI=6
25 -
26 -# Ninja provides better scalability and cleaner verbose output, and is used
27 -# throughout all LLVM projects.
28 -: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
29 -# (needed due to CMAKE_BUILD_TYPE != Gentoo)
30 -CMAKE_MIN_VERSION=3.7.0-r1
31 -EGIT_REPO_URI="https://git.llvm.org/git/libcxx.git
32 - https://github.com/llvm-mirror/libcxx.git"
33 -EGIT_BRANCH="release_70"
34 -PYTHON_COMPAT=( python2_7 )
35 -
36 -[[ ${PV} == *9999 ]] && SCM="git-r3" || SCM=""
37 -
38 -inherit ${SCM} cmake-multilib llvm multiprocessing python-any-r1 \
39 - toolchain-funcs
40 -
41 -DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
42 -HOMEPAGE="https://libcxx.llvm.org/"
43 -if [[ ${PV} != *9999 ]] ; then
44 - SRC_URI="https://llvm.org/releases/${PV}/${P}.src.tar.xz"
45 - S="${WORKDIR}/${P}.src"
46 -else
47 - SRC_URI=""
48 -fi
49 -
50 -LICENSE="|| ( UoI-NCSA MIT )"
51 -SLOT="0"
52 -if [[ ${PV} != *9999 ]] ; then
53 - KEYWORDS="~amd64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
54 -else
55 - KEYWORDS=""
56 -fi
57 -IUSE="elibc_glibc elibc_musl +libcxxabi libcxxrt +libunwind +static-libs test"
58 -REQUIRED_USE="libunwind? ( || ( libcxxabi libcxxrt ) )
59 - ?? ( libcxxabi libcxxrt )"
60 -RESTRICT="!test? ( test )"
61 -
62 -RDEPEND="
63 - libcxxabi? ( ~sys-libs/libcxxabi-${PV}[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
64 - libcxxrt? ( sys-libs/libcxxrt[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
65 - !libcxxabi? ( !libcxxrt? ( >=sys-devel/gcc-4.7:=[cxx] ) )"
66 -# llvm-6 for new lit options
67 -# clang-3.9.0 installs necessary target symlinks unconditionally
68 -# which removes the need for MULTILIB_USEDEP
69 -DEPEND="${RDEPEND}
70 - test? ( >=sys-devel/clang-3.9.0
71 - $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )
72 - app-arch/xz-utils
73 - >=sys-devel/llvm-6"
74 -
75 -DOCS=( CREDITS.TXT )
76 -
77 -PATCHES=(
78 - # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a
79 - # out-of-tree build.
80 - "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch"
81 -)
82 -
83 -# least intrusive of all
84 -CMAKE_BUILD_TYPE=RelWithDebInfo
85 -
86 -python_check_deps() {
87 - has_version "dev-python/lit[${PYTHON_USEDEP}]"
88 -}
89 -
90 -pkg_setup() {
91 - llvm_pkg_setup
92 - use test && python-any-r1_pkg_setup
93 -
94 - if ! use libcxxabi && ! use libcxxrt && ! tc-is-gcc ; then
95 - eerror "To build ${PN} against libsupc++, you have to use gcc. Other"
96 - eerror "compilers are not supported. Please set CC=gcc and CXX=g++"
97 - eerror "and try again."
98 - die
99 - fi
100 - if tc-is-gcc && [[ $(gcc-version) < 4.7 ]] ; then
101 - eerror "${PN} needs to be built with gcc-4.7 or later (or other"
102 - eerror "conformant compilers). Please use gcc-config to switch to"
103 - eerror "gcc-4.7 or later version."
104 - die
105 - fi
106 -}
107 -
108 -test_compiler() {
109 - $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \
110 - <<<'int main() { return 0; }' &>/dev/null
111 -}
112 -
113 -src_configure() {
114 - # note: we need to do this before multilib kicks in since it will
115 - # alter the CHOST
116 - local cxxabi cxxabi_incs
117 - if use libcxxabi; then
118 - cxxabi=libcxxabi
119 - cxxabi_incs="${EPREFIX}/usr/include/libcxxabi"
120 - elif use libcxxrt; then
121 - cxxabi=libcxxrt
122 - cxxabi_incs="${EPREFIX}/usr/include/libcxxrt"
123 - else
124 - local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)"
125 - cxxabi=libsupc++
126 - cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}"
127 - fi
128 -
129 - multilib-minimal_src_configure
130 -}
131 -
132 -multilib_src_configure() {
133 - # we want -lgcc_s for unwinder, and for compiler runtime when using
134 - # gcc, clang with gcc runtime (or any unknown compiler)
135 - local extra_libs=() want_gcc_s=ON
136 - if use libunwind; then
137 - # work-around missing -lunwind upstream
138 - extra_libs+=( -lunwind )
139 - # if we're using libunwind and clang with compiler-rt, we want
140 - # to link to compiler-rt instead of -lgcc_s
141 - if tc-is-clang; then
142 - local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
143 - ${LDFLAGS} -print-libgcc-file-name)
144 - if [[ ${compiler_rt} == *libclang_rt* ]]; then
145 - want_gcc_s=OFF
146 - extra_libs+=( "${compiler_rt}" )
147 - fi
148 - fi
149 - fi
150 -
151 - # bootstrap: cmake is unhappy if compiler can't link to stdlib
152 - local nolib_flags=( -nodefaultlibs -lc )
153 - if ! test_compiler; then
154 - if test_compiler "${nolib_flags[@]}"; then
155 - local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}"
156 - ewarn "${CXX} seems to lack runtime, trying with ${nolib_flags[*]}"
157 - fi
158 - fi
159 -
160 - local libdir=$(get_libdir)
161 - local mycmakeargs=(
162 - -DLIBCXX_LIBDIR_SUFFIX=${libdir#lib}
163 - -DLIBCXX_ENABLE_SHARED=ON
164 - -DLIBCXX_ENABLE_STATIC=$(usex static-libs)
165 - -DLIBCXX_CXX_ABI=${cxxabi}
166 - -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs}
167 - # we're using our own mechanism for generating linker scripts
168 - -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
169 - -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
170 - -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s}
171 - -DLIBCXX_INCLUDE_TESTS=$(usex test)
172 - -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}"
173 - )
174 -
175 - if use test; then
176 - local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
177 - local jobs=${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}
178 -
179 - [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
180 -
181 - mycmakeargs+=(
182 - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
183 - -DLLVM_LIT_ARGS="-vv;-j;${jobs};--param=cxx_under_test=${clang_path}"
184 - )
185 - fi
186 - cmake-utils_src_configure
187 -}
188 -
189 -multilib_src_test() {
190 - cmake-utils_src_make check-libcxx
191 -}
192 -
193 -# Usage: deps
194 -gen_ldscript() {
195 - local output_format
196 - output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
197 - [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
198 -
199 - cat <<-END_LDSCRIPT
200 -/* GNU ld script
201 - Include missing dependencies
202 -*/
203 -${output_format}
204 -GROUP ( $@ )
205 -END_LDSCRIPT
206 -}
207 -
208 -gen_static_ldscript() {
209 - local libdir=$(get_libdir)
210 - local cxxabi_lib=$(usex libcxxabi "libc++abi.a" "$(usex libcxxrt "libcxxrt.a" "libsupc++.a")")
211 -
212 - # Move it first.
213 - mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/libc++_static.a" || die
214 - # Generate libc++.a ldscript for inclusion of its dependencies so that
215 - # clang++ -stdlib=libc++ -static works out of the box.
216 - local deps="libc++_static.a ${cxxabi_lib} $(usex libunwind libunwind.a libgcc_eh.a)"
217 - # On Linux/glibc it does not link without libpthread or libdl. It is
218 - # fine on FreeBSD.
219 - use elibc_glibc && deps+=" libpthread.a libdl.a"
220 -
221 - gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.a" || die
222 -}
223 -
224 -gen_shared_ldscript() {
225 - local libdir=$(get_libdir)
226 - # libsupc++ doesn't have a shared version
227 - local cxxabi_lib=$(usex libcxxabi "libc++abi.so" "$(usex libcxxrt "libcxxrt.so" "libsupc++.a")")
228 -
229 - mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die
230 - local deps="libc++_shared.so ${cxxabi_lib} $(usex libunwind libunwind.so libgcc_s.so)"
231 -
232 - gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die
233 -}
234 -
235 -multilib_src_install() {
236 - cmake-utils_src_install
237 - gen_shared_ldscript
238 - use static-libs && gen_static_ldscript
239 -}
240 -
241 -pkg_postinst() {
242 - elog "This package (${PN}) is mainly intended as a replacement for the C++"
243 - elog "standard library when using clang."
244 - elog "To use it, instead of libstdc++, use:"
245 - elog " clang++ -stdlib=libc++"
246 - elog "to compile your C++ programs."
247 -}