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 #2

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

Actions #3

Updated by Ken Dreyer almost 2 years ago

  • Status changed from New to In Progress
  • Assignee set to Ken Dreyer
Actions #4

Updated by Ken Dreyer almost 2 years ago

  • Has duplicate Bug #56492: undefined reference to "__atomic_load_16" on s390x added
Actions #5

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.

Actions #6

Updated by Ken Dreyer over 1 year ago

  • Status changed from In Progress to Pending Backport
  • Backport set to quincy
Actions #7

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
Actions #8

Updated by Backport Bot over 1 year ago

  • Tags set to backport_processed
Actions

Also available in: Atom PDF