Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 762898 - sys-devel/llvm-11.0.0: libstdc++ version must be at least 5.1 (macOS Big Sur, Clang bootstrap)
Summary: sys-devel/llvm-11.0.0: libstdc++ version must be at least 5.1 (macOS Big Sur,...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-01 06:45 UTC by Sam James
Modified: 2021-01-02 03:58 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (file_762898.txt,7.32 KB, text/plain)
2021-01-01 06:45 UTC, Sam James
Details
CMakeOutput.log (file_762898.txt,37.74 KB, text/plain)
2021-01-01 06:46 UTC, Sam James
Details
CMakeError.log (file_762898.txt,1.45 KB, text/plain)
2021-01-01 06:46 UTC, Sam James
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-01-01 06:45:31 UTC
Created attachment 680491 [details]
build.log

I figured I'd give it a run to see where things are, not expecting them to work yet.

I get to stage 3 but it barfs on finding libstdc++ - similar to the issues Jacob had but hard failing instead of linking against the wrong one.

I tried naively adding in pkgconf as it was trying to call out to pkg-config but that made no difference.

----
-- Found libtool - /Library/Developer/CommandLineTools/usr/bin/libtool
-- Performing Test LLVM_LIBSTDCXX_MIN
-- Performing Test LLVM_LIBSTDCXX_MIN - Failed
CMake Error at cmake/modules/CheckCompilerVersion.cmake:97 (message):
  libstdc++ version must be at least 5.1.
Call Stack (most recent call first):
  cmake/config-ix.cmake:13 (include)
  CMakeLists.txt:655 (include)


-- Configuring incomplete, errors occurred!
See also "/Users/sam/prefix/var/tmp/portage/sys-devel/llvm-11.0.0/work/llvm-11.0.0_build-abi_x86_64.amd64/CMakeFiles/CMakeOutput.log".
See also "/Users/sam/prefix/var/tmp/portage/sys-devel/llvm-11.0.0/work/llvm-11.0.0_build-abi_x86_64.amd64/CMakeFiles/CMakeError.log".
 * ERROR: sys-devel/llvm-11.0.0::gentoo_prefix failed (configure phase):
 *   cmake failed
 *
 * Call stack:
 *     ebuild.sh, line  125:  Called src_configure
 *   environment, line 3980:  Called multilib-minimal_src_configure
 *   environment, line 2606:  Called multilib_foreach_abi 'multilib-minimal_abi_src_configure'
 *   environment, line 2859:  Called multibuild_foreach_variant '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_configure'
 *   environment, line 2536:  Called _multibuild_run '_multilib_multibuild_wrapper' 'multilib-minimal_abi_src_configure'
 *   environment, line 2534:  Called _multilib_multibuild_wrapper 'multilib-minimal_abi_src_configure'
 *   environment, line  530:  Called multilib-minimal_abi_src_configure
 *   environment, line 2600:  Called multilib_src_configure
 *   environment, line 3115:  Called cmake_src_configure
 *   environment, line 1437:  Called die
 * The specific snippet of code:
 *       "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed";
 *
 * If you need support, post the output of `emerge --info '=sys-devel/llvm-11.0.0::gentoo_prefix'`,
 * the complete build log and the output of `emerge -pqv '=sys-devel/llvm-11.0.0::gentoo_prefix'`.
 * The complete build log is located at '/Users/sam/prefix/var/tmp/portage/sys-devel/llvm-11.0.0/temp/build.log'.
 * The ebuild environment file is located at '/Users/sam/prefix/var/tmp/portage/sys-devel/llvm-11.0.0/temp/environment'.
 * Working directory: '/Users/sam/prefix/var/tmp/portage/sys-devel/llvm-11.0.0/work/llvm-11.0.0_build-abi_x86_64.amd64'
 * S: '/Users/sam/prefix/var/tmp/portage/sys-devel/llvm-11.0.0/work/llvm'

----
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-01-01 06:46:04 UTC
Created attachment 680494 [details]
CMakeOutput.log
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-01-01 06:46:31 UTC
Created attachment 680497 [details]
CMakeError.log
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-01-01 06:48:32 UTC
I'll try again with some of Jacob's include path guidance given to Clang and friends throughout.
Comment 4 Fabian Groffen gentoo-dev 2021-01-01 13:06:36 UTC
This is because the llvm buildsys assumes libstdc++ is in use, while we have libc++ in use.

I verified I can get past this by using the LLVM_ENABLE_LIBCXX option.  Contrary to what its name suggest (ENABLE), it allows usage with libcxx, quoting:

LLVM_ENABLE_LIBCXX:BOOL
    If the host compiler and linker supports the stdlib flag, -stdlib=libc++ is passed to invocations of both so that the project is built using libc++ instead of stdlibc++. Defaults to OFF.

I suggest updating the is_libcxx_linked section as follows:

@@ -381,6 +381,7 @@ multilib_src_configure() {
                # libraries with libstdc++ clang, and the other way around.
                mycmakeargs+=(
                        -DLLVM_VERSION_SUFFIX="libcxx"
+                       -DLLVM_ENABLE_LIBCXX=ON
                )
        fi
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-01-01 13:10:17 UTC
Feel free to push that if it solves the problem for you.
Comment 6 Larry the Git Cow gentoo-dev 2021-01-01 15:32:35 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=82671ff8646c372ed9d8d6782f143b27b43ca0c8

commit 82671ff8646c372ed9d8d6782f143b27b43ca0c8
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2021-01-01 15:32:10 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2021-01-01 15:32:10 +0000

    sys-devel/llvm: fix usage of libc++, bug #762898
    
    Closes: https://bugs.gentoo.org/762898
    Package-Manager: Portage-3.0.9, Repoman-3.0.2
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 sys-devel/llvm/llvm-11.0.0.ebuild      | 3 ++-
 sys-devel/llvm/llvm-11.0.1.9999.ebuild | 3 ++-
 sys-devel/llvm/llvm-11.0.1_rc1.ebuild  | 3 ++-
 sys-devel/llvm/llvm-11.0.1_rc2.ebuild  | 3 ++-
 sys-devel/llvm/llvm-12.0.0.9999.ebuild | 3 ++-
 5 files changed, 10 insertions(+), 5 deletions(-)