-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
Description
Describe the bug
gcc TSAN builds are failing with ‘constinit’ variable ‘absl::lts_20220623::time_state’ does not have a constant initializer
Steps to reproduce the bug
Any gcc TSAN build
What version of Abseil are you using?
https://github.com/abseil/abseil-cpp/releases/tag/20220623.0
What operating system and version are you using
RHEL7
What compiler and version are you using?
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-11/root/usr/libexec/gcc/x86_64-redhat-linux/11/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-11/root/usr --mandir=/opt/rh/devtoolset-11/root/usr/share/man --infodir=/opt/rh/devtoolset-11/root/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 --with-default-libstdcxx-abi=gcc4-compatible --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-11.2.1-20210728/obj-x86_64-redhat-linux/isl-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.2.1 20210728 (Red Hat 11.2.1-1) (GCC)What build system are you using?
$ cmake --version
cmake version 3.18.2Additional context
Most likely due to https://github.com/abseil/abseil-cpp/blob/20220623.0/absl/base/internal/spinlock.h#L70
FAILED: _deps/abseil-cpp-build/absl/time/CMakeFiles/absl_time.dir/clock.cc.o
/bats/ccache/current/bin/ccache /opt/rh/devtoolset-11/root/usr/bin/c++ -DBATSLL_VERSION=13.31.0 -I_deps/abseil-cpp-src -Wno-free-non
heap-object -Wno-free-nonheap-object -Wno-free-nonheap-object -Wno-free-nonheap-object -Wno-free-nonheap-object -Wno-free-nonheap-ob
ject -Wno-free-nonheap-object -Wno-free-nonheap-object -O2 -DNDEBUG -flto -fno-fat-lto-objects -g -march=native -fno-var-tracking-as
signments -fsanitize=thread -Wall -Wextra -Wcast-qual -Wconversion-null -Wformat-security -Wmissing-declarations -Woverlength-string
s -Wpointer-arith -Wundef -Wunused-local-typedefs -Wunused-result -Wvarargs -Wvla -Wwrite-strings -DNOMINMAX -pthread -std=c++2a -MD
-MT _deps/abseil-cpp-build/absl/time/CMakeFiles/absl_time.dir/clock.cc.o -MF _deps/abseil-cpp-build/absl/time/CMakeFiles/absl_time.
dir/clock.cc.o.d -o _deps/abseil-cpp-build/absl/time/CMakeFiles/absl_time.dir/clock.cc.o -c _deps/abseil-cpp-src/absl/time/clock.cc
_deps/abseil-cpp-src/absl/time/clock.cc:199:34: error: ‘constinit’ variable ‘absl::lts_20220623::time_state’ does not have a constan
t initializer
199 | ABSL_CONST_INIT static TimeState time_state{};
| ^~~~~~~~~~
_deps/abseil-cpp-src/absl/time/clock.cc:199:45: error: temporary of non-literal type ‘absl::lts_20220623::base_internal::SpinLock’ in a constant expression
199 | ABSL_CONST_INIT static TimeState time_state{};
| ^
In file included from _deps/abseil-cpp-src/absl/time/clock.cc:31:
_deps/abseil-cpp-src/absl/base/internal/spinlock.h:52:21: note: ‘absl::lts_20220623::base_internal::SpinLock’ is not literal because
:
52 | class ABSL_LOCKABLE SpinLock {
| ^~~~~~~~
_deps/abseil-cpp-src/absl/base/internal/spinlock.h:52:21: note: ‘absl::lts_20220623::base_internal::SpinLock’ does not have ‘const
expr’ destructor