Commit Graph

37 Commits

Author SHA1 Message Date
Ted Kremenek
b796305846 Merge pull request #1371 from hpux735/thumb
Added thumb to supported platforms conditions
2016-03-08 22:10:13 -08:00
Davide Italiano
edfa8fe428 [FreeBSD] XFAIL some Driver tests as we do on Linux. 2016-03-01 19:37:59 +00:00
William Dillon
390e50c999 Added thumb to supported platforms conditions 2016-02-21 16:56:02 +00:00
William Dillon
d0d9b1de5a Discard swift.ld and support gold linker 2016-02-17 17:47:35 -08:00
William Dillon
ab7c87e7e8 Implemented ARMv6 and fixed up ARMv7 2016-01-29 21:41:22 +00:00
Jordan Rose
f557563068 [Driver] Pass -filelist to Darwin 'ld' too.
Start sketching out a way for individual jobs to request filelists for
their inputs or their outputs. This should cover all the cases mentioned
in ad945426.

More https://bugs.swift.org/browse/SR-280.
2016-01-13 18:39:24 -08:00
Jordan Rose
d1b72c7b0c [test] Fix test case to account for temporary file names. 2016-01-12 16:17:27 -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
William Dillon
4bf81e09da Build working on ARMv7l 2015-12-12 22:06:13 -08: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
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
Dmitri Hrybenko
ea17483633 Add CMake options and #ifs to hide tvOS
Swift SVN r28752
2015-05-19 05:15:52 +00:00
Dmitri Hrybenko
c53cbc63e7 stdlib: when linking arclite, link in CoreFoundation
Arclite now depends on CoreFoundation.

rdar://problem/20735508

Swift SVN r27884
2015-04-28 22:09:59 +00:00
Dmitri Hrybenko
2791a4c317 Disable the test for swift-autolink-extract when the binary is not
available

Swift SVN r27162
2015-04-09 06:22:54 +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
Graham Batty
078a558b26 Extract autolink information as a compile step.
Swift SVN r25510
2015-02-24 20:33:05 +00:00
Jordan Rose
ba46749c08 [Driver] Search for ld and dsymutil relative to swift, just like lldb.
This is important when we need a particular linker feature for swiftc.

rdar://problem/18875396

Swift SVN r25391
2015-02-19 02:28:36 +00:00
Graham Batty
805727c966 Linker test fails on linux until osx sysroot built
rdar://problem/19692770

Swift SVN r24926
2015-02-03 20:43:42 +00:00
Dmitri Hrybenko
6670bb76ec Rewrite the CMake build system
Swift SVN r24124
2014-12-23 22:15:30 +00:00
Graham Batty
17b1721f8f Implement ELF protocol conformance loading.
This works by loading the protocols from a specially named symbol,
which is generated by the linker through the help of a linker script
that merges all of the protocol conformance blocks into one section
with its size at the start of it and points a global symbol at
the section.

We do all this because unlike MachO, section information does not
survive to be loaded into memory with ELF binaries. Instead,
the mappings that survive are 'segments', which contain one or
more sections. Information about how these relate to their original
sections is difficult, if not impossible, to obtain at runtime.

Swift SVN r23518
2014-11-21 17:09:48 +00:00
Graham Batty
c61e40bbb8 Revert "Implement ELF protocol conformance loading."
This reverts commit r23475 at dgribenko's request.

Swift SVN r23487
2014-11-20 21:31:46 +00:00
Graham Batty
738a1b4ba0 Implement ELF protocol conformance loading.
This works by loading the protocols from a specially named symbol,
which is generated by the linker through the help of a linker script
that merges all of the protocol conformance blocks into one section
with its size at the start of it and points a global symbol at
the section.

We do all this because unlike MachO, section information does not
survive to be loaded into memory with ELF binaries. Instead,
the mappings that survive are 'segments', which contain one or
more sections. Information about how these relate to their original
sections is difficult, if not impossible, to obtain at runtime.

Swift SVN r23475
2014-11-20 17:40:05 +00:00
Graham Batty
e2258fa323 Only run dsymutil on darwin.
Swift SVN r23325
2014-11-14 20:14:11 +00:00
Graham Batty
4968d8f6fd Link in the right places and correct -Xlinker.
Swift SVN r22621
2014-10-09 16:03:48 +00:00
Jordan Rose
1d8c75ede1 [test] Fix driver tests to handle spaces in the path to Xcode.
Commands like 'ld' are picked up from the path, which can result in picking
the binaries inside Xcode.

Swift SVN r21749
2014-09-05 22:22:41 +00:00
Jordan Rose
c510b1d425 [Driver] Infer libFOO.dylib from a module name of FOO and vice versa.
(when in -emit-library mode)

The one catch is that if you specify an output file named "libFOO" with no
extension, the module name will still be "libFOO", not "FOO". Explicitly
providing both -o and -module-name is always allowed.

<rdar://problem/17827584>

Swift SVN r20869
2014-08-01 00:52:06 +00:00
Jordan Rose
0481b87ba5 Move target configuration setup into CompilerInvocation.
Without this, clients that don't use a CompilerInstance (like LLDB) won't
have target configuration options available.

Also, move minimum OS checking into the driver. This makes sure the check
happens early (and only once), and in general fits the philosophy of
allowing the frontend to use configurations that might be banned for users.

<rdar://problem/17688913>

Swift SVN r20701
2014-07-29 21:48:59 +00:00
Jordan Rose
c477314b59 [Driver] Only link in arclite if deploying to pre-8.0 iOS or pre-10.10 OS X.
<rdar://problem/16749280>

Swift SVN r20663
2014-07-29 00:38:26 +00:00
Jordan Rose
69533b53f7 [Driver] Invoke dsymutil after linking when invoked with -g.
This matches Clang's behavior, though this implementation does not check
that it's actually on a platform that uses dsymutil.

<rdar://problem/16012971>

Swift SVN r20529
2014-07-25 01:31:40 +00:00
Ben Langmuir
d2ef235237 Move the lit tests over to the new swift/swiftc interfaces
Most of the tests just got moved to swiftc, but some of them were
duplicated to apply to both swiftc and swift. A handful still use the
existing 'swift' because they are for the existing '-i' syntax.

Note: this means config.swift_driver now uses the staging symlink
'swifti'. The only thing preventing us from dropping the 'i' and getting
rid of the old interface is that Xcode hasn't moved to swiftc yet
<rdar://problem/17769327>.

Swift SVN r20467
2014-07-24 04:34:10 +00:00
Jordan Rose
79224874eb [Driver] Switch debug info to use ld's new -add_ast_path option.
Rather than embed AST info directly in binaries, we now include a special
symbol table entry that points to the serialized AST as a separate file.
This requires a very recent version of ld.

We still want to support the __SWIFT,__ast section in a binary because
that's how it's modeled in dSYM, so manually test both modes in
ASTSection_linker.swift.

Part of <rdar://problem/15796201>.

Swift SVN r20421
2014-07-23 18:04:10 +00:00
Jordan Rose
9155772014 [Driver] Drop the -arch flag; it does the wrong thing for the iOS simulator.
Clang uses this to produce fat binaries, so we'll probably want to get it
right some day, but for now it's fine to just leave it out.

Swift SVN r18872
2014-06-13 17:27:48 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Jordan Rose
9cb81b0006 [driver] Add support for invoking ld.
swift_driver can now end-to-end compile a Swift file. Try it yourself!

echo 'println("hello")' | swift_driver -

Swift SVN r12840
2014-01-23 02:11:47 +00:00