Only display the appropriate usage help (and then fail) if invoked
without any explicit cmdline options. Otherwise emit an error about
missing source files and fail immediately, without displaying the usage
help.
Besides making LDC and LDMD behave identically in this regard, it makes
just more sense IMO (when forgetting to specify a file, LDC previously
just printed the cmdline help without any error message).
It also makes `ldmd2 -transition=?` and `ldmd2 -preview=help` etc. print
the expected help without LDMD special cases.
* druntime: Adapt test/shared to vanished osmodel.mak
* LDMD: Accept multiple `-fPIC`. It translates to
`-relocation-model=pic`; that option is provided by LLVM and only
allowed once in the command line.
That issue is new for 2.076, as druntime's test/common.mak defaults to
PIC now.
The default MS C runtime library doesn't depend on the `LINK_WITH_MSVCRT`
CMake variable anymore.
The user can freely choose among the 4 variants libcmt[d] / msvcrt[d] via
-mscrtlib or choose between static/dynamic release variant via -static.
LDC keeps on defaulting to the static release C runtime, so
`-static=false` or `-mscrtlib=msvcrt[d]` must be used explicitly in order
to link against the runtime DLLs.
Ignore `-mcpu=baseline`, forward `-mcpu=native` to LDC and translate
`-mcpu=avx` to `-mattr=+avx`. Show LLVM's (extensive) help for `-mcpu=?`
(which is sadly actually printed 3 consecutive times).
Simplify LDMD quite a bit by translating the few different command-line
options directly in-place. This puts some more stress onto LDC's
command-line parsing, especially due to multiple occurrences of a single
Boolean option (e.g., '-o-') or mixtures of `-m64` and `-m32` etc. for
dmd-testsuite.
Also add new command-line option `-verrors-spec` showing gagged errors
(DMD's equivalent is `-verrors=<spec|limit>`) and sync the usage text with
DMD. LDMD now also recognizes `-h` (and `/?` on Windows).
Approximate DMD behavior by naming the temporary object files uniquely
and, if successful, removing all generated object files.
Executables and shared libs imply -singleobj => no collisions.
Let LDC treat relative output paths as relative to the current working
directory again (as it always used to until a few weeks ago). It's more
intuitive and avoids breaking build systems/scripts using LDC directly.
Only LDMD continues to prepend the -od directory to the relative output
path, for DMD compatibility.
Fixes issue #1819.