Closed marxin closed 2 years ago
The warnings are harmless (and arguably wrong) - removal of the pointer from a set, memory is not accessed. But that GCC change seems quite related. Perhaps the warnings appeared as a result of that change.
We are able to reproduce this with gcc/g++ 12 on Fedora 36, but only if SCons is used to build the code. Given that Galera SCons scritps are not actively maintained, it would be better to switch the build to use CMake if possible.
We are able to reproduce this with gcc/g++ 12 on Fedora 36, but only if SCons is used to build the code. Given that Galera SCons scritps are not actively maintained, it would be better to switch the build to use CMake if possible.
Correct, we cannot build the package with cmake due to:
[ 18s] cd /home/abuild/rpmbuild/BUILD/galera-4-26.4.10/build/galerautils/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/galerautils_hw_crc32c.dir/link.txt --verbose=1
[ 18s] /usr/bin/cc -fPIC -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -Wno-implicit-fallthrough -DNDEBUG -Wall -Wextra -g -D_XOPEN_SOURCE=600 -O2 -g -DNDEBUG -flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now -shared -Wl,-soname,libgalerautils_hw_crc32c.so -o libgalerautils_hw_crc32c.so CMakeFiles/galerautils_hw_crc32c.dir/gu_crc32c_x86.c.o
[ 18s] /usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: /tmp/ccQgS77t.ltrans0.ltrans.o: in function `gu_crc32c_hardware':
[ 18s] /home/abuild/rpmbuild/BUILD/galera-4-26.4.10/galerautils/src/gu_crc32c_x86.c:113: undefined reference to `gu_log'
[ 18s] collect2: error: ld returned 1 exit status
[ 18s] make[2]: *** [galerautils/src/CMakeFiles/galerautils_hw_crc32c.dir/build.make:100: galerautils/src/libgalerautils_hw_crc32c.so] Error 1
[ 18s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/galera-4-26.4.10/build'
[ 18s] make[1]: *** [CMakeFiles/Makefile2:1175: galerautils/src/CMakeFiles/galerautils_hw_crc32c.dir/all] Error 2
[ 18s] make[1]: *** Waiting for unfinished jobs....
[ 18s] make[2]: Entering directory '/home/abuild/rpmbuild/BUILD/galera-4-26.4.10/build'
[ 18s] [ 3%] Linking C executable wsrep_test
Is there a link to complete build log containing this error?
Is there a link to complete build log containing this error?
Sure, I built it locally and complete build log is here: https://gist.githubusercontent.com/marxin/03f0d8eb8ffd6030334e85b00cbd7b1a/raw/52c0ca1a129ed6e5292e1ad53b24636701320eaa/gistfile1.txt
The build failure is caused by -DBUILD_SHARED_LIBS:BOOL=ON
, which I believe comes from build system. With this build option defined, the intermediate libraries must be added explicitly as STATIC in order to build to work. Additionally there is a cyclic dependency between galerautils and crc32c HW libs in galerautils/src/CMakeLists.txt
.
The attached patch made the build pass for me
Thanks, I can confirm the patch fixed cmake build for me.
Fixed in 4.11
Fails here: https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:Gcc7/galera-4/standard/x86_64
with:
It started with the following GCC revision: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=e3ef832a9e8d6a950a439e34e576eb4cb202dc48
which is an optimization for libstdc++.
I bet the root cause are the following warnings: