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ß <ef%math.uni-bonn.de@localhost> 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
> -- 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.

    https://developer.apple.com/documentation/xcode-release-notes/xcode-10-release-notes

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/buildlink3.mk"
    .include "../../lang/libcxx/buildlink3.mk"
    .include "../../lang/libcxxabi/buildlink3.mk"
    .include "../../lang/libunwind/buildlink3.mk"
    CMAKE_ARGS+=    -DCLANG_DEFAULT_RTLIB:STRING="compiler-rt"
    CMAKE_ARGS+=    -DCLANG_DEFAULT_CXX_STDLIB:STRING="libc++"
    .endif

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