Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1800945 - Undefined reference to inlined static class member (gcc 10 - armv7hl, i686, aarch64)
Summary: Undefined reference to inlined static class member (gcc 10 - armv7hl, i686, a...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: root
Version: 32
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Mattias Ellert
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: GCC10 1799980
TreeView+ depends on / blocked
 
Reported: 2020-02-09 09:14 UTC by Mattias Ellert
Modified: 2021-04-29 16:29 UTC (History)
12 users (show)

Fixed In Version: root-6.18.04-5.fc32
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-29 16:29:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Pre-processed code for x86_64 - this architecture compiles OK (deleted)
2020-02-09 09:16 UTC, Mattias Ellert
no flags Details
Pre-processed code for i686 - this architecture has the missing symbol (deleted)
2020-02-09 09:17 UTC, Mattias Ellert
no flags Details
Original source before preprocessing (deleted)
2020-02-09 09:20 UTC, Mattias Ellert
no flags Details
The header file where the missing symbol is defined (deleted)
2020-02-09 09:22 UTC, Mattias Ellert
no flags Details

Description Mattias Ellert 2020-02-09 09:14:02 UTC
Description of problem:

The root package failed the mass rebuild for Fedora 32. After addressing a trivial issue with a missing STL header the compilation succeeds on x86_64 (with one failing test in the test suite). However, on armv7hl, i686 and aarch64 the linking of a library fails due to a missing reference to a symbol for a static class member that is declared inline in the class header file. This is a new failure w.r.t. gcc 9.

(The build on ppc64le also fails, but due to a different issue.)

A koji scratch build is available here:
https://koji.fedoraproject.org/koji/taskinfo?taskID=41407179

The linker error is:

/usr/bin/ld: CMakeFiles/ROOTHistDraw.dir/G__ROOTHistDraw.cxx.o:(.toc+0xc8): undefined reference to `ROOT::Experimental::RDrawingAttrBase::FromOption'
/usr/bin/ld: CMakeFiles/ROOTHistDraw.dir/v7/src/RHistDrawable.cxx.o:(.toc+0xb0): undefined reference to `ROOT::Experimental::RDrawingAttrBase::FromOption'

I.e. the same missing symbol is referenced in two different object files.

For the x86_64 compilation that succeeds, the command compiling the RHistDrawable.cxx.o is:

( cd /builddir/build/BUILD/root-6.18.04/builddir/hist/histdraw && /usr/bin/c++ \
-save-temps  -I/builddir/build/BUILD/root-6.18.04/builddir/include -I/builddir/\
build/BUILD/root-6.18.04/hist/histdraw/v7/inc -I/builddir/build/BUILD/root-6.18\
.04/hist/histdraw/inc -I/builddir/build/BUILD/root-6.18.04/hist/histdraw  -O2 -\
g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_AS\
SERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/us\
r/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-\
cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -\
fcf-protection -std=c++14 -Wno-implicit-fallthrough -Wno-noexcept-type -pipe  -\
Wshadow -Wall -W -Woverloaded-virtual -fsigned-char -pthread -DR__HAVE_CONFIG -\
O3 -g -DNDEBUG -fPIC   -std=c++14 -o CMakeFiles/ROOTHistDraw.dir/v7/src/RHistDr\
awable.cxx.o -c /builddir/build/BUILD/root-6.18.04/hist/histdraw/v7/src/RHistDr\
awable.cxx )

The ROOT::Experimental::RDrawingAttrBase::FromOption symbol is not present in the generated object file:

nm CMakeFiles/ROOTHistDraw.dir/v7/src/RHistDrawable.cxx.o | grep FromOption
                 U _ZN4ROOT12Experimental16RDrawingAttrBaseC2ENS1_12FromOption_\
tERKNS1_4NameERNS0_16RDrawingOptsBaseE

For the i686 compilation, the command compiling the RHistDrawable.cxx.o is:

( cd /builddir/build/BUILD/root-6.18.04/builddir/hist/histdraw && /usr/bin/c++ \
-save-temps  -I/builddir/build/BUILD/root-6.18.04/builddir/include -I/builddir/\
build/BUILD/root-6.18.04/hist/histdraw/v7/inc -I/builddir/build/BUILD/root-6.18\
.04/hist/histdraw/inc -I/builddir/build/BUILD/root-6.18.04/hist/histdraw  -O2 -\
g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_AS\
SERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/us\
r/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-\
cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynch\
ronous-unwind-tables -fstack-clash-protection -fcf-protection -std=c++14 -Wno-i\
mplicit-fallthrough -Wno-noexcept-type -pipe -msse -mfpmath=sse -Wshadow -Wall \
-W -Woverloaded-virtual -fsigned-char -pthread -DR__HAVE_CONFIG -O3 -g -DNDEBUG\
 -fPIC   -std=c++14 -o CMakeFiles/ROOTHistDraw.dir/v7/src/RHistDrawable.cxx.o -\
c /builddir/build/BUILD/root-6.18.04/hist/histdraw/v7/src/RHistDrawable.cxx )

Here, the ROOT::Experimental::RDrawingAttrBase::FromOption symbol is present in the generated object file:

nm CMakeFiles/ROOTHistDraw.dir/v7/src/RHistDrawable.cxx.o | grep FromOption
         U _ZN4ROOT12Experimental16RDrawingAttrBase10FromOptionE
         U _ZN4ROOT12Experimental16RDrawingAttrBaseC2ENS1_12FromOption_tERKNS1_\
4NameERNS0_16RDrawingOptsBaseE

Version-Release number of selected component (if applicable):

gcc-10.0.1-0.7.fc32

How reproducible:

Always

Steps to Reproduce:
1. Pre-processed source will be attached to this report

Actual results:

Link failure due to missing symbol

Expected results:

Successful build.

Additional info:

Comment 1 Mattias Ellert 2020-02-09 09:16:02 UTC
Created attachment 1661958 [details]
Pre-processed code for x86_64 - this architecture compiles OK

Comment 2 Mattias Ellert 2020-02-09 09:17:41 UTC
Created attachment 1661959 [details]
Pre-processed code for i686 - this architecture has the missing symbol

Comment 3 Mattias Ellert 2020-02-09 09:20:29 UTC
Created attachment 1661960 [details]
Original source before preprocessing

Comment 4 Mattias Ellert 2020-02-09 09:22:51 UTC
Created attachment 1661962 [details]
The header file where the missing symbol is defined

Comment 5 Ben Cotton 2020-02-11 16:35:32 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 6 Fedora Program Management 2021-04-29 16:12:34 UTC
This message is a reminder that Fedora 32 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '32'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 32 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Jonathan Wakely 2021-04-29 16:23:08 UTC
The code looks invalid. The FromOption object is never defined, so the linker error is correct.
https://gcc.gnu.org/wiki/VerboseDiagnostics#missing_static_const_definition

Comment 8 Jonathan Wakely 2021-04-29 16:29:52 UTC
It looks like this was fixed by patching the package to define the constant, via the root-static-constexpr.patch patch, which is the correct fix.

If built using -std=c++17 that would not be necessary, because it would be implicitly inline, and so not need an out-of-line definition, but the compiler flags include -std=c++14 so the definition is required.


Note You need to log in before you can comment on or make changes to this bug.