dpp icon indicating copy to clipboard operation
dpp copied to clipboard

dpp generated file cause `gdc` link error: multiple definition of `_D8liblfdsd14threadConsumerFOCQBc__T9queue_ummTiZQnZv'; /tmp/ccmsmGbO.o:liblfdsd.d:(.text+0x8a00)

Open mw66 opened this issue 2 weeks ago • 1 comments

dpp generated liblfdsd.d file cause gdc link error: multiple definition of `_D8liblfdsd14threadConsumerFOCQBc__T9queue_ummTiZQnZv'; /tmp/ccmsmGbO.o:liblfdsd.d:(.text+0x8a00)

Both LDC and DMD works fine, but not GDC

$ git clone https://github.com/mw66/liblfdsd
$ cd liblfdsd

test LDC2:

$ dub build [email protected] --compiler=ldc2
$ make test
ldmd2 -unittest -version=LIBLFDS_TEST source/liblfdsd.d -O4 --release --boundscheck=off -L-L./liblfds7.1.1/liblfds711/bin -L-L. -L-llfdsd -L-llfdsdc -L-llfds711
./liblfdsd
string: Madge The Skutter; change the pushed after push & before pop
...

test DMD:

$ dub build [email protected] --compiler=dmd
$ dmd -unittest -version=LIBLFDS_TEST source/liblfdsd.d -L-L./liblfds7.1.1/liblfds711/bin -L-L. -L-llfdsd -L-llfdsdc -L-llfds711
$ ./liblfdsd
string: Madge The Skutter; change the pushed after push & before pop
...

test GDC: due to this dub issue: https://github.com/dlang/dub/issues/2938, first edit Makefile, comment out the last line # dub clean,

$ vim Makefile  #  comment out the last line
$ dub build [email protected] --compiler=gdc
$ gdc -unittest -fversion=LIBLFDS_TEST source/liblfdsd.d -O4 --release --bounds-check=off -L-L./liblfds7.1.1/liblfds711/bin -L-L. -L. -llfdsd -L. -llfdsdc -L. -llfds711
/usr/bin/ld: ./liblfdsd.a: in function `_D8liblfdsd16__pthread_cond_s6__wseqMUNaNbNcNdNiNfZm':
/.dub/packages/liblfdsd/0.3.4/liblfdsd/source/liblfdsd.d:760: multiple definition of `_D8liblfdsd16__pthread_cond_s6__wseqMUNaNbNcNdNiNfZm'; /tmp/ccmsmGbO.o:liblfdsd.d:(.text+0x580): first defined here
/usr/bin/ld: ./liblfdsd.a: in function `_D8liblfdsd16__pthread_cond_s8__wseq32MUNaNbNcNdNiNfZSQCaQBu12_Anonymous_012_Anonymous_1':
/.dub/packages/liblfdsd/0.3.4/liblfdsd/source/liblfdsd.d:762: multiple definition of `_D8liblfdsd16__pthread_cond_s8__wseq32MUNaNbNcNdNiNfZSQCaQBu12_Anonymous_012_Anonymous_1'; /tmp/ccmsmGbO.o:liblfdsd.d:(.text+0x590): first defined here
/usr/bin/ld: ./liblfdsd.a: in function `_D8liblfdsd16__pthread_cond_s10__g1_startMUNaNbNcNdNiNfZm':
/.dub/packages/liblfdsd/0.3.4/liblfdsd/source/liblfdsd.d:781: multiple definition of `_D8liblfdsd16__pthread_cond_s10__g1_startMUNaNbNcNdNiNfZm'; /tmp/ccmsmGbO.o:liblfdsd.d:(.text+0x5a0): first defined here
/usr/bin/ld: ./liblfdsd.a: in function `_D8liblfdsd16__pthread_cond_s12__g1_start32MUNaNbNcNdNiNfZSQCfQBz12_Anonymous_312_Anonymous_4':
/.dub/packages/liblfdsd/0.3.4/liblfdsd/source/liblfdsd.d:783: multiple definition of `_D8liblfdsd16__pthread_cond_s12__g1_start32MUNaNbNcNdNiNfZSQCfQBz12_Anonymous_312_Anonymous_4'; /tmp/ccmsmGbO.o:liblfdsd.d:(.text+0x5b0): first defined here
/usr/bin/ld: ./liblfdsd.a:(.bss+0x0): multiple definition of `_D8liblfdsd8NULL_PTRyPPv'; /tmp/ccmsmGbO.o:(.bss+0x18): first defined here
/usr/bin/ld: ./liblfdsd.a:(.bss+0x8): multiple definition of `_D8liblfdsd7NULL_CByPUPSQw23lfds711_queue_bmm_statePvQcZv'; /tmp/ccmsmGbO.o:(.bss+0x10): first defined here
/usr/bin/ld: ./liblfdsd.a:(.data+0x0): multiple definition of `_D8liblfdsd1nxm'; /tmp/ccmsmGbO.o:(.data+0x1e0): first defined here
/usr/bin/ld: ./liblfdsd.a: in function `_D8liblfdsd14threadProducerFOCQBc__T9queue_ummTiZQnZv':
/.dub/packages/liblfdsd/0.3.4/liblfdsd/source/liblfdsd.d:4807: multiple definition of `_D8liblfdsd14threadProducerFOCQBc__T9queue_ummTiZQnZv'; /tmp/ccmsmGbO.o:liblfdsd.d:(.text+0x5c0): first defined here
/usr/bin/ld: ./liblfdsd.a: in function `_D8liblfdsd14threadConsumerFOCQBc__T9queue_ummTiZQnZv':
/.dub/packages/liblfdsd/0.3.4/liblfdsd/source/liblfdsd.d:4817: multiple definition of `_D8liblfdsd14threadConsumerFOCQBc__T9queue_ummTiZQnZv'; /tmp/ccmsmGbO.o:liblfdsd.d:(.text+0x8a00): first defined here
collect2: error: ld returned 1 exit status

mw66 avatar Jun 22 '24 05:06 mw66