Bug 9684 – rdmd -lib <filename> produces corrupted file

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
tools
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2013-03-10T18:15:10Z
Last change time
2021-01-09T19:28:03Z
Assigned to
No Owner
Creator
David Nadlinger

Comments

Comment #0 by code — 2013-03-10T18:15:10Z
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.