Commit Graph

2763 Commits

Author SHA1 Message Date
Kuba Brecka 2735a02572 Rename 'DarwinStaticLib' to 'DarwinLibName'
The former name doesn't make sense, we are using this parameter for both .a and .dylib libraries.

No functional change.

http://reviews.llvm.org/D6040

llvm-svn: 220939
2014-10-31 00:08:57 +00:00
Saleem Abdulrasool 56dd1ac16f Driver: remove a stray s that propagated in cross-windows
The option is '--allow-multiple-definition' not '--allow-multiple-definitions'.

llvm-svn: 220760
2014-10-28 03:15:02 +00:00
Viktor Kutuzov d553bcff4f Allow thread sanitizer in clang driver on FreeBSD
http://reviews.llvm.org/D5999

llvm-svn: 220680
2014-10-27 13:51:25 +00:00
Viktor Kutuzov 64df1f177b Revert rL220675 due to failures on check-clang
llvm-svn: 220677
2014-10-27 12:33:10 +00:00
Viktor Kutuzov bff42de11c Allow thread sanitizer in clang driver on FreeBSD
Differential Revision: http://reviews.llvm.org/D5994

llvm-svn: 220675
2014-10-27 11:26:01 +00:00
Saleem Abdulrasool f0ba6ce309 Driver: reduce search logic duplication
Refactor the path search into a helper function to avoid duplicating the path
handling for the search.  NFC.

llvm-svn: 220628
2014-10-25 23:33:21 +00:00
Saleem Abdulrasool eeafce17e6 Driver: assume that all architectures are supported for libstc++
Rather than asserting that the target is unsupported, make a guess at what the
tree for a port would look like and use that for the search path.

Addresses review comments from Ried Kleckner for SVN r220547.

llvm-svn: 220624
2014-10-25 20:48:35 +00:00
Oliver Stannard abed2eeaea [Thumb] Clang thinks "char" is signed when using a thumb triple
'char' is unsigned on all ARM and Thumb architectures. Clang gets this
right for ARM, and for thumb when using and arm triple and the -mthumb
option, but gets it wrong for thumb triples. This fixes that.

llvm-svn: 220555
2014-10-24 11:28:47 +00:00
Saleem Abdulrasool 432f461e4d Driver: add missed file from previous commit
llvm-svn: 220547
2014-10-24 03:24:33 +00:00
Saleem Abdulrasool 543a78b55e Driver: add CrossWindowsToolChain
This is a very basic toolchain.  It supports cross-compiling Windows (primarily
inspired by the WoA target).  It is meant to use clang with the LLVM IAS and a
binutils ld-compatible interface for the linker (eventually to be lld).  It does
not perform any "standard" GCC lookup, nor does it perform any special
adjustments given that it is expected to be used in an environment where the
user is using MSVCRT (and as such Visual Studio headers) and the Windows SDK.
The primary runtime library is expected to be compiler-rt and the C++
implementation to be libc++.

It also expects that a sysroot has been setup given the usual Unix semantics
(standard C headers in /usr/include, all the import libraries available in
/usr/lib).  It also expects that an entry point stub is present in /usr/lib
(crtbegin.obj for executables, crtbeginS.obj for shared libraries).

The entry point stub is responsible for running any GNU constructors.

llvm-svn: 220546
2014-10-24 03:13:37 +00:00
Alexey Samsonov ecfd5c84ca Revert r218541 - Don't link in sanitizer runtimes if -nostdlib/-nodefaultlibs is provided.
This is a sad thing to do, but all the alternatives look ugly.

Looks like there are legitimate cases when users may want to link
with sanitizer runtimes *and* -nodefaultlibs (and ensure they provide
replacements for system libraries). For example, this happens in libc++
test suite.

"-nodefaultlibs" is told to link only the libraries explicitly provided
by the user, and providing "-fsanitize=address" is a clear indication of
intention to link with ASan runtime.
We can't easily introduce analogue of "-print-libgcc-name": linking with
sanitizers runtimes is not trivial: some runtimes are split into several
archive libraries, which are required to be wrapped in
-whole-archive/-no-whole-archive.

If "-fsanitize=whatever" and "-nodefaultlibs" are provided, system library
dependencies of sanitizer runtimes (-lc/-ldl/-lpthread/-lrt) will *not* be
linked, and user would have to link them in manually. Note that this can
cause problems, as failing to provide "-lrt" might lead to crashes in runtime
during ASan initialization. But looks like we should bite this bullet.

See r218541 review thread for the discussion.

llvm-svn: 220455
2014-10-23 00:46:10 +00:00
Zachary Turner 34eb943fb2 Fix C++ compliance issue. string literals must be const char *
llvm-svn: 220434
2014-10-22 21:48:56 +00:00
Zachary Turner 10d75b2f95 Make a good guess about where MSVC and Windows SDK libraries are for linking.
When a user has not configured a standard Visual Studio environment
by running vcvarsall, clang tries its best to find Visual Studio
include files and executables anyway.  This patch makes clang also
try to find system and Windows SDK libraries for linking against,
as well.

Reviewed by: Hans Wennborg
Differential Revision: http://reviews.llvm.org/D5873

llvm-svn: 220425
2014-10-22 20:40:43 +00:00
Zachary Turner 0eaf8fc4ac Resubmit "Improve Windows toolchain support for non-standard environments."
This resubmits change r220226.  That change broke the chromium
build bots because chromium it ships an hermetic MSVC toolchain
that it expects clang to fallback to by finding it on the path.

This patch fixes the issue by bumping up the prioritization of PATH
when looking for MSVC binaries.

Reviewed by: Hans Wennborg, Reid Kleckner
Differential Revision: http://reviews.llvm.org/D5892

llvm-svn: 220424
2014-10-22 20:40:28 +00:00
Saleem Abdulrasool 819f391dae Driver: rename Windows to MSVCToolChain
This renames the Windows toolchain to MSVCToolChain.  This is a preparatory step
for adding a CrossWindowsToolChain which uses clang/libc++/(ld/lld) without the
standard GCC toolchain lookup.  NFC.

llvm-svn: 220362
2014-10-22 02:37:29 +00:00
Richard Smith e842a47452 [modules] Initial support for explicitly loading .pcm files.
Implicit module builds are not well-suited to a lot of build systems. In
particular, they fare badly in distributed build systems, and they lead to
build artifacts that are not tracked as part of the usual dependency management
process. This change allows explicitly-built module files (which are already
supported through the -emit-module flag) to be explicitly loaded into a build,
allowing build systems to opt to manage module builds and dependencies
themselves.

This is only the first step in supporting such configurations, and it should
be considered experimental and subject to change or removal for now.

llvm-svn: 220359
2014-10-22 02:05:46 +00:00
Aaron Ballman 9d35e2e70e Removing unused variable (assigned into, but never read from); NFC.
llvm-svn: 220313
2014-10-21 19:37:56 +00:00
Hal Finkel 4add5dc093 Treat -g1 as -gline-tables-only
-g1 on gcc (and also IBM's xlc) are documented to be very similar to
-gline-tables-only. Our -gline-tables-only might still be more verbose than -g1
on other compilers, but currently we treat -g1 as -g, and so we're producing
much more debug info at -g1 than everybody else. Treating -g1 as
-gline-tables-only brings us much closer to what everyone else is doing.

For more information, see the discussion on
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-October/039649.html

llvm-svn: 220311
2014-10-21 19:20:21 +00:00
Justin Bogner 33bdbc66d3 Driver: Quote the command in crash reproduction scripts.
This fixes crash report generation when filenames have spaces. It also
removes an awkward workaround that quoted *some* arguments when
generating crash reports.

llvm-svn: 220307
2014-10-21 18:03:08 +00:00
Justin Bogner 256451561c Driver: Move crash report command mangling into Command::Print
This pushes the logic for generating a crash reproduction script
entirely into Command::Print, instead of Command doing half of the
work and then relying on textual substitution for the rest. This makes
this logic much easier to read and will simplify fixing a couple of
issues in this area.

llvm-svn: 220305
2014-10-21 17:24:44 +00:00
Hans Wennborg e6b994eb93 Revert "Improve Windows toolchain support for non-standard environments." (r220226)
In environments where PATH was set to point to the VS installation, Clang would
override that by looking in the registry and finding the latest VS installation.

If the environment is set up to point to a VS installation, that should take
precedence.

Reverting this until we can fix it.

llvm-svn: 220243
2014-10-20 23:26:03 +00:00
Justin Bogner 659ecc3120 Driver: Consolidate the logic for naming the module crashdump cache
List the module cache we use for crashdumps as a tempfile. This
simplifies how we pick up this directory when generating the actual
crash diagnostic and removes some duplicate logic.

llvm-svn: 220241
2014-10-20 22:47:23 +00:00
Justin Bogner c1fdf7fa11 Driver: Name crashdump scripts after the first temp file
In practice there's only ever one temporary output file when
generating a crashdump, but even if there were many iterating over
each and creating a duplicate run script for each one wouldn't make
very much sense.

This updates the behaviour to only generate the script once, based on
the first filename.

This should make it more reasonable to generate extra output files to
include in the crashdump going forward, so I've also added a FIXME to
look into doing just that with the extra module crashdump files.

llvm-svn: 220238
2014-10-20 21:47:56 +00:00
Justin Bogner bc89b18c4e Driver: Use an early return instead of a long if condition (NFC)
This just flattens an if block by returning early on the "else"
condition.

llvm-svn: 220235
2014-10-20 21:20:27 +00:00
Justin Bogner e1a33d1e4c Driver: Make FailingCommand mandatory for generateCompilationDiagnostics
We currently use a null FailingCommand when generating crash reports
as an indication that the cause is FORCE_CLANG_DIAGNOSTICS_CRASH, the
environment variable that exists to test crash dumps. This means that
our tests don't actually cover real crashes at all, and adds a more
complicated code path that's only used in the tests.

Instead, we can have the driver synthesize that every command failed
and just call generateCompilationDiagnostics normally.

llvm-svn: 220234
2014-10-20 21:02:05 +00:00
Zachary Turner 63350417e1 Improve Windows toolchain support for non-standard environments.
Typically clang finds Visual Studio by the user explicitly setting
up a Visual Studio environment via vcvarsall.  But we still try to
behave intelligently and fallback to different methods of finding
Visual Studio when this is not done.  This patch improves various
fallback codepaths to make Visual Studio locating more robust.

Specifically, this patch:

* Adds support for searching environment variables for VS 12.0
* Correctly locates include folders for Windows SDK 8.x (this was
  previously broken, and would cause clang to error)
* Prefers locating link.exe in the same location as cl.exe.  This
  is helpful in case another link.exe is in the path earlier than
  Visual Studio (e.g. GnuWin32)
* Minor cleanup in the registry reading code to make it more
  robust in the presence of long pathnames.

llvm-svn: 220226
2014-10-20 20:08:04 +00:00
Benjamin Kramer 6ec434e8bf Use non-member begin/end for a slight readability improvement.
llvm-svn: 220140
2014-10-18 10:43:51 +00:00
Richard Smith 9887d79af5 PR21215: Support -fmodule-map-file being specified multiple times. Support
loading multiple module map files from the same directory.

llvm-svn: 220020
2014-10-17 01:42:53 +00:00
Bradley Smith 04ee8aa1fc [AArch64] Enable A53 erratum workaround (835769) by default for Android targets
llvm-svn: 219933
2014-10-16 16:35:14 +00:00
Alexander Eremin 670c62770e specify dwarf version for Solaris
llvm-svn: 219901
2014-10-16 05:55:24 +00:00
Ehsan Akhgari e0db196556 clang-cl: Diagnose the usage of ASAN with a debug runtime library
Summary:
AddressSanitizer currently doesn't support this configuration, and binaries
built with it will just get into an infinite loop during startup.

Test Plan: Includes an automated test.

Reviewers: samsonov

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D5764

llvm-svn: 219744
2014-10-14 23:15:44 +00:00
Renato Golin 5886bc35b0 Adds support for the Cortex-A17 processor to Clang
Patch by Matthew Wahab.

llvm-svn: 219607
2014-10-13 10:22:48 +00:00
Bradley Smith 9ff64332a0 [AArch64] Add workaround for Cortex-A53 erratum (835769)
Some early revisions of the Cortex-A53 have an erratum (835769) whereby it is
possible for a 64-bit multiply-accumulate instruction in AArch64 state to
generate an incorrect result.  The details are quite complex and hard to
determine statically, since branches in the code may exist in some
circumstances, but all cases end with a memory (load, store, or prefetch)
instruction followed immediately by the multiply-accumulate operation.

The safest work-around for this issue is to make the compiler avoid emitting
multiply-accumulate instructions immediately after memory instructions and the
simplest way to do this is to insert a NOP.

This patch implements clang options to enable this workaround in the backend.

The work-around code generation is not enabled by default.

llvm-svn: 219604
2014-10-13 10:16:06 +00:00
Bob Wilson 7f294b54b3 Treat -mios-simulator-version-min option as an alias for -mios-version-min.
We can safely rely on the architecture to distinguish iOS device builds from
iOS simulator builds. We already have code to do that, in fact. This simplifies
some of the error checking for the option handling.

llvm-svn: 219545
2014-10-10 23:10:10 +00:00
Bob Wilson f42585fd96 Remove rest of the comment that is no longer true after r219527.
llvm-svn: 219528
2014-10-10 19:59:18 +00:00
Bob Wilson 771b7cd812 Remove a FIXME: use the ios_simulator_version_min linker option consistently.
This was previously only used when explicitly requested with a command line
option because it had to work with some old versions of the linker when it
was first introduced. That is ancient history now, and it should be safe to
use the correct option even when using the IPHONEOS_DEPLOYMENT_TARGET
environment variable to specify that the target is the iOS simulator.
Besides updating the test for this, I also added a few more tests for the
iOS linker options.

llvm-svn: 219527
2014-10-10 19:38:34 +00:00
Bob Wilson 43ec870a73 Remove support for the IOS_SIMULATOR_DEPLOYMENT_TARGET env var.
It turns out that this was never used. Instead we just use the
IPHONEOS_DEPLOYMENT_TARGET variable for both iOS devices and simulator.
rdar://problem/18596744

llvm-svn: 219467
2014-10-10 03:12:15 +00:00
Dan Albert a4ec57c2c5 Hopefully fixes test failures for msvc.
Looks like llvm::sys::path::filename() was canonicalizing my paths
before emitting them for FileCheck to stumble over.

Fix a style nit with r219460 while I'm at it.

llvm-svn: 219464
2014-10-10 02:26:00 +00:00
Dan Albert b8e7eaedcb PR21195: Emit .gcno files to the proper location.
When building with coverage, -no-integrated-as, and -c, the driver was
emitting -cc1 -coverage-file pointing at a file in /tmp. Ensure the
coverage file is emitted in the same directory as the output file.

llvm-svn: 219460
2014-10-10 01:01:29 +00:00
Ulrich Weigand 55f66f77fe [SystemZ] Turn on the integrated assembler by default
llvm-svn: 219426
2014-10-09 18:46:38 +00:00
Kostya Serebryany aed71a89bc Add experimental clang/driver flag -fsanitize-address-field-padding=N
Summary:
This change adds an experimental flag -fsanitize-address-field-padding=N (0, 1, 2)
to clang and driver. With this flag ASAN will be able to detect some cases of
intra-object-overflow bugs,
see https://code.google.com/p/address-sanitizer/wiki/IntraObjectOverflow

There is no actual functionality here yet, just the flag parsing.
The functionality is being reviewed at http://reviews.llvm.org/D5687

Test Plan: Build and run SPEC, LLVM Bootstrap, Chrome with this flag.

Reviewers: samsonov

Reviewed By: samsonov

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D5676

llvm-svn: 219417
2014-10-09 17:53:04 +00:00
Jonathan Roelofs 2b00d54676 Emit diagnostic for -munaligned-access on v6m
Patch by: Charlie Turner <charlie.turner@arm.com>

llvm-svn: 219211
2014-10-07 15:11:32 +00:00
Rafael Espindola 6ff5f2e13b Remove cases that are now handled by the parent class implementation.
llvm-svn: 219132
2014-10-06 17:45:47 +00:00
Eric Christopher 7647109917 Turn on the integrated assembler by default for ppc64 and
ppc64le.

Reviewed by Hal Finkel and Bill Schmidt.

llvm-svn: 219129
2014-10-06 17:33:18 +00:00
Jonathan Roelofs b140a100a0 CFE Knob for: Add a thread-model knob for lowering atomics on baremetal & single threaded systems
http://reviews.llvm.org/D4985

llvm-svn: 219027
2014-10-03 21:57:44 +00:00
Asiri Rathnayake 9e3c7cbfa1 Revert changes in r218863, r218864
Summary: The changes introduced in the above two commits are giving
a rough time to one of the build bots. Reverting the changes for the
moment so that the bot can go green again.

Change-Id: Id19f6cb2a8bc292631fac2262268927563d820c2
llvm-svn: 218970
2014-10-03 09:11:41 +00:00
Justin Bogner aab9792b6c Driver: Use pointee_iterator rather than iterating over unique_ptrs
There's probably never a good reason to iterate over unique_ptrs. This
lets us use range-for and say Job.foo instead of (*it)->foo in a few
places.

llvm-svn: 218938
2014-10-03 01:04:53 +00:00
Asiri Rathnayake fcd41ce5ae [ARM] Handle conflicts between -mfpu and -mfloat-abi options.
Summary: This patch implements warnings/downgradable errors for
invalid -mfpu, -mfloat-abi option combinations (e.g. -mfpu=none
-mfloat-abi=hard).

Change-Id: I94fa664e1bc0b5855ad835abd7a50a3e0395632d
llvm-svn: 218863
2014-10-02 09:56:07 +00:00
Fariborz Jahanian 5afc869f96 Adds 'override' to overriding methods. NFC.
These were uncoveredby my yet undelivered patch.

llvm-svn: 218774
2014-10-01 16:56:40 +00:00
Oliver Stannard bfd3ea32b7 [ARM] Add support for Cortex-M7, FPv5-SP and FPv5-DP
The Cortex-M7 has 3 options for its FPU: none, FPv5-SP-D16 and
FPv5-DP-D16. FPv5 has the same instructions as FP-ARMv8, so it can be
modeled using the same target feature, and all double-precision
operations are already disabled by the fp-only-sp target features.

llvm-svn: 218748
2014-10-01 09:03:02 +00:00