68 Commits

Author SHA1 Message Date
Julian Lettner
e24585dc17 [Driver] Delegate linking of sanitizer runtimes to underlying Clang
For Unix tool chains.
2019-03-26 10:56:52 -07:00
futurejones
010693840c change default linker to gold for AArch64 2018-11-29 08:21:21 +09:00
Daniel Rodríguez Troitiño
8dd8fc0cfa Add -Xclang-linker option to the compiler. (#20441)
In the Darwin toolchain the linker is invoked directly, and compiler_rt
is used if it is found, but in Unix platforms, clang++ is invoked
instead, and the clang driver will invoke the linker. Howerver there was
no way of modifying this clang++ invocation, so there's no way of
providing `--rtlib=` and change the platform default (which is normally
libgcc). The only workaround is doing the work that the Swift driver is
doing "manually".

The change adds a new option (with help hidden, but we can change that)
to allow providing extra arguments to the clang++ invocation. The change
is done in the two places in the Unix and Windows toolchains that I
found the clang driver was being used.

Includes some simple tests.
2018-11-28 10:48:20 -08:00
Rahul Malik
d3cc043e58 Add Undefined Behavior sanitizer to Swift Driver (#18553)
This change allows the swift driver to link the ubsan runtime if
`-sanitize=undefined` is specified.
This is useful for sanitizing linked Objective-C code.
2018-11-13 12:11:56 -08:00
Saleem Abdulrasool
f85d8ae216 Merge pull request #19875 from Kaiede/i686Toolchain
Change Default Linker to Gold for x86
2018-10-23 17:34:30 -07:00
swift-ci
cb5d34e7c7 Merge pull request #19476 from drodriguez/android-aarch64-compiler 2018-10-14 19:02:23 -07:00
Adam Thayer
250aa60166 Change Default Linker to Gold for x86
For the same reasons that ARM 32-bit Linux needs gold, we should be using the same linker by default for x86/i686.
2018-10-14 12:57:35 -07:00
Daniel Rodríguez Troitiño
02e26d2810 [android] Remove compiler check for ARMv7.
Allows the compiler to target AArch64.
2018-10-09 13:38:47 -07:00
Tony Allevato
0f8a765baa Add response file support for more Swift jobs. (#19449)
This enables response files for any jobs that invoke `swift` or another
toolchain tool that goes through the same driver code path, like
`swift-autolink-extract`.
2018-09-24 14:54:51 -07:00
Jordan Rose
e224e31720 Break almost all dependencies of Driver on Frontend
- Sink OutputFileMap{.h,.cpp} and ReferenceDependencyKeys.h to Basic
- Remove unnecessary includes of Frontend.h.
2018-08-27 20:47:58 -07:00
Keith Smiley
ab5588da05 Reorder Xlinker and linker option group 2018-07-30 09:30:12 -07:00
Keith Smiley
1f4e643d42 Move linker arguments to the end 2018-07-27 14:34:00 -07:00
Keith Smiley
577b18f86d Unify linker argument order across platforms
Previously extra linker arguments had different behavior on darwin vs
other unix platforms. On darwin the arguments passed with -Xlinker would
be passed to the linker before the default arguments, where as with the
default unix toolchain they would be passed afterwards.

There isn't really a great option for which order these should be in.
If you want to have a custom rpath that takes precedence over the
default rpaths, you want them to be passed before, but if you want to
negate a default argument you want them to come after.

This change unifies the behavior so at least you always get the same
behavior across platforms.
2018-07-26 13:37:09 -07:00
Austin Belknap
7dd3800a6b Make sure -o is the last option. 2018-07-11 15:29:52 -07:00
Austin Belknap
16fdb8f03a Merge branch 'master' into verbose_linker 2018-07-11 09:22:34 -07:00
Austin Belknap
7acef0356c Run clang++ in verbose mode during linking if swiftc is called with "-v". 2018-05-14 08:52:06 -07:00
Austin Belknap
2297f75c4a Move the "allowsResponseFiles" flag to the ToolChain. 2018-05-11 15:21:25 -07:00
Thomas Roughton
0506ccc244 Refactor ToolChains into separate files. (#16091)
Format the code and factor together some common functionality at the same time.
2018-05-02 11:11:54 -07:00