adamdruppe / adrdox

41 stars 15 forks source link

Unable to build using `make ldc` due to linking errors #39

Closed katyo closed 4 years ago

katyo commented 4 years ago

When I try to build adrdox with make ldc I get multiple linking errors related to multiple definitions of symbols:

/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/ld.gold: error: /nix/store/gpl8vha4l6dlric5i5wnhnm56ix6ik87-ldc-1.22.0/lib/libphobos2-ldc.a(stats_collector.o): multiple definition of '_D3std12experimental9allocator15building_blocks15stats_collector12__ModuleInfoZ'
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/ld.gold: adrdox.main.o: previous definition here
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/ld.gold: error: /nix/store/gpl8vha4l6dlric5i5wnhnm56ix6ik87-ldc-1.22.0/lib/libphobos2-ldc.a(common.o): multiple definition of '_D3std12experimental9allocator6common12__ModuleInfoZ'
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/ld.gold: adrdox.main.o: previous definition here
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/ld.gold: error: /nix/store/gpl8vha4l6dlric5i5wnhnm56ix6ik87-ldc-1.22.0/lib/libphobos2-ldc.a(common.o): multiple definition of '_D3std12experimental9allocator6common15forwardToMemberFAyaAQeXQh'
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/ld.gold: adrdox.main.o: previous definition here
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/ld.gold: error: /nix/store/gpl8vha4l6dlric5i5wnhnm56ix6ik87-ldc-1.22.0/lib/libphobos2-ldc.a(package.o): multiple definition of '_D3std12experimental9allocator10IAllocator11__InterfaceZ'
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/ld.gold: adrdox.main.o: previous definition here
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/ld.gold: error: /nix/store/gpl8vha4l6dlric5i5wnhnm56ix6ik87-ldc-1.22.0/lib/libphobos2-ldc.a(package.o): multiple definition of '_D3std12experimental9allocator12__ModuleInfoZ'
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/ld.gold: adrdox.main.o: previous definition here
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/ld.gold: error: /nix/store/gpl8vha4l6dlric5i5wnhnm56ix6ik87-ldc-1.22.0/lib/libphobos2-ldc.a(region.o): multiple definition of '_D3std12experimental9allocator15building_blocks6region12__ModuleInfoZ'
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/ld.gold: adrdox.main.o: previous definition here
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/ld.gold: error: /nix/store/gpl8vha4l6dlric5i5wnhnm56ix6ik87-ldc-1.22.0/lib/libphobos2-ldc.a(gc_allocator.o): multiple definition of '_D3std12experimental9allocator12gc_allocator12__ModuleInfoZ'
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/ld.gold: adrdox.main.o: previous definition here
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/ld.gold: error: /nix/store/gpl8vha4l6dlric5i5wnhnm56ix6ik87-ldc-1.22.0/lib/libphobos2-ldc.a(mmap_allocator.o): multiple definition of '_D3std12experimental9allocator14mmap_allocator12__ModuleInfoZ'
/nix/store/1zf4cnaaidjajwb4gx4mnkqc5dypkcdy-binutils-2.31.1/bin/ld.gold: adrdox.main.o: previous definition here

LDC2 compiler version:

$ ldc2 --version
LDC - the LLVM D compiler (1.22.0):
  based on DMD v2.092.1 and LLVM 8.0.1
  built with LDC - the LLVM D compiler (1.19.0)
  Default target: x86_64-unknown-linux-gnu
  Host CPU: westmere
  http://dlang.org - http://wiki.dlang.org/LDC

When I removed all sourses related to _Dscanner/libparse/experimentalallocator from LIBPARSE variable in Makefile it build successfully.

adamdruppe commented 4 years ago

that's a little bizarre, make ldc is what I use to build the website. but i don't think i actually use that stuff anyway

this ldc build is so slow btw. I blame libdparse somewhere, it has some heavy ctfe, but I aven't been able to find the time to fix it yet.,

nevertheless yeah it didn't break anything here removing it, so just did. I can delete all tha stuff from the repo now I think. sweet.

katyo commented 4 years ago

Fixed in master