Project

General

Profile

Actions

Bug #54514

open

build: LTO can cause false positives in cmake tests resulting in build failures

Added by Kaleb KEITHLEY about 2 years ago. Updated over 1 year ago.

Status:
Pending Backport
Priority:
Normal
Assignee:
Category:
-
Target version:
% Done:

0%

Source:
Community (dev)
Tags:
backport_processed
Backport:
quincy
Regression:
No
Severity:
3 - minor
Reviewed:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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'


Related issues 2 (1 open1 closed)

Has duplicate devops - Bug #56492: undefined reference to "__atomic_load_16" on s390xPending BackportKen Dreyer

Actions
Copied to devops - Backport #57685: quincy: build: LTO can cause false positives in cmake tests resulting in build failuresDuplicateKen DreyerActions
Actions

Also available in: Atom PDF