pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: building lang/llvm with pkgsrc clang (was: using pkgsrc with pkgsrc clang)

On Wed, Aug 24, 2022 at 2:51 AM Edgar Fuß <> wrote:
> > then re-build lang/clang.
> Which fails building llvm. Which sounds crazy given it builds with gcc.
> -- The C compiler identification is Clang 13.0.1
> -- The CXX compiler identification is Clang 13.0.1
> [...]
> -- Performing Test LLVM_LIBSTDCXX_MIN
> -- Performing Test LLVM_LIBSTDCXX_MIN - Success
> -- Performing Test LLVM_LIBSTDCXX_SOFT_ERROR - Failed
> CMake Error at cmake/modules/CheckCompilerVersion.cmake:119 (message):
>   libstdc++ version should be at least 5.1 because LLVM will soon use new C++
>   features which your toolchain version doesn't support.  You can temporarily
>   opt out using LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN, but very soon your
>   toolchain won't be supported.
> Call Stack (most recent call first):
>   cmake/config-ix.cmake:14 (include)
>   CMakeLists.txt:684 (include)
> I formerly sucessfully built lang/clang (for clang-format) on macOS (with clang, of course).
> Help!

macOS ships with a libstdc++ in /usr/lib but it was deprecated, so
it's out of date:

    Building with libstdc++ was deprecated with Xcode 8 and is not
supported in Xcode 10 when targeting iOS.

LLVM has its own C++ library named libc++ (aka libcxx). But pkgsrc
only builds clang with libc++ on SunOS:

    # Enable full LLVM suite on SunOS
    .if ${OPSYS} == "SunOS"
    .include "../../lang/compiler-rt/"
    .include "../../lang/libcxx/"
    .include "../../lang/libcxxabi/"
    .include "../../lang/libunwind/"

You can edit the Makefile to remove that conditional (.if ${OPSYS} ==
"SunOS") and Clang will be built with libc++.

Home | Main Index | Thread Index | Old Index