Bug 2331361

Summary: undefined reference to `__parse_hwcap_and_convert_at_platform' from libgcc
Product: [Fedora] Fedora Reporter: Dan Horák <dan>
Component: libtoolAssignee: Frédéric Bérat <fberat>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: arjun.is, codonell, dj, fberat, fjanus, fweimer, jakub, jlaw, josmyers, kasal, mcermak, mcoufal, mfabian, pfrankli, praiskup, rhbugs, sipoyare, skolosov, suraj.ghimire7
Target Milestone: ---   
Target Release: ---   
Hardware: ppc64le   
OS: Linux   
Whiteboard:
Fixed In Version: libtool-2.5.4-2.fc42 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-01-10 16:37:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1071880    

Description Dan Horák 2024-12-10 13:50:19 UTC
A build of the codeblocks IDE in Rawhide fails with

...
make[4]: Entering directory '/builddir/build/BUILD/codeblocks-20.03-build/codeblocks/src/plugins/contrib/HexEditor'
/bin/sh ../../../../libtool  --tag=CXX   --mode=link g++  -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -mcpu=power8 -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection  -Winvalid-pch -fPIC -fexceptions -module -shared -version-info 0:1:0 -no-undefined -avoid-version -Wl,--no-undefined -Wl,-z,relro -Wl,--as-needed  -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes  -o libHexEditor.la -rpath /usr/lib64/codeblocks/plugins CharacterView.lo DigitView.lo ExpressionExecutor.lo ExpressionParser.lo ExpressionPreprocessed.lo ExpressionTestCases.lo ExpressionTester.lo FileContentBase.lo FileContentBuffered.lo FileContentDisk.lo HexEditLineBuffer.lo HexEditor.lo HexEditPanel.lo HexEditViewBase.lo SearchDialog.lo SelectStoredExpressionDlg.lo TestCasesDlg.lo ../../../sdk/libcodeblocks.la -pthread   -lwx_gtk3u_aui-3.2 -lwx_gtk3u_propgrid-3.2 -lwx_gtk3u_richtext-3.2 -lwx_gtk3u_xrc-3.2 -lwx_gtk3u_html-3.2 -lwx_gtk3u_qa-3.2 -lwx_gtk3u_core-3.2 -lwx_baseu_xml-3.2 -lwx_baseu_net-3.2 -lwx_baseu-3.2  -lpthread -ldl 
libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/ppc64le-redhat-linux/14/../../../../lib64/crti.o /usr/lib/gcc/ppc64le-redhat-linux/14/crtbeginS.o  .libs/CharacterView.o .libs/DigitView.o .libs/ExpressionExecutor.o .libs/ExpressionParser.o .libs/ExpressionPreprocessed.o .libs/ExpressionTestCases.o .libs/ExpressionTester.o .libs/FileContentBase.o .libs/FileContentBuffered.o .libs/FileContentDisk.o .libs/HexEditLineBuffer.o .libs/HexEditor.o .libs/HexEditPanel.o .libs/HexEditViewBase.o .libs/SearchDialog.o .libs/SelectStoredExpressionDlg.o .libs/TestCasesDlg.o   ../../../sdk/.libs/libcodeblocks.so -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -lgdk_pixbuf-2.0 -lcairo-gobject -lcairo -lgobject-2.0 -lglib-2.0 -ltinyxml -lwx_gtk3u_aui-3.2 -lwx_gtk3u_propgrid-3.2 -lwx_gtk3u_richtext-3.2 -lwx_gtk3u_xrc-3.2 -lwx_gtk3u_html-3.2 -lwx_gtk3u_qa-3.2 -lwx_gtk3u_core-3.2 -lwx_baseu_xml-3.2 -lwx_baseu_net-3.2 -lwx_baseu-3.2 -lpthread -ldl -L/usr/lib/gcc/ppc64le-redhat-linux/14 -L/usr/lib/gcc/ppc64le-redhat-linux/14/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64le-redhat-linux/14/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/ppc64le-redhat-linux/14/crtendS.o /usr/lib/gcc/ppc64le-redhat-linux/14/../../../../lib64/crtn.o -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -O2 -flto=auto -g -grecord-gcc-switches -Werror=format-security -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mcpu=power8 -mtune=power8 -Wl,--no-undefined -Wl,-z -Wl,relro -Wl,--as-needed -Wl,-z -Wl,pack-relative-relocs -Wl,-z -Wl,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes   -pthread -Wl,-soname -Wl,libHexEditor.so -o .libs/libHexEditor.so
make[4]: Leaving directory '/builddir/build/BUILD/codeblocks-20.03-build/codeblocks/src/plugins/contrib/HexEditor'
/usr/bin/ld: /usr/lib/gcc/ppc64le-redhat-linux/14/libgcc.a(float128-ifunc.o):(.data+0x0): undefined reference to `__parse_hwcap_and_convert_at_platform'
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:610: libHexEditor.la] Error 1


The build used
glibc-2.40.9000-21.fc42.ppc64le
gcc-14.2.1-6.fc42.ppc64le


link to build logs in copr = https://download.copr.fedorainfracloud.org/results/sharkcz/danny/fedora-rawhide-ppc64le/08372393-codeblocks/

Reproducible: Always

Comment 1 Dan Horák 2024-12-10 14:07:31 UTC
Per https://copr.fedorainfracloud.org/coprs/sharkcz/danny/build/8372393/ there is no such problem in earlier releases.

Comment 2 Carlos O'Donell 2024-12-10 17:01:44 UTC
It exists in ld.so:

$ readelf -a -W usr/lib64/ld64.so.2 | grep __parse_hwcap
    19: 000000000002e240  2516 FUNC    GLOBAL DEFAULT [<localentry>: 8]     9 __parse_hwcap_and_convert_at_platform@@GLIBC_2.23
    30: 000000000002e240  2516 FUNC    GLOBAL DEFAULT [<localentry>: 8]     9 __parse_hwcap_3_4_and_convert_at_platform@@GLIBC_2.39
   663: 000000000002e240  2516 FUNC    GLOBAL DEFAULT [<localentry>: 8]     9 __parse_hwcap_and_convert_at_platform@@GLIBC_2.23
   680: 000000000002e240  2516 FUNC    GLOBAL DEFAULT [<localentry>: 8]     9 __parse_hwcap_3_4_and_convert_at_platform@@GLIBC_2.39

And libc.so includes it AS_NDEEDED:

$ cat ./usr/lib64/libc.so
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
OUTPUT_FORMAT(elf64-powerpcle)
GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a  AS_NEEDED ( /lib64/ld64.so.2 ) )

So I would expect the link to resolve the reference to the dynamic loader.

I don't think there is any bug here, but the problem is likely in the link line?

Comment 3 Florian Weimer 2024-12-10 17:24:24 UTC
This is likely because libtool tries to reimplement the linker in a shell script. It's required to use the order -lc -lgcc_s -lc (listing -lc twice), otherwise links with -Wl,--as-needed fail.

Comment 4 Dan Horák 2024-12-10 20:29:09 UTC
you are right, sounds like bug 2047389 is back

Comment 5 Fedora Update System 2025-01-10 15:05:56 UTC
FEDORA-2025-1072edb794 (libtool-2.5.4-2.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-1072edb794

Comment 6 Fedora Update System 2025-01-10 16:37:57 UTC
FEDORA-2025-1072edb794 (libtool-2.5.4-2.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.