Commit Graph

479 Commits

Author SHA1 Message Date
Jordan Rose
b45a69ef09 [Driver] Allow passing all source files in a filelist.
Generate frontend commands with -filelist in them. This isn't actually
implemented yet, but we can start testing at this point.

Part 1 of https://bugs.swift.org/browse/SR-280.
2016-01-12 19:20:50 -08:00
Jordan Rose
5f78d24e85 [Driver] Make the list of input files available when creating Jobs.
Previously jobs had to grovel this information out of the raw argument
list, which dropped the types we had inferred on input files. This
makes things more consistent across the compiler, though arguably we
should be able to designate "primary" and "non-primary" inputs on a
per-action basis rather than resorting to "global" state.

Use this new information to stop passing object file inputs to the
Swift frontend, fixing rdar://problem/23213785.

The list wouldn't have to live on the Compilation, but I'm going to use
it to fix SR-280 / rdar://problem/23878192 as well.
2016-01-12 11:52:31 -08:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
practicalswift
8ab8847684 Fix typos. 2015-12-16 22:09:32 +01:00
William Dillon
4bf81e09da Build working on ARMv7l 2015-12-12 22:06:13 -08:00
Landon Fuller
daa97e0079 Adopt suggested 'GenericUnix' toolchain class name. 2015-12-04 17:30:42 -07:00
Landon Fuller
83b706df8a Merge branch 'master' into landonf/freebsd-patchset-1 2015-12-04 17:11:54 -07:00
Dmitri Gribenko
a3c92e1b0d Remove build options for conditionally enabling targets
* We don't have a use-case for this.

* Swift, like Clang, is fundamentally a cross-compiler, and there is no
  known reason to artificially limit it.
2015-12-04 16:04:35 -08:00
Landon Fuller
0aeef6fec3 Merge branch 'master' into landonf/freebsd-patchset-1 2015-12-04 14:22:28 -07:00
Landon Fuller
d7721781bc Unify the identical Linux/FreeBSD definitions.
When these diverge, we can use the Unix toolchain as
a common baseclass for both.
2015-12-04 14:14:02 -07:00
Jordan Rose
5a54c7ef21 [Driver] Now that we set DYLD_LIBRARY_PATH, stop passing -L to the frontend.
...again, specifically for interpreter jobs. There's no point in the frontend
repeating work that the dynamic linker can do itself.
2015-12-04 12:18:48 -08:00
Jordan Rose
4f9367041f [Driver] Always use the runtime resource library path for DYLD_LIBRARY_PATH.
...when interpreting. Otherwise, the script may depend on library X, which
depends on library Y, where library Y is a standard Swift library, located
in lib/swift/$PLATFORM/.

Finishes rdar://problem/23588774
2015-12-04 12:18:48 -08:00
Jordan Rose
8021ed0873 [Driver] Set [DY]LD_LIBRARY_PATH when building an interpreter job.
That's DYLD_LIBRARY_PATH on OS X and LD_LIBRARY_PATH on Linux for -L,
and DYLD_FRAMEWORK_PATH on OS X for -F.

Note that this commit doesn't actually include the setenv calls yet, so an
end-to-end test is coming in the next commit.

Part of rdar://problem/23588774
2015-12-04 12:18:47 -08:00
Jordan Rose
13470ae19d [Driver] Replace a std::pair with a struct in Job construction.
No functionality change. Groundwork for setting [DY]LD_LIBRARY_PATH ahead
of time when invoking the interpreter, which is rdar://problem/23588774.
2015-12-04 12:18:46 -08:00
Jordan Rose
6d9b5cb8ed [Driver] Factor interpret-script mode out into a separate Action.
This makes it easier to make interpreter modes behave differently from
compilation modes. Obviously that's a trade-off, since the two modes also
share plenty, but given how few of the existing CompileJobAction checks had
to be modified for the new InterpretJobAction, I think this is the right
way to go.

Groundwork for setting [DY]LD_LIBRARY_PATH ahead of time when invoking the
interpreter, which is rdar://problem/23588774.
2015-12-04 12:18:45 -08:00
Landon Fuller
a7ec794287 Add basic build system and Driver support for FreeBSD targets/hosts. 2015-12-04 12:24:46 -07:00
Dmitri Gribenko
4324e7c903 Remove conditional compilation of tvOS 2015-12-01 14:43:45 -07:00
David Farler
7546d586b2 Revert "Add -linker-path frontend option to choose the linker"
This reverts commit 58cfa27eb5.

We require at least clang-3.6 for C++14 build support but
Ubuntu 14.04's clang-3.6 package does not lay down the symlink
/usr/bin/clang++ -> /usr/bin/clang++-3.6. We will require a
clang++ alternatives entry or symlink when building for these
systems (see README.md).
2015-11-16 17:10:40 -08:00
David Farler
58cfa27eb5 Add -linker-path frontend option to choose the linker
In most Linux distributions, installing a clang package other than the
default unversioned one will not install a symlink from /usr/bin/clang++
-> /usr/bin/clang++-N-M, which can break builds with a not so great
diagnostic (a separate problem).

"ld" and "clang++" are hard-coded in the link job actions, so provide a
frontend flag, -linker-path, as a customization point for these.

rdar://problem/23537079
2015-11-13 14:22:55 -08:00
Jordan Rose
877b51dfbd [Driver] If lib/arc/ isn't present next to Swift, look next to Xcode's Clang.
Deploying to older OSs requires linking in a compatibility library called
"arclite", but this library isn't open source and won't be distributed with
our open source downloads. Fall back to the version in Xcode.

The next step is to remove the local symlink used in builds, but I wanted to
handle that separately.

rdar://problem/23421436
2015-11-06 18:46:34 -08:00
Argyrios Kyrtzidis
1d5e9e0acd [FixCode] Introduce '-fixit-all' option that, when -fixit-code is enabled, applies all fixits from diagnostics without any filtering.
Swift SVN r31772
2015-09-08 18:30:49 +00:00
Adrian Prantl
ee13581192 Unconditionally use SWIFT_EXECUTABLE_NAME for ModuleWrap invocations.
Swift SVN r31675
2015-09-03 23:27:32 +00:00
Adrian Prantl
0de0d43773 Introduce a -modulewrap driver action that wraps a (merged) .swiftmodule
inside a swift ast section in an object file so it can be passed to the
linker. The driver automatically wraps merged swiftmodules iff the target
is ELF.

rdar://problem/22407666

Swift SVN r31641
2015-09-02 21:56:25 +00:00
Jordan Rose
de2ecbb80e [Driver] Remove the notion of Tools, turn ToolChain into an Action visitor.
The "Tool" abstraction wasn't buying us enough to deserve the added
complexity. Now a ToolChain turns Actions into Jobs, and every helper
tool is searched for relative to Swift first. Much simpler.

Swift SVN r31563
2015-08-28 23:12:33 +00:00
Jordan Rose
2b325a1091 [Driver] Remove some essentially-unused helpers from ToolChain. NFC.
Swift SVN r31546
2015-08-27 22:04:16 +00:00
Dmitri Hrybenko
cc05e7640b Disable Linux support in Apple B&I builds
Swift SVN r25633
2015-02-28 02:42:43 +00:00
Graham Batty
a1e0b0fbf7 Driver: More stubbing for Linux support
Swift SVN r22362
2014-09-29 21:14:32 +00:00
Greg Parker
f042995c56 Don't use architecture "arm". The linker and other tools don't accept it.
Swift SVN r14770
2014-03-07 05:34:41 +00:00
Connor Wakamo
ed2038585f Initial set of changes to add a new 'swift_driver' executable.
- Added a couple of new targets:
  - libswiftDriver, which contains most of the driver implementation
  - swift_driver, which produces the actual executable

- Added centralized version information into libswiftBasic.

- Added a new "Driver Design & Internals" document, which currently describes
  the high-level design of the Swift driver.

- Implemented an early version of the functionality of the driver, including
  versions of the Parse, Pipeline, Bind, Translate, and Execute driver stages.
  Parse, Pipeline, and Bind are largely implemented; Translate and Execute are
  early placeholders. (Translate produces "swift_driver --version" and "ld -v"
  commands, while Execute performs all subtasks sequentially, rather than in
  parallel.)

This is just the starting point for the Swift driver. Tests for the existing
behavior are forthcoming.

Swift SVN r10933
2013-12-06 21:23:01 +00:00