Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lld 17+: cannot link libflashrom due to version script refering to undefined symbols #321

Closed
alaviss opened this issue Apr 3, 2024 · 1 comment

Comments

@alaviss
Copy link

alaviss commented Apr 3, 2024

Build logs:
FAILED: libflashrom.so.1.0.0
clang  -o libflashrom.so.1.0.0 libflashrom.so.1.0.0.p/82802ab.c.o libflashrom.so
.1.0.0.p/at45db.c.o libflashrom.so.1.0.0.p/bitbang_spi.c.o libflashrom.so.1.0.0.
p/edi.c.o libflashrom.so.1.0.0.p/en29lv640b.c.o libflashrom.so.1.0.0.p/flashchip
s.c.o libflashrom.so.1.0.0.p/flashrom.c.o libflashrom.so.1.0.0.p/fmap.c.o libfla
shrom.so.1.0.0.p/helpers.c.o libflashrom.so.1.0.0.p/helpers_fileio.c.o libflashr
om.so.1.0.0.p/ich_descriptors.c.o libflashrom.so.1.0.0.p/jedec.c.o libflashrom.s
o.1.0.0.p/layout.c.o libflashrom.so.1.0.0.p/libflashrom.c.o libflashrom.so.1.0.0
.p/opaque.c.o libflashrom.so.1.0.0.p/parallel.c.o libflashrom.so.1.0.0.p/print.c
.o libflashrom.so.1.0.0.p/programmer.c.o libflashrom.so.1.0.0.p/programmer_table
.c.o libflashrom.so.1.0.0.p/s25f.c.o libflashrom.so.1.0.0.p/sfdp.c.o libflashrom
.so.1.0.0.p/spi25.c.o libflashrom.so.1.0.0.p/spi25_statusreg.c.o libflashrom.so.
1.0.0.p/spi95.c.o libflashrom.so.1.0.0.p/spi.c.o libflashrom.so.1.0.0.p/sst28sf0
40.c.o libflashrom.so.1.0.0.p/sst49lfxxxc.c.o libflashrom.so.1.0.0.p/sst_fwhub.c
.o libflashrom.so.1.0.0.p/stm50.c.o libflashrom.so.1.0.0.p/udelay.c.o libflashro
m.so.1.0.0.p/w29ee011.c.o libflashrom.so.1.0.0.p/w39.c.o libflashrom.so.1.0.0.p/
writeprotect.c.o libflashrom.so.1.0.0.p/writeprotect_ranges.c.o libflashrom.so.1
.0.0.p/platform_endian_little.c.o libflashrom.so.1.0.0.p/platform_memaccess.c.o
libflashrom.so.1.0.0.p/hwaccess_physmap.c.o libflashrom.so.1.0.0.p/hwaccess_x86_
msr.c.o libflashrom.so.1.0.0.p/hwaccess_x86_io.c.o libflashrom.so.1.0.0.p/atavia
.c.o libflashrom.so.1.0.0.p/pcidev.c.o libflashrom.so.1.0.0.p/buspirate_spi.c.o
libflashrom.so.1.0.0.p/serial.c.o libflashrom.so.1.0.0.p/custom_baud_linux.c.o l
ibflashrom.so.1.0.0.p/ch341a_spi.c.o libflashrom.so.1.0.0.p/dediprog.c.o libflas
hrom.so.1.0.0.p/usbdev.c.o libflashrom.so.1.0.0.p/developerbox_spi.c.o libflashr
om.so.1.0.0.p/digilent_spi.c.o libflashrom.so.1.0.0.p/dirtyjtag_spi.c.o libflash
rom.so.1.0.0.p/drkaiser.c.o libflashrom.so.1.0.0.p/dummyflasher.c.o libflashrom.
so.1.0.0.p/ft2232_spi.c.o libflashrom.so.1.0.0.p/gfxnvidia.c.o libflashrom.so.1.
0.0.p/processor_enable.c.o libflashrom.so.1.0.0.p/chipset_enable.c.o libflashrom
.so.1.0.0.p/board_enable.c.o libflashrom.so.1.0.0.p/cbtable.c.o libflashrom.so.1
.0.0.p/internal.c.o libflashrom.so.1.0.0.p/it87spi.c.o libflashrom.so.1.0.0.p/sb
600spi.c.o libflashrom.so.1.0.0.p/amd_imc.c.o libflashrom.so.1.0.0.p/wbsio_spi.c
.o libflashrom.so.1.0.0.p/mcp6x_spi.c.o libflashrom.so.1.0.0.p/ichspi.c.o libfla
shrom.so.1.0.0.p/dmi.c.o libflashrom.so.1.0.0.p/known_boards.c.o libflashrom.so.
1.0.0.p/it8212.c.o libflashrom.so.1.0.0.p/linux_mtd.c.o libflashrom.so.1.0.0.p/l
inux_spi.c.o libflashrom.so.1.0.0.p/nic3com.c.o libflashrom.so.1.0.0.p/nicintel.
c.o libflashrom.so.1.0.0.p/nicintel_eeprom.c.o libflashrom.so.1.0.0.p/nicintel_s
pi.c.o libflashrom.so.1.0.0.p/nicrealtek.c.o libflashrom.so.1.0.0.p/ogp_spi.c.o
libflashrom.so.1.0.0.p/pickit2_spi.c.o libflashrom.so.1.0.0.p/pony_spi.c.o libfl
ashrom.so.1.0.0.p/raiden_debug_spi.c.o libflashrom.so.1.0.0.p/usb_device.c.o lib
flashrom.so.1.0.0.p/rayer_spi.c.o libflashrom.so.1.0.0.p/satamv.c.o libflashrom.
so.1.0.0.p/satasii.c.o libflashrom.so.1.0.0.p/serprog.c.o libflashrom.so.1.0.0.p
/stlinkv3_spi.c.o libflashrom.so.1.0.0.p/usbblaster_spi.c.o -flto=thin -Wl,--as-
needed -Wl,--no-undefined -shared -fPIC -Wl,-soname,libflashrom.so.1 -O2 -march=
native -mtune=native -pipe -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-O2 -Wl,--as-needed -O2
-march=native -mtune=native -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
 -Wl,--version-script,/tmp/portage/sys-apps/flashrom-1.3.0-r2/work/flashrom-v1.3
.0/libflashrom.map -Wl,--start-group /usr/lib64/libpci.so /usr/lib64/libusb-1.0.
so /usr/lib64/libftdi1.so -Wl,--end-group
ld.lld: error: version script assignment of 'LIBFLASHROM_1.0' to symbol 'flashro
m_board_info' failed: symbol not defined
ld.lld: error: version script assignment of 'LIBFLASHROM_1.0' to symbol 'flashro
m_chipset_info' failed: symbol not defined
ld.lld: error: version script assignment of 'LIBFLASHROM_1.0' to symbol 'flashro
m_flashchip_info' failed: symbol not defined
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

Starting with LLD 17, the linker will error when any symbol in a version script cannot be found in he object files.

The problematic symbols are:

  • flashrom_board_info
  • flashrom_chipset_info
  • flashrom_flashchip_info

Which are all structs and thus will not exist within the generated object files.

The solution would be to remove them from the linker script.

Copy link

github-actions bot commented Apr 3, 2024

Thank you for your contribution. The flashrom project does not handle GitHub issues or pull requests, since this repository on GitHub is just a mirror of our actual repository. Thus, we would like to encourage you to have a look at on our development guide and submit your patch to review.coreboot.org. Issues are handled over our ticket system. If you have questions, feel free to reach out to us. There are multiple ways to contact us.

@github-actions github-actions bot closed this as completed Apr 3, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant