Breaking changes to command-line semantics

kinke via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Sat Oct 1 10:14:53 PDT 2016


Hi all,

LDC lately streamlined its main() and output filenames with DMD, 
leading
to a few breaking changes to command-line semantics.

* `-singleobj` (emitting all source files into a single object 
file) is
   now enforced when building an executable or a shared library 
(not for
   static libraries though).
   LDMD already behaved like that, but LDC directly didn't.

* If not using `-of` explicitly, the name of the produced 
object/library/
   executable is now inferred from the first source filename (or 
first
   object filename for non-singleobj builds if it precedes the 
first source
   file in the command-line).
   It used to be based on the module declaration of the first 
source file.
   Static libraries with inferred filename are now created in the 
`-od`
   directory.

* `-op` (preserve source paths for object files) now works as 
expected.
   It used to be enforced when building static and dynamic 
libraries and
   was otherwise ignored.

* Windows targets now support .res and .def files in the 
command-line.
   They are forwarded appropriately to the MS linker.

* The object files order for the linker now corresponds to the 
command-
   line order of source and object files.
   The previous order was all existing object files in 
command-line order,
   then all new object files in reversed command-line order.
   For singleobj builds, the single new object file is always the 
first
   one, preceding all existing object files.


More information about the digitalmars-d-ldc mailing list