Bug 2082146

Summary: Bad aarch64 branch-protection test for class destructor
Product: [Fedora] Fedora Reporter: Mark Wielaard <mjw>
Component: annobinAssignee: Nick Clifton <nickc>
Status: MODIFIED --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 37CC: fweimer, jakub, nickc, sipoyare, yahmad
Target Milestone: ---Keywords: Bugfix, Triaged
Target Release: ---   
Hardware: aarch64   
OS: Unspecified   
Whiteboard:
Fixed In Version: annobin-10.69-1.fc37 Doc Type: No Doc Update
Doc Text:
If this bug requires documentation, please select an appropriate Doc Type value.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mark Wielaard 2022-05-05 13:21:00 UTC
For elfutils-0.187-2.fc36
https://bodhi.fedoraproject.org/updates/FEDORA-2022-287a6c3913

Annobin reports:
FAIL: branch-protection test because not enabled (function: _ZN14tmp_inc_metricD2Ev.lto_priv.0) 

https://osci-jenkins-1.ci.fedoraproject.org/job/fedora-ci/job/rpminspect-pipeline/job/master/98018/testReport/(root)/tests/_annocheck/

Which is a class destructor: tmp_inc_metric::~tmp_inc_metric() [clone .lto_priv.0]

But as can be seen in the build.log it is build with -mbranch-protection=standard

g++ -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"/usr/share/locale"' -I. -I..  -I. -I. -I../lib -I.. -I. -I./../libelf -I./../libebl -I./../libdw -I./../libdwelf -I/usr/include/p11-kit-1       -std=c++11 -Wall -Wshadow -Wtrampolines -Wlogical-op -Wduplicated-cond -Wnull-dereference -Wimplicit-fallthrough=5 -Werror -Wunused -Wextra -Wstack-usage=262144   -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -c -o debuginfod.o debuginfod.cxx
g++ -std=c++11 -Wall -Wshadow -Wtrampolines -Wlogical-op -Wduplicated-cond -Wnull-dereference -Wimplicit-fallthrough=5 -Werror -Wunused -Wextra -Wstack-usage=262144   -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -Wl,-rpath-link,../libelf:../libdw:. -Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -Wl,-dT,/builddir/build/BUILD/elfutils-0.187/.package_note-elfutils-0.187-2.fc36.aarch64.ld -o debuginfod debuginfod.o ../libdw/libdw.so ../libelf/libelf.so ../lib/libeu.a ./libdebuginfod.so   -lmicrohttpd  -lsqlite3  -larchive  -lpthread -ldl 

https://kojipkgs.fedoraproject.org//packages/elfutils/0.187/2.fc36/data/logs/aarch64/build.log

Comment 1 Nick Clifton 2022-05-06 13:52:07 UTC
Ho hum - another issue with the detection of the -mbranch-protection option when LTO is enabled.
I am testing a local fix which I hope, this time, will fix all of the problems....

Comment 2 Nick Clifton 2022-05-06 14:49:57 UTC
Right - the latest annobin - annobin-10.69-1.fc37 - should fix the problem.

Comment 3 Ben Cotton 2022-08-09 13:42:06 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle.
Changing version to 37.