Commit Graph

23 Commits

Author SHA1 Message Date
Saleem Abdulrasool
936309ec44 test: adjust quoting of arguments
When running the tests with a toolchain built with the "early swift
driver", we would incorrectly process the command line, losing the empty
string argument to `-sdk` which would then incorrectly process the
remainder of the command line. This allows most of the remaining tests
to pass with the early swift driver on Windows (assuming that the paths
are adjusted properly).
2024-12-03 14:44:42 -08:00
Yuta Saito
c994500d82 [Driver] Use WebAssembly toolchain for WASI target
The toolchain was introduced in 710816d3e0
but was not used. Test cases now use fake resource dir to lookup
static-executable-args.lnk file, which is required by the toolchain but
is not present when not building stdlib for WASI.
2023-06-08 11:40:10 +00:00
Saleem Abdulrasool
fc3ccdc542 Driver: simplify the profiler linking on Windows
Rather than computing an absolute path relative to Swift's resource
directory, use the compiler driver to locate the profiling runtime
relative to the C/C++ compiler's resource directory.  This ensures that
we correctly locate the runtime.  Additionally, because clang adds the
clang resource directory to the library search path, we do not need to
compute the path and can rely on the linker locating the runtime via the
library search path.  This simplifies the handling for the profile
runtime linking on Windows.

Out of abundant paranoia, place the library link request after the
forced symbol inclusion as a GC root to ensure that `/opt:ref` will not
accidentally dead strip the symbol and force a reload of the library.
2021-05-23 17:10:15 -07:00
Saleem Abdulrasool
b3d5181ac4 Driver: correct profiling symbol preservation on Windows
The Windows linker does not support `-u`.  Furthermore, the compiler
driver does not forward the `-u` option to the linker.  We correctly use
the `/include:` option from the linker.  This should ensure that the
symbol is preserved even with `/opt:ref`.  This spelling should be
compatible with both lld and link, which should provide sufficient
portability.

Take the opportunity to make it more obvious that the two parameters are
creating a pair that will be concatenated by using a braced initializer.

See
https://docs.microsoft.com/en-us/cpp/build/reference/include-force-symbol-references?view=msvc-160
for more details on the option.
2021-05-23 10:43:28 -07:00
Doug Gregor
b656955f79 [Driver tests] Be explicit when we don't care about SDK/target mismatches 2020-06-16 15:53:13 -07:00
Saleem Abdulrasool
5b6ef8649c test: loosen the test expectation
The test expects the output location to be temp directory layout which
may not be the case.  Loosen the test to enable moving the temporary
directory.
2020-05-03 17:40:49 -07:00
Doug Gregor
574f0e8a5b [Platform] Stop inferring simulator-ness.
The *-simulator target triples have been used consistently in tools for
several years to indicate simulator targets. Stop inferring the
simulator part, rdar://problem/35810403.
2020-04-20 08:50:34 -07:00
Saleem Abdulrasool
fbbf61f297 Revert "[Darwin] Further restrict inference of the simulator environment" 2020-04-19 16:43:22 -07:00
Doug Gregor
7e7dc648f2 [Platform] Stop inferring simulator-ness.
The *-simulator target triples have been used consistently in tools for
several years to indicate simulator targets. Stop inferring the
simulator part, rdar://problem/35810403.
2020-04-16 11:35:43 -07:00
Saleem Abdulrasool
23b1a6b87a Driver: add support for WASI/WASM toolchain
Treat WASM/WASI as a generic Unix toolchain.  This adds the necessary
support to build a toolchain for WASM/WASI.
2019-12-04 20:14:08 -08:00
Saleem Abdulrasool
67475dced4 Driver: avoid linking against the C++ runtime
Use `clang` rather than `clang++` as the linker driver.  This ensures
that we do not force a C++ runtime on the general code.  This is fine
for now as C++ interop is not yet available for Swift.  This prevents
the accidental mix-and-match of various C++ runtimes.  This can cause
problems on platforms like android where `libstdc++` is an unsupported
runtime but is generally the default for Linux platforms.
2019-07-24 19:48:02 -07:00
Saleem Abdulrasool
285e2acdd0 test: adjust for Windows file extensions
Windows tools have the `.exe` suffix which may or may not be present.
Adjust the test to account for that.
2019-04-03 13:36:24 -07:00
Saleem Abdulrasool
5b6e8cd061 test: make the test more resilient to path setup on Windows
Windows tools have a .exe suffix which may or may not be found.  Adjust
the tests to accommodate them.
2019-04-02 13:17:07 -07:00
Jason Mittertreiner
4e0b092fbe Fixing Driver tests on Windows (#20209) 2018-12-10 18:27:37 -08:00
Thomas Roughton
5bb6ac2e12 Implement a Windows toolchain. 2018-04-18 15:26:05 +12:00
Vedant Kumar
1621facc6c [SwiftPGO] Add driver support for -profile-use=<path>
This option tells the compiler where to find a profdata file. The
information in this file enables PGO. For more information about the PGO
infrastructure, look for the -profile-generate option and for the
llvm-profdata tool [1].

[1] http://llvm.org/docs/CommandGuide/llvm-profdata.html
2017-09-26 10:52:08 -07:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Vedant Kumar
8887175db8 [Driver] Pass the profiling runtime hook to the linker
We need to force-load a hook symbol from the profiling runtime to
convince the Linux linker to load the rest of the library.

This fixes SR-2109.
2016-07-25 11:16:13 -07:00
Jordan Rose
9c6cdd3296 [Driver] Fix references to Clang's profiling runtime.
(1) We no longer put the Clang version string in our copy of or symlink to
    Clang's resource directory.
(2) Newer Clang builds now generate a separate library for the Apple OS
    simulators, instead of a fat binary.

We still need a proper end-to-end test for this, but that depends on
building compiler-rt with Swift, which isn't a standard config yet.
2016-01-28 20:00:41 -08:00
Dmitri Gribenko
4324e7c903 Remove conditional compilation of tvOS 2015-12-01 14:43:45 -07:00
Dmitri Hrybenko
ea17483633 Add CMake options and #ifs to hide tvOS
Swift SVN r28752
2015-05-19 05:15:52 +00:00
David Farler
544ef4002d Merge tvOS and watchOS Support
- Add frontend and standard library build support for tvOS.
- Add frontend support for watchOS.

watchOS standard library builds are still disabled during SDK bring-up.

To build for TVOS, specify --tvos to build-script.
To build for watchOS, specify --watchos to build-script (not yet supported).

This patch does not include turning on full tests for TVOS or watchOS, and
will be included in a follow-up patch.

Swift SVN r26278
2015-03-18 21:35:07 +00:00
Justin Bogner
a49008298e InstrProf: Set up the basic infrastructure for profiling swift
This adds the -profile-generate flag, which enables LLVM's
instrumentation based profiling. It implements the instrumentation
for basic control flow, such as if statements, loops, and closures.

Swift SVN r25155
2015-02-11 01:06:18 +00:00