sys-libs/libcxx-9.0.0: add USE to explicitly link compiler-rt
authorYang Yang <geraint0923@gmail.com>
Sun, 24 Nov 2019 05:07:44 +0000 (21:07 -0800)
committerMichał Górny <mgorny@gentoo.org>
Wed, 27 Nov 2019 08:58:41 +0000 (09:58 +0100)
According to
https://clang.llvm.org/docs/Toolchain.html#compiler-rt-llvm,
`-DLIBCXX_USE_COMPILER_RT=YES` is needed to linked to compiler-rt.

Otherwise building libcxx using clang+compiler-rt will fail.

Signed-off-by: Yang Yang <geraint0923@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/13748
Signed-off-by: Michał Górny <mgorny@gentoo.org>
sys-libs/libcxx/libcxx-10.0.0.9999.ebuild
sys-libs/libcxx/libcxx-9.0.0.ebuild
sys-libs/libcxx/libcxx-9.0.1.9999.ebuild
sys-libs/libcxx/libcxx-9.0.1_rc1.ebuild

index f5f67053d776095e26b129d0fb45fb0f26f5f6ce..db9250d5440bb99c51b38ddc53ff9190cd240ddf 100644 (file)
@@ -93,7 +93,7 @@ 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
+       local extra_libs=() want_gcc_s=ON want_compiler_rt=OFF
        if use libunwind; then
                # work-around missing -lunwind upstream
                extra_libs+=( -lunwind )
@@ -104,6 +104,7 @@ multilib_src_configure() {
                           ${LDFLAGS} -print-libgcc-file-name)
                        if [[ ${compiler_rt} == *libclang_rt* ]]; then
                                want_gcc_s=OFF
+                               want_compiler_rt=ON
                                extra_libs+=( "${compiler_rt}" )
                        fi
                fi
@@ -130,6 +131,7 @@ multilib_src_configure() {
                -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
                -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s}
                -DLIBCXX_INCLUDE_TESTS=$(usex test)
+               -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt}
                -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}"
        )
 
index 76ae63ba35ad7e73efd18f7e3a0ade29af393ca0..41c96a83d6189de13da5f530fad0522ac66f9e50 100644 (file)
@@ -93,7 +93,7 @@ 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
+       local extra_libs=() want_gcc_s=ON want_compiler_rt=OFF
        if use libunwind; then
                # work-around missing -lunwind upstream
                extra_libs+=( -lunwind )
@@ -104,6 +104,7 @@ multilib_src_configure() {
                           ${LDFLAGS} -print-libgcc-file-name)
                        if [[ ${compiler_rt} == *libclang_rt* ]]; then
                                want_gcc_s=OFF
+                               want_compiler_rt=ON
                                extra_libs+=( "${compiler_rt}" )
                        fi
                fi
@@ -130,6 +131,7 @@ multilib_src_configure() {
                -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
                -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s}
                -DLIBCXX_INCLUDE_TESTS=$(usex test)
+               -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt}
                -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}"
        )
 
index f5f67053d776095e26b129d0fb45fb0f26f5f6ce..db9250d5440bb99c51b38ddc53ff9190cd240ddf 100644 (file)
@@ -93,7 +93,7 @@ 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
+       local extra_libs=() want_gcc_s=ON want_compiler_rt=OFF
        if use libunwind; then
                # work-around missing -lunwind upstream
                extra_libs+=( -lunwind )
@@ -104,6 +104,7 @@ multilib_src_configure() {
                           ${LDFLAGS} -print-libgcc-file-name)
                        if [[ ${compiler_rt} == *libclang_rt* ]]; then
                                want_gcc_s=OFF
+                               want_compiler_rt=ON
                                extra_libs+=( "${compiler_rt}" )
                        fi
                fi
@@ -130,6 +131,7 @@ multilib_src_configure() {
                -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
                -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s}
                -DLIBCXX_INCLUDE_TESTS=$(usex test)
+               -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt}
                -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}"
        )
 
index f5f67053d776095e26b129d0fb45fb0f26f5f6ce..db9250d5440bb99c51b38ddc53ff9190cd240ddf 100644 (file)
@@ -93,7 +93,7 @@ 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
+       local extra_libs=() want_gcc_s=ON want_compiler_rt=OFF
        if use libunwind; then
                # work-around missing -lunwind upstream
                extra_libs+=( -lunwind )
@@ -104,6 +104,7 @@ multilib_src_configure() {
                           ${LDFLAGS} -print-libgcc-file-name)
                        if [[ ${compiler_rt} == *libclang_rt* ]]; then
                                want_gcc_s=OFF
+                               want_compiler_rt=ON
                                extra_libs+=( "${compiler_rt}" )
                        fi
                fi
@@ -130,6 +131,7 @@ multilib_src_configure() {
                -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl)
                -DLIBCXX_HAS_GCC_S_LIB=${want_gcc_s}
                -DLIBCXX_INCLUDE_TESTS=$(usex test)
+               -DLIBCXX_USE_COMPILER_RT=${want_compiler_rt}
                -DCMAKE_SHARED_LINKER_FLAGS="${extra_libs[*]} ${LDFLAGS}"
        )