I.e., llvm/CodeGen/CommandFlags.h which in turn includes
llvm/MC/MCTargetOptionsCommandFlags.h.
This gets rid of a few duplicates on our side and includes about 35
(depending on LLVM version) new command-line options. LLVM provides a
helper function to set up the TargetOptions according to (most of) these
options.
Newer LLVM versions may add new options and we'll automatically inherit
them, including setting up the TargetOptions accordingly.
I did my best (TM) to remove a few unused/undesirable options and hide all
remaining new ones except for `-fp-contract`. The lists will need to be
tweaked from time to time.
And merge the two out-of-sync copies for adding gcc target flags. The flag
was omitted for gcc as linker already, but not for gcc as external assembler.
This PR is only meant to change Darwin link line with -fsanitize=address. With this PR, I can use addresssanitizer successfully (and easily) on my Mac.
The PR finds a libldc_rt.asan_osx_dynamic.dylib or libclang_rt.asan_osx_dynamic.dylib in LDC's lib dir, and falls back to the old behavior (passing -fsanitize=address to the linker driver) if nothing is found. So now the user can copy his self-built library to LDC's lib dir and be happy :-)
(the cmake script could copy+rename the library to the lib dir when the library is found in the LLVM binaries)