August 08, 2021

Hi,

I tried to update my server from dmd v2.096.1 to v2.097 and I started getting this linker error:

Linking...
/usr/bin/ld: .dub/build/executable-ssl11-debug-linux.posix-x86_64-dmd_v2.097.2-beta.1-7651E13F70724FF6B1F8D8B61B1AEABD/gis-collective-api.o: in function `_D3std6traits__T6fqnSymS5crateZ11adjustIdentFAyaZQe':
/usr/include/dmd/phobos/std/traits.d:737: undefined reference to `_D3std9algorithm9searching__T8skipOverZ__TQnTAyaTQeZQxFNaNfKQpQrZb'
/usr/bin/ld: /usr/include/dmd/phobos/std/traits.d:737: undefined reference to `_D3std9algorithm9searching__T8skipOverZ__TQnTAyaTQeZQxFNaNfKQpQrZb'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
/usr/bin/dmd failed with exit code 1.

What's the best aproach on debugging linker errors with DMD on linux?

Best,
Bogdan

August 08, 2021

On Sunday, 8 August 2021 at 11:58:42 UTC, Bogdan wrote:

>

Hi,

I tried to update my server from dmd v2.096.1 to v2.097 and I started getting this linker error:

Linking...
/usr/bin/ld: .dub/build/executable-ssl11-debug-linux.posix-x86_64-dmd_v2.097.2-beta.1-7651E13F70724FF6B1F8D8B61B1AEABD/gis-collective-api.o: in function `_D3std6traits__T6fqnSymS5crateZ11adjustIdentFAyaZQe':
/usr/include/dmd/phobos/std/traits.d:737: undefined reference to `_D3std9algorithm9searching__T8skipOverZ__TQnTAyaTQeZQxFNaNfKQpQrZb'
/usr/bin/ld: /usr/include/dmd/phobos/std/traits.d:737: undefined reference to `_D3std9algorithm9searching__T8skipOverZ__TQnTAyaTQeZQxFNaNfKQpQrZb'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
/usr/bin/dmd failed with exit code 1.

What's the best aproach on debugging linker errors with DMD on linux?

Best,
Bogdan

I'd try the following options

  • --force dub to rebuild everything.
  • -allinst in the dflags.
  • -verbose output can show interesting details sometimes.
  • the different linking mode proposed by dub.

if one of te following fixes the issue then maybe that digger can help to detect a regression.