Unable to build 20210324.2 for CS8 - error: use of deleted function
Describe the bug
While building 20210324.2 for CentOS Stream 8, we're hitting the issue below
[ 91%] Building CXX object absl/random/CMakeFiles/absl_random_mock_distributions_test.dir/mock_distributions_test.cc.o
cd /builddir/build/BUILD/abseil-cpp-20210324.2/x86_64-redhat-linux-gnu/absl/random && /usr/bin/c++ -I/builddir/build/BUILD/abseil-cpp-20210324.2 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -O2 -g -DNDEBUG -Wall -Wextra -Wcast-qual -Wconversion-null -Wformat-security -Wmissing-declarations -Woverlength-strings -Wpointer-arith -Wundef -Wunused-local-typedefs -Wunused-result -Wvarargs -Wvla -Wwrite-strings -DNOMINMAX -Wno-conversion-null -Wno-deprecated-declarations -Wno-missing-declarations -Wno-sign-compare -Wno-unused-function -Wno-unused-parameter -Wno-unused-private-field -std=gnu++17 -MD -MT absl/random/CMakeFiles/absl_random_mock_distributions_test.dir/mock_distributions_test.cc.o -MF CMakeFiles/absl_random_mock_distributions_test.dir/mock_distributions_test.cc.o.d -o CMakeFiles/absl_random_mock_distributions_test.dir/mock_distributions_test.cc.o -c /builddir/build/BUILD/abseil-cpp-20210324.2/absl/random/mock_distributions_test.cc
/builddir/build/BUILD/abseil-cpp-20210324.2/absl/hash/hash_test.cc: In instantiation of 'struct {anonymous}::IsAggregateInitializable<absl::lts_20210324::hash_internal::Hash<{anonymous}::IsHashableTest_PoisonHash_Test::TestBody()::X> >':
/builddir/build/BUILD/abseil-cpp-20210324.2/absl/hash/hash_test.cc:639:3: required from here
/builddir/build/BUILD/abseil-cpp-20210324.2/absl/hash/hash_test.cc:614:22: error: use of deleted function 'absl::lts_20210324::hash_internal::PoisonedHash::PoisonedHash()'
: std::true_type {};
^
In file included from /builddir/build/BUILD/abseil-cpp-20210324.2/absl/hash/hash.h:76,
from /builddir/build/BUILD/abseil-cpp-20210324.2/absl/hash/hash_test.cc:15:
/builddir/build/BUILD/abseil-cpp-20210324.2/absl/hash/internal/hash.h:972:3: note: declared here
PoisonedHash() = delete;
^~~~~~~~~~~~
/builddir/build/BUILD/abseil-cpp-20210324.2/absl/hash/hash_test.cc:614:22: error: use of deleted function 'absl::lts_20210324::hash_internal::PoisonedHash::PoisonedHash()'
: std::true_type {};
^
In file included from /builddir/build/BUILD/abseil-cpp-20210324.2/absl/hash/hash.h:76,
from /builddir/build/BUILD/abseil-cpp-20210324.2/absl/hash/hash_test.cc:15:
/builddir/build/BUILD/abseil-cpp-20210324.2/absl/hash/internal/hash.h:972:3: note: declared here
PoisonedHash() = delete;
^~~~~~~~~~~~
[ 91%] Linking CXX executable ../../bin/absl_hash_function_defaults_test
What version of Abseil are you using? 20210324.2
What operating system and version are you using
CentOS Stream release 8
What compiler and version are you using?
<mock-chroot> sh-4.4# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.5.0 20210514 (Red Hat 8.5.0-7) (GCC)
What build system are you using?
The full configuration which triggers the issue in CentOS packaging is the use of our %cmake macro:
CFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
CXXFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
FFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules'
FCFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules'
LDFLAGS='-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'
+ /usr/bin/cmake -S . -B x86_64-redhat-linux-gnu -DCMAKE_C_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_Fortran_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
-DCMAKE_INSTALL_PREFIX:PATH=/usr -DINCLUDE_INSTALL_DIR:PATH=/usr/include
-DLIB_INSTALL_DIR:PATH=/usr/lib64
-DSYSCONF_INSTALL_DIR:PATH=/etc
-DSHARE_INSTALL_PREFIX:PATH=/usr/share
-DLIB_SUFFIX=64
-DBUILD_SHARED_LIBS:BOOL=ON
-DABSL_USE_EXTERNAL_GOOGLETEST:BOOL=ON
-DBUILD_TESTING:BOOL=ON
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
-DCMAKE_CXX_STANDARD:STRING=17
-- The CXX compiler identification is GNU 8.5.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_CXX_FLAGS_RELEASE
CMAKE_C_FLAGS_RELEASE
CMAKE_Fortran_FLAGS_RELEASE
INCLUDE_INSTALL_DIR
LIB_INSTALL_DIR
LIB_SUFFIX
SHARE_INSTALL_PREFIX
SYSCONF_INSTALL_DIR
+ /usr/bin/cmake --build x86_64-redhat-linux-gnu -j8 --verbose
Add any other context about the problem here.
More informational data
DEBUG util.py:446: Last metadata expiration check: 0:00:01 ago on Wed Jan 19 10:09:31 2022.
DEBUG util.py:446: Package gcc-c++-8.5.0-7.el8.x86_64 is already installed.
DEBUG util.py:446: Package make-1:4.2.1-11.el8.x86_64 is already installed.
DEBUG util.py:446: Dependencies resolved.
DEBUG util.py:446: ================================================================================
DEBUG util.py:446: Package Arch Version Repository Size
DEBUG util.py:446: ================================================================================
DEBUG util.py:446: Installing:
DEBUG util.py:446: cmake x86_64 3.20.2-4.el8 appstream 12 M
DEBUG util.py:446: gmock-devel x86_64 1.11.0-1.el8 myrepo 227 k
DEBUG util.py:446: gtest-devel x86_64 1.11.0-1.el8 myrepo 264 k
DEBUG util.py:446: Installing dependencies:
DEBUG util.py:446: cmake-data noarch 3.20.2-4.el8 appstream 1.7 M
DEBUG util.py:446: cmake-filesystem x86_64 3.20.2-4.el8 appstream 44 k
DEBUG util.py:446: cmake-rpm-macros noarch 3.20.2-4.el8 appstream 44 k
DEBUG util.py:446: emacs-filesystem noarch 1:26.1-7.el8 baseos 70 k
DEBUG util.py:446: gmock x86_64 1.11.0-1.el8 myrepo 60 k
DEBUG util.py:446: gtest x86_64 1.11.0-1.el8 myrepo 162 k
DEBUG util.py:446: libuv x86_64 1:1.41.1-1.el8_4 appstream 156 k
DEBUG util.py:446: vim-filesystem noarch 2:8.0.1763-16.el8_5.3 appstream 49 k
DEBUG util.py:446: Transaction Summary
This is a known issue only affecting a test. In the latest version we turned off that test: https://github.com/abseil/abseil-cpp/blob/fbbb5865a562c9a9167d71c1cf56b82025a8f065/absl/hash/hash_test.cc#L826-L829
I'm not sure if this is a GCC bug or an Abseil bug.