Description of problem: When attempting to build Mir 0.28.1 with LTO enabled in the build, it fails to link, failing the build. Disabling LTO fixes the build. Version-Release number of selected component (if applicable): 2.29.1-4.fc28 How reproducible: Always Steps to Reproduce: 1. Grab a SRPM for mir 2. Run "mock -r fedora-rawhide-ppc64 --with lto </path/to/mir.src.rpm>" Actual results: Fails the build because LTO fails Expected results: Build succeeds and packages are built Additional info: Koji task with the failed build and its logs: https://koji.fedoraproject.org/koji/taskinfo?taskID=23270960
Created attachment 1356850 [details] build.log
The error looks like ... make[2]: Entering directory '/builddir/build/BUILD/mir-0.28.1/ppc64-redhat-linux-gnu' [ 98%] Linking CXX executable ../../bin/miral-kiosk.bin cd /builddir/build/BUILD/mir-0.28.1/ppc64-redhat-linux-gnu/examples/miral-kiosk && /usr/bin/cmake -E cmake_link_script CMakeFiles/miral-kiosk.dir/link.txt --verbose=1 /usr/bin/c++ -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -pthread -g -std=c++14 -Werror -Wall -fno-strict-aliasing -pedantic -Wnon-virtual-dtor -Wextra -fPIC -Wno-psabi -flto -ffat-lto-objects -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--as-needed -Wl,--no-undefined -rdynamic CMakeFiles/miral-kiosk.dir/kiosk_main.cpp.o CMakeFiles/miral-kiosk.dir/kiosk_window_manager.cpp.o CMakeFiles/miral-kiosk.dir/sw_splash.cpp.o -o ../../bin/miral-kiosk.bin ../../lib/libmiral.so.2 ../../lib/libmirclient.so.9 -lxkbcommon ../../lib/libmirprotobuf.so.3 -lprotobuf-lite ../../lib/libmircookie.so.2 -lnettle ../../lib/libmircommon.so.7 ../../src/capnproto/libmircapnproto.a /usr/lib64/libcapnp.so.0.6.1 /usr/lib64/libkj.so.0.6.1 ../../lib/libmircore.so.1 -lboost_date_time -lboost_program_options -lboost_filesystem -ldl -lboost_system -Wl,-rpath-link,/builddir/build/BUILD/mir-0.28.1/ppc64-redhat-linux-gnu/lib make[2]: Leaving directory '/builddir/build/BUILD/mir-0.28.1/ppc64-redhat-linux-gnu' /builddir/build/BUILD/mir-0.28.1/ppc64-redhat-linux-gnu/lib/libmirserver.so.45: undefined reference to `LTHUNK10.lto_priv.900' /builddir/build/BUILD/mir-0.28.1/ppc64-redhat-linux-gnu/lib/libmirserver.so.45: undefined reference to `LTHUNK8.lto_priv.1719' /builddir/build/BUILD/mir-0.28.1/ppc64-redhat-linux-gnu/lib/libmirserver.so.45: undefined reference to `LTHUNK0.lto_priv.1954' /builddir/build/BUILD/mir-0.28.1/ppc64-redhat-linux-gnu/lib/libmirserver.so.45: undefined reference to `LTHUNK14.lto_priv.1778' /builddir/build/BUILD/mir-0.28.1/ppc64-redhat-linux-gnu/lib/libmirserver.so.45: undefined reference to `LTHUNK13.lto_priv.1777' /builddir/build/BUILD/mir-0.28.1/ppc64-redhat-linux-gnu/lib/libmirserver.so.45: undefined reference to `LTHUNK6.lto_priv.1598' /builddir/build/BUILD/mir-0.28.1/ppc64-redhat-linux-gnu/lib/libmirserver.so.45: undefined reference to `LTHUNK1.lto_priv.1731' /builddir/build/BUILD/mir-0.28.1/ppc64-redhat-linux-gnu/lib/libmirserver.so.45: undefined reference to `LTHUNK6.lto_priv.1724' /builddir/build/BUILD/mir-0.28.1/ppc64-redhat-linux-gnu/lib/libmirserver.so.45: undefined reference to `LTHUNK10.lto_priv.1774' /builddir/build/BUILD/mir-0.28.1/ppc64-redhat-linux-gnu/lib/libmirserver.so.45: undefined reference to `LTHUNK5.lto_priv.1433' /builddir/build/BUILD/mir-0.28.1/ppc64-redhat-linux-gnu/lib/libmirserver.so.45: undefined reference to `LTHUNK4.lto_priv.1000' /builddir/build/BUILD/mir-0.28.1/ppc64-redhat-linux-gnu/lib/libmirserver.so.45: undefined reference to `LTHUNK0.lto_priv.996' /builddir/build/BUILD/mir-0.28.1/ppc64-redhat-linux-gnu/lib/libmirserver.so.45: undefined reference to `LTHUNK4.lto_priv.1535' /builddir/build/BUILD/mir-0.28.1/ppc64-redhat-linux-gnu/lib/libmirserver.so.45: undefined reference to `LTHUNK9.lto_priv.1770' /builddir/build/BUILD/mir-0.28.1/ppc64-redhat-linux-gnu/lib/libmirserver.so.45: undefined reference to `LTHUNK7.lto_priv.1879' /builddir/build/BUILD/mir-0.28.1/ppc64-redhat-linux-gnu/lib/libmirserver.so.45: undefined reference to `LTHUNK5.lto_priv.1533' collect2: error: ld returned 1 exit status
Hi Dan, I just tried to reproduce this using a mir-0.29.0-1 source rpm on a ppc64le system with binutils-2.29.1-9.fc28.ppc64 and the problem did not appear. I suspect that the bug may have been fixed with the 2.29.1-8 release of the binutils rpm, which disabled the use of relro by default for PPC64. (Since this had been reported as causing problems for other packages). Therefore please could you try building mir again, with LTO enabled, and let me know if the problem has been fixed ? Cheers Nick
Oops, sorry Neal - I meant to address comment #3 to you...
Nick, It works fine with ppc64le. It's ppc64be that's a problem (that is, the big endian variant!). Could you try again with ppc64*be*?
(In reply to Neal Gompa from comment #5) Hi Neal, > It works fine with ppc64le. It's ppc64be that's a problem (that is, the big > endian variant!). > > Could you try again with ppc64*be*? That works too. :-) I really think that this problem might be fixed. Cheers Nick
This bug appears to have been reported against 'rawhide' during the Fedora 28 development cycle. Changing version to '28'.
binutils-2.31.1-17.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-ba3cbcfd20
binutils-2.31.1-17.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-ba3cbcfd20
binutils-2.31.1-17.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.