Bug #54514
openbuild: LTO can cause false positives in cmake tests resulting in build failures
0%
Description
In particular the cmake/modules/CheckCxxAtomic.cmake test will report success for HAVE_CXX11_ATOMIC on s390x in Fedora.
Note that the Fedora package builds use the %cmake, %cmake_build, and %cmake_install macros defined in /usr/lib/rpm/macros.d/macros.cmake which add f -flto=auto -ffat-lto-objects to the CFLAGS and CXXFLAGS.
The HAVE_CXX11_ATOMIC test incorrectly reports success when LTO determines that atomic16() is unused and optimizes it out, and it successfully links, even though one might naively think it shouldn't. Thus the test doesn't perform the subsequent test for HAVE_LIBATOMIC. The build then proceeds but fails later on when attempts to link certain programs fail with undefined references to __atomic_load_16, __atomic_store_16, and __atomic_compare_exchange_16'
Updated by Kaleb KEITHLEY about 2 years ago
Updated by Ken Dreyer almost 2 years ago
- Pull request ID set to 47153
Kaleb, after discussing in #56492 and reviewing the patch you've added to Fedora to build v17.2.1 on s390x there, I've submitted this at https://github.com/ceph/ceph/pull/47153
Updated by Ken Dreyer almost 2 years ago
- Status changed from New to In Progress
- Assignee set to Ken Dreyer
Updated by Ken Dreyer almost 2 years ago
- Has duplicate Bug #56492: undefined reference to "__atomic_load_16" on s390x added
Updated by Ken Dreyer almost 2 years ago
Even without the %cmake RPM macros, ceph.spec.in upstream uses $RPM_OPT_FLAGS
, and that has -O2 -flto=auto -ffat-lto-objects
.
Updated by Ken Dreyer over 1 year ago
- Status changed from In Progress to Pending Backport
- Backport set to quincy
quincy backport in https://github.com/ceph/ceph/pull/48263
Updated by Backport Bot over 1 year ago
- Copied to Backport #57685: quincy: build: LTO can cause false positives in cmake tests resulting in build failures added