* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcxx/, sys-libs/libcxx/files/
@ 2016-10-03 8:51 Alexis Ballier
0 siblings, 0 replies; 3+ messages in thread
From: Alexis Ballier @ 2016-10-03 8:51 UTC (permalink / raw
To: gentoo-commits
commit: 6d628e49032d182a45ee5b9150911ade92b570c9
Author: Lei Zhang <zhanglei.april <AT> gmail <DOT> com>
AuthorDate: Sat Sep 3 11:30:01 2016 +0000
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Mon Oct 3 08:51:20 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d628e49
sys-libs/libcxx: version bump to 3.9.0
to synchronize with live ebuild.
sys-libs/libcxx/Manifest | 2 +
.../libcxx/files/libcxx-3.9-cmake-static-lib.patch | 196 +++++++++++++++++++++
sys-libs/libcxx/libcxx-3.9.0.ebuild | 196 +++++++++++++++++++++
3 files changed, 394 insertions(+)
diff --git a/sys-libs/libcxx/Manifest b/sys-libs/libcxx/Manifest
index 8e2fb79..d6884e0 100644
--- a/sys-libs/libcxx/Manifest
+++ b/sys-libs/libcxx/Manifest
@@ -2,3 +2,5 @@ DIST libcxx-3.7.0.src.tar.xz 994580 SHA256 c18f3c8333cd7e678c1424a57fe5e25efe740
DIST libcxx-3.7.1.src.tar.xz 995724 SHA256 357fbd4288ce99733ba06ae2bec6f503413d258aeebaab8b6a791201e6f7f144 SHA512 08d2399a8b36aa15290733256c896c9fa43f1a1223bc5c73bbcd014fddf8880e514d2a6dcc456bcf18b537c01fb6911b092e6d9958bccd8e64e9f375ed7a1ab9 WHIRLPOOL 19f77946abf48cbdd3e7ea21fd009ca3cc5f607dfe0512a44b102847044bb1d5ae4b16f503f18b14ebd9ea115256e87af07409907ba2a65f6061e217a502a359
DIST libcxx-3.8.0.src.tar.xz 1062884 SHA256 36804511b940bc8a7cefc7cb391a6b28f5e3f53f6372965642020db91174237b SHA512 3a9f0c9b4b0c22757028800b28c5fd7b28fc79d0cbf33cad2087de493dc778c93f2df4b919f162638d883069f60a633f36ddc18d7da8ae00c6af409266a05e6b WHIRLPOOL 6f1328c8b220f91d15f6644e34dd74e3d204ee0ee56769df4442d14b884e31626a289e6ab5e7d075438c7527b2efde92763b362791914bcd18c269405c9c7c8e
DIST libcxx-3.8.1.src.tar.xz 1074164 SHA256 77d7f3784c88096d785bd705fa1bab7031ce184cd91ba8a7008abf55264eeecc SHA512 782ff3cdb85d02e92404e943474d0266ff601725c202f0667d60e7807f1ba3cfdebbdb062e27a52fec96be1c99339044be93a88ba7e396682f98d99c9ac175b2 WHIRLPOOL a729c44060972edee79b0019fd4c6c23fa56dd625e564f4c5965682d9fc79be4094df0643f67c5d2ffa3ae3c743c892c3c9ba19719b2307aada35775f64ed104
+DIST libcxx-3.9.0.src.tar.xz 1198308 SHA256 d0b38d51365c6322f5666a2a8105785f2e114430858de4c25a86b49f227f5b06 SHA512 55d5c4adff378ee02b0b99d732bc9f326910f9e49ab8c320a588eccdd0362fe009bc9a6a4337d29faf6338420c91b10d0d7d67f66128268f01258d30502c4f4a WHIRLPOOL 3ee3519acfe95287a862a6c44e30ed52ced1204332913007797da4e4da40dfdc5991ae120f5686827cc208b559936da5bc5485dab75617bdd5cbbd9e95a6032a
+DIST llvm-3.9.0.src.tar.xz 18235716 SHA256 66c73179da42cee1386371641241f79ded250e117a79f571bbd69e56daa48948 SHA512 f18ae32531218ab156c3e56c11826be0fd05f0799c82eaf2e6a043b38e1277560b4d921987513b88b11d97ea2619feaf277eec72181dd2ae4f4108c2836bf7b2 WHIRLPOOL a36c1bcee6e7995067a9a7a51e3fdb0f10d51d0239250eefab92ed2e46b024a203fa10a17a25a5aca69046bcb413628e288427f1a6690d0862e07cd95694c8a8
diff --git a/sys-libs/libcxx/files/libcxx-3.9-cmake-static-lib.patch b/sys-libs/libcxx/files/libcxx-3.9-cmake-static-lib.patch
new file mode 100644
index 00000000..5f0e318
--- /dev/null
+++ b/sys-libs/libcxx/files/libcxx-3.9-cmake-static-lib.patch
@@ -0,0 +1,196 @@
+From b640da0b315ead39690d4d65c76938ab8aeb5449 Mon Sep 17 00:00:00 2001
+From: Petr Hosek <phosek@chromium.org>
+Date: Mon, 8 Aug 2016 22:57:25 +0000
+Subject: [PATCH] Allow building both shared and static library
+
+This change allows building both shared and static version of libc++
+in a single build, sharing object files between both versions.
+
+Differential Revision: https://reviews.llvm.org/D23232
+
+git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278068 91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ CMakeLists.txt | 5 ++++
+ docs/BuildingLibcxx.rst | 11 ++++++--
+ lib/CMakeLists.txt | 71 ++++++++++++++++++++++++++++++++++---------------
+ 3 files changed, 63 insertions(+), 24 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 950070d..98886b0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -52,6 +52,7 @@ MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
+ # Basic options ---------------------------------------------------------------
+ option(LIBCXX_ENABLE_ASSERTIONS "Enable assertions independent of build mode." ON)
+ option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON)
++option(LIBCXX_ENABLE_STATIC "Build libc++ as a static library." ON)
+ option(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY "Build libc++experimental.a" ON)
+ option(LIBCXX_ENABLE_FILESYSTEM
+ "Build filesystem as part of libc++experimental.a" ${LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY})
+@@ -68,6 +69,10 @@ option(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY "Install libc++experimental.a" OFF)
+ set(LIBCXX_ABI_VERSION 1 CACHE STRING "ABI version of libc++.")
+ option(LIBCXX_ABI_UNSTABLE "Unstable ABI of libc++." OFF)
+
++if (NOT LIBCXX_ENABLE_SHARED AND NOT LIBCXX_ENABLE_STATIC)
++ message(FATAL_ERROR "libc++ must be built as either a shared or static library.")
++endif()
++
+ # ABI Library options ---------------------------------------------------------
+ set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}" CACHE STRING
+ "Specify C++ ABI library to use." FORCE)
+diff --git a/docs/BuildingLibcxx.rst b/docs/BuildingLibcxx.rst
+index 5dd174a..6709352 100644
+--- a/docs/BuildingLibcxx.rst
++++ b/docs/BuildingLibcxx.rst
+@@ -150,8 +150,15 @@ libc++ specific options
+
+ **Default**: ``ON``
+
+- Build libc++ as a shared library. If ``OFF`` is specified then libc++ is
+- built as a static library.
++ Build libc++ as a shared library. Either :option:`LIBCXX_ENABLE_SHARED` or
++ :option:`LIBCXX_ENABLE_STATIC` has to be enabled.
++
++.. option:: LIBCXX_ENABLE_STATIC:BOOL
++
++ **Default**: ``ON``
++
++ Build libc++ as a static library. Either :option:`LIBCXX_ENABLE_SHARED` or
++ :option:`LIBCXX_ENABLE_STATIC` has to be enabled.
+
+ .. option:: LIBCXX_LIBDIR_SUFFIX:STRING
+
+diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
+index afc388e..cabf2e6 100644
+--- a/lib/CMakeLists.txt
++++ b/lib/CMakeLists.txt
+@@ -28,16 +28,6 @@ if(NOT LIBCXX_INSTALL_LIBRARY)
+ set(exclude_from_all EXCLUDE_FROM_ALL)
+ endif()
+
+-if (LIBCXX_ENABLE_SHARED)
+- add_library(cxx SHARED ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
+-else()
+- add_library(cxx STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
+-endif()
+-
+-if (DEFINED LIBCXX_CXX_ABI_DEPS)
+- add_dependencies(cxx LIBCXX_CXX_ABI_DEPS)
+-endif()
+-
+ #if LIBCXX_CXX_ABI_LIBRARY_PATH is defined we want to add it to the search path.
+ add_link_flags_if(LIBCXX_CXX_ABI_LIBRARY_PATH "-L${LIBCXX_CXX_ABI_LIBRARY_PATH}")
+
+@@ -139,18 +129,51 @@ if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
+ endif()
+ endif()
+
+-target_link_libraries(cxx ${LIBCXX_LIBRARIES})
+ split_list(LIBCXX_COMPILE_FLAGS)
+ split_list(LIBCXX_LINK_FLAGS)
+
+-set_target_properties(cxx
++# Add a object library that contains the compiled source files.
++add_library(cxx_objects OBJECT ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
++
++set_target_properties(cxx_objects
+ PROPERTIES
+ COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
+- LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
+- OUTPUT_NAME "c++"
+- VERSION "${LIBCXX_ABI_VERSION}.0"
+- SOVERSION "${LIBCXX_ABI_VERSION}"
++)
++
++set(LIBCXX_TARGETS)
++
++# Build the shared library.
++if (LIBCXX_ENABLE_SHARED)
++ add_library(cxx_shared SHARED $<TARGET_OBJECTS:cxx_objects>)
++ target_link_libraries(cxx_shared ${LIBCXX_LIBRARIES})
++ set_target_properties(cxx_shared
++ PROPERTIES
++ LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
++ OUTPUT_NAME "c++"
++ VERSION "${LIBCXX_ABI_VERSION}.0"
++ SOVERSION "${LIBCXX_ABI_VERSION}"
+ )
++ list(APPEND LIBCXX_TARGETS "cxx_shared")
++endif()
++
++# Build the static library.
++if (LIBCXX_ENABLE_STATIC)
++ add_library(cxx_static STATIC $<TARGET_OBJECTS:cxx_objects>)
++ target_link_libraries(cxx_static ${LIBCXX_LIBRARIES})
++ set_target_properties(cxx_static
++ PROPERTIES
++ LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
++ OUTPUT_NAME "c++"
++ )
++ list(APPEND LIBCXX_TARGETS "cxx_static")
++endif()
++
++# Add a meta-target for both libraries.
++add_custom_target(cxx DEPENDS ${LIBCXX_TARGETS})
++
++if (DEFINED LIBCXX_CXX_ABI_DEPS)
++ add_dependencies(cxx LIBCXX_CXX_ABI_DEPS)
++endif()
+
+ if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
+ file(GLOB LIBCXX_EXPERIMENTAL_SOURCES ../src/experimental/*.cpp)
+@@ -158,7 +181,11 @@ if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
+ file(GLOB LIBCXX_FILESYSTEM_SOURCES ../src/experimental/filesystem/*.cpp)
+ endif()
+ add_library(cxx_experimental STATIC ${LIBCXX_EXPERIMENTAL_SOURCES} ${LIBCXX_FILESYSTEM_SOURCES})
+- target_link_libraries(cxx_experimental cxx)
++ if (LIBCXX_ENABLE_SHARED)
++ target_link_libraries(cxx_experimental cxx_shared)
++ else()
++ target_link_libraries(cxx_experimental cxx_static)
++ endif()
+
+ set(experimental_flags "${LIBCXX_COMPILE_FLAGS}")
+ check_flag_supported(-std=c++14)
+@@ -174,7 +201,7 @@ endif()
+
+ # Generate a linker script inplace of a libc++.so symlink. Rerun this command
+ # after cxx builds.
+-if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
++if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
+ # Get the name of the ABI library and handle the case where CXXABI_LIBNAME
+ # is a target name and not a library. Ex cxxabi_shared.
+ set(SCRIPT_ABI_LIBNAME "${LIBCXX_CXX_ABI_LIBRARY}")
+@@ -183,11 +210,11 @@ if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
+ endif()
+ # Generate a linker script inplace of a libc++.so symlink. Rerun this command
+ # after cxx builds.
+- add_custom_command(TARGET cxx POST_BUILD
++ add_custom_command(TARGET cxx_shared POST_BUILD
+ COMMAND
+ ${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/gen_link_script/gen_link_script.py
+ ARGS
+- "$<TARGET_LINKER_FILE:cxx>"
++ "$<TARGET_LINKER_FILE:cxx_shared>"
+ "${SCRIPT_ABI_LIBNAME}"
+ WORKING_DIRECTORY ${LIBCXX_BUILD_DIR}
+ )
+@@ -197,13 +224,13 @@ if (LIBCXX_INSTALL_LIBRARY)
+ if (LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY)
+ set(experimental_lib cxx_experimental)
+ endif()
+- install(TARGETS cxx ${experimental_lib}
++ install(TARGETS ${LIBCXX_TARGETS} ${experimental_lib}
+ LIBRARY DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT libcxx
+ ARCHIVE DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT libcxx
+ )
+ # NOTE: This install command must go after the cxx install command otherwise
+ # it will not be executed after the library symlinks are installed.
+- if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
++ if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
+ # Replace the libc++ filename with $<TARGET_LINKER_FILE:cxx>
+ # after we required CMake 3.0.
+ install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}"
+--
+2.4.10
+
diff --git a/sys-libs/libcxx/libcxx-3.9.0.ebuild b/sys-libs/libcxx/libcxx-3.9.0.ebuild
new file mode 100644
index 00000000..25e0b69
--- /dev/null
+++ b/sys-libs/libcxx/libcxx-3.9.0.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+# Ninja provides better scalability and cleaner verbose output, and is used
+# throughout all LLVM projects.
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+EGIT_REPO_URI="http://llvm.org/git/libcxx.git
+ https://github.com/llvm-mirror/libcxx.git"
+CMAKE_MIN_VERSION=3.4.3
+PYTHON_COMPAT=( python2_7 )
+
+[[ ${PV} == 9999 ]] && SCM="git-r3" || SCM=""
+
+inherit ${SCM} cmake-multilib python-any-r1 toolchain-funcs
+
+DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
+HOMEPAGE="http://libcxx.llvm.org/"
+if [[ ${PV} != 9999 ]] ; then
+ SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.xz
+ test? ( http://llvm.org/releases/${PV}/llvm-${PV}.src.tar.xz )"
+ S="${WORKDIR}/${P}.src"
+ LLVM_S="${WORKDIR}/llvm-${PV}.src"
+else
+ SRC_URI=""
+ LLVM_S="${WORKDIR}/llvm"
+fi
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+if [[ ${PV} != 9999 ]] ; then
+ KEYWORDS="~amd64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+else
+ KEYWORDS=""
+fi
+IUSE="elibc_glibc elibc_musl +libcxxrt libunwind +static-libs test"
+REQUIRED_USE="libunwind? ( libcxxrt )"
+
+RDEPEND="libcxxrt? ( sys-libs/libcxxrt[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
+ !libcxxrt? ( >=sys-devel/gcc-4.7:=[cxx] )"
+# llvm-3.9.0 needed because its cmake files installation path changed, which is
+# needed by libcxx
+DEPEND="${RDEPEND}
+ test? ( sys-devel/clang[${MULTILIB_USEDEP}]
+ ${PYTHON_DEPS} )
+ app-arch/xz-utils
+ >=sys-devel/llvm-3.9.0[${MULTILIB_USEDEP}]"
+
+DOCS=( CREDITS.TXT )
+
+PATCHES=(
+ # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a
+ # out-of-tree build.
+ "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch"
+
+ # Back-port of https://reviews.llvm.org/D23232, allowing building both
+ # shared and static libs in one run.
+ "${FILESDIR}/${PN}-3.9-cmake-static-lib.patch"
+)
+
+pkg_setup() {
+ use test && python_setup
+
+ if ! use libcxxrt && ! tc-is-gcc ; then
+ eerror "To build ${PN} against libsupc++, you have to use gcc. Other"
+ eerror "compilers are not supported. Please set CC=gcc and CXX=g++"
+ eerror "and try again."
+ die
+ fi
+ if tc-is-gcc && [[ $(gcc-version) < 4.7 ]] ; then
+ eerror "${PN} needs to be built with gcc-4.7 or later (or other"
+ eerror "conformant compilers). Please use gcc-config to switch to"
+ eerror "gcc-4.7 or later version."
+ die
+ fi
+}
+
+src_unpack() {
+ [[ ${PV} != 9999 ]] && default && return
+
+ if use test; then
+ # needed for tests
+ git-r3_fetch "http://llvm.org/git/llvm.git
+ https://github.com/llvm-mirror/llvm.git"
+ fi
+ git-r3_fetch
+
+ if use test; then
+ git-r3_checkout http://llvm.org/git/llvm.git \
+ "${WORKDIR}"/llvm
+ fi
+ git-r3_checkout
+}
+
+multilib_src_configure() {
+ local cxxabi cxxabi_incs
+ if use libcxxrt; then
+ cxxabi=libcxxrt
+ cxxabi_incs="${EPREFIX}/usr/include/libcxxrt"
+ else
+ local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)"
+ cxxabi=libsupc++
+ cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}"
+ fi
+
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBCXX_ENABLE_SHARED=ON
+ -DLIBCXX_ENABLE_STATIC=$(usex static-libs)
+ -DLIBCXX_CXX_ABI=${cxxabi}
+ -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs}
+ # we're using our own mechanism for generating linker scripts
+ -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
+ -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
+ -DLIBCXX_HAS_GCC_S_LIB=$(usex !libunwind)
+ -DLIBCXX_INCLUDE_TESTS=$(usex test)
+ -DCMAKE_SHARED_LINKER_FLAGS=$(usex libunwind "-lunwind" "")
+ )
+ if use test; then
+ mycmakeargs+=(
+ -DLLVM_MAIN_SRC_DIR=${LLVM_S}
+ )
+ fi
+ cmake-utils_src_configure
+}
+
+multilib_src_test() {
+ local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
+
+ [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
+ sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die
+
+ cmake-utils_src_make check-libcxx
+}
+
+# Usage: deps
+gen_ldscript() {
+ local output_format
+ output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
+ [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
+
+ cat <<-END_LDSCRIPT
+/* GNU ld script
+ Include missing dependencies
+*/
+${output_format}
+GROUP ( $@ )
+END_LDSCRIPT
+}
+
+gen_static_ldscript() {
+ local libdir=$(get_libdir)
+ local cxxabi_lib=$(usex libcxxrt "libcxxrt.a" "libsupc++.a")
+
+ # Move it first.
+ mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/libc++_static.a" || die
+ # Generate libc++.a ldscript for inclusion of its dependencies so that
+ # clang++ -stdlib=libc++ -static works out of the box.
+ local deps="libc++_static.a ${cxxabi_lib}"
+ # On Linux/glibc it does not link without libpthread or libdl. It is
+ # fine on FreeBSD.
+ use elibc_glibc && deps+=" libpthread.a libdl.a"
+ # unlike libgcc_s, libunwind is not implicitly linked
+ use libunwind && deps+=" libunwind.a"
+
+ gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.a" || die
+}
+
+gen_shared_ldscript() {
+ local libdir=$(get_libdir)
+ # libsupc++ doesn't have a shared version
+ local cxxabi_lib=$(usex libcxxrt "libcxxrt.so" "libsupc++.a")
+
+ mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die
+ local deps="libc++_shared.so ${cxxabi_lib}"
+ use libunwind && deps+=" libunwind.so"
+
+ gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+ gen_shared_ldscript
+ use static-libs && gen_static_ldscript
+}
+
+pkg_postinst() {
+ elog "This package (${PN}) is mainly intended as a replacement for the C++"
+ elog "standard library when using clang."
+ elog "To use it, instead of libstdc++, use:"
+ elog " clang++ -stdlib=libc++"
+ elog "to compile your C++ programs."
+}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcxx/, sys-libs/libcxx/files/
@ 2018-01-18 21:43 Michał Górny
0 siblings, 0 replies; 3+ messages in thread
From: Michał Górny @ 2018-01-18 21:43 UTC (permalink / raw
To: gentoo-commits
commit: 04b71ac54cfb0e0c3846c96fff58138db721dedb
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jan 18 21:37:41 2018 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jan 18 21:43:03 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=04b71ac5
sys-libs/libcxx: Remove old 3.8.1 version
LLVM 3.8.1 has been removed from the tree, so libcxx can go too.
sys-libs/libcxx/Manifest | 1 -
.../libcxx/files/libcxx-3.8.1-musl-support.patch | 15 --
sys-libs/libcxx/libcxx-3.8.1.ebuild | 176 ---------------------
3 files changed, 192 deletions(-)
diff --git a/sys-libs/libcxx/Manifest b/sys-libs/libcxx/Manifest
index d8e670586d7..9e115253237 100644
--- a/sys-libs/libcxx/Manifest
+++ b/sys-libs/libcxx/Manifest
@@ -1,5 +1,4 @@
DIST libcxx-3.7.1.src.tar.xz 995724 BLAKE2B aab68f1b99a2c817e7154b71c04c81bd809154d1ae1c077a2dfede37319070729d6d768223b6ba5e2a866d6c2f18972dd501ce517864378ebc26c49cacafb635 SHA512 08d2399a8b36aa15290733256c896c9fa43f1a1223bc5c73bbcd014fddf8880e514d2a6dcc456bcf18b537c01fb6911b092e6d9958bccd8e64e9f375ed7a1ab9
-DIST libcxx-3.8.1.src.tar.xz 1074164 BLAKE2B 8aa07974a0301684f852408a62c173084fb913179bec951df3bae33895f8b46434eddc95b838cb936a5ef31f5b8ead25b7d0e241adc039eaea38ef95045c8ccb SHA512 782ff3cdb85d02e92404e943474d0266ff601725c202f0667d60e7807f1ba3cfdebbdb062e27a52fec96be1c99339044be93a88ba7e396682f98d99c9ac175b2
DIST libcxx-3.9.1.src.tar.xz 1209020 BLAKE2B 510e77c2c1163babbba904933f441e8720b0d366b9f0cfa2cdde2401368c224e00efd66afc1403b0087c40549cda4ebbc4d0c4b2d0906178324fa6158502d5ad SHA512 a5976e4096624a7307b3e43f4a22ac2dc74572226e0f57af9f3ef537a14c3cff1601b7042aef9dc40a0ee53ca76b08d72eb9c253dcf34f115d3153c302db7070
DIST libcxx-4.0.1.src.tar.xz 1446380 BLAKE2B cd871eff4c4ca25a1fe4d27f778e913fe536a0b5863ea7dd3c8895f6b743b6f039e4df71f9ba5124c98761a8099666f68e1dfd073b5ec7b9fe0007ef09a9117d SHA512 91f3f397be606989be99865d0b279557f9afb93f7a74ed10c3a74f4440e38b5694ddf452bbf2f487cacd4391606dd5c7edfe5130f2de19e2acfd6cce619d028a
DIST libcxx-5.0.1.src.tar.xz 1527852 BLAKE2B 9454fbca8228ee456feb79b65a63ce5daa27bf2e47e457d79592f4974dceeace19fe6cdeee51cc51f94e9072d7ce3c03e5acb617507670153647b9c435feadbd SHA512 994681d3c79047fc2d618c5584b08e9b5c925dab48f8812fc0adc81a575b49a637e9481bb9a0f7ae6f7f352b2b33f40056c347c27123cd6c96c6c226febd002c
diff --git a/sys-libs/libcxx/files/libcxx-3.8.1-musl-support.patch b/sys-libs/libcxx/files/libcxx-3.8.1-musl-support.patch
deleted file mode 100644
index ef86254dff1..00000000000
--- a/sys-libs/libcxx/files/libcxx-3.8.1-musl-support.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/include/__config b/include/__config
-index db5a832..f463557 100644
---- a/include/__config
-+++ b/include/__config
-@@ -11,6 +11,10 @@
- #ifndef _LIBCPP_CONFIG
- #define _LIBCPP_CONFIG
-
-+// Normally this definition is handled by cmake; but since we're not using
-+// cmake, we have to hardcode it here.
-+#define _LIBCPP_HAS_MUSL_LIBC
-+
- #if defined(_MSC_VER) && !defined(__clang__)
- #define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
- #endif
diff --git a/sys-libs/libcxx/libcxx-3.8.1.ebuild b/sys-libs/libcxx/libcxx-3.8.1.ebuild
deleted file mode 100644
index 98135711b43..00000000000
--- a/sys-libs/libcxx/libcxx-3.8.1.ebuild
+++ /dev/null
@@ -1,176 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-ESVN_REPO_URI="https://llvm.org/svn/llvm-project/libcxx/trunk"
-
-[ "${PV%9999}" != "${PV}" ] && SCM="subversion" || SCM=""
-
-inherit ${SCM} flag-o-matic toolchain-funcs multilib multilib-minimal
-
-DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
-HOMEPAGE="https://libcxx.llvm.org/"
-if [ "${PV%9999}" = "${PV}" ] ; then
- SRC_URI="https://llvm.org/releases/${PV}/${P}.src.tar.xz"
- S="${WORKDIR}/${P}.src"
-else
- SRC_URI=""
-fi
-
-LICENSE="|| ( UoI-NCSA MIT )"
-SLOT="0"
-if [ "${PV%9999}" = "${PV}" ] ; then
- KEYWORDS="~amd64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
-else
- KEYWORDS=""
-fi
-IUSE="elibc_glibc elibc_musl +libcxxrt libunwind +static-libs test"
-REQUIRED_USE="libunwind? ( libcxxrt )"
-
-RDEPEND="libcxxrt? ( >=sys-libs/libcxxrt-0.0_p20130725[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
- !libcxxrt? ( >=sys-devel/gcc-4.7:=[cxx] )"
-DEPEND="${RDEPEND}
- test? ( sys-devel/clang )
- app-arch/xz-utils"
-
-DOCS=( CREDITS.TXT )
-
-pkg_setup() {
- if ! use libcxxrt ; then
- ewarn "You have disabled USE=libcxxrt. This will build ${PN} against"
- ewarn "libsupc++. Please note that this is not well supported."
- ewarn "In particular, static linking will not work."
- fi
- if tc-is-gcc && [[ $(gcc-version) < 4.7 ]] ; then
- eerror "${PN} needs to be built with gcc-4.7 or later (or other"
- eerror "conformant compilers). Please use gcc-config to switch to"
- eerror "gcc-4.7 or later version."
- die
- fi
-}
-
-src_prepare() {
- cp -f "${FILESDIR}/Makefile" lib/ || die
- use elibc_musl && epatch "${FILESDIR}/${P}-musl-support.patch"
- multilib_copy_sources
-}
-
-src_configure() {
- export LIBS="-lpthread -lrt -lc -l$(usex libunwind unwind gcc_s)"
- if use libcxxrt ; then
- append-cppflags -DLIBCXXRT "-I${EPREFIX}/usr/include/libcxxrt/"
- LIBS="-lcxxrt ${LIBS}"
- cp "${EPREFIX}/usr/include/libcxxrt/"*.h "${S}/include"
- else
- # Very hackish, see $HOMEPAGE
- # If someone has a clever idea, please share it!
- local includes="$(echo | ${CHOST}-g++ -Wp,-v -x c++ - -fsyntax-only 2>&1 | grep -C 2 '#include.*<...>' | tail -n 2 | sed -e 's/^ /-I/' | tr '\n' ' ')"
- local libcxx_gcc_dirs="$(echo | ${CHOST}-g++ -Wp,-v -x c++ - -fsyntax-only 2>&1 | grep -C 2 '#include.*<...>' | tail -n 2 | tr '\n' ' ')"
- append-cppflags -D__GLIBCXX__ ${includes}
- LIBS="-lsupc++ ${LIBS}"
- local libsupcxx_includes="cxxabi.h bits/c++config.h bits/os_defines.h bits/cpu_defines.h bits/cxxabi_tweaks.h bits/cxxabi_forced.h"
- for i in ${libsupcxx_includes} ; do
- local found=""
- [ -d "${S}/include/$(dirname ${i})/" ] || mkdir -p "${S}/include/$(dirname ${i})"
- for j in ${libcxx_gcc_dirs} ; do
- if [ -f "${j}/${i}" ] ; then
- cp "${j}/${i}" "${S}/include/$(dirname ${i})/" || die
- found=yes
- fi
- done
- [ -n "${found}" ] || die "Header not found: ${i}"
- done
- fi
-
- tc-export AR CC CXX
-
- append-ldflags "-Wl,-z,defs" # make sure we are not underlinked
-}
-
-multilib_src_compile() {
- cd "${BUILD_DIR}/lib" || die
- emake shared
- use static-libs && emake static
-}
-
-# Tests fail for now, if anybody is able to fix them, help is very welcome.
-multilib_src_test() {
- cd "${BUILD_DIR}/test"
- LD_LIBRARY_PATH="${BUILD_DIR}/lib:${LD_LIBRARY_PATH}" \
- CC="clang++ $(get_abi_CFLAGS) ${CXXFLAGS}" \
- HEADER_INCLUDE="-I${BUILD_DIR}/include" \
- SOURCE_LIB="-L${BUILD_DIR}/lib" \
- LIBS="-lm $(usex libcxxrt -lcxxrt "")" \
- ./testit || die
- # TODO: fix link against libsupc++
-}
-
-# Usage: deps
-gen_ldscript() {
- local output_format
- output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
- [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
-
- cat <<-END_LDSCRIPT
-/* GNU ld script
- Include missing dependencies
-*/
-${output_format}
-GROUP ( $@ )
-END_LDSCRIPT
-}
-
-gen_static_ldscript() {
- if use libcxxrt ; then
- # Move it first.
- mv "${ED}/usr/$(get_libdir)/libc++.a" "${ED}/usr/$(get_libdir)/libc++_static.a" || die
-
- # Generate libc++.a ldscript for inclusion of its dependencies so that
- # clang++ -stdlib=libc++ -static works out of the box.
- local deps="${EPREFIX}/usr/$(get_libdir)/libc++_static.a ${EPREFIX}/usr/$(get_libdir)/libcxxrt.a"
- # On Linux/glibc it does not link without libpthread or libdl. It is
- # fine on FreeBSD.
- use elibc_glibc && deps="${deps} ${EPREFIX}/usr/$(get_libdir)/libpthread.a ${EPREFIX}/usr/$(get_libdir)/libdl.a"
-
- # unlike libgcc_s, libunwind is not implicitly linked
- use libunwind && deps="${deps} ${EPREFIX}/usr/$(get_libdir)/libunwind.a"
-
- gen_ldscript "${deps}" > "${ED}/usr/$(get_libdir)/libc++.a"
- fi
- # TODO: Generate a libc++.a ldscript when building against libsupc++
-}
-
-gen_shared_ldscript() {
- if use libcxxrt ; then
- mv "${ED}/usr/$(get_libdir)/libc++.so" "${ED}/usr/$(get_libdir)/libc++_shared.so" || die
- local deps="${EPREFIX}/usr/$(get_libdir)/libc++_shared.so ${EPREFIX}/usr/$(get_libdir)/libcxxrt.so"
- use libunwind && deps="${deps} ${EPREFIX}/usr/$(get_libdir)/libunwind.so"
- gen_ldscript "${deps}" > "${ED}/usr/$(get_libdir)/libc++.so"
- fi
- # TODO: Generate the linker script for other configurations too.
-}
-
-multilib_src_install() {
- cd "${BUILD_DIR}/lib"
- if use static-libs ; then
- dolib.a libc++.a
- gen_static_ldscript
- fi
- dolib.so libc++.so*
- gen_shared_ldscript
-}
-
-multilib_src_install_all() {
- einstalldocs
- insinto /usr/include/c++/v1
- doins -r include/*
-}
-
-pkg_postinst() {
- elog "This package (${PN}) is mainly intended as a replacement for the C++"
- elog "standard library when using clang."
- elog "To use it, instead of libstdc++, use:"
- elog " clang++ -stdlib=libc++"
- elog "to compile your C++ programs."
-}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcxx/, sys-libs/libcxx/files/
@ 2019-03-10 19:53 Michał Górny
0 siblings, 0 replies; 3+ messages in thread
From: Michał Górny @ 2019-03-10 19:53 UTC (permalink / raw
To: gentoo-commits
commit: 4457b2c99d536fc44e945e43f8fd7fbe09a0df60
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 10 18:22:23 2019 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Mar 10 19:52:56 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4457b2c9
sys-libs/libcxx: Drop <6
Bug: https://bugs.gentoo.org/519112
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
sys-libs/libcxx/Manifest | 4 -
sys-libs/libcxx/files/Makefile | 38 ----
.../libcxx/files/libcxx-3.9-cmake-static-lib.patch | 196 ------------------
sys-libs/libcxx/files/prepare_snapshot.sh | 16 --
sys-libs/libcxx/libcxx-3.7.1.ebuild | 169 ----------------
sys-libs/libcxx/libcxx-3.9.1.ebuild | 222 ---------------------
sys-libs/libcxx/libcxx-4.0.1.ebuild | 213 --------------------
sys-libs/libcxx/libcxx-5.0.2.ebuild | 209 -------------------
8 files changed, 1067 deletions(-)
diff --git a/sys-libs/libcxx/Manifest b/sys-libs/libcxx/Manifest
index a5405d54d24..29b7d711fc2 100644
--- a/sys-libs/libcxx/Manifest
+++ b/sys-libs/libcxx/Manifest
@@ -1,7 +1,3 @@
-DIST libcxx-3.7.1.src.tar.xz 995724 BLAKE2B aab68f1b99a2c817e7154b71c04c81bd809154d1ae1c077a2dfede37319070729d6d768223b6ba5e2a866d6c2f18972dd501ce517864378ebc26c49cacafb635 SHA512 08d2399a8b36aa15290733256c896c9fa43f1a1223bc5c73bbcd014fddf8880e514d2a6dcc456bcf18b537c01fb6911b092e6d9958bccd8e64e9f375ed7a1ab9
-DIST libcxx-3.9.1.src.tar.xz 1209020 BLAKE2B 510e77c2c1163babbba904933f441e8720b0d366b9f0cfa2cdde2401368c224e00efd66afc1403b0087c40549cda4ebbc4d0c4b2d0906178324fa6158502d5ad SHA512 a5976e4096624a7307b3e43f4a22ac2dc74572226e0f57af9f3ef537a14c3cff1601b7042aef9dc40a0ee53ca76b08d72eb9c253dcf34f115d3153c302db7070
-DIST libcxx-4.0.1.src.tar.xz 1446380 BLAKE2B cd871eff4c4ca25a1fe4d27f778e913fe536a0b5863ea7dd3c8895f6b743b6f039e4df71f9ba5124c98761a8099666f68e1dfd073b5ec7b9fe0007ef09a9117d SHA512 91f3f397be606989be99865d0b279557f9afb93f7a74ed10c3a74f4440e38b5694ddf452bbf2f487cacd4391606dd5c7edfe5130f2de19e2acfd6cce619d028a
-DIST libcxx-5.0.2.src.tar.xz 1530908 BLAKE2B e0c47d6803668267a71c75df873a136a2c3bec3732a08c365107b286f6dfef883edb81f9f4d22a0f312228865528bf1f15450c41803f8d3a8c8081fe12b62c25 SHA512 c77e0ea6bb3dc03270312de4a24fdd0d027448b2e182af31489031fd52f0997377c9049769930b80b2ba0062fe21317d8ae823c5e80e12128f8ae8e6f171be22
DIST libcxx-6.0.1.src.tar.xz 1552328 BLAKE2B 65a6addd04e530c2a72e8cba207282b9e9fafc01a594d7b11f63d10b6f88eca67a3cdf90b8055e410ede358d9be1f63fbe427f308e1337833447c0260d96e1c8 SHA512 c04f628b0924d76f035f615b59d19ce42dfc19c9a8eea4fe2b22a95cfe5a037ebdb30943fd741443939df5b4cf692bc1e51c840fefefbd134e3afbe2a75fe875
DIST libcxx-7.0.1.src.tar.xz 1638188 BLAKE2B 541d27c3801895d59ad06b15de5fe9ff0d9b5b3ef393a5fad05a12a52dd6453ecc530b0ce3129624a27e959d3c9c5f7066ebb57fd85caca538ebf4f990aa6967 SHA512 b3ad7ad95bdcf2d902b29de8a0b757d4dbc220bc1a22a813d6bcec15a34b3aa42e85c59f4cecbb318c799ca611550b44c328b37278f4349b984016ad4556c1d8
DIST libcxx-8.0.0rc2.src.tar.xz 1755516 BLAKE2B b6c15d0d50d01e69afb376140052a1d27e2acef45796781497b35dbd8c26db88883e17105fb4e83c50097ab7a4ebf077350754bc1b1d43ef8426b82a7e92b72d SHA512 79ac5a389f5a6bcb145e8e387ae2cbdf0679996a9f66fe38a8e62cd893b6ed68943824d5538e7408b57ecfa4182aec20b837158c9a6f50188c1e9aae176a4f5f
diff --git a/sys-libs/libcxx/files/Makefile b/sys-libs/libcxx/files/Makefile
deleted file mode 100644
index 029e7295b88..00000000000
--- a/sys-libs/libcxx/files/Makefile
+++ /dev/null
@@ -1,38 +0,0 @@
-CXXFLAGS+=-std=c++11 -fstrict-aliasing -Wall -Wextra -Wshadow -Wconversion \
- -Wpadded -Wstrict-aliasing=2 -Wstrict-overflow=4
-
-SRCDIR=..
-LIB=libc++
-STATIC=libc++.a
-MAJOR=1
-MINOR=0
-SHEXT?=.so
-SHLIB=$(LIB)$(SHEXT).$(MAJOR).$(MINOR)
-SONAME=$(LIB)$(SHEXT).$(MAJOR)
-
-SRC=$(wildcard $(SRCDIR)/src/*.cpp)
-OBJ=$(SRC:$(SRCDIR)/src/%.cpp=%.o)
-SOBJ=$(SRC:$(SRCDIR)/src/%.cpp=%.So)
-
-
-%.So: $(SRCDIR)/src/%.cpp
- $(CXX) -I$(SRCDIR)/include $(CPPFLAGS) $(CXXFLAGS) -fPIC -nostdinc++ -c $< -o $@
-
-%.o: $(SRCDIR)/src/%.cpp
- $(CXX) -I$(SRCDIR)/include $(CPPFLAGS) $(CXXFLAGS) -nostdinc++ -c $< -o $@
-
-$(STATIC): $(OBJ)
- $(AR) cr $@ $^
-
-static: $(STATIC)
-
-$(SHLIB): $(SOBJ)
- $(CXX) -fPIC -nodefaultlibs $(CXXFLAGS) $(LDFLAGS) -shared -Wl,-soname,$(SONAME) -o $@ $^ $(LIBS)
-
-$(SONAME): $(SHLIB)
- ln -s $< $@
-
-$(LIB)$(SHEXT): $(SONAME)
- ln -s $< $@
-
-shared: $(SHLIB) $(SONAME) $(LIB)$(SHEXT)
diff --git a/sys-libs/libcxx/files/libcxx-3.9-cmake-static-lib.patch b/sys-libs/libcxx/files/libcxx-3.9-cmake-static-lib.patch
deleted file mode 100644
index 5f0e31864df..00000000000
--- a/sys-libs/libcxx/files/libcxx-3.9-cmake-static-lib.patch
+++ /dev/null
@@ -1,196 +0,0 @@
-From b640da0b315ead39690d4d65c76938ab8aeb5449 Mon Sep 17 00:00:00 2001
-From: Petr Hosek <phosek@chromium.org>
-Date: Mon, 8 Aug 2016 22:57:25 +0000
-Subject: [PATCH] Allow building both shared and static library
-
-This change allows building both shared and static version of libc++
-in a single build, sharing object files between both versions.
-
-Differential Revision: https://reviews.llvm.org/D23232
-
-git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@278068 91177308-0d34-0410-b5e6-96231b3b80d8
----
- CMakeLists.txt | 5 ++++
- docs/BuildingLibcxx.rst | 11 ++++++--
- lib/CMakeLists.txt | 71 ++++++++++++++++++++++++++++++++++---------------
- 3 files changed, 63 insertions(+), 24 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 950070d..98886b0 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -52,6 +52,7 @@ MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
- # Basic options ---------------------------------------------------------------
- option(LIBCXX_ENABLE_ASSERTIONS "Enable assertions independent of build mode." ON)
- option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON)
-+option(LIBCXX_ENABLE_STATIC "Build libc++ as a static library." ON)
- option(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY "Build libc++experimental.a" ON)
- option(LIBCXX_ENABLE_FILESYSTEM
- "Build filesystem as part of libc++experimental.a" ${LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY})
-@@ -68,6 +69,10 @@ option(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY "Install libc++experimental.a" OFF)
- set(LIBCXX_ABI_VERSION 1 CACHE STRING "ABI version of libc++.")
- option(LIBCXX_ABI_UNSTABLE "Unstable ABI of libc++." OFF)
-
-+if (NOT LIBCXX_ENABLE_SHARED AND NOT LIBCXX_ENABLE_STATIC)
-+ message(FATAL_ERROR "libc++ must be built as either a shared or static library.")
-+endif()
-+
- # ABI Library options ---------------------------------------------------------
- set(LIBCXX_CXX_ABI "${LIBCXX_CXX_ABI}" CACHE STRING
- "Specify C++ ABI library to use." FORCE)
-diff --git a/docs/BuildingLibcxx.rst b/docs/BuildingLibcxx.rst
-index 5dd174a..6709352 100644
---- a/docs/BuildingLibcxx.rst
-+++ b/docs/BuildingLibcxx.rst
-@@ -150,8 +150,15 @@ libc++ specific options
-
- **Default**: ``ON``
-
-- Build libc++ as a shared library. If ``OFF`` is specified then libc++ is
-- built as a static library.
-+ Build libc++ as a shared library. Either :option:`LIBCXX_ENABLE_SHARED` or
-+ :option:`LIBCXX_ENABLE_STATIC` has to be enabled.
-+
-+.. option:: LIBCXX_ENABLE_STATIC:BOOL
-+
-+ **Default**: ``ON``
-+
-+ Build libc++ as a static library. Either :option:`LIBCXX_ENABLE_SHARED` or
-+ :option:`LIBCXX_ENABLE_STATIC` has to be enabled.
-
- .. option:: LIBCXX_LIBDIR_SUFFIX:STRING
-
-diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
-index afc388e..cabf2e6 100644
---- a/lib/CMakeLists.txt
-+++ b/lib/CMakeLists.txt
-@@ -28,16 +28,6 @@ if(NOT LIBCXX_INSTALL_LIBRARY)
- set(exclude_from_all EXCLUDE_FROM_ALL)
- endif()
-
--if (LIBCXX_ENABLE_SHARED)
-- add_library(cxx SHARED ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
--else()
-- add_library(cxx STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
--endif()
--
--if (DEFINED LIBCXX_CXX_ABI_DEPS)
-- add_dependencies(cxx LIBCXX_CXX_ABI_DEPS)
--endif()
--
- #if LIBCXX_CXX_ABI_LIBRARY_PATH is defined we want to add it to the search path.
- add_link_flags_if(LIBCXX_CXX_ABI_LIBRARY_PATH "-L${LIBCXX_CXX_ABI_LIBRARY_PATH}")
-
-@@ -139,18 +129,51 @@ if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
- endif()
- endif()
-
--target_link_libraries(cxx ${LIBCXX_LIBRARIES})
- split_list(LIBCXX_COMPILE_FLAGS)
- split_list(LIBCXX_LINK_FLAGS)
-
--set_target_properties(cxx
-+# Add a object library that contains the compiled source files.
-+add_library(cxx_objects OBJECT ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
-+
-+set_target_properties(cxx_objects
- PROPERTIES
- COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
-- LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
-- OUTPUT_NAME "c++"
-- VERSION "${LIBCXX_ABI_VERSION}.0"
-- SOVERSION "${LIBCXX_ABI_VERSION}"
-+)
-+
-+set(LIBCXX_TARGETS)
-+
-+# Build the shared library.
-+if (LIBCXX_ENABLE_SHARED)
-+ add_library(cxx_shared SHARED $<TARGET_OBJECTS:cxx_objects>)
-+ target_link_libraries(cxx_shared ${LIBCXX_LIBRARIES})
-+ set_target_properties(cxx_shared
-+ PROPERTIES
-+ LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
-+ OUTPUT_NAME "c++"
-+ VERSION "${LIBCXX_ABI_VERSION}.0"
-+ SOVERSION "${LIBCXX_ABI_VERSION}"
- )
-+ list(APPEND LIBCXX_TARGETS "cxx_shared")
-+endif()
-+
-+# Build the static library.
-+if (LIBCXX_ENABLE_STATIC)
-+ add_library(cxx_static STATIC $<TARGET_OBJECTS:cxx_objects>)
-+ target_link_libraries(cxx_static ${LIBCXX_LIBRARIES})
-+ set_target_properties(cxx_static
-+ PROPERTIES
-+ LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
-+ OUTPUT_NAME "c++"
-+ )
-+ list(APPEND LIBCXX_TARGETS "cxx_static")
-+endif()
-+
-+# Add a meta-target for both libraries.
-+add_custom_target(cxx DEPENDS ${LIBCXX_TARGETS})
-+
-+if (DEFINED LIBCXX_CXX_ABI_DEPS)
-+ add_dependencies(cxx LIBCXX_CXX_ABI_DEPS)
-+endif()
-
- if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
- file(GLOB LIBCXX_EXPERIMENTAL_SOURCES ../src/experimental/*.cpp)
-@@ -158,7 +181,11 @@ if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
- file(GLOB LIBCXX_FILESYSTEM_SOURCES ../src/experimental/filesystem/*.cpp)
- endif()
- add_library(cxx_experimental STATIC ${LIBCXX_EXPERIMENTAL_SOURCES} ${LIBCXX_FILESYSTEM_SOURCES})
-- target_link_libraries(cxx_experimental cxx)
-+ if (LIBCXX_ENABLE_SHARED)
-+ target_link_libraries(cxx_experimental cxx_shared)
-+ else()
-+ target_link_libraries(cxx_experimental cxx_static)
-+ endif()
-
- set(experimental_flags "${LIBCXX_COMPILE_FLAGS}")
- check_flag_supported(-std=c++14)
-@@ -174,7 +201,7 @@ endif()
-
- # Generate a linker script inplace of a libc++.so symlink. Rerun this command
- # after cxx builds.
--if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
-+if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
- # Get the name of the ABI library and handle the case where CXXABI_LIBNAME
- # is a target name and not a library. Ex cxxabi_shared.
- set(SCRIPT_ABI_LIBNAME "${LIBCXX_CXX_ABI_LIBRARY}")
-@@ -183,11 +210,11 @@ if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
- endif()
- # Generate a linker script inplace of a libc++.so symlink. Rerun this command
- # after cxx builds.
-- add_custom_command(TARGET cxx POST_BUILD
-+ add_custom_command(TARGET cxx_shared POST_BUILD
- COMMAND
- ${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/gen_link_script/gen_link_script.py
- ARGS
-- "$<TARGET_LINKER_FILE:cxx>"
-+ "$<TARGET_LINKER_FILE:cxx_shared>"
- "${SCRIPT_ABI_LIBNAME}"
- WORKING_DIRECTORY ${LIBCXX_BUILD_DIR}
- )
-@@ -197,13 +224,13 @@ if (LIBCXX_INSTALL_LIBRARY)
- if (LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY)
- set(experimental_lib cxx_experimental)
- endif()
-- install(TARGETS cxx ${experimental_lib}
-+ install(TARGETS ${LIBCXX_TARGETS} ${experimental_lib}
- LIBRARY DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT libcxx
- ARCHIVE DESTINATION lib${LIBCXX_LIBDIR_SUFFIX} COMPONENT libcxx
- )
- # NOTE: This install command must go after the cxx install command otherwise
- # it will not be executed after the library symlinks are installed.
-- if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
-+ if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
- # Replace the libc++ filename with $<TARGET_LINKER_FILE:cxx>
- # after we required CMake 3.0.
- install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}"
---
-2.4.10
-
diff --git a/sys-libs/libcxx/files/prepare_snapshot.sh b/sys-libs/libcxx/files/prepare_snapshot.sh
deleted file mode 100755
index 3de5a97a809..00000000000
--- a/sys-libs/libcxx/files/prepare_snapshot.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-VERSION=$(date +%Y%m%d)
-BASE_VERSION="0.0"
-PACKAGE="libcxx-${BASE_VERSION}_p${VERSION}"
-
-svn co http://llvm.org/svn/llvm-project/libcxx/trunk ${PACKAGE}
-
-find "${PACKAGE}" -type d -name '.svn' -prune -print0 | xargs -0 rm -rf
-find "${PACKAGE}" -type d -name '.git' -prune -print0 | xargs -0 rm -rf
-
-tar cJf ${PACKAGE}.tar.xz ${PACKAGE}
-rm -rf ${PACKAGE}/
-
-echo "Tarball: \"${PACKAGE}.tar.xz\""
-
-echo "** all done **"
diff --git a/sys-libs/libcxx/libcxx-3.7.1.ebuild b/sys-libs/libcxx/libcxx-3.7.1.ebuild
deleted file mode 100644
index c0caf08e81c..00000000000
--- a/sys-libs/libcxx/libcxx-3.7.1.ebuild
+++ /dev/null
@@ -1,169 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-ESVN_REPO_URI="https://llvm.org/svn/llvm-project/libcxx/trunk"
-
-[ "${PV%9999}" != "${PV}" ] && SCM="subversion" || SCM=""
-
-inherit ${SCM} flag-o-matic toolchain-funcs multilib multilib-minimal
-
-DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
-HOMEPAGE="https://libcxx.llvm.org/"
-if [ "${PV%9999}" = "${PV}" ] ; then
- SRC_URI="https://llvm.org/releases/${PV}/${P}.src.tar.xz"
- S="${WORKDIR}/${P}.src"
-else
- SRC_URI=""
-fi
-
-LICENSE="|| ( UoI-NCSA MIT )"
-SLOT="0"
-if [ "${PV%9999}" = "${PV}" ] ; then
- KEYWORDS="~amd64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
-else
- KEYWORDS=""
-fi
-IUSE="elibc_glibc +libcxxrt +static-libs test"
-
-RDEPEND="libcxxrt? ( >=sys-libs/libcxxrt-0.0_p20130725[static-libs?,${MULTILIB_USEDEP}] )
- !libcxxrt? ( >=sys-devel/gcc-4.7:=[cxx] )"
-DEPEND="${RDEPEND}
- test? ( sys-devel/clang )
- app-arch/xz-utils"
-
-DOCS=( CREDITS.TXT )
-
-pkg_setup() {
- if ! use libcxxrt ; then
- ewarn "You have disabled USE=libcxxrt. This will build ${PN} against"
- ewarn "libsupc++. Please note that this is not well supported."
- ewarn "In particular, static linking will not work."
- fi
- if [[ $(gcc-version) < 4.7 ]] && [[ $(tc-getCXX) != *clang++* ]] ; then
- eerror "${PN} needs to be built with clang++ or gcc-4.7 or later."
- eerror "Please use gcc-config to switch to gcc-4.7 or later version."
- die
- fi
-}
-
-src_prepare() {
- cp -f "${FILESDIR}/Makefile" lib/ || die
- multilib_copy_sources
-}
-
-src_configure() {
- export LIBS="-lpthread -lrt -lc -lgcc_s"
- if use libcxxrt ; then
- append-cppflags -DLIBCXXRT "-I${EPREFIX}/usr/include/libcxxrt/"
- LIBS="-lcxxrt ${LIBS}"
- cp "${EPREFIX}/usr/include/libcxxrt/"*.h "${S}/include"
- else
- # Very hackish, see $HOMEPAGE
- # If someone has a clever idea, please share it!
- local includes="$(echo | ${CHOST}-g++ -Wp,-v -x c++ - -fsyntax-only 2>&1 | grep -C 2 '#include.*<...>' | tail -n 2 | sed -e 's/^ /-I/' | tr '\n' ' ')"
- local libcxx_gcc_dirs="$(echo | ${CHOST}-g++ -Wp,-v -x c++ - -fsyntax-only 2>&1 | grep -C 2 '#include.*<...>' | tail -n 2 | tr '\n' ' ')"
- append-cppflags -D__GLIBCXX__ ${includes}
- LIBS="-lsupc++ ${LIBS}"
- local libsupcxx_includes="cxxabi.h bits/c++config.h bits/os_defines.h bits/cpu_defines.h bits/cxxabi_tweaks.h bits/cxxabi_forced.h"
- for i in ${libsupcxx_includes} ; do
- local found=""
- [ -d "${S}/include/$(dirname ${i})/" ] || mkdir -p "${S}/include/$(dirname ${i})"
- for j in ${libcxx_gcc_dirs} ; do
- if [ -f "${j}/${i}" ] ; then
- cp "${j}/${i}" "${S}/include/$(dirname ${i})/" || die
- found=yes
- fi
- done
- [ -n "${found}" ] || die "Header not found: ${i}"
- done
- fi
-
- tc-export AR CC CXX
-
- append-ldflags "-Wl,-z,defs" # make sure we are not underlinked
-}
-
-multilib_src_compile() {
- cd "${BUILD_DIR}/lib" || die
- emake shared
- use static-libs && emake static
-}
-
-# Tests fail for now, if anybody is able to fix them, help is very welcome.
-multilib_src_test() {
- cd "${BUILD_DIR}/test"
- LD_LIBRARY_PATH="${BUILD_DIR}/lib:${LD_LIBRARY_PATH}" \
- CC="clang++ $(get_abi_CFLAGS) ${CXXFLAGS}" \
- HEADER_INCLUDE="-I${BUILD_DIR}/include" \
- SOURCE_LIB="-L${BUILD_DIR}/lib" \
- LIBS="-lm $(usex libcxxrt -lcxxrt "")" \
- ./testit || die
- # TODO: fix link against libsupc++
-}
-
-# Usage: deps
-gen_ldscript() {
- local output_format
- output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
- [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
-
- cat <<-END_LDSCRIPT
-/* GNU ld script
- Include missing dependencies
-*/
-${output_format}
-GROUP ( $@ )
-END_LDSCRIPT
-}
-
-gen_static_ldscript() {
- if use libcxxrt ; then
- # Move it first.
- mv "${ED}/usr/$(get_libdir)/libc++.a" "${ED}/usr/$(get_libdir)/libc++_static.a" || die
-
- # Generate libc++.a ldscript for inclusion of its dependencies so that
- # clang++ -stdlib=libc++ -static works out of the box.
- local deps="${EPREFIX}/usr/$(get_libdir)/libc++_static.a ${EPREFIX}/usr/$(get_libdir)/libcxxrt.a"
- # On Linux/glibc it does not link without libpthread or libdl. It is
- # fine on FreeBSD.
- use elibc_glibc && deps="${deps} ${EPREFIX}/usr/$(get_libdir)/libpthread.a ${EPREFIX}/usr/$(get_libdir)/libdl.a"
-
- gen_ldscript "${deps}" > "${ED}/usr/$(get_libdir)/libc++.a"
- fi
- # TODO: Generate a libc++.a ldscript when building against libsupc++
-}
-
-gen_shared_ldscript() {
- if use libcxxrt ; then
- mv "${ED}/usr/$(get_libdir)/libc++.so" "${ED}/usr/$(get_libdir)/libc++_shared.so" || die
- local deps="${EPREFIX}/usr/$(get_libdir)/libc++_shared.so ${EPREFIX}/usr/$(get_libdir)/libcxxrt.so"
- gen_ldscript "${deps}" > "${ED}/usr/$(get_libdir)/libc++.so"
- fi
- # TODO: Generate the linker script for other confiurations too.
-}
-
-multilib_src_install() {
- cd "${BUILD_DIR}/lib"
- if use static-libs ; then
- dolib.a libc++.a
- gen_static_ldscript
- fi
- dolib.so libc++.so*
- gen_shared_ldscript
-}
-
-multilib_src_install_all() {
- einstalldocs
- insinto /usr/include/c++/v1
- doins -r include/*
-}
-
-pkg_postinst() {
- elog "This package (${PN}) is mainly intended as a replacement for the C++"
- elog "standard library when using clang."
- elog "To use it, instead of libstdc++, use:"
- elog " clang++ -stdlib=libc++"
- elog "to compile your C++ programs."
-}
diff --git a/sys-libs/libcxx/libcxx-3.9.1.ebuild b/sys-libs/libcxx/libcxx-3.9.1.ebuild
deleted file mode 100644
index d5282680825..00000000000
--- a/sys-libs/libcxx/libcxx-3.9.1.ebuild
+++ /dev/null
@@ -1,222 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-# Ninja provides better scalability and cleaner verbose output, and is used
-# throughout all LLVM projects.
-: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
-EGIT_REPO_URI="https://llvm.org/git/libcxx.git
- https://github.com/llvm-mirror/libcxx.git"
-PYTHON_COMPAT=( python2_7 )
-
-[[ ${PV} == 9999 ]] && SCM="git-r3" || SCM=""
-
-inherit ${SCM} cmake-multilib python-any-r1 toolchain-funcs
-
-DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
-HOMEPAGE="https://libcxx.llvm.org/"
-if [[ ${PV} != 9999 ]] ; then
- SRC_URI="https://llvm.org/releases/${PV}/${P}.src.tar.xz"
- S="${WORKDIR}/${P}.src"
-else
- SRC_URI=""
-fi
-
-LICENSE="|| ( UoI-NCSA MIT )"
-SLOT="0"
-if [[ ${PV} != 9999 ]] ; then
- KEYWORDS="amd64 ~arm64 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
-else
- KEYWORDS="amd64 ~arm64 x86"
-fi
-IUSE="elibc_glibc elibc_musl libcxxabi +libcxxrt libunwind +static-libs test"
-REQUIRED_USE="libunwind? ( || ( libcxxabi libcxxrt ) )
- ?? ( libcxxabi libcxxrt )"
-
-RDEPEND="
- libcxxabi? ( ~sys-libs/libcxxabi-${PV}[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
- libcxxrt? ( sys-libs/libcxxrt[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
- !libcxxabi? ( !libcxxrt? ( >=sys-devel/gcc-4.7:=[cxx] ) )"
-# llvm-3.9.0 needed because its cmake files installation path changed, which is
-# needed by libcxx
-# clang-3.9.0 installs necessary target symlinks unconditionally
-# which removes the need for MULTILIB_USEDEP
-DEPEND="${RDEPEND}
- test? ( >=sys-devel/clang-3.9.0
- $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )
- app-arch/xz-utils
- >=sys-devel/llvm-3.9.0"
-
-DOCS=( CREDITS.TXT )
-
-PATCHES=(
- # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a
- # out-of-tree build.
- "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch"
-
- # Back-port of https://reviews.llvm.org/D23232, allowing building both
- # shared and static libs in one run.
- "${FILESDIR}/${PN}-3.9-cmake-static-lib.patch"
-)
-
-python_check_deps() {
- has_version "dev-python/lit[${PYTHON_USEDEP}]"
-}
-
-pkg_setup() {
- use test && python-any-r1_pkg_setup
-
- if ! use libcxxabi && ! use libcxxrt && ! tc-is-gcc ; then
- eerror "To build ${PN} against libsupc++, you have to use gcc. Other"
- eerror "compilers are not supported. Please set CC=gcc and CXX=g++"
- eerror "and try again."
- die
- fi
- if tc-is-gcc && [[ $(gcc-version) < 4.7 ]] ; then
- eerror "${PN} needs to be built with gcc-4.7 or later (or other"
- eerror "conformant compilers). Please use gcc-config to switch to"
- eerror "gcc-4.7 or later version."
- die
- fi
-}
-
-src_configure() {
- NATIVE_LIBDIR=$(get_libdir)
- cmake-multilib_src_configure
-}
-
-src_configure() {
- # note: we need to do this before multilib kicks in since it will
- # alter the CHOST
- local cxxabi cxxabi_incs
- if use libcxxabi; then
- cxxabi=libcxxabi
- cxxabi_incs="${EPREFIX}/usr/include/libcxxabi"
- elif use libcxxrt; then
- cxxabi=libcxxrt
- cxxabi_incs="${EPREFIX}/usr/include/libcxxrt"
- else
- local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)"
- cxxabi=libsupc++
- cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}"
- fi
-
- multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
- # we want -lgcc_s for unwinder, and for compiler runtime when using
- # gcc, clang with gcc runtime (or any unknown compiler)
- local extra_libs=() want_gcc_s=ON
- if use libunwind; then
- # work-around missing -lunwind upstream
- extra_libs+=( -lunwind )
- # if we're using libunwind and clang with compiler-rt, we want
- # to link to compiler-rt instead of -lgcc_s
- if tc-is-clang; then
- # get the full library list out of 'pretend mode'
- # and grep it for libclang_rt references
- local args=( $($(tc-getCC) -### -x c - 2>&1 | tail -n 1) )
- local i
- for i in "${args[@]}"; do
- if [[ ${i} == *libclang_rt* ]]; then
- want_gcc_s=OFF
- extra_libs+=( "${i}" )
- fi
- done
- fi
- fi
-
- local libdir=$(get_libdir)
- local mycmakeargs=(
- # LLVM_LIBDIR_SUFFIX is used to find CMake files
- # and we are happy to use the native set
- -DLLVM_LIBDIR_SUFFIX=${NATIVE_LIBDIR#lib}
- -DLIBCXX_LIBDIR_SUFFIX=${libdir#lib}
- -DLIBCXX_ENABLE_SHARED=ON
- -DLIBCXX_ENABLE_STATIC=$(usex static-libs)
- -DLIBCXX_CXX_ABI=${cxxabi}
- -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs}
- # we're using our own mechanism for generating linker scripts
- -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
- -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
- -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s}
- -DLIBCXX_INCLUDE_TESTS=$(usex test)
- -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}"
- )
-
- if use test; then
- mycmakeargs+=(
- # this can be any directory, it just needs to exist...
- -DLLVM_MAIN_SRC_DIR="${T}"
- -DLIT_COMMAND="${EPREFIX}"/usr/bin/lit
- )
- fi
- cmake-utils_src_configure
-}
-
-multilib_src_test() {
- local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
-
- [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
- sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die
-
- cmake-utils_src_make check-libcxx
-}
-
-# Usage: deps
-gen_ldscript() {
- local output_format
- output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
- [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
-
- cat <<-END_LDSCRIPT
-/* GNU ld script
- Include missing dependencies
-*/
-${output_format}
-GROUP ( $@ )
-END_LDSCRIPT
-}
-
-gen_static_ldscript() {
- local libdir=$(get_libdir)
- local cxxabi_lib=$(usex libcxxabi "libc++abi.a" "$(usex libcxxrt "libcxxrt.a" "libsupc++.a")")
-
- # Move it first.
- mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/libc++_static.a" || die
- # Generate libc++.a ldscript for inclusion of its dependencies so that
- # clang++ -stdlib=libc++ -static works out of the box.
- local deps="libc++_static.a ${cxxabi_lib} $(usex libunwind libunwind.a libgcc_eh.a)"
- # On Linux/glibc it does not link without libpthread or libdl. It is
- # fine on FreeBSD.
- use elibc_glibc && deps+=" libpthread.a libdl.a"
-
- gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.a" || die
-}
-
-gen_shared_ldscript() {
- local libdir=$(get_libdir)
- # libsupc++ doesn't have a shared version
- local cxxabi_lib=$(usex libcxxabi "libc++abi.so" "$(usex libcxxrt "libcxxrt.so" "libsupc++.a")")
-
- mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die
- local deps="libc++_shared.so ${cxxabi_lib} $(usex libunwind libunwind.so libgcc_s.so)"
-
- gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die
-}
-
-multilib_src_install() {
- cmake-utils_src_install
- gen_shared_ldscript
- use static-libs && gen_static_ldscript
-}
-
-pkg_postinst() {
- elog "This package (${PN}) is mainly intended as a replacement for the C++"
- elog "standard library when using clang."
- elog "To use it, instead of libstdc++, use:"
- elog " clang++ -stdlib=libc++"
- elog "to compile your C++ programs."
-}
diff --git a/sys-libs/libcxx/libcxx-4.0.1.ebuild b/sys-libs/libcxx/libcxx-4.0.1.ebuild
deleted file mode 100644
index 4273ce8d76e..00000000000
--- a/sys-libs/libcxx/libcxx-4.0.1.ebuild
+++ /dev/null
@@ -1,213 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-# Ninja provides better scalability and cleaner verbose output, and is used
-# throughout all LLVM projects.
-: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
-# (needed due to CMAKE_BUILD_TYPE != Gentoo)
-CMAKE_MIN_VERSION=3.7.0-r1
-PYTHON_COMPAT=( python2_7 )
-
-inherit cmake-multilib llvm python-any-r1 toolchain-funcs
-
-DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
-HOMEPAGE="https://libcxx.llvm.org/"
-SRC_URI="https://releases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz"
-
-LICENSE="|| ( UoI-NCSA MIT )"
-SLOT="0"
-KEYWORDS="amd64 ~arm64 x86"
-IUSE="elibc_glibc elibc_musl +libcxxabi libcxxrt +libunwind +static-libs test"
-REQUIRED_USE="libunwind? ( || ( libcxxabi libcxxrt ) )
- ?? ( libcxxabi libcxxrt )"
-
-RDEPEND="
- libcxxabi? ( ~sys-libs/libcxxabi-${PV}[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
- libcxxrt? ( sys-libs/libcxxrt[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
- !libcxxabi? ( !libcxxrt? ( >=sys-devel/gcc-4.7:=[cxx] ) )"
-# LLVM 4 required for llvm-config --cmakedir
-# clang-3.9.0 installs necessary target symlinks unconditionally
-# which removes the need for MULTILIB_USEDEP
-DEPEND="${RDEPEND}
- test? ( >=sys-devel/clang-3.9.0
- $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )
- app-arch/xz-utils
- >=sys-devel/llvm-4"
-
-S=${WORKDIR}/${P/_/}.src
-
-DOCS=( CREDITS.TXT )
-
-PATCHES=(
- # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a
- # out-of-tree build.
- "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch"
-)
-
-# least intrusive of all
-CMAKE_BUILD_TYPE=RelWithDebInfo
-
-python_check_deps() {
- has_version "dev-python/lit[${PYTHON_USEDEP}]"
-}
-
-pkg_setup() {
- llvm_pkg_setup
- use test && python-any-r1_pkg_setup
-
- if ! use libcxxabi && ! use libcxxrt && ! tc-is-gcc ; then
- eerror "To build ${PN} against libsupc++, you have to use gcc. Other"
- eerror "compilers are not supported. Please set CC=gcc and CXX=g++"
- eerror "and try again."
- die
- fi
- if tc-is-gcc && [[ $(gcc-version) < 4.7 ]] ; then
- eerror "${PN} needs to be built with gcc-4.7 or later (or other"
- eerror "conformant compilers). Please use gcc-config to switch to"
- eerror "gcc-4.7 or later version."
- die
- fi
-}
-
-src_configure() {
- # note: we need to do this before multilib kicks in since it will
- # alter the CHOST
- local cxxabi cxxabi_incs
- if use libcxxabi; then
- cxxabi=libcxxabi
- cxxabi_incs="${EPREFIX}/usr/include/libcxxabi"
- elif use libcxxrt; then
- cxxabi=libcxxrt
- cxxabi_incs="${EPREFIX}/usr/include/libcxxrt"
- else
- local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)"
- cxxabi=libsupc++
- cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}"
- fi
-
- multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
- # we want -lgcc_s for unwinder, and for compiler runtime when using
- # gcc, clang with gcc runtime (or any unknown compiler)
- local extra_libs=() want_gcc_s=ON
- if use libunwind; then
- # work-around missing -lunwind upstream
- extra_libs+=( -lunwind )
- # if we're using libunwind and clang with compiler-rt, we want
- # to link to compiler-rt instead of -lgcc_s
- if tc-is-clang; then
- # get the full library list out of 'pretend mode'
- # and grep it for libclang_rt references
- local args=( $($(tc-getCC) -### -x c - 2>&1 | tail -n 1) )
- local i
- for i in "${args[@]}"; do
- if [[ ${i} == *libclang_rt* ]]; then
- want_gcc_s=OFF
- extra_libs+=( "${i}" )
- fi
- done
- fi
- fi
-
- local libdir=$(get_libdir)
- local mycmakeargs=(
- -DLIBCXX_LIBDIR_SUFFIX=${libdir#lib}
- -DLIBCXX_ENABLE_SHARED=ON
- -DLIBCXX_ENABLE_STATIC=$(usex static-libs)
- -DLIBCXX_CXX_ABI=${cxxabi}
- -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs}
- # we're using our own mechanism for generating linker scripts
- -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
- -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
- -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s}
- -DLIBCXX_INCLUDE_TESTS=$(usex test)
- -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}"
- )
-
- if use test; then
- mycmakeargs+=(
- # this can be any directory, it just needs to exist...
- # FIXME: remove this once https://reviews.llvm.org/D25093 is merged
- -DLLVM_MAIN_SRC_DIR="${T}"
- )
- if has_version '>=sys-devel/llvm-6'; then
- mycmakeargs+=(
- -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
- )
- else
- mycmakeargs+=(
- -DLIT_COMMAND="${EPREFIX}"/usr/bin/lit
- )
- fi
- fi
- cmake-utils_src_configure
-}
-
-multilib_src_test() {
- local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
-
- [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
- sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die
-
- cmake-utils_src_make check-libcxx
-}
-
-# Usage: deps
-gen_ldscript() {
- local output_format
- output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
- [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
-
- cat <<-END_LDSCRIPT
-/* GNU ld script
- Include missing dependencies
-*/
-${output_format}
-GROUP ( $@ )
-END_LDSCRIPT
-}
-
-gen_static_ldscript() {
- local libdir=$(get_libdir)
- local cxxabi_lib=$(usex libcxxabi "libc++abi.a" "$(usex libcxxrt "libcxxrt.a" "libsupc++.a")")
-
- # Move it first.
- mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/libc++_static.a" || die
- # Generate libc++.a ldscript for inclusion of its dependencies so that
- # clang++ -stdlib=libc++ -static works out of the box.
- local deps="libc++_static.a ${cxxabi_lib} $(usex libunwind libunwind.a libgcc_eh.a)"
- # On Linux/glibc it does not link without libpthread or libdl. It is
- # fine on FreeBSD.
- use elibc_glibc && deps+=" libpthread.a libdl.a"
-
- gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.a" || die
-}
-
-gen_shared_ldscript() {
- local libdir=$(get_libdir)
- # libsupc++ doesn't have a shared version
- local cxxabi_lib=$(usex libcxxabi "libc++abi.so" "$(usex libcxxrt "libcxxrt.so" "libsupc++.a")")
-
- mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die
- local deps="libc++_shared.so ${cxxabi_lib} $(usex libunwind libunwind.so libgcc_s.so)"
-
- gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die
-}
-
-multilib_src_install() {
- cmake-utils_src_install
- gen_shared_ldscript
- use static-libs && gen_static_ldscript
-}
-
-pkg_postinst() {
- elog "This package (${PN}) is mainly intended as a replacement for the C++"
- elog "standard library when using clang."
- elog "To use it, instead of libstdc++, use:"
- elog " clang++ -stdlib=libc++"
- elog "to compile your C++ programs."
-}
diff --git a/sys-libs/libcxx/libcxx-5.0.2.ebuild b/sys-libs/libcxx/libcxx-5.0.2.ebuild
deleted file mode 100644
index eda78625c06..00000000000
--- a/sys-libs/libcxx/libcxx-5.0.2.ebuild
+++ /dev/null
@@ -1,209 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-# Ninja provides better scalability and cleaner verbose output, and is used
-# throughout all LLVM projects.
-: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
-# (needed due to CMAKE_BUILD_TYPE != Gentoo)
-CMAKE_MIN_VERSION=3.7.0-r1
-PYTHON_COMPAT=( python2_7 )
-
-inherit cmake-multilib llvm python-any-r1 toolchain-funcs
-
-DESCRIPTION="New implementation of the C++ standard library, targeting C++11"
-HOMEPAGE="https://libcxx.llvm.org/"
-SRC_URI="https://releases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz"
-
-LICENSE="|| ( UoI-NCSA MIT )"
-SLOT="0"
-KEYWORDS="amd64 ~arm64 x86"
-IUSE="elibc_glibc elibc_musl +libcxxabi libcxxrt +libunwind +static-libs test"
-REQUIRED_USE="libunwind? ( || ( libcxxabi libcxxrt ) )
- ?? ( libcxxabi libcxxrt )"
-
-RDEPEND="
- libcxxabi? ( ~sys-libs/libcxxabi-${PV}[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
- libcxxrt? ( sys-libs/libcxxrt[libunwind=,static-libs?,${MULTILIB_USEDEP}] )
- !libcxxabi? ( !libcxxrt? ( >=sys-devel/gcc-4.7:=[cxx] ) )"
-# LLVM 4 required for llvm-config --cmakedir
-# clang-3.9.0 installs necessary target symlinks unconditionally
-# which removes the need for MULTILIB_USEDEP
-DEPEND="${RDEPEND}
- test? ( >=sys-devel/clang-3.9.0
- $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )
- app-arch/xz-utils
- >=sys-devel/llvm-4"
-
-S=${WORKDIR}/${P/_/}.src
-
-DOCS=( CREDITS.TXT )
-
-PATCHES=(
- # Add link flag "-Wl,-z,defs" to avoid underlinking; this is needed in a
- # out-of-tree build.
- "${FILESDIR}/${PN}-3.9-cmake-link-flags.patch"
-)
-
-# least intrusive of all
-CMAKE_BUILD_TYPE=RelWithDebInfo
-
-python_check_deps() {
- has_version "dev-python/lit[${PYTHON_USEDEP}]"
-}
-
-pkg_setup() {
- llvm_pkg_setup
- use test && python-any-r1_pkg_setup
-
- if ! use libcxxabi && ! use libcxxrt && ! tc-is-gcc ; then
- eerror "To build ${PN} against libsupc++, you have to use gcc. Other"
- eerror "compilers are not supported. Please set CC=gcc and CXX=g++"
- eerror "and try again."
- die
- fi
- if tc-is-gcc && [[ $(gcc-version) < 4.7 ]] ; then
- eerror "${PN} needs to be built with gcc-4.7 or later (or other"
- eerror "conformant compilers). Please use gcc-config to switch to"
- eerror "gcc-4.7 or later version."
- die
- fi
-}
-
-src_configure() {
- # note: we need to do this before multilib kicks in since it will
- # alter the CHOST
- local cxxabi cxxabi_incs
- if use libcxxabi; then
- cxxabi=libcxxabi
- cxxabi_incs="${EPREFIX}/usr/include/libcxxabi"
- elif use libcxxrt; then
- cxxabi=libcxxrt
- cxxabi_incs="${EPREFIX}/usr/include/libcxxrt"
- else
- local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)"
- cxxabi=libsupc++
- cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}"
- fi
-
- multilib-minimal_src_configure
-}
-
-multilib_src_configure() {
- # we want -lgcc_s for unwinder, and for compiler runtime when using
- # gcc, clang with gcc runtime (or any unknown compiler)
- local extra_libs=() want_gcc_s=ON
- if use libunwind; then
- # work-around missing -lunwind upstream
- extra_libs+=( -lunwind )
- # if we're using libunwind and clang with compiler-rt, we want
- # to link to compiler-rt instead of -lgcc_s
- if tc-is-clang; then
- local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \
- ${LDFLAGS} -print-libgcc-file-name)
- if [[ ${compiler_rt} == *libclang_rt* ]]; then
- want_gcc_s=OFF
- extra_libs+=( "${compiler_rt}" )
- fi
- fi
- fi
-
- local libdir=$(get_libdir)
- local mycmakeargs=(
- -DLIBCXX_LIBDIR_SUFFIX=${libdir#lib}
- -DLIBCXX_ENABLE_SHARED=ON
- -DLIBCXX_ENABLE_STATIC=$(usex static-libs)
- -DLIBCXX_CXX_ABI=${cxxabi}
- -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs}
- # we're using our own mechanism for generating linker scripts
- -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF
- -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
- -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s}
- -DLIBCXX_INCLUDE_TESTS=$(usex test)
- -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}"
- )
-
- if use test; then
- mycmakeargs+=(
- # this can be any directory, it just needs to exist...
- # FIXME: remove this once https://reviews.llvm.org/D25093 is merged
- -DLLVM_MAIN_SRC_DIR="${T}"
- )
- if has_version '>=sys-devel/llvm-6'; then
- mycmakeargs+=(
- -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
- )
- else
- mycmakeargs+=(
- -DLIT_COMMAND="${EPREFIX}"/usr/bin/lit
- )
- fi
- fi
- cmake-utils_src_configure
-}
-
-multilib_src_test() {
- local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null)
-
- [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests"
- sed -i -e "/cxx_under_test/s^\".*\"^\"${clang_path}\"^" test/lit.site.cfg || die
-
- cmake-utils_src_make check-libcxx
-}
-
-# Usage: deps
-gen_ldscript() {
- local output_format
- output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p')
- [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )"
-
- cat <<-END_LDSCRIPT
-/* GNU ld script
- Include missing dependencies
-*/
-${output_format}
-GROUP ( $@ )
-END_LDSCRIPT
-}
-
-gen_static_ldscript() {
- local libdir=$(get_libdir)
- local cxxabi_lib=$(usex libcxxabi "libc++abi.a" "$(usex libcxxrt "libcxxrt.a" "libsupc++.a")")
-
- # Move it first.
- mv "${ED}/usr/${libdir}/libc++.a" "${ED}/usr/${libdir}/libc++_static.a" || die
- # Generate libc++.a ldscript for inclusion of its dependencies so that
- # clang++ -stdlib=libc++ -static works out of the box.
- local deps="libc++_static.a ${cxxabi_lib} $(usex libunwind libunwind.a libgcc_eh.a)"
- # On Linux/glibc it does not link without libpthread or libdl. It is
- # fine on FreeBSD.
- use elibc_glibc && deps+=" libpthread.a libdl.a"
-
- gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.a" || die
-}
-
-gen_shared_ldscript() {
- local libdir=$(get_libdir)
- # libsupc++ doesn't have a shared version
- local cxxabi_lib=$(usex libcxxabi "libc++abi.so" "$(usex libcxxrt "libcxxrt.so" "libsupc++.a")")
-
- mv "${ED}/usr/${libdir}/libc++.so" "${ED}/usr/${libdir}/libc++_shared.so" || die
- local deps="libc++_shared.so ${cxxabi_lib} $(usex libunwind libunwind.so libgcc_s.so)"
-
- gen_ldscript "${deps}" > "${ED}/usr/${libdir}/libc++.so" || die
-}
-
-multilib_src_install() {
- cmake-utils_src_install
- gen_shared_ldscript
- use static-libs && gen_static_ldscript
-}
-
-pkg_postinst() {
- elog "This package (${PN}) is mainly intended as a replacement for the C++"
- elog "standard library when using clang."
- elog "To use it, instead of libstdc++, use:"
- elog " clang++ -stdlib=libc++"
- elog "to compile your C++ programs."
-}
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-10 19:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-10 19:53 [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcxx/, sys-libs/libcxx/files/ Michał Górny
-- strict thread matches above, loose matches on Subject: below --
2018-01-18 21:43 Michał Górny
2016-10-03 8:51 Alexis Ballier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox