Open tpgxyz opened 3 years ago
The problem here is that asio makes some assumptions about the compiler based on GNUC versioning. clang configured to set GNUC / __GNUC_MINOR__ to something >= 8.4 will fail.
In particular, BOOST_ASIO_HAS_SFINAE_VARIABLE_TEMPLATES gets set, which breaks the build with clang.
This isn't showing for most other systems because clang by default sets GNUC and friends to 4.2.1 -- but doing that disables all sorts of optimizations (just look at boost-asio configs for examples of what gets disabled for "gcc 4.2.1" even though modern versions of clang can handle it easily). To reproduce on unpatched clang, add -fgnuc-version=11.1 to the compiler flags.
The attached patch fixes the problem, but isn't a very nice solution (because it just makes the assumption that HAS_SFINAE_VARIABLE_TEMPLATES should never be set for clang, which may be wrong once clang 13 or 14 is released). The best solution would be a check to see if SFINAE_VARIABLE_TEMPLATES will work.
Clang bug report with reduced sample: https://github.com/llvm/llvm-project/issues/57894
A workaround is to compile with -std=c++17
or later.
Another workaround is to make the out-of-class member definitions constexpr
.
Hi,
i'm trying to compile boost-1.76.0 on aarch64 with LLVM/clang-12.x. and it due to this error:
More build logs can be found here: https://abf.openmandriva.org/build_lists/55053
Our boost sources are here: https://github.com/OpenMandrivaAssociation/boost