Linking issues with GCC 9 on non-x86

Bug #1816474 reported by BenjaminBerg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Firmware Test Suite
Fix Released
High
Colin Ian King

Bug Description

I am seeing a number of linking failures on Fedora again:

https://kojipkgs.fedoraproject.org//work/tasks/8082/32888082/build.log

I haven't figured out what the cause is. The functions seem to be defined in fwtsacpica, but the linker doesn't seem to resolve this. I'll poke it some more tomorrow or so.

Revision history for this message
BenjaminBerg (benjamin-sipsolutions) wrote :

This issue does seem to be GCC related, as even the older package fails to rebuild on F30 (i.e. the primary cause is not an update of FWTS).

Revision history for this message
BenjaminBerg (benjamin-sipsolutions) wrote :

Ah, it could be though that some default parameters for GCC have also changed.

Revision history for this message
Colin Ian King (colin-king) wrote :
Download full text (8.2 KiB)

Builds OK with gcc-9 on Ubuntu bionic:

/bin/bash ../libtool --tag=CC --mode=link gcc-9 -g -O2 -lm -lbsd `pkg-config --libs glib-2.0 gio-2.0` -o fwts fwts-main.o acpi/ac_adapter/fwts-ac_adapter.o acpi/acpidump/fwts-acpidump.o acpi/acpiinfo/fwts-acpiinfo.o acpi/acpitables/fwts-acpitables.o sbbr/acpitables/fwts-acpitables.o acpi/apicinstance/fwts-apicinstance.o acpi/asf/fwts-asf.o acpi/aspt/fwts-aspt.o acpi/battery/fwts-battery.o acpi/bert/fwts-bert.o acpi/bgrt/fwts-bgrt.o acpi/boot/fwts-boot.o acpi/brightness/fwts-brightness-helper.o acpi/brightness/fwts-brightness.o acpi/brightness/fwts-autobrightness.o acpi/checksum/fwts-checksum.o acpi/cpep/fwts-cpep.o acpi/crsdump/fwts-crsdump.o acpi/crsdump/fwts-prsdump.o acpi/csrt/fwts-csrt.o acpi/cstates/fwts-cstates.o acpi/dbgp/fwts-dbgp.o acpi/dbg2/fwts-dbg2.o acpi/devices/ac_adapter/fwts-ac.o acpi/devices/battery/fwts-battery.o acpi/devices/battery/fwts-smart_battery.o acpi/devices/ec/fwts-ec.o acpi/devices/buttons/fwts-power_button.o acpi/devices/buttons/fwts-sleep_button.o acpi/devices/lid/fwts-lid.o acpi/devices/sensor/fwts-als.o acpi/devices/time/fwts-time.o acpi/devices/wpc/fwts-wpc.o acpi/dmar/fwts-dmar.o acpi/dppt/fwts-dppt.o acpi/drtm/fwts-drtm.o acpi/dsddump/fwts-dsddump.o acpi/ecdt/fwts-ecdt.o acpi/einj/fwts-einj.o acpi/erst/fwts-erst.o acpi/facs/fwts-facs.o acpi/fadt/fwts-fadt.o sbbr/fadt/fwts-fadt.o acpi/fan/fwts-fan.o acpi/fpdt/fwts-fpdt.o acpi/gpedump/fwts-gpedump.o acpi/gtdt/fwts-gtdt.o acpi/hest/fwts-hest.o acpi/hpet/fwts-hpet.o acpi/hmat/fwts-hmat.o acpi/iort/fwts-iort.o acpi/lid/fwts-lid.o acpi/lpit/fwts-lpit.o acpi/madt/fwts-madt.o acpi/mcfg/fwts-mcfg.o acpi/mchi/fwts-mchi.o acpi/mpst/fwts-mpst.o acpi/msct/fwts-msct.o acpi/msdm/fwts-msdm.o acpi/method/fwts-method.o acpi/nfit/fwts-nfit.o acpi/osilinux/fwts-osilinux.o acpi/pcc/fwts-pcc.o acpi/pcct/fwts-pcct.o acpi/pdtt/fwts-pdtt.o acpi/powerbutton/fwts-powerbutton.o acpi/plddump/fwts-plddump.o acpi/pmtt/fwts-pmtt.o acpi/pptt/fwts-pptt.o acpi/rasf/fwts-rasf.o acpi/rsdp/fwts-rsdp.o sbbr/rsdp/fwts-rsdp.o acpi/rsdt/fwts-rsdt.o acpi/s3/fwts-s3.o acpi/s3power/fwts-s3power.o acpi/s4/fwts-s4.o acpi/sbst/fwts-sbst.o acpi/sdei/fwts-sdei.o acpi/sdev/fwts-sdev.o acpi/slic/fwts-slic.o acpi/slit/fwts-slit.o acpi/spcr/fwts-spcr.o acpi/spmi/fwts-spmi.o acpi/srat/fwts-srat.o acpi/stao/fwts-stao.o acpi/syntaxcheck/fwts-syntaxcheck.o acpi/tcpa/fwts-tcpa.o acpi/tpm2/fwts-tpm2.o acpi/uefi/fwts-uefi.o acpi/waet/fwts-waet.o acpi/wakealarm/fwts-wakealarm.o acpi/wdat/fwts-wdat.o acpi/wmi/fwts-wmi.o acpi/wpbt/fwts-wpbt.o acpi/wsmt/fwts-wsmt.o acpi/xsdt/fwts-xsdt.o acpi/xenv/fwts-xenv.o apic/apicedge/fwts-apicedge.o bios/bios_info/fwts-bios_info.o bios/bios32/fwts-bios32.o bios/ebda_region/fwts-ebda_region.o bios/ebdadump/fwts-ebdadump.o bios/hdaaudio/fwts-hdaaudio.o bios/memmapdump/fwts-memmapdump.o bios/mtrr/fwts-mtrr.o bios/multiproc/fwts-mpcheck.o bios/multiproc/fwts-mpdump.o bios/pciirq/fwts-pciirq.o bios/pnp/fwts-pnp.o bios/romdump/fwts-romdump.o cmos/cmosdump/fwts-cmosdump.o coreboot/clog/fwts-clog.o cpu/virt/fwts-virt.o cpu/virt/fwts-virt_svm.o cpu/virt/fwts-virt_vmx.o cpu/maxfreq/fwts-maxfreq.o cpu/cpufreq/fwts-cpufreq.o cpu/nx/fwts-nx.o cpu/msr/...

Read more...

Revision history for this message
BenjaminBerg (benjamin-sipsolutions) wrote :

Yeah, Fedora builds with "-Wl,-z,now" in the default compile flags which is the root cause of this.

In the past we already had https://bugs.launchpad.net/fwts/+bug/1712572 but something must have changed with the new gcc version.

Revision history for this message
Colin Ian King (colin-king) wrote :

OK, I'll look into that tomorrow, it's past my end of day here in the UK, but I'll try and get this sorted sooner than later. If you have any ideas of the solution, keep me informed.

Revision history for this message
BenjaminBerg (benjamin-sipsolutions) wrote :

So, I did look at it a bit, and the linking error doesn't make much sense to me. i.e. it looks to me like the undefined symbols are defined inside libfwtsacpica.so. And libfwtsiasl.so is not accessing them directly anywhere.

Revision history for this message
Colin Ian King (colin-king) wrote :

Can you point me to an ISO image for this release so I can try and reproduce this issue?

Changed in fwts:
importance: Undecided → Medium
assignee: nobody → Colin Ian King (colin-king)
status: New → Triaged
status: Triaged → In Progress
Revision history for this message
BenjaminBerg (benjamin-sipsolutions) wrote :

Hmm, I see https://ams.edge.kernel.org/fedora-buffet/fedora/linux/development/rawhide/Everything/ right now, but that doesn't include PowerPC. I think that ARM had the same failure though.

I can ask to get access to a running PowerPC machine for debugging purposes. i.e. in the Fedora infrastructure https://fedoraproject.org/wiki/Architectures/PowerPC#PPC_Shell_access_for_debugging

That said, I suspect you will also be able to reproduce it by setting the following build options:

+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'

With the specs file:
"""
*self_spec:
+ %{!static:%{!shared:%{!r:-pie}}}
"""

Revision history for this message
Colin Ian King (colin-king) wrote :

Builds fine for arm64 on fedora30; see attached log

I'm still working on the powerpc64 build, takes a while as I'm emulating the H/W in qemu

Revision history for this message
Colin Ian King (colin-king) wrote :

I finally got fedora30 ppc64el installed and built. I pulled in all the latest package updates and built fwts based on today's fwts tip. It builds and links fine for me, see attached log:

So.. I can only guess it's a build issue introduced with the fedora packaging. I'll try and see if I can force these flags to reproduce the error.

Revision history for this message
Colin Ian King (colin-king) wrote :

OK, simple to reproduce this given enough time tinkering with LD flags, just use:

./configure LDFLAGS='-Wl,--as-needed'
make clean; make

Revision history for this message
Colin Ian King (colin-king) wrote :
Changed in fwts:
importance: Medium → High
Revision history for this message
Colin Ian King (colin-king) wrote :

Fixes now committed to fwts git repo

Changed in fwts:
status: In Progress → Fix Committed
Revision history for this message
BenjaminBerg (benjamin-sipsolutions) wrote :

Nice! Thanks a lot, I don't think I would have figured that one out :)

Revision history for this message
Colin Ian King (colin-king) wrote :

Thanks for reporting the issue - I'm very keen to ensure fwts builds on a wide range of systems.

Changed in fwts:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.