November 22
This is a bug report but I cannot reduce to a simple case.
The problem doesn't happen if I use a simple test library.

test script:

=== ===
if [ -z "$DC"  ]; then
if [ ! -d styx ]; then
    git clone ""
cd styx
# e.g "Compile project" in an IDE
$DC $(find "src" -iname "*.d") -lib -of"bin/libstyx.a"
# e.g "Test current module" in an IDE
$DC "src/styx/lexer.d" "bin/libstyx.a" -I"src" -main -unittest

The following works fine:

  $ DC=dmd sh

When using ld2c I got linking errors

  $ DC=ldmd2 sh