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

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

Open
mw66 opened this issue Jun 22, 2024 · 1 comment

Comments

@mw66
Copy link

mw66 commented Jun 22, 2024

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: dlang/dub#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
Copy link
Author

mw66 commented Jun 22, 2024

in the Makefile:

the source/liblfdsd.d is generated by dpp

https://github.com/mw66/liblfdsd/blob/master/Makefile#L24-L25

@mw66 mw66 changed the title dpp generated liblfdsd.d file cause gdc link error: multiple definition of `_D8liblfdsd14threadConsumerFOCQBc__T9queue_ummTiZQnZv'; /tmp/ccmsmGbO.o:liblfdsd.d:(.text+0x8a00) dpp generated file cause gdc link error: multiple definition of `_D8liblfdsd14threadConsumerFOCQBc__T9queue_ummTiZQnZv'; /tmp/ccmsmGbO.o:liblfdsd.d:(.text+0x8a00) Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant