Commit Graph

3103 Commits

Author SHA1 Message Date
Evgeniy Stepanov 072b1a2d6c Enable msan unconditionally on Linux.
Memory sanitizer compatibility are already done in
MemorySanitizer::doInitialization. It verifies whether the necessary offsets
exist and bails out if not. For this reason it is no good to duplicate two
checks in two projects. This patch removes clang check and postpones msan
compatibility validation till MemorySanitizer::doInitialization.

Another reason for this patch is to allow using msan with any CPU (given
compatible runtime) and custom mapping provided via the arguments added by
https://reviews.llvm.org/D44926.

Patch by vit9696.

Differential Revision: https://reviews.llvm.org/D44927

llvm-svn: 329241
2018-04-04 23:48:06 +00:00
Peter Collingbourne f11eb3ebe7 AArch64: Implement support for the shadowcallstack attribute.
The implementation of shadow call stack on aarch64 is quite different to
the implementation on x86_64. Instead of reserving a segment register for
the shadow call stack, we reserve the platform register, x18. Any function
that spills lr to sp also spills it to the shadow call stack, a pointer to
which is stored in x18.

Differential Revision: https://reviews.llvm.org/D45239

llvm-svn: 329236
2018-04-04 21:55:44 +00:00
Dan Albert e00799ea04 [Driver] Include the Android multiarch includes.
Summary:
Most Android headers live in a single directory, but a small handful
live in multiarch directories.

Reviewers: srhines

Reviewed By: srhines

Subscribers: javed.absar, cfe-commits

Differential Revision: https://reviews.llvm.org/D44995

llvm-svn: 329234
2018-04-04 21:28:34 +00:00
Yaxun Liu 8a5fc15aa4 [CUDA] Add amdgpu sub archs
Patch by Greg Rodgers.
Revised and lit tests added by Yaxun Liu.

Differential Revision: https://reviews.llvm.org/D45277

llvm-svn: 329232
2018-04-04 21:19:27 +00:00
Alex Lorenz 8427e94b54 Split test/Driver/darwin-sdkroot.c into two tests
The test additions in r329110 are Darwin-specific, as they rely
on a code path that is reachabled when driver is invoked without
-target. Instead of making the old test checks Darwin-specific too,
let's simply split it into two files to ensure that the old
checks are still platform-agnostic. Thanks Chandler for
suggesting this!

llvm-svn: 329141
2018-04-04 02:11:20 +00:00
Vlad Tsyrklevich e55aa03ad4 Add the -fsanitize=shadow-call-stack flag
Summary:
Add support for the -fsanitize=shadow-call-stack flag which causes clang
to add ShadowCallStack attribute to functions compiled with that flag
enabled.

Reviewers: pcc, kcc

Reviewed By: pcc, kcc

Subscribers: cryptoad, cfe-commits, kcc

Differential Revision: https://reviews.llvm.org/D44801

llvm-svn: 329122
2018-04-03 22:33:53 +00:00
Alex Lorenz ce8766b2fd Add REQUIRES: darwin-system to test/Driver/darwin-sdkroot.c
The test from r329110 is for Darwin only

llvm-svn: 329113
2018-04-03 21:10:26 +00:00
Alex Lorenz 9114eb40b5 [driver][darwin] Do not infer -simulator environment for non-simulator SDKs
rdar://36369832

llvm-svn: 329110
2018-04-03 20:50:05 +00:00
Krzysztof Parzyszek 3163610010 [Hexagon] Remove -mhvx-double and the corresponding subtarget feature
Specifying the HVX vector length should be done via the -mhvx-length
option.

llvm-svn: 329077
2018-04-03 15:59:10 +00:00
Petr Hosek bae4856d31 [Driver] Wire up the -f[no-]rtlib-add-rpath flag and tests
D30700 added the -f[no-]rtlib-add-rpath flag, but that flag was never
wired up in the driver and tests were updated to check whether it
actually does anything. This patch wires up the flag and updates test.

Differential Revision: https://reviews.llvm.org/D45145

llvm-svn: 329032
2018-04-02 23:36:14 +00:00
Eli Friedman 1ad23a494b Remove unused CHECK lines leftover from r306928.
The RUN lines were removed, but the corresponding CHECK lines never
went away.

llvm-svn: 328891
2018-03-30 18:39:28 +00:00
Zhihao Yuan 0132baad7e [test] Fix an XRay test on FreeBSD
Summary: Fixing clang-test on FreeBSD as a follow-up of https://reviews.llvm.org/D43378 to handle the revert happened in r325749.

Reviewers: devnexen, krytarowski, dberris

Subscribers: emaste, dberris, cfe-commits

Differential Revision: https://reviews.llvm.org/D45002

llvm-svn: 328797
2018-03-29 15:50:44 +00:00
Shiva Chen 203917e26e [PATCH] [RISCV] Verify the input value of -march=
Summary:
This patch doing more check and verify the -march= string and will issue
an error if it's a invalid combination.

Reviewers: asb, apazos

Differential Revision: https://reviews.llvm.org/D44189

Patch by Kito Cheng.

llvm-svn: 328690
2018-03-28 08:29:50 +00:00
Alex Shlyapnikov 0a20cefffd [HWASan] Port HWASan to Linux x86-64 (clang)
Summary: Porting HWASan to Linux x86-64, the third of the three patches, clang part.

Reviewers: eugenis

Subscribers: cryptoad, cfe-commits

Differential Revision: https://reviews.llvm.org/D44745

llvm-svn: 328361
2018-03-23 19:47:45 +00:00
Artem Belevich 4c86af7579 [CUDA] add REQUIRES fields for CUDA variants of LTO tests.
Also relax checking for nvptx triple. This should avoid test failure if
the test is executed on 32-bit platform.

llvm-svn: 328213
2018-03-22 16:47:41 +00:00
Artem Belevich ecb178bb35 [CUDA] Disable LTO for device-side compilations.
This fixes host-side LTO during CUDA compilation. Before, LTO
pipeline construction was clashing with CUDA pipeline construction.

At the moment there's no point doing LTO on device side as each
device-side TU is a complete program.  We will need to figure out
compilation pipeline construction for the device-side LTO when we
have working support for multi-TU device-side CUDA compilation.

Differential Revision: https://reviews.llvm.org/D44691

llvm-svn: 328161
2018-03-21 22:22:59 +00:00
Petr Hosek 5559144206 Allow builtins for Cross-DSO CFI on Android
This is needed to avoid the test failure in case when compiler-rt
is set as the default runtime library for Clang.

Differential Revision: https://reviews.llvm.org/D44655

llvm-svn: 327932
2018-03-20 00:56:08 +00:00
Gheorghe-Teodor Bercea 0d5aa84ad9 [OpenMP] Add flag for linking runtime bitcode library
Summary: This patch adds an additional flag to the OpenMP device offloading toolchain to link in the runtime library bitcode.

Reviewers: Hahnfeld, ABataev, carlo.bertolli, caomhin, grokos, hfinkel

Reviewed By: ABataev, grokos

Subscribers: jholewinski, guansong, cfe-commits

Differential Revision: https://reviews.llvm.org/D43197

llvm-svn: 327460
2018-03-13 23:19:52 +00:00
Gheorghe-Teodor Bercea 0805b80a73 Revert revision 327438.
llvm-svn: 327447
2018-03-13 20:50:12 +00:00
Gheorghe-Teodor Bercea 148046c11b [OpenMP] Add flag for linking runtime bitcode library
Summary: This patch adds an additional flag to the OpenMP device offloading toolchain to link in the runtime library bitcode.

Reviewers: Hahnfeld, ABataev, carlo.bertolli, caomhin, grokos, hfinkel

Reviewed By: ABataev, grokos

Subscribers: jholewinski, guansong, cfe-commits

Differential Revision: https://reviews.llvm.org/D43197

llvm-svn: 327438
2018-03-13 19:39:19 +00:00
Krzysztof Parzyszek 06507fd283 [Hexagon] Clang side of r327302 in LLVM
Add option -m[no-]packets to control generation of instruction packets
(enabled by default).

llvm-svn: 327393
2018-03-13 13:30:43 +00:00
Vedant Kumar 0899948f7f Check that ubsan is the only supported sanitizer on OpenBSD
Patch by David Carlier!

Differential Revision: https://reviews.llvm.org/D44069

llvm-svn: 327317
2018-03-12 19:18:51 +00:00
Akira Hatanaka 9f9d766037 [Driver] Pass Default=false to hasFlag.
I forgot to do this in r326530.

llvm-svn: 327204
2018-03-10 05:55:21 +00:00
Evgeniy Stepanov d48c0cd910 Don't use -pie in relocatable link.
Summary:
Android, in particular, got PIE enabled by default in r316606. It resulted in
relocatable links passing both -r and -pie to the linker, which is not allowed.

Reviewers: srhines

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D44229

llvm-svn: 327165
2018-03-09 19:35:16 +00:00
Petr Hosek fdcbcfb040 [Driver] Enable SafeStack by default on Fuchsia
This is already used throughout the entire system, so make it a default.

Differential Revision: https://reviews.llvm.org/D44065

llvm-svn: 326867
2018-03-07 02:49:58 +00:00
Yuka Takahashi 41789e46a6 [Bash-autocompletion] Pass all flags in shell command-line to Clang
Previously, we passed "#" to --autocomplete to indicate to enable cc1
flags. For example, when -cc1 or -Xclang was passed to bash, bash
executed `clang --autocomplete=#-<flag they want to complete>`.

However, this was not a good implementation because it depends -Xclang
and -cc1 parsing to shell. So I changed this to pass all flags shell
has, so that Clang can handle them internally.

I had to change many testcases because API spec changed quite a lot.

Reviewers: teemperor, v.g.vassilev

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D39342

llvm-svn: 326684
2018-03-05 08:54:20 +00:00
Kamil Rytarowski 51965f877b Disable tests of -fsanitize on OpenBSD
This causes failures on buildbots:
/export/users/atombot/llvm/clang-atom-d525-fedora-rel/llvm/tools/clang/test/Driver/fsanitize.c:18:29: error: expected string not found in input
// CHECK-UNDEFINED-OPENBSD: "-fsanitize={{((signed-integer-overflow|integer-divide-by-zero|float-divide-by-zero|shift-base|shift-exponent|unreachable|return|vla-bound|alignment|null|pointer-overflow|float-cast-overflow|array-bounds|enum|bool|builtin|returns-nonnull-attribute|nonnull-attribute),?){18}"}}
                            ^
<stdin>:1:1: note: scanning from here
clang version 7.0.0 (trunk 326648)
^

This will be investigated.

llvm-svn: 326652
2018-03-03 12:28:54 +00:00
Erich Keane 0c4457b952 Remove -i command line option, add -imultilib
I discovered that '-i' is a command line option for the driver,
however it actually does not do anything and is not supported by any
other compiler. In fact, it is completely undocumented for Clang.

I found a couple of instances of people confusing it with one of
the variety of other command line options that control the driver.
Because of this, we should delete this option so that it is clear
that it isn't valid.

HOWEVER, I found that GCC DOES support -imultilib, which the -i
was hiding our lack of support for. We currently only use imultilib
for the purpose of forwarding to gfortran (in a specific test written
  by chandlerc for this purpose).

  imultilib is a rarely used (if ever?) feature that I could find no
  references to on the internet, and in fact, my company's massive test
  suite has zero references to it ever being used.

  SO, this patch removes the -i option so that we will now give an error
  on its usage (so that it won't be confused with -I), and replaces it with
  -imultilib, which is now specified as a gfortran_group option.

Differential Revision: https://reviews.llvm.org/D44032

llvm-svn: 326623
2018-03-02 21:53:25 +00:00
Akira Hatanaka 627586b850 Add an option to disable tail-call optimization for escaping blocks.
This makes it easier to debug crashes and hangs in block functions since
users can easily find out where the block is called from. The option
doesn't disable tail-calls from non-escaping blocks since non-escaping
blocks are not as hard to debug as escaping blocks.

rdar://problem/35758207

Differential Revision: https://reviews.llvm.org/D43841

llvm-svn: 326530
2018-03-02 01:53:15 +00:00
Chih-Hung Hsieh ca552b8d31 [Driver] Pass -f[no-]emulated-tls and set up ExplicitEmulatedTLS
Since LLVM r326341, default EmulatedTLS mode is decided in backend
according to target triple. Any front-end should pass -f[no]-emulated-tls
to backend and set up ExplicitEmulatedTLS only when the flags are used.

Differential Revision: https://reviews.llvm.org/D43965

llvm-svn: 326499
2018-03-01 22:26:19 +00:00
Saleem Abdulrasool cc6238158a Driver: hoist `-fno-rtti-data` to a driver flag
This is needed for building with the GNU driver (`clang++`) when
targeting Windows and using msvcprt.  This flag is the equivalent of
`/GR-`.

llvm-svn: 326469
2018-03-01 19:13:43 +00:00
Nico Weber 926bbc0256 Attempt to fix cl-include.c on Windows.
llvm-svn: 326370
2018-02-28 20:58:06 +00:00
Krzysztof Parzyszek fde8b04235 [Hexagon] Add -ffixed-r19 driver option and translate it to +reserved-r19
llvm-svn: 326366
2018-02-28 20:31:55 +00:00
Nico Weber 07f0a52c7f [clang-cl] Implement /X
/X makes cl stop looking in %INCLUDE%. Implement this for clang-cl.

As it turns out, the return in ToolChains/MSVC.cpp, AddClangSystemIncludeArgs()
for -nostdlibinc is already in the right place (but -nostdlibinc isn't exposed
by clang-cl), so just alias /X to that.

https://reviews.llvm.org/D43888

llvm-svn: 326357
2018-02-28 19:49:07 +00:00
Jonas Hahnfeld e768132f94 [CUDA] Include single GPU binary, NFCI.
Binaries for multiple architectures are combined by fatbinary,
so the current code was effectively not needed.

Differential Revision: https://reviews.llvm.org/D43461

llvm-svn: 326342
2018-02-28 17:53:46 +00:00
Konstantin Zhuravlyov 419889e266 AMDGPU: Move run and check lines around to match processor order in AMDGPU.h
llvm-svn: 326278
2018-02-28 00:27:00 +00:00
Konstantin Zhuravlyov d6b3453bdb AMDGPU: Define FP_FAST_FMA{F} macros for amdgcn
- Expand GK_*s (i.e. GFX6 -> GFX600, GFX601, etc.)
  - This allows us to choose features correctly in some cases (for example, fast fmaf is available on gfx600, but not gfx601)
- Move HasFMAF, HasFP64, HasLDEXPF to GPUInfo tables
- Add HasFastFMA, HasFastFMAF to GPUInfo tables
- Add missing tests

llvm-svn: 326254
2018-02-27 21:48:05 +00:00
Martin Storsjo ca4a24eb72 [MinGW, CrossWindows] Allow passing -static together with -shared
In these combinations, link a DLL as usual, but pass -Bstatic instead
of -Bdynamic to indicate prefering static libraries.

Differential Revision: https://reviews.llvm.org/D43811

llvm-svn: 326235
2018-02-27 19:42:19 +00:00
Martin Storsjo f9b3c67956 [test] Extend the Driver/mingw-msvcrt.c test with a -SAME check. NFC.
llvm-svn: 326180
2018-02-27 08:35:35 +00:00
Shoaib Meenai 80396248cf [Driver] Fix codeview-column-info on macOS
macOS home directory paths begin with /Users, and clang-cl interprets
the /U portion as a macro undefine rather than a path, causing test
failures on macOS. Use a -- to explicitly treat the input file as a path
and fix the test.

This effectively reverts r326168 and adds an alternative fix.

llvm-svn: 326171
2018-02-27 06:04:23 +00:00
Adam Nemet eec8221d4b Attempt to fix greendragon bot after r326141
llvm-svn: 326168
2018-02-27 04:49:26 +00:00
Igor Kudrin a49182aa5a [Driver] Allow using a canonical form of '-fuse-ld=' when cross-compiling on Windows.
clang used to require adding an ".exe" suffix when targeting ELF systems on Windows.

Differential Revision: https://reviews.llvm.org/D43621

llvm-svn: 326164
2018-02-27 02:51:30 +00:00
Petr Hosek a459dab937 [Driver] Add SafeStack to a map of incompatible sanitizers
This allows reporting an error when user tries to use SafeStack with
incompatible sanitizers.

Differential Revision: https://reviews.llvm.org/D43606

llvm-svn: 326151
2018-02-27 00:01:26 +00:00
Volodymyr Sapsai dade327773 Fix which Darwin versions have ObjC runtime with full subscripting support.
Update min deployment target in some tests so that they don't try
to link against libarclite and don't fail when it's not available.

rdar://problem/29253617

Reviewers: vsk, kubamracek

Reviewed By: vsk

Subscribers: jkorous-apple, cfe-commits

Differential Revision: https://reviews.llvm.org/D43787

llvm-svn: 326145
2018-02-26 23:10:23 +00:00
Reid Kleckner a54daa6d97 Fix codeview-column-info.c test with a triple
llvm-svn: 326144
2018-02-26 23:06:40 +00:00
Reid Kleckner 54af3e7e14 Re-land "Emit proper CodeView when -gcodeview is passed without the cl driver."
Reverts r326116 and re-lands r326113 with a fix to ASan so that it
enables column info in its test suite.

llvm-svn: 326141
2018-02-26 22:55:33 +00:00
Zachary Turner 13e3520d49 Revert "Emit proper CodeView when -gcodeview is passed without the cl driver."
This reverts commit e17911006548518634fad66bb8648bcad49a1d64.

This is failing on ASAN bots because asan expects column info,
and it's also failing on some linux bots for unknown reasons which
i need to investigate.

llvm-svn: 326116
2018-02-26 19:51:29 +00:00
Zachary Turner 9eee7bb7e5 Emit proper CodeView when -gcodeview is passed without the cl driver.
Windows debuggers don't work properly when column info is emitted
with lines.  We handled this by checking if the driver mode was
cl, but it's possible to cause the gcc driver to emit codeview as
well, and in that path we were emitting column info with codeview.

Differential Revision: https://reviews.llvm.org/D43700

llvm-svn: 326113
2018-02-26 19:25:39 +00:00
Adam Nemet a456db3ea3 [Driver] Forward opt-remark hotness threshold to LTO
llvm-svn: 326108
2018-02-26 18:38:11 +00:00
Scott Linder a2fbcef8ee [DebugInfo] Support DWARF v5 source code embedding extension
In DWARF v5 the Line Number Program Header is extensible, allowing values with
new content types. This vendor extension to DWARF v5 allows source text to be
embedded directly in the line tables of the debug line section.

Add new flag (-g[no-]embed-source) to Driver and CC1 which indicates
that source should be passed through to LLVM during CodeGen.

Differential Revision: https://reviews.llvm.org/D42766

llvm-svn: 326102
2018-02-26 17:32:31 +00:00