[go: up one dir, main page]

Menu

#399 Fix building with the lld and mold linkers by removing duplicate symbols

v3.x
closed
nobody
None
bugfix
2025-05-28
2025-05-28
No

If you try to build VICE with the lld or mold linkers (as opposed to bfd from binutils) then you get these errors due to duplicate symbols:

ld.lld: error: duplicate symbol: rsuser_cmdline_options_init
>>> defined at rsuser.c
>>>            rsuser.o:(rsuser_cmdline_options_init) in archive ../src/rs232drv/librs232drv.a
>>> defined at cbm2-stubs.c
>>>            cbm2-stubs.o:(.text+0x20) in archive ../src/cbm2/libcbm2stubs.a

ld.lld: error: duplicate symbol: rsuser_resources_init
>>> defined at rsuser.c
>>>            rsuser.o:(rsuser_resources_init) in archive ../src/rs232drv/librs232drv.a
>>> defined at cbm2-stubs.c
>>>            cbm2-stubs.o:(.text+0x30) in archive ../src/cbm2/libcbm2stubs.a

ld.lld: error: duplicate symbol: rsuser_cmdline_options_init
>>> defined at rsuser.c
>>>            rsuser.o:(rsuser_cmdline_options_init) in archive ../src/rs232drv/librs232drv.a
>>> defined at pet-stubs.c
>>>            pet-stubs.o:(.text+0x150) in archive ../src/pet/libpetstubs.a

ld.lld: error: duplicate symbol: rsuser_resources_init
>>> defined at rsuser.c
>>>            rsuser.o:(rsuser_resources_init) in archive ../src/rs232drv/librs232drv.a
>>> defined at pet-stubs.c
>>>            pet-stubs.o:(.text+0x160) in archive ../src/pet/libpetstubs.a

ld.lld: error: duplicate symbol: rsuser_resources_init
>>> defined at rsuser.c
>>>            rsuser.o:(rsuser_resources_init) in archive ../src/rs232drv/librs232drv.a
>>> defined at c64dtv-stubs.c
>>>            c64dtv-stubs.o:(.text+0x350) in archive ../src/c64dtv/libc64dtvstubs.a

ld.lld: error: duplicate symbol: rsuser_cmdline_options_init
>>> defined at rsuser.c
>>>            rsuser.o:(rsuser_cmdline_options_init) in archive ../src/rs232drv/librs232drv.a
>>> defined at c64dtv-stubs.c
>>>            c64dtv-stubs.o:(.text+0x360) in archive ../src/c64dtv/libc64dtvstubs.a

ld.lld: error: duplicate symbol: parallel_cable_cpu_resources_init
>>> defined at c64parallel.c
>>>            c64parallel.o:(parallel_cable_cpu_resources_init) in archive ../src/c64/libc64c64dtv.a
>>> defined at c64dtv-stubs.c
>>>            c64dtv-stubs.o:(.text+0x370) in archive ../src/c64dtv/libc64dtvstubs.a

ld.lld: error: duplicate symbol: parallel_cable_drive_write
>>> defined at c64dtviec.c
>>>            c64dtviec.o:(parallel_cable_drive_write) in archive ../src/c64dtv/libc64dtv.a
>>> defined at c64parallel.c
>>>            c64parallel.o:(.text+0xa0) in archive ../src/c64/libc64c64dtv.a

ld.lld: error: duplicate symbol: parallel_cable_drive_read
>>> defined at c64dtviec.c
>>>            c64dtviec.o:(parallel_cable_drive_read) in archive ../src/c64dtv/libc64dtv.a
>>> defined at c64parallel.c
>>>            c64parallel.o:(.text+0x120) in archive ../src/c64/libc64c64dtv.a

The patch addresses this. I can confirm that it builds and x64dtv runs, but I'm not sure whether this is strictly correct. Perhaps you were relying on these stubs to mask the proper functions.

1 Attachments

Discussion

  • gpz

    gpz - 2025-05-28

    yeah, the stubs are required, and this patch will probably break compilation on other systems. The source and buildsystem needs to be fixed in some way that the "other" library is not linked

     
  • James Le Cuirot

    James Le Cuirot - 2025-05-28

    Ah! I now realise this was already fixed in rev 45435. I only tried against 3.9, and I had expected to see changes elsewhere when checking trunk. Sorry for the noise.

     
  • gpz

    gpz - 2025-05-28

    Hehe, ok. closed :)

     
  • gpz

    gpz - 2025-05-28
    • status: open --> closed
     

Log in to post a comment.