Commit Graph

211 Commits

Author SHA1 Message Date
Bob Wilson 9e6e0751b3 Support LIBRARY_PATH on all Darwin targets.
r197490 changed the behavior of LIBRARY_PATH to try to match GCC's behavior
for cross compilers and make clang work better on "bare metal" targets.
Unfortunately that change is breaking a number of MacPorts projects because
the LIBRARY_PATH environment variable is being ignored when compiling on a
64-bit host for a 32-bit target. Because the host and target architectures
differ, isCrossCompiling returns true. This does not make sense for Darwin,
where multiple architectures are supported natively via "fat" Mach-O slices
and where development is generally done against SDKs regardless. This patch
fixes the problem by overriding isCrossCompiling to return false for Darwin
toolchains.

llvm-svn: 214208
2014-07-29 20:17:52 +00:00
Brad Smith 636b6a2fd7 Add missing override keyword to OpenBSD IsIntegratedAssemblerDefault().
llvm-svn: 214060
2014-07-28 01:57:32 +00:00
Tim Northover 40956e64f2 AArch64: update Clang for merged arm64/aarch64 triples.
The main subtlety here is that the Darwin tools still need to be given "-arch
arm64" rather than "-arch aarch64". Fortunately this already goes via a custom
function to handle weird edge-cases in other architectures, and it tested.

I removed a few arm64_be tests because that really isn't an interesting thing
to worry about. No-one using big-endian is also referring to the target as
arm64 (at least as far as toolchains go). Mostly they date from when arm64 was
a separate target and we *did* need a parallel name simply to test it at all.
Now aarch64_be is sufficient.

llvm-svn: 213744
2014-07-23 12:32:58 +00:00
Brad Smith 873d467bb6 Use the integrated assembler by default on OpenBSD/sparc.
llvm-svn: 213105
2014-07-15 23:07:10 +00:00
NAKAMURA Takumi 557fb62e80 Revert r211866, r211895 and r211995, "Driver: use GNU::Link for the Generic_GCC toolchain". It broke users of Generic_GCC, cygwin and mingw32.
It reverts commits as follows:
  r211866: "Driver: use GNU::Link for the Generic_GCC toolchain"
  r211895: "Replace GetProgramPath("ld") with GetLinkerPath()."
  r211995: "Driver: add a cygwin linker tool"

llvm-svn: 211998
2014-06-29 16:00:11 +00:00
Saleem Abdulrasool a4a474b859 Driver: add a cygwin linker tool
This adds a linker tool for the Windows cygwin environment.  This linker
invocation is significantly different from the generic ld invocation.  It
requires additional parameters as well as does not accept some normal
parameters.  This should fix self-hosting on Cygwin.

llvm-svn: 211995
2014-06-29 06:11:14 +00:00
Brad Smith 33db9e31e8 Use the integrated assembler by default on OpenBSD/powerpc.
llvm-svn: 211075
2014-06-16 23:03:00 +00:00
Rafael Espindola 2d401f5bb5 Use stack protector strong by default on OpenBSD.
Use stack protector strong by default to match the base OS and ports/packages
compiler policy.

Patch by Brad Smith.

llvm-svn: 209432
2014-05-22 12:52:35 +00:00
Simon Atanasyan 60280b4e65 [Driver] Do not lose already detected set of toolchain's multilibs while
iterating over different library path suffixes and different library versions.

To find the most appropriate library for the given command line flags we
iterate over a set of disk paths. Before probe each path the already
detected set of multilibs are cleared. If the set of paths contains
existing paths which do not satisfy command line flags or do not contain
necessary libraries and object files at all we might lose found multilibs.

The patch updates variables which hold detected multilibs if we really find
a new multilib matches command line flags.

The patch reviewed by Jon Roelofs.

llvm-svn: 208523
2014-05-12 07:37:51 +00:00
Richard Smith 51af519db3 Bitrig's standard C++ standard library changed from libstdc++ to libc++.
Also, it uses libc++abi and needs pthread.  While there, fix the libc++
include path. Patch by Patrick Wildt!

llvm-svn: 207813
2014-05-01 23:24:24 +00:00
Tim Northover a2ee433c8d ARM64: initial clang support commit.
This adds Clang support for the ARM64 backend. There are definitely
still some rough edges, so please bring up any issues you see with
this patch.

As with the LLVM commit though, we think it'll be more useful for
merging with AArch64 from within the tree.

llvm-svn: 205100
2014-03-29 15:09:45 +00:00
Tim Northover 336f189b61 Driver: implement addClangWarningOptions
This function allows certain platforms to enable or disable diagnostics
by default.

llvm-svn: 205095
2014-03-29 13:16:12 +00:00
Craig Topper 21beb40da5 Remove seemingly dead method. It was marked virtual but doesn't override anything and there don't seem to be any in tree callers.
llvm-svn: 203894
2014-03-14 06:04:02 +00:00
Craig Topper b45acb8a16 [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 203893
2014-03-14 06:02:07 +00:00
Ahmed Charles b89843299a Replace OwningPtr with std::unique_ptr.
This compiles cleanly with lldb/lld/clang-tools-extra/llvm.

llvm-svn: 203279
2014-03-07 20:03:18 +00:00
Craig Topper a798a9db93 Switch all uses of LLVM_OVERRIDE to just use 'override' directly.
llvm-svn: 202625
2014-03-02 09:32:10 +00:00
Alexey Samsonov e65ceb9f16 Respect ToolChain::isPIEDefault() in constructing link job on Linux and FreeBSD.
Partially based on http://llvm-reviews.chandlerc.com/D2644 by Viktor Kutuzov.

llvm-svn: 202150
2014-02-25 13:26:03 +00:00
Jonathan Roelofs 2cea1bea87 Add Multilib selection machinery
This patch improves the support for picking Multilibs from gcc installations.
It also provides a better approximation for the flags '-print-multi-directory'
and '-print-multi-lib'.

This reverts r201203 (i.e. re-applying r201202 with small fixes in
unittests/CMakeLists.txtto make the build bots happy).

review: http://llvm-reviews.chandlerc.com/D2538
llvm-svn: 201205
2014-02-12 03:21:20 +00:00
Jonathan Roelofs 3fa96d8378 Revert 201202
Breaks cmake configure of new unit tests directory

llvm-svn: 201203
2014-02-12 01:36:51 +00:00
Jonathan Roelofs 0e7ec60b74 Add Multilib selection machinery
This patch improves the support for picking Multilibs from gcc installations.
It also provides a better approximation for the flags '-print-multi-directory'
and '-print-multi-lib'.

review: http://llvm-reviews.chandlerc.com/D2538
llvm-svn: 201202
2014-02-12 01:29:25 +00:00
Tim Northover 157d911b42 MachO: use *-*-*-macho for MachO embedded targets.
Previously we had bodged together some hacks mapping MachO embedded
targets (i.e. mainly ARM v6M and v7M) to the "*-*-darwin-eabi" triple.
This is incorrect in both details (they don't run Darwin and they're
not EABI in any real sense).

This commit appropriates the existing "MachO" environment for the
purpose instead.

llvm-svn: 199367
2014-01-16 08:48:16 +00:00
Kristof Beyls fb38729d78 Enable -fuse-init-array for all AArch64 ELF targets by default, not just linux.
llvm-svn: 198940
2014-01-10 13:44:34 +00:00
Chandler Carruth 5553d0d4ca Sort all the #include lines with LLVM's utils/sort_includes.py which
encodes the canonical rules for LLVM's style. I noticed this had drifted
quite a bit when cleaning up LLVM, so wanted to clean up Clang as well.

llvm-svn: 198686
2014-01-07 11:51:46 +00:00
Roman Divacky 78589ecd50 Use the integrated assembler by default on FreeBSD/ppc and ppc64.
llvm-svn: 197521
2013-12-17 20:34:25 +00:00
Tim Northover 9c7e035656 Darwin-embedded: find correct libclang_rt for embedded targets.
This refactors some of the Darwin toolchain classification to give a more solid
distinction between the three primary Darwin platforms (OS X, IOS and IOS
simulator) so that a 4th choice can be added temporarily: embedded MachO
targets.

Longer term, this support will be factored out into a separate class and no
longer classified as "darwin-eabi", but the refactoring should still be useful.

llvm-svn: 197148
2013-12-12 11:55:52 +00:00
Renato Golin 1588cdaa4b Turning IAS on by default on ARM/Thumb
This is an experimental feature, where -integrated-as will be
on by default on ARM/Thumb. We aim to detect the missing features
so that the next release is stable.

Updating the ReleaseNotes, too.

Also moving the AArch64 into the same place.

llvm-svn: 197024
2013-12-11 09:35:10 +00:00
Roman Divacky 326d998cfa Move the body of GCCInstallationDetector ctor into an init() function
and call it from its only user. The linux toolchain. This saves quite
a lot of directory searching on other platforms.

llvm-svn: 196590
2013-12-06 18:32:18 +00:00
Simon Atanasyan 13e965a5c0 [Mips] Do not detect a used MIPS toolchain. Build a path suffix for FSF
toolchain first and check the path existence. If the path does not
exist build and check a path suffix for Code Sourcery toolchain.

llvm-svn: 195751
2013-11-26 11:57:14 +00:00
Rafael Espindola a8b3b680c3 Make the integrated assembler the default for cygwin/mingw too.
The integrated assembler was already the default for win32. It is now able
to handle a clang bootstrap on mingw, so make it the default.

llvm-svn: 195676
2013-11-25 18:50:53 +00:00
Rafael Espindola 8de3f11e94 remove gcc::Precompile
Clang still has support for running gcc for performing various stages
of a build. Right now it looks like this is used for

* Supporting Fortran in the clang driver
* Running an assembler or linker in systems we don't yet know how to
run them directly.

It looks like the gcc::Precompile is a vestige from the days when we
supported using clang for C and running gcc for c++. This patch removes it
(yes, we have no tests for it).

llvm-svn: 195586
2013-11-24 23:40:06 +00:00
Rafael Espindola 1462796cdd Remove the Darwin_Generic_GCC toolchain.
This is currently unused by any test. The code path would still be hit
by clang on ppc, but

* PPC has not been supported on current versions of OS X
* A port of current clang to older OS X on ppc should be using
toolchains::DarwinClang.

llvm-svn: 195585
2013-11-24 23:28:23 +00:00
Rafael Espindola d1821587c7 Remove two unused #ifdefs.
llvm-svn: 194983
2013-11-17 22:36:07 +00:00
Roman Divacky f0d7f94490 Add gold plugin support to the FreeBSD link driver.
llvm-svn: 194350
2013-11-10 09:31:43 +00:00
David Chisnall 867ccd865e Commit the changes to make libc++ the default on FreeBSD >= 10, rather than
just the test...

llvm-svn: 194333
2013-11-09 15:10:56 +00:00
Chandler Carruth 8677d92c9c Clean up the deeply misleading name of the "MultiLibSuffix". This is
actually a MIPS-only hack to shim in random ABI directory suffixes in
numerous places throughout the toolchain's path search. It shouldn't
appear to be anything more general or useful.

llvm-svn: 193595
2013-10-29 08:53:03 +00:00
Robert Lytton cf1dd692ae XCore target: add an xcore toolchain implementation
llvm-svn: 192437
2013-10-11 10:29:40 +00:00
Simon Atanasyan a61b7ecb2f [Mips] Support FSF Mips toolchain directories tree in the Clang driver.
The patch reviewed by Rafael Espindola.
http://llvm-reviews.chandlerc.com/D1843

llvm-svn: 192343
2013-10-10 07:57:44 +00:00
Simon Atanasyan a0d895733b Remove unused param from Linux::computeSysRoot().
llvm-svn: 192034
2013-10-05 14:37:55 +00:00
Simon Atanasyan ee1accf14e Separate construction of bi-arch path suffix from construction of
multi-library path suffix.

The code calculates MIPS toolchain specific multi-lib path suffixes like
mips16/soft-float/el is moved to the separate function
findMultiLibSuffix(). This function called during GCC installation
detection and result is stored for the future using.

The patch reviewed by Rafael Espindola.
http://llvm-reviews.chandlerc.com/D1738

llvm-svn: 191612
2013-09-28 13:45:11 +00:00
Chandler Carruth 1f2b2f8d45 Teach the Linux toolchain about more modern Gentoo installations of GCC
which add another wrinkle to the installation of the libstdc++ headers.

Add at least some basic testing of the weirdnesses of Gentoo's layout.

llvm-svn: 189212
2013-08-26 08:59:53 +00:00
Alexey Samsonov 609213f9eb Move SanitizerArgs to the clang Driver
Summary:
This change turns SanitizerArgs into high-level options
stored in the Driver, which are parsed lazily. This fixes an issue of multiple copies of the same diagnostic message produced by sanitizer arguments parser.

Reviewers: rsmith

Reviewed By: rsmith

CC: chandlerc, eugenis, cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1341

llvm-svn: 188660
2013-08-19 09:14:21 +00:00
Joerg Sonnenberger 51f358209f Build unwind tables by default on NetBSD.
llvm-svn: 188463
2013-08-15 15:08:33 +00:00
Joerg Sonnenberger 88d4c53e7d Use the integrated assembler on NetBSD/powerpc by default.
llvm-svn: 188462
2013-08-15 15:04:56 +00:00
Benjamin Kramer a97e4d1376 Enhance the clang -v gcc debug printing to skip obviously bad and duplicate paths.
Otherwise it lists all files (e.g. shared libraries) that happen to be in the
same paths the GCC installations usually reside in.

On a x86_64 Debian 7 system with i386 multilibs.
before: clang -v 2>&1|wc -l
        3059
after:  clang -v 2>&1|wc -l
        10

llvm-svn: 188400
2013-08-14 18:38:51 +00:00
Benjamin Kramer 604e848655 Add a convenient way to compare GCCVersions without creating temporary objects.
No functionality change.

llvm-svn: 188084
2013-08-09 17:17:48 +00:00
Chandler Carruth 0ae39aaefd Start keeping track of what work was done to detect a GCC installation
on the system, and report it when running the driver in verbose mode.
Without this it is essentially impossible to understand why a particular
GCC toolchain is used by Clang for libstdc++, libgcc, etc.

This also required threading a hook through the toolchain layers for
a specific toolchain implementation to print custom information under
'clang -v'. The naming here isn't spectacular. Suggestions welcome.

llvm-svn: 187427
2013-07-30 17:57:09 +00:00
Chandler Carruth b427c56399 Reword and reformat some of the "Multiarch" code in the toolchain setup.
There are fundamentally two different things that were getting conflated
here.

1) A bi-arch GCC toolchain install. This is not a full blown cross
   compiler, but it supports targetting both 32-bit and 64-bit variants
   of the same architecture using multilib OS installs and runtimes.

2) A "multiarch" Debian OS/runtime layout that lays out the libraries,
   headers, etc as-if there were going to be a full blown cross compiler
   even when in reality it is just a bi-arch GCC targeting two variants.
   Also, these tend to use oddly "canonicalized" triples without the
   vendor in them unlike the typical cross compiler runtime library
   search that vanilla GCC cross compilers perform.

Now, when we mean the bi-arch nature of GCC accomplished with just
a suffix or tweak to the GCC paths, we say 'Biarch' or something
related. When we mean the Debian layout of includes and libraries, we
say multiarch or reference the multiarch triple.

In the process of reading and often renaming stuff in all these places,
also reformat with clang-format. No functionality change should be going
on here, this is just tidying up.

llvm-svn: 184632
2013-06-22 11:35:51 +00:00
Reid Kleckner 724c21c05b [Driver] Remove the using namespace directives from headers
This adds a bunch of llvm::opt name specifiers to all the uses of types
from that namespace.

Reviewers: espindola

Differential Revision: http://llvm-reviews.chandlerc.com/D983

llvm-svn: 184079
2013-06-17 13:59:19 +00:00
Rafael Espindola 8fb2a7e7ac Try to fix the windows build.
llvm-svn: 183783
2013-06-11 20:06:05 +00:00
Rafael Espindola 044f783bc0 Default to PIE and using stack protection on OpenBSD.
Patch by Matthew Dempsky.

llvm-svn: 183295
2013-06-05 04:28:55 +00:00