2021.03.15.00: build fails
Source tree configured with:
%cmake \
-D BUILD_SHARED_LIBS=ON \
-D BUILD_TESTS=ON \
-D CMAKE_INSTALL_DIR=%{_libdir}/cmake/%{name} \
-D PACKAGE_VERSION=%{version} \
-D PYTHON_EXTENSIONS=ON \
and build fails with:
[tkloczko@barrel x86_64-redhat-linux-gnu]$ make
/usr/bin/cmake -S/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00 -B/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/x86_64-redhat-linux-gnu --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/x86_64-redhat-linux-gnu/CMakeFiles /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/x86_64-redhat-linux-gnu//CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/x86_64-redhat-linux-gnu'
make -f CMakeFiles/folly_base.dir/build.make CMakeFiles/folly_base.dir/depend
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/x86_64-redhat-linux-gnu'
cd /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/x86_64-redhat-linux-gnu && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00 /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00 /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/x86_64-redhat-linux-gnu /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/x86_64-redhat-linux-gnu /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/x86_64-redhat-linux-gnu/CMakeFiles/folly_base.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/x86_64-redhat-linux-gnu'
make -f CMakeFiles/folly_base.dir/build.make CMakeFiles/folly_base.dir/build
make[2]: Entering directory '/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/x86_64-redhat-linux-gnu'
[ 0%] Building CXX object CMakeFiles/folly_base.dir/folly/fibers/FiberManager.cpp.o
/usr/bin/g++ -DFMT_LOCALE -DFMT_SHARED -DFOLLY_XLOG_STRIP_PREFIXES=\"/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00:/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/x86_64-redhat-linux-gnu\" -DGFLAGS_IS_A_DLL=0 -D_GNU_SOURCE -D_REENTRANT -I/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00 -I/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/x86_64-redhat-linux-gnu -O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none -DNDEBUG -fPIC -g -std=gnu++1z -finput-charset=UTF-8 -fsigned-char -Wall -Wno-deprecated -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused -Wunused-label -Wunused-result -Wshadow-compatible-local -Wno-noexcept-type -faligned-new -fopenmp -std=gnu++17 -o CMakeFiles/folly_base.dir/folly/fibers/FiberManager.cpp.o -c /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManager.cpp
/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManager.cpp:346:74: error: no matching function for call to ‘constexpr_max(long int, int)’
346 | constexpr size_t kAltStackSize = folly::constexpr_max(SIGSTKSZ, 32 * 1024);
| ^
In file included from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/lang/Bits.h:63,
from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/hash/Hash.h:34,
from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/FBString.h:45,
from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/Demangle.h:19,
from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/ExceptionWrapper.h:34,
from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/Try.h:24,
from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManagerInternal.h:34,
from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManager.cpp:17:
/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/ConstexprMath.h:30:13: note: candidate: ‘template<class T> constexpr T folly::constexpr_max(T)’
30 | constexpr T constexpr_max(T a) {
| ^~~~~~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/ConstexprMath.h:30:13: note: template argument deduction/substitution failed:
/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManager.cpp:346:74: note: candidate expects 1 argument, 2 provided
346 | constexpr size_t kAltStackSize = folly::constexpr_max(SIGSTKSZ, 32 * 1024);
| ^
In file included from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/lang/Bits.h:63,
from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/hash/Hash.h:34,
from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/FBString.h:45,
from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/Demangle.h:19,
from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/ExceptionWrapper.h:34,
from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/Try.h:24,
from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManagerInternal.h:34,
from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManager.cpp:17:
/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/ConstexprMath.h:34:13: note: candidate: ‘template<class T, class ... Ts> constexpr T folly::constexpr_max(T, T, Ts ...)’
34 | constexpr T constexpr_max(T a, T b, Ts... ts) {
| ^~~~~~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/ConstexprMath.h:34:13: note: template argument deduction/substitution failed:
/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManager.cpp:346:74: note: deduced conflicting types for parameter ‘T’ (‘long int’ and ‘int’)
346 | constexpr size_t kAltStackSize = folly::constexpr_max(SIGSTKSZ, 32 * 1024);
| ^
/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManager.cpp:391:19: error: ‘AltStackBuffer’ was not declared in this scope
391 | std::unique_ptr<AltStackBuffer> stack_;
| ^~~~~~~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManager.cpp:391:33: error: template argument 1 is invalid
391 | std::unique_ptr<AltStackBuffer> stack_;
| ^
/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManager.cpp:391:33: error: template argument 2 is invalid
/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManager.cpp: In constructor ‘folly::fibers::{anonymous}::ScopedAlternateSignalStack::ScopedAlternateSignalStack()’:
/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManager.cpp:375:31: error: ‘AltStackBuffer’ was not declared in this scope
375 | stack_ = std::make_unique<AltStackBuffer>();
| ^~~~~~~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManager.cpp:375:47: error: no matching function for call to ‘make_unique<<expression error> >()’
375 | stack_ = std::make_unique<AltStackBuffer>();
| ^
In file included from /usr/include/c++/11/memory:76,
from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManagerInternal.h:20,
from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManager.cpp:17:
/usr/include/c++/11/bits/unique_ptr.h:961:5: note: candidate: ‘template<class _Tp, class ... _Args> typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...)’
961 | make_unique(_Args&&... __args)
| ^~~~~~~~~~~
/usr/include/c++/11/bits/unique_ptr.h:961:5: note: template argument deduction/substitution failed:
/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManager.cpp:375:47: error: template argument 1 is invalid
375 | stack_ = std::make_unique<AltStackBuffer>();
| ^
In file included from /usr/include/c++/11/memory:76,
from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManagerInternal.h:20,
from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManager.cpp:17:
/usr/include/c++/11/bits/unique_ptr.h:967:5: note: candidate: ‘template<class _Tp> typename std::_MakeUniq<_Tp>::__array std::make_unique(std::size_t)’
967 | make_unique(size_t __num)
| ^~~~~~~~~~~
/usr/include/c++/11/bits/unique_ptr.h:967:5: note: template argument deduction/substitution failed:
/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManager.cpp:375:47: error: template argument 1 is invalid
375 | stack_ = std::make_unique<AltStackBuffer>();
| ^
In file included from /usr/include/c++/11/memory:76,
from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManagerInternal.h:20,
from /home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManager.cpp:17:
/usr/include/c++/11/bits/unique_ptr.h:973:5: note: candidate: ‘template<class _Tp, class ... _Args> typename std::_MakeUniq<_Tp>::__invalid_type std::make_unique(_Args&& ...)’ (deleted)
973 | make_unique(_Args&&...) = delete;
| ^~~~~~~~~~~
/usr/include/c++/11/bits/unique_ptr.h:973:5: note: template argument deduction/substitution failed:
/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManager.cpp:375:47: error: template argument 1 is invalid
375 | stack_ = std::make_unique<AltStackBuffer>();
| ^
/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManager.cpp:377:29: error: base operand of ‘->’ is not a pointer
377 | setAlternateStack(stack_->data(), stack_->size());
| ^~
/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/folly/fibers/FiberManager.cpp:377:45: error: base operand of ‘->’ is not a pointer
377 | setAlternateStack(stack_->data(), stack_->size());
| ^~
make[2]: *** [CMakeFiles/folly_base.dir/build.make:1645: CMakeFiles/folly_base.dir/folly/fibers/FiberManager.cpp.o] Error 1
make[2]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/x86_64-redhat-linux-gnu'
make[1]: *** [CMakeFiles/Makefile2:4293: CMakeFiles/folly_base.dir/all] Error 2
make[1]: Leaving directory '/home/tkloczko/rpmbuild/BUILD/folly-2021.03.15.00/x86_64-redhat-linux-gnu'
make: *** [Makefile:163: all] Error 2
What version of GCC or clang are you compiling with?
gcc 11.0.1 from fedora rawhide.
same issue
same problem here. using gcc 9.4.0 in ubuntu 21.10. Anyone know a fix?
Could you see if either of these solve the issue? I suspect SIGSTKSZ is explicitly unsigned on some systems which is causing confusion when trying to infer the type of T
constexpr size_t kAltStackSize = folly::constexpr_max<size_t>(SIGSTKSZ, 32 * 1024);
constexpr size_t kAltStackSize = folly::constexpr_max(int(SIGSTKSZ), 32 * 1024);
Unfortunately, those failed with the message:
error: call to non-‘constexpr’ function ‘long int sysconf(int)’
The issue was because I needed to use an old folly commit, but SIGSTKSZ is no longer a constant in latest linux/glibc. I've applied the non-const changes from the new commits now and it worked.
Thanks,