Commit Graph

2304 Commits

Author SHA1 Message Date
Saleem Abdulrasool 37bf71828b Reapply SVN r274797.
Original Commit Message

    Driver: Stop linking to C++ when using sanitizers on Darwin

    Sanitizers on Darwin are built as dynamic libraries, not static libraries.
    Sanitizers will have their C++ dependency satisfied internally (LC_LOAD_DYLIB)
    in the libclang_rt dylib. As long as the sanitizers stay dynamic and not static,
    linking against C++ when enabling a sanitizer becomes over linkage.

    Patch by Dave Lee!

llvm-svn: 275032
2016-07-10 23:24:36 +00:00
David Majnemer 58fab355e2 [clang-cl] Add support for /Zd
MASM (ML.exe and ML64.exe) and older versions of MSVC (CL.exe) support a
flag called /Zd which is more-or-less -gline-tables-only.

It seems nicer to support this flag instead of exposing
-gline-tables-only.

llvm-svn: 274991
2016-07-09 21:49:16 +00:00
Yaxun Liu 79c99fb7eb [OpenCL] Add missing -cl-no-signed-zeros option into driver
Add OCL option -cl-no-signed-zeros to driver options.

Also added to opencl.cl testcases.

Patch by Aaron En Ye Shi.

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

llvm-svn: 274923
2016-07-08 20:28:29 +00:00
Justin Lebar 3e2576f968 Fix flag name in comment in cuda-version-check.cu.
llvm-svn: 274897
2016-07-08 17:59:24 +00:00
Saleem Abdulrasool c61723f73e Revert "Driver: Stop linking to C++ when using sanitizers on Darwin"
This reverts SVN r274797.  It broke the Green Dragon bot.  Revert it until the
failure can be addressed.

llvm-svn: 274814
2016-07-08 00:37:31 +00:00
Michael Kuperstein 123ae0f26b [CUDA] Pass correct option in test.
llvm-svn: 274805
2016-07-07 23:22:39 +00:00
Saleem Abdulrasool a1a36c85df Driver: Stop linking to C++ when using sanitizers on Darwin
Sanitizers on Darwin are built as dynamic libraries, not static libraries.
Sanitizers will have their C++ dependency satisfied internally (LC_LOAD_DYLIB)
in the libclang_rt dylib. As long as the sanitizers stay dynamic and not static,
linking against C++ when enabling a sanitizer becomes over linkage.

Patch by Dave Lee!

llvm-svn: 274797
2016-07-07 21:42:29 +00:00
Justin Lebar c43ad9ee5a [CUDA] Check that our CUDA install supports the requested architectures.
Summary:
Raise an error if you're using a CUDA installation that's too old for
the requested architectures.  In practice, this means that you need a
CUDA 8 install to compile for sm_6*.

Reviewers: tra

Subscribers: cfe-commits

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

llvm-svn: 274781
2016-07-07 18:17:52 +00:00
Jacob Baungard Hansen 1bf12828be [Sparc] Allow LEON cpu models to be selected with -mcpu
Summary: This change exposes the recently added LEON CPUs (D19359) in the LLVM Sparc backend to Clang, allowing the cpu's to be selected using the -mcpu flag.

Reviewers: jyknight, lero_chris

Subscribers: jyknight, cfe-commits

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

llvm-svn: 274487
2016-07-04 08:56:08 +00:00
Saleem Abdulrasool 1f5ceb0b5d Driver: support -L for MSVC toolchain under the GNU driver
When not using clang in the CL emulation mode, honour the -L flags as additional
library paths to pass to the linker invocation.

llvm-svn: 274356
2016-07-01 15:36:31 +00:00
Benjamin Kramer 0048964d84 Enable opencl driver tests, which never ran.
Then mark it as XFAIL because it always fails. I'll let OpenCL people
figure this out.

llvm-svn: 274221
2016-06-30 09:17:46 +00:00
Yaxun Liu b5f176e9bd [OpenCL] Allow -cl-std and other standard -cl- options in driver
Allow -cl-std and other standard -cl- options from cc1 to driver.

Added a test for the options moved.

Patch by Aaron En Ye Shi.

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

llvm-svn: 274150
2016-06-29 19:39:32 +00:00
Pankaj Gode 3267e843c5 [Driver][AArch64] Add support for Broadcom Vulcan core.
Adding support for new Broadcom Vulcan core (ARMv8.1A).

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

llvm-svn: 274114
2016-06-29 10:00:31 +00:00
Sean Silva 28dee56187 Revert "[PS4] Tighten up a test (noticed in passing)"
This reverts commit r269709.

r262285 changed this deliberately so that the test would not be
sensitive to which binaries are in the same directory as clang.
See the commit message of that commit for more background.

llvm-svn: 274084
2016-06-29 00:29:23 +00:00
David Majnemer 093012bf6e [clang-cl] Implement support for /std
/std: supports two arguments, c++14 and c++latest.  Currently, c++latest
maps to c++1z but this might change down the road.

llvm-svn: 273841
2016-06-27 02:32:12 +00:00
Rafael Espindola 0fa668072f Add support for musl-libc on ARM Linux.
Patch by Lei Zhang!

llvm-svn: 273735
2016-06-24 21:35:06 +00:00
Rafael Espindola c9d336e549 Restructure the propagation of -fPIC/-fPIE.
The PIC and PIE levels are not independent. In fact, if PIE is defined
it is always the same as PIC.

This is clear in the driver where ParsePICArgs returns a PIC level and
a IsPIE boolean. Unfortunately that is currently lost and we pass two
redundant levels down the pipeline.

This patch keeps a bool and a PIC level all the way down to codegen.

llvm-svn: 273566
2016-06-23 15:07:32 +00:00
Rafael Espindola 611b418d84 Make this test a bit more strict and fix it.
We do pass -pic-level to cc1 when targeting darwin. Given that codegen
itself doesn't use it, the only difference is whether __PIE__ and
__pie__ are defined.

llvm-svn: 273450
2016-06-22 18:04:52 +00:00
Hans Wennborg 44d061a471 Add support for /Ob1 and -finline-hint-functions flags
Add support for /Ob1 (and equivalent -finline-hint-functions), which enable
inlining only for functions marked inline, either explicitly (via inline
keyword, for example), or implicitly (function definition in class body,
for example).

This works by enabling inlining pass, and adding noinline attribute to
every function not marked inline.

Patch by Rudy Pons <rudy.pons@ilod.org>!

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

llvm-svn: 273440
2016-06-22 16:56:16 +00:00
Paul Robinson 6d5dc402a1 Make test less sensitive to the resource directory.
Same tactic as linux-header-search.cpp and android-ndk-standalone.cpp.

llvm-svn: 273158
2016-06-20 14:33:49 +00:00
Cong Liu 3688c4ca78 Add -fsyntax-only to Driver/opencl.cl test.
llvm-svn: 273150
2016-06-20 11:25:26 +00:00
Andrey Turetskiy e8e1ffef11 [X86] Add -mno-iamcu option.
Add -mno-iamcu option to:
  1) Countervail -miamcu option easily
  2) Be compatible with GCC which supports this option

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

llvm-svn: 273147
2016-06-20 10:31:39 +00:00
Paul Robinson dfcae38ede Revert "Make test less sensitive to the resource directory."
Will need to try this on an actual Windows system.

llvm-svn: 273102
2016-06-19 01:14:35 +00:00
Paul Robinson 27788f5694 Make test less sensitive to the resource directory.
Like linux-header-search.cpp and android-ndk-standalone.cpp.

llvm-svn: 273101
2016-06-18 23:26:37 +00:00
Saleem Abdulrasool 62d42cd088 test: support / and \ as directory separators
Windows uses \ as the directory separator and this causes the tests to fail on
Windows.

llvm-svn: 273036
2016-06-17 19:59:01 +00:00
Saleem Abdulrasool 003bd8c367 test: generalise the matching
Use a regex for the clang version as that will change all the time.

llvm-svn: 273018
2016-06-17 17:33:36 +00:00
Saleem Abdulrasool 88879e6559 Driver: introduce and use `-isystem-after` for cross-windows
This mirrors the many other -i*after options to insert a new system search
directory at the end of the search path.  This makes it possible to actually
inject a search path after the resource dir.  This option is similar in spirit
to the /imsvc option in the clang-cl driver.  This is needed to properly use the
driver for Windows targets where the clang headers wrap some of the system
headers.

This concept is actually useful on other targets (e.g. Linux) and would be
really easy to support on the core toolchain.

llvm-svn: 273016
2016-06-17 17:23:16 +00:00
Yaxun Liu b5044fe421 [OpenCL] Allow -std={cl|CL}{|1.1|1.2|2.0} in driver
Fix a regression which forbids using -std=cl|CL1.1|CL1.2|CL2.0 in driver.

Allow -std and -cl-std={cl|CL}{|1.1|1.2|2.0}.

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

llvm-svn: 273015
2016-06-17 17:19:28 +00:00
Bryan Chan d346ae6ee6 [Driver] Adapt Linux::GCCVersion::Parse to match GCC 5 installations
Summary:
Some GCC 5 installations store the libstdc++ includes and GCC-specific files in paths without 
the minor part of the version number, such as

  /usr/include/c++/5
  /usr/lib64/gcc/x86_64-suse-linux/5

Reviewers: cfe-commits, thiagomacieira, jroelofs

Subscribers: tinti, jroelofs

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

llvm-svn: 273012
2016-06-17 16:47:14 +00:00
Artem Belevich ce4ce7368f Minor fixes for miamcpu-opt.c test
Added -no-canonical-prefixes to make cc1 binary name more predictable.
Added appropriate REQUIRES keywords.

llvm-svn: 272947
2016-06-16 20:16:49 +00:00
Haojian Wu 00cfe279c1 A follow-up fixing on cuda-march.cu: Don't match clang to other place.
llvm-svn: 272890
2016-06-16 13:27:02 +00:00
Andrey Turetskiy 83491bb7a5 Patch "Compilation for Intel MCU (Part 2/3)" caused the clang-x64-ninja-win7
buildbot to fail because of inaccurate CHECK in the test. This is a quick fix
for the test to make it platform independent.

llvm-svn: 272887
2016-06-16 12:26:20 +00:00
Andrey Turetskiy c410548071 Compilation for Intel MCU (Part 3/3)
This is the last patch required to support compilation for Intel MCU target (e.g. Intel(R) Quark(TM) micro controller D 2000).

When IAMCU triple is used:
 * Use IAMCU linker output format
 * Link with IAMCU crt objects
 * Link with IAMCU libraries

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

llvm-svn: 272885
2016-06-16 10:49:27 +00:00
Andrey Turetskiy 4798eb6d59 Compilation for Intel MCU (Part 2/3)
This is the second patch required to support compilation for Intel MCU target (e.g. Intel(R) Quark(TM) micro controller D 2000).
When IAMCU triple is used:
 * Recognize and use IAMCU GCC toolchain
 * Set up include paths
 * Forbid C++

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

llvm-svn: 272883
2016-06-16 10:36:09 +00:00
NAKAMURA Takumi 6e72651e59 clang/test/Driver/cuda-march.cu: Tweak not to match "clang" to other place like "path-to-clang-foo".
llvm-svn: 272874
2016-06-16 06:08:09 +00:00
Justin Lebar 4db224e199 [CUDA] Don't pass top-level -march down to device cc1 or ptxas.
Summary:
Previously if you did e.g.

  $ clang -march=haswell -x cuda foo.cu

we would pass "-march=haswell -march=sm_20" down to the ptxas tool.
This causes it to assert, and rightly so!

Reviewers: tra

Subscribers: cfe-commits, echristo

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

llvm-svn: 272857
2016-06-15 23:46:11 +00:00
Evgeniy Stepanov 322f21908d Fix sanitizer-ld test.
llvm-svn: 272856
2016-06-15 23:29:26 +00:00
Evgeniy Stepanov aac94b1e2e Fix linking of DFSan + coverage.
Broken in r272717 because of no test coverage.

llvm-svn: 272853
2016-06-15 23:05:21 +00:00
Etienne Bergeron e28e7f234d Add support to clang-cl driver for /GS switch
Summary:
This patch is adding command-line support for the MSVC buffer security check.

The buffer security check is turned on with the '/GS' compiler switch.
https://msdn.microsoft.com/en-us/library/8dbf701c.aspx

The MSVC buffer security check in implemented here:
http://reviews.llvm.org/D20346

Reviewers: hans, rnk

Subscribers: chrisha, cfe-commits, rnk, hans, thakis

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

llvm-svn: 272832
2016-06-15 20:34:33 +00:00
Rafael Espindola b31478bf40 Add a few Musl related tests that already pass.
Patch by Lei Zhang.

llvm-svn: 272825
2016-06-15 20:02:22 +00:00
Evgeniy Stepanov 5c063c108a Fix sanitizer coverage support in the win32 driver.
--dependent-lib arguments for the sanitizer libraries must be emitted when
coverage is enabled w/o any sanitizers.

llvm-svn: 272735
2016-06-14 23:21:19 +00:00
Evgeniy Stepanov 5b49eb42c5 [sanitizer] Allow sanitize coverage w/o sanitizers.
The reason is that this (a) seems to work just fine and (b) useful when building stuff with
sanitizer+coverage, but need to exclude the sanitizer for a particular source file.

llvm-svn: 272717
2016-06-14 21:33:40 +00:00
Rafael Espindola 164fe34e98 Start adding support for Musl.
The two patches together enable clang to support targets like
"x86_64-pc-linux-musl" and build binaries against musl-libc instead of
glibc. This make it easy for clang to work on some musl-based systems
like Alpine Linux and certain flavors of Gentoo.

Patch by Lei Zhang.

llvm-svn: 272662
2016-06-14 12:47:24 +00:00
Daniel Sanders 32b2d6b160 [mips] Defer validity check for CPU/ABI pairs and improve error message for invalid cases.
Summary:
The validity of ABI/CPU pairs is no longer checked on the fly but is
instead checked after initialization. As a result, invalid CPU/ABI pairs
can be reported as being known but invalid instead of being unknown. For
example, we now emit:
  error: ABI 'n32' is not supported on CPU 'mips32r2'
instead of:
  error: unknown target ABI 'n64'

Reviewers: atanasyan

Subscribers: sdardis, cfe-commits

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

llvm-svn: 272645
2016-06-14 08:58:50 +00:00
Hans Wennborg 92375f55ed clang-cl: Support -resource-dir option (PR28074)
It's useful e.g. for distributed build systems.

llvm-svn: 272583
2016-06-13 20:31:30 +00:00
Paul Robinson f2a34a889d Capture the resource directory and use it for subsequent checks.
This is the same tactic used in linux-header-search.cpp.

llvm-svn: 272568
2016-06-13 17:41:05 +00:00
Chandler Carruth 1256cc818b Revert "Strip Android version when looking up toolchain paths."
This reverts commit r272413. The tests here have been failing on several
different build bots for over 10 hours.

llvm-svn: 272454
2016-06-11 04:57:29 +00:00
Saleem Abdulrasool 094f17beeb Driver: make it easier to select the SjLj EH model
GCC still permits enabling the SjLj EH model.  This is something which can be
done on various targets.  Hoist the -fsjlj-exceptions option into the driver and
pass it through.  This allows one to opt into the alternative EH model while
retaining the default to be the target's default.

Resolves PR27749!

llvm-svn: 272424
2016-06-10 20:12:00 +00:00
Josh Gao 4e9cef0491 Strip Android version when looking up toolchain paths.
Summary:
Android target triples can include a version number in the abi field
(e.g. 'aarch64-linux-android21'), used for checking for availability.
However, the driver was searching for toolchain binaries using the
passed in triple as a prefix.

Reviewers: srhines, danalbert, t.p.northover

Subscribers: t.p.northover, aemerson, tberghammer, danalbert, srhines, cfe-commits

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

llvm-svn: 272413
2016-06-10 18:30:33 +00:00
Strahinja Petrovic b859896815 This patch fixes target linker emulation for ARM 32 big endian.
llvm-svn: 272402
2016-06-10 16:09:20 +00:00