On 16/11/2023 15:01, Peter Dimov via Boost wrote:
Matthijs Möhlmann wrote:
Hi,
I tried to build with clang (16.0.6) and it causes a build failure.
Here is the gist with the output: https://gist.github.com/matthijs/f60a54d6f5ce86b3ec35c83d751c9631
Here is the partial output of the compile error (its the first one where it happens): /usr/bin/ld: bin.v2/libs/filesystem/build/clang-linux-16/release/threading-multi/visibility- hidden/operations.o: in function `boost::filesystem::detail::absolute(boost::filesystem::path const&, boost::filesystem::path const&, boost::system::error_code*)': operations.cpp:(.text+0xd8): undefined reference to `operator new(unsigned long)' ...
This might be caused by Filesystem adding <linkflags>"-Wl,--no-undefined" to its build, which might (for some unfathomable reason) interfere with your linkflags="-stdlib=libc++".
As a general rule, you should prefer using the built-in b2 features for stdlib selection and C++ standard level; instead of
cxxflags="-I/usr/include/libcxxabi -std=c++20 -stdlib=libc++" linkflags="-stdlib=libc++"
try
stdlib=libc++ cxxstd=20
and, if needed,
include=/usr/include/libcxxabi
.
I tried your suggestion but still the same errors. If I say --with-toolset=clang is the linker from llvm also selected or do I have to add the flag linker=... to that list? Regards, Matthijs