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