Bug 1171140 - gcc10 causes link error for ipxe component of qemu
gcc10 causes link error for ipxe component of qemu
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: KVM
Current
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: Bruce Rogers
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-05-05 03:09 UTC by Bruce Rogers
Modified: 2020-06-28 17:24 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bruce Rogers 2020-05-05 03:09:49 UTC
In exploring gcc10 issues for building qemu, I get the following linker error linking the ipxe firmware:

ld: bin/blib.a(dmfe.o):(.bss+0x0): multiple definition of `_shared_bss'; bin/blib.a(davicom.o):(.bss+0x0): first defined here
ld: bin/blib.a(epic100.o):(.bss+0x0): multiple definition of `_shared_bss'; bin/blib.a(davicom.o):(.bss+0x0): first defined here
ld: bin/blib.a(pxe_preboot.o):/home/brogers/osr/git/ipxe/src/include/ipxe/isapnp.h:237: multiple definition of `isapnp_read_port'; bin/blib.a(isapnp.o):(.bss+0x0): first defined here
ld: bin/blib.a(sis900.o):(.bss+0x0): multiple definition of `_shared_bss'; bin/blib.a(davicom.o):(.bss+0x0): first defined here
ld: bin/blib.a(sundance.o):(.bss+0x0): multiple definition of `_shared_bss'; bin/blib.a(davicom.o):(.bss+0x0): first defined here
ld: bin/blib.a(tlan.o):(.bss+0x0): multiple definition of `_shared_bss'; bin/blib.a(davicom.o):(.bss+0x0): first defined here
ld: bin/blib.a(tulip.o):(.bss+0x0): multiple definition of `_shared_bss'; bin/blib.a(davicom.o):(.bss+0x0): first defined here
ld: bin/blib.a(w89c840.o):(.bss+0x0): multiple definition of `_shared_bss'; bin/blib.a(davicom.o):(.bss+0x0): first defined here
make: *** [Makefile.housekeeping:1192: bin/ipxe.dsk.tmp] Error 1
This can be tracked to the change in the gcc10 default from previous versions from an implicit -fcommon to -fno-common.

The fix I believe will be acceptable to upstream is to simply be explicit about the need for -fcommon, since the above is intended. See the following git grep __shared in the git repo:
src/drivers/net/davicom.c:} davicom_bufs __shared;
src/drivers/net/dmfe.c:} dmfe_bufs __shared;
src/drivers/net/epic100.c:} epic100_bufs __shared;
src/drivers/net/sis900.c:} sis900_bufs __shared;
src/drivers/net/sundance.c:} rx_tx_buf __shared;
src/drivers/net/tlan.c:} tlan_buffers __shared;
src/drivers/net/tulip.c:} tulip_bss __shared __attribute__ ((aligned(4)));
src/drivers/net/w89c840.c:} w89c840_buf __shared;
src/include/compiler.h: *   } my_static_data __shared;
src/include/compiler.h:#define __shared __asm__ ( "_shared_bss" ) __aligned
Comment 1 Swamp Workflow Management 2020-05-06 23:40:17 UTC
This is an autogenerated message for OBS integration:
This bug (1171140) was mentioned in
https://build.opensuse.org/request/show/800842 Factory / qemu
Comment 2 Bruce Rogers 2020-06-28 17:24:55 UTC
This got fixed upstream with commit 6260364cc4bfea9a78867da63be8d4bf50e4a561.
I've replaced the temporary fix in the package with the upstream version.
Marking fixed.