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: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 32
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
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: 2020-10-05 08:13 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: ---
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)
Pre-processed code for x86_64 - this architecture compiles OK (2.01 MB, text/plain)
2020-02-09 09:16 UTC, Mattias Ellert
no flags Details
Pre-processed code for i686 - this architecture has the missing symbol (2.01 MB, text/plain)
2020-02-09 09:17 UTC, Mattias Ellert
no flags Details
Original source before preprocessing (2.82 KB, text/x-csrc)
2020-02-09 09:20 UTC, Mattias Ellert
no flags Details
The header file where the missing symbol is defined (11.76 KB, text/x-csrc)
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.


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