Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libcxxabi-14.0.6 fails to compile with: ../include/c++/v1/__bit/bit_cast.h:31:38: error: expected primary-expression before ‘,’ token #56828

Open
stefson opened this issue Jul 31, 2022 · 3 comments
Labels
build-problem libc++abi libc++abi C++ Runtime Library. Not libc++.

Comments

@stefson
Copy link

stefson commented Jul 31, 2022

hey everyone,

I ran into a compile error when compiling libcxxabi:

[545/563] /usr/bin/aarch64-unknown-linux-gnu-g++ -DHAVE___CXA_THREAD_ATEXIT_IMPL -DLIBCXXABI_USE_LLVM_UNWINDER -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_DISABLE_EXTERN_TEMPLATE -D_LIBCXXABI_BUILDING_LIBRARY -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/tmp/portage/sys-libs/libcxxabi-14.0.6/work/libcxxabi/include -I/usr/include -I/var/tmp/portage/sys-libs/libcxxabi-14.0.6/work/libcxxabi/../libcxx/src  -O2 -pipe -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -Wimplicit-fallthrough -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wmisleading-indentation -fdiagnostics-color -fdata-sections  -fPIC -nostdinc++ -Werror=return-type -W -Wall -Wchar-subscripts -Wconversion -Wmismatched-tags -Wmissing-braces -Wunused-function -Wshadow -Wsign-compare -Wsign-conversion -Wstrict-aliasing=2 -Wstrict-overflow=4 -Wunused-parameter -Wunused-variable -Wwrite-strings -Wundef -Wno-suggest-override -Wno-error -pedantic -fstrict-aliasing -D_DEBUG -I/var/tmp/portage/sys-libs/libcxxabi-14.0.6/work/runtimes_build-.arm64/include/c++/v1 -std=c++2a -MD -MT libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_default_handlers.cpp.o -MF libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_default_handlers.cpp.o.d -o libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_default_handlers.cpp.o -c /var/tmp/portage/sys-libs/libcxxabi-14.0.6/work/libcxxabi/src/cxa_default_handlers.cpp
FAILED: libcxxabi/src/CMakeFiles/cxxabi_shared.dir/cxa_default_handlers.cpp.o 
/var/tmp/portage/sys-libs/libcxxabi-14.0.6/work/runtimes_build-.arm64/include/c++/v1/__bit/bit_cast.h: In function ‘constexpr _ToType std::__1::bit_cast(const _FromType&)’:
/var/tmp/portage/sys-libs/libcxxabi-14.0.6/work/runtimes_build-.arm64/include/c++/v1/__bit/bit_cast.h:31:38: error: expected primary-expression before ‘,’ token
   31 |     return __builtin_bit_cast(_ToType, __from);
      |   

compressed build.log: build.log.gz

@thesamesam
Copy link
Member

Originally reported downstream in Gentoo by OP at #56828.

The bug is for w/ GCC 10, 11 is fine.

@stefson
Copy link
Author

stefson commented Jul 31, 2022

the issue was first detected on aarch64, but happens as well on amd64 hardware.

my toolchain is gcc-10 based, and it seems this is an issue here for unknown reasons. libcxxabi does compile if using a gcc-11 based toolchain.

@EugeneZelenko EugeneZelenko added libc++abi libc++abi C++ Runtime Library. Not libc++. build-problem and removed new issue labels Jul 31, 2022
@mrjoel
Copy link

mrjoel commented Sep 2, 2022

I'm running into this as well, using default GCC 10 from Debian. In some quick tag checking, I get build failures starting with llvmorg-14.0.0-rc1, but llvmorg-13.0.1 builds correctly

ehmry pushed a commit to NixOS/nixpkgs that referenced this issue Nov 30, 2022
The libcxx library needs a C++20 capable compiler toolchain since version 14, but aarch64-linux uses GCC 9 by default.

However, building libcxxabi fails when using GCC 10, see [llvm/llvm-project#56828]. So let's use GCC 11 instead.

[llvm/llvm-project#56828]: llvm/llvm-project#56828
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-problem libc++abi libc++abi C++ Runtime Library. Not libc++.
Projects
None yet
Development

No branches or pull requests

4 participants