Commit Graph

13 Commits

Author SHA1 Message Date
Saleem Abdulrasool
7514adf66a Driver: introduce new -libc option for Windows
On Windows, there are multiple variants of the C runtime that must be
explicitly specified and consistently used from the runtime to the
application.  The new `-libc` option allows us to control the linking
phase by correctly embedding the requested library to be linked.  It is
made into a required parameter on Windows and will add in the
appropriate flags for the imported C headers as well.  This ensures that
the C library is not incorrectly linked.
2019-05-16 21:01:47 -07:00
Saleem Abdulrasool
4341a7bda6 Driver: use -Xlinker rather than -Wl (NFC)
This is just nicer to read and makes the option standout better.  NFC.
2019-05-15 16:21:33 -07:00
Saleem Abdulrasool
c931d9530e Driver: correct the registrar extension
The object file extension on Windows is `.obj` rather than `.o`.  Ensure
that we get the extension correct when compiling for Windows.
Furthermore, ensure that we install with the correct extension when
installing a cross-compiled image.  As we may be using the homegrown
cross-compilation system, we must explicitly handle the extension
ourselves.  This allows nearly a 100 additional tests to pass on
Windows.
2018-12-03 19:17:06 -08: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
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
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
Jordan Rose
7d8e40b0bb Merge pull request #16362 from dabelknap/frontend_responsefile
Wrap Command Line Arguments in a Response File if System Limits are Exceeded

https://bugs.swift.org/browse/SR-4517
2018-06-21 16:31:20 -07:00
Ellis Hoag
c93a5a5776 Add -debug-info-format=[dwarf|codeview] option (#16888) 2018-06-20 09:52:57 -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