Commit graph

17 commits

Author SHA1 Message Date
kinke
ae9d43c167 Use LLVM headers for shared codegen command-line options (#2148)
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.
2017-09-20 01:04:43 +02:00
Johan Engelen
4a820f1449 libFuzzer: support LLVM 6.0 compiler-rt fuzzer (#2285)
libFuzzer was moved to compiler-rt, and therefore its location and filename has changed.
Tested locally on OSX only.
2017-08-24 18:41:06 +02:00
kinke
3b2f6bccdb Don't use -m32/-m64 for external ARM assembler (#2264)
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.
2017-08-12 18:17:03 +02:00
Johan Engelen
80118cff25 Add hidden option to disable automatic linking with c++ stdlib 2017-07-26 22:04:48 +02:00
Johan Engelen
800dc5a97f Add automatic libFuzzer linking + fuzz test 2017-07-26 22:04:48 +02:00
Johan Engelen
fffeb85b5c Add search logic for AddressSanitizer library on Linuxes. (#2214)
* Make exe_path API a little more flexible.

* Add search logic for AddressSanitizer library on Linuxes.
2017-07-21 19:51:30 +02:00
Martin
1fb269f940 Drop support for LLVM < 3.7 2017-07-16 02:18:00 +02:00
Johan Engelen
f4949f957a AddressSanitizer, Darwin: add support for linking with correct library when found in LDC's lib dir. (#2188)
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)
2017-07-14 16:07:32 +02:00
Johan Engelen
4d10b9a64e Use ASCII hyphen character in linker-gcc.cpp. 2017-06-25 23:09:41 +02:00
Johan Engelen
22b1accb59 Replace -sanitize with -fsanitize and add -fsanitize-coverage. (#2149)
This reworks the sanitizer interface to be identical with Clang's.
What's left to do is pass the correct runtime libraries to the linker.
2017-06-15 17:19:21 +02:00
Martin
383c2d3a59 Range-ify usages of front-end Arrays 2017-06-04 00:29:44 +02:00
Martin
9fd7fa2d90 Add experimental -link-internally switch to enable LLD opt-in
And infer CMake LDC_WITH_LLD automatically based on availability of LLVM
3.9+ with LLD headers & libs.
2017-05-29 22:45:32 +02:00
Martin
ede23642ef Add first version of ld linker driver as ArgsBuilder specialization 2017-05-27 03:30:25 +02:00
Martin
9416d334c6 Introduce ArgsBuilder::addLdFlag() 2017-05-27 03:02:31 +02:00
Martin
1339c02598 Incorporate LTO stuff in GCC ArgsBuilder 2017-05-27 02:42:07 +02:00
Martin
9c86ae9ad0 Refactor generation of GCC linker command line 2017-05-27 02:27:17 +02:00
Martin
ecbfa0e52a Move GCC driver to dedicated driver/linker-gcc.cpp 2017-05-27 02:23:49 +02:00