The original test case from issues 6535
---
module lib;
import std.stdio;
void libraryFunction()
{
writeln("You have executed the library function!");
}
---
rdmd --build-only -lib lib.d
---
works with rdmd from Git master, but if the command is replaced with just "rdmd -lib lib.d", i.e. the --build-only flag is not specified, it still creates a corrupt library file, at least on Linux.
rdmd should probably default to the equivalent of --build-only if -lib is specified.
Comment #1 by pro.mathias.lang — 2021-01-09T19:28:03Z
I just tried this on Linux with `rdmd build 20201024` (distributed with LDC v1.24). I made `libraryFunction` extern(C) for simplicity and tried to compile the final executable with `{dmd,ldc2} main.d mylib.a`. Both calls worked, so closing as WORKSFORME.