Commit Graph

1634 Commits

Author SHA1 Message Date
NAKAMURA Takumi 06ac98299f Remove "REQUIRES:shell" from tests. They work for me.
llvm-svn: 221269
2014-11-04 13:41:33 +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
Saleem Abdulrasool d0b6a4ac67 test: attempt to make test more hermetic
Add a fake linker in to a sysroot to use for testing the driver's tool
invocation.  Should make the test behave similarly on all platforms.  Addresses
review comments from Reid Kleckner from SVN r220546.

llvm-svn: 220625
2014-10-25 20:49:12 +00:00
Reid Kleckner a48d977ee2 Fix windows-cross.c test on my machine
I suspect it will need a custom sysroot to pass reliably elsewhere.

llvm-svn: 220576
2014-10-24 17:55:29 +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
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 581a5adfcf Driver: Tighten up crash report tests
These tests were a little bit too flexible in terms of filenames.

llvm-svn: 220265
2014-10-21 05:13:09 +00:00
Artyom Skrobov 6701327758 D5823: Fix typo in Clang test arm-cortex-cpus.c; patch by Gabor Ballabas!
llvm-svn: 220201
2014-10-20 13:48:19 +00:00
Hans Wennborg a6af1e87c8 Try to fix parse-progname.c test on Darwin
llvm-svn: 220086
2014-10-17 20:55:54 +00:00
Hans Wennborg 1a27e04af9 Driver: support detecting driver mode when clang has a version suffix without dash (PR21094)
Clang would previously not get into C++ mode when invoked as 'clang++3.6'
(though clang++-3.6 would work).

I found the previous loop logic in this function confusing; hopefully this
makes it a little clearer.

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

llvm-svn: 220052
2014-10-17 17:07:59 +00:00
Richard Smith 93a13de304 Remove incorrect usage of JoinedOrSeparate.
llvm-svn: 220023
2014-10-17 01:52:48 +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
Ulrich Weigand 804a3e655f [SystemZ] Address review comments for r219679
llvm-svn: 219691
2014-10-14 16:46:45 +00:00
Ulrich Weigand b454930cda [SystemZ] Add test case to verify default use of integrated assembler
llvm-svn: 219679
2014-10-14 11:45:53 +00:00
Bradley Smith 76d2e24bb8 [AArch64] Fixup test from A53 erratum patch after buildbot failures
Don't include stdint.h directly, instead typedef int64_t which is all we need.

llvm-svn: 219608
2014-10-13 11:18:05 +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
NAKAMURA Takumi f0e61f4442 clang/test/Driver: Some tests don't REQUIRE asserts any more. Remove them.
llvm-svn: 219580
2014-10-12 06:44:05 +00:00
Renato Golin 8d57d2510f Fix typo in ARM reserved-r9 test case
Patch by Charlie Turner.

llvm-svn: 219569
2014-10-11 10:34: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
Dan Albert a7693d2c83 Alright, just XFAIL all these for Windows.
I'm going to fix up FileCheck to better handle things like this soon,
but for now let's just unblock the Windows people.

llvm-svn: 219513
2014-10-10 17:20:10 +00:00
Bill Schmidt 59eb767e11 [PowerPC] Add feature for Power8 vector extensions
The current VSX feature for PowerPC specifies availability of the VSX
instructions added with the 2.06 architecture version.  With 2.07, the
architecture adds new instructions to both the Category:Vector and
Category:VSX instruction sets.  Additionally, unaligned vector storage
operations have improved performance.

This patch adds a feature to provide access to the new instructions
and performance capabilities of Power8.  For compatibility with GCC,
the feature is controlled via a new -mpower8-vector switch, and the
feature causes the __POWER8_VECTOR__ builtin define to be generated by
the preprocessor.

There is a companion patch for llvm being committed at the same time.

llvm-svn: 219502
2014-10-10 15:09:43 +00:00
Dan Albert e16b92db2d XFAIL coverage -no-integrated-as tests for msvc.
Windows can't use -no-integrated-as, so split these tests out into a
separate file and XFAIL them for win32,win64.

llvm-svn: 219472
2014-10-10 04:28:04 +00:00
Dan Albert a6a79bcf1b _Really_ fix these tests (probably).
llvm-svn: 219468
2014-10-10 03:51:59 +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
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
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
Asiri Rathnayake 4ae7f2e839 Fix a broken test case.
Summary: Commit r218863 broke this test case. This patch fixes it
by updating the expected output line. Should've been updated with
the original patch but for some reason it didn't fail during my
local make check.

Change-Id: I89ed28b37f67c34d1a5d28a3e47ae33d9a82a98f
llvm-svn: 218864
2014-10-02 10:45:58 +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
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
Richard Smith ffb650856d Enable both C and C++ modules with -fmodules, by switching -fcxx-modules to
being on by default. -fno-cxx-modules can still be used to enable C modules but
not C++ modules, but C++ modules is not significantly less stable than C
modules any more.

Also remove some of the scare words from the modules documentation. We're
certainly not going to remove modules support (though we might change the
interface), and it works well enough to bootstrap and build lots of
non-trivial code.

Note that this does not represent a commitment to the current interface nor
implementation, and we still intend to follow whatever direction the C and C++
committees take regarding modules support.

llvm-svn: 218717
2014-09-30 23:10:19 +00:00
Alexey Samsonov 58ae9ae23a Don't link in sanitizer runtimes if -nostdlib/-nodefaultlibs is provided.
It makes no sense to link in sanitizer runtimes in this case: the user
probably doesn't want to see any system/toolchain libs in his link if he
provides these flags, and the link will most likely fail anyway - as sanitizer
runtimes depend on libpthread, libdl, libc etc.

Also, see discussion in https://code.google.com/p/address-sanitizer/issues/detail?id=344

llvm-svn: 218541
2014-09-26 21:22:08 +00:00
Reid Kleckner 337188fdb8 Fix forwarding -l to MSVC's link.exe
Translate -lfoo to -lfoo.lib while making sure that -lfoo.lib stays as
-lfoo.lib. Also, these arguments were being passed twice: once
explicitly via AddAllArgs, and again implicitly as linker inputs. Now
they are passed once.

Fixes PR20868.

llvm-svn: 217895
2014-09-16 19:22:00 +00:00
Alexey Samsonov 5255034982 Major rewrite of linking strategy for sanitizer runtimes on Linux.
Change 1: we used to add static sanitizer runtimes at the
very beginning of the linker invocation, even before crtbegin.o, which
is gross and not correct in general. Fix this: now addSanitizerRuntimes()
adds all sanitizer-related link flags to the end of the linker invocation
being constructed. It means, that we should call this function in the
correct place, namely, before AddLinkerInputs() to make sure sanitizer
versions of library functions will be preferred.

Change 2: Put system libraries sanitizer libraries depend on at the
end of the linker invocation, where all the rest system libraries are
located. Respect --nodefaultlibs and --nostdlib flags. This is another way
to fix PR15823. Original fix landed in r215940 put "-lpthread" and friends
immediately after static ASan runtime, before the user linker inputs.
This caused significant slowdown in dynamic linker for large binaries
linked against thousands of shared objects. Instead, to mark system
libraries as DT_NEEDED we prepend them with "--no-as-needed" flag,
discarding the "-Wl,--as-needed" flag that could be provided by the user.

Otherwise, this change is a code cleanup. Instead of having a special method
for each sanitizer, we introduce a function collectSanitizerRuntimes() that
analyzes -fsanitize= flags and returns the set of static and shared
libraries that needs to be linked.

llvm-svn: 217817
2014-09-15 19:58:40 +00:00
Reid Kleckner 0290c9ca5c Teach Clang how to use response files when calling other tools
Patch by Rafael Auler!

This patch addresses PR15171 and teaches Clang how to call other tools
with response files, when the command line exceeds system limits. This
is a problem for Windows systems, whose maximum command-line length is
32kb.

I introduce the concept of "response file support" for each Tool object.
A given Tool may have full support for response files (e.g. MSVC's
link.exe) or only support file names inside response files, but no flags
(e.g. Apple's ld64, as commented in PR15171), or no support at all (the
default case). Therefore, if you implement a toolchain in the clang
driver and you want clang to be able to use response files in your
tools, you must override a method (getReponseFileSupport()) to tell so.

I designed it to support different kinds of tools and
internationalisation needs:

- VS response files ( UTF-16 )
- GNU tools ( uses system's current code page, windows' legacy intl.
  support, with escaped backslashes. On unix, fallback to UTF-8 )
- Clang itself ( UTF-16 on windows, UTF-8 on unix )
- ld64 response files ( only a limited file list, UTF-8 on unix )

With this design, I was able to test input file names with spaces and
international characters for Windows. When the linker input is large
enough, it creates a response file with the correct encoding. On a Mac,
to test ld64, I temporarily changed Clang's behavior to always use
response files regardless of the command size limit (avoiding using huge
command line inputs). I tested clang with the LLVM test suite (compiling
benchmarks) and it did fine.

Test Plan: A LIT test that tests proper response files support. This is
tricky, since, for Unix systems, we need a 2MB response file, otherwise
Clang will simply use regular arguments instead of a response file. To
do this, my LIT test generate the file on the fly by cloning many -DTEST
parameters until we have a 2MB file. I found out that processing 2MB of
arguments is pretty slow, it takes 1 minute using my notebook in a debug
build, or 10s in a Release build. Therefore, I also added "REQUIRES:
long_tests", so it will only run when the user wants to run long tests.

In the full discussion in
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130408/171463.html,
Rafael Espindola discusses a proper way to test
llvm::sys::argumentsFitWithinSystemLimits(), and, there, Chandler
suggests to use 10 times the current system limit (20MB resp file), so
we guarantee that the system will always use response file, even if a
new linux comes up that can handle a few more bytes of arguments.
However, by testing with a 20MB resp file, the test takes long 8 minutes
just to perform a silly check to see if the driver will use a response
file. I found it to be unreasonable. Thus, I discarded this approach and
uses a 2MB response file, which should be enough.

Reviewers: asl, rafael, silvas

Reviewed By: silvas

Subscribers: silvas, rnk, thakis, cfe-commits

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

llvm-svn: 217792
2014-09-15 17:45:39 +00:00
JF Bastien 87ebb6859c Make test/Driver hermetic
Summary:
The includes shouldn't be there, use the compiler's built-in types/macros instead.

This is a follow-up to r217694, as discussed in:
  http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140908/114669.html

Test Plan: ninja check-clang

Reviewers: nlewycky, thakis, echristo, chandlerc

Subscribers: cfe-commits

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

llvm-svn: 217743
2014-09-14 23:42:15 +00:00
Ehsan Akhgari c249abba05 clang-cl: Warn when a /TC or /TP argument is unused
Test Plan: The patch includes a test case.

Reviewers: hansw

Subscribers: cfe-commits

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

llvm-svn: 217710
2014-09-12 21:44:24 +00:00
Ehsan Akhgari 7e954ea063 clang-cl: Don't treat linker input files differently when /TP or /TC is specified.
Summary: This fixes http://llvm.org/PR20923.

Test Plan: This patch includes an automated test.

Reviewers: hansw

Subscribers: cfe-commits

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

llvm-svn: 217699
2014-09-12 18:15:10 +00:00
JF Bastien 1adacee6a5 Fix copy/paste for test, the triple should be le64-unknown-unknown
llvm-svn: 217695
2014-09-12 17:52:49 +00:00
JF Bastien 643817d929 Add support for le64.
Summary:
le64 is a generic little-endian 64-bit processor, mimicking le32.

Also see the associated LLVM change.

Test Plan: make check-all

Reviewers: dschuff

Subscribers: llvm-commits

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

llvm-svn: 217694
2014-09-12 17:52:47 +00:00
Timur Iskhodzhanov 651725e191 [ASan/Win] Fix PR20918 -- SEH handler doesn't work with the MD runtime
llvm-svn: 217679
2014-09-12 14:01:30 +00:00
Timur Iskhodzhanov 7083c0e02e Update the test case after r217673
Sorry, committing to multiple repos at once is hard...

llvm-svn: 217677
2014-09-12 13:47:44 +00:00
Ehsan Akhgari 81f36b712f clang-cl: Add support for the /o option for object files, executables, and preprocessor output
Summary:
cl.exe recognizes /o as a deprecated and undocumented option similar to
/Fe.  This patch adds support for this option to clang-cl for /Fe, /Fo
and /Fi.  It also ensures that the last option among /o and /F* wins,
if both specified.

This is required at least for building autoconf based software, since
autoconf uses -o to specify the executable output.

This fixes http://llvm.org/PR20894.

Test Plan: The patch includes automated tests.

Reviewers: rnk

Subscribers: cfe-commits

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

llvm-svn: 217615
2014-09-11 18:16:21 +00:00
Joerg Sonnenberger b7e0ac6253 Only override the target architecture on -m32 and friends if it is
actually different. Fixes a surprising link error with nodejs on rpi,
where armv6-netbsd-eabihf turned into armv5e-netbsd-eabihf, which
doesn't lacks the necessary VFP support.

llvm-svn: 217546
2014-09-10 21:25:37 +00:00
Alexey Samsonov 8e1162c71d Implement nonnull-attribute sanitizer
Summary:
This patch implements a new UBSan check, which verifies
that function arguments declared to be nonnull with __attribute__((nonnull))
are actually nonnull in runtime.

To implement this check, we pass FunctionDecl to CodeGenFunction::EmitCallArgs
(where applicable) and if function declaration has nonnull attribute specified
for a certain formal parameter, we compare the corresponding RValue to null as
soon as it's calculated.

Test Plan: regression test suite

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits, rnk

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

llvm-svn: 217389
2014-09-08 17:22:45 +00:00
Oliver Stannard ec8b6b32b8 ARM: Default to apcs-gnu ABI for NetBSD
r216662 changed the default ABI for 32-bit ARM targets to be "aapcs"
when no environment is given in the triple, however NetBSD requires it
to be "apcs-gnu".

llvm-svn: 217141
2014-09-04 10:38:53 +00:00
Rafael Espindola ed1233e8a7 Call powerpc-darwin external tools with -arch ppc.
With this patch we call external tools for powerpc-darwin with "-arch ppc"
instead of "-arch powerpc", so as to be compatible with the cctools assembler
and ld64 linker.

Patch by Stephen Drake!

llvm-svn: 216687
2014-08-28 21:23:05 +00:00
Oliver Stannard 28ee5d2e90 [ARM] Change default ABI for AArch32 to be "aapcs" (was "apcs-gnu")
The current default abi when no environment is given is "apcs-gnu",
which is obsolete. This patch changes the default to "aapcs". "aapcs" has both
hard- and soft-float variants, so the -mhard-float, -msoft-float and
-mfloat-abi= options now all behave as expected when no environment is
specified in the triple.

While writing this I also noticed that a preprocessor test claims to be
checking darwin, but is actually checking the defaults, which are
different for darwin.

llvm-svn: 216662
2014-08-28 12:15:49 +00:00
Chandler Carruth c26a79d4f2 Fix PR20773 which I introduced with a silly edit mistake in r216531.
Trivial fix, and I've made the gentoo tests more representative. With
the changes, they would have caught this failure.

llvm-svn: 216572
2014-08-27 18:21:27 +00:00
Evgeniy Stepanov 8f4e736080 [asan] Restore asan-rt name on linux back to pre-r216380.
There is no reason to have different library names for shared and static
cases on linux. It also breaks Android where we install the shared asan-rt
library into the system and should keep the old name.

This change reverts most of r216380 limiting it to win32 targets only.

llvm-svn: 216533
2014-08-27 09:46:54 +00:00
Chandler Carruth c44f4d44e6 Significantly fix Clang's header search for Ubuntu (and possibly other
modern Debian-based distributions) due to on-going multiarch madness.

It appears that when the multiarch heeader search support went into the
clang driver, it went in in a quite bad state. The order of includes
completely failed to match the order exhibited by GCC, and in a specific
case -- when the GCC triple and the multiarch triple don't match as with
i686-linux-gnu and i386-linux-gnu -- we would absolutely fail to find
the libstdc++ target-specific header files.

I assume that folks who have been using Clang on Ubuntu 32-bit systems
have been applying weird patches to hack around this. I can't imagine
how else it could have worked. This was originally reported by a 64-bit
operating system user who had a 32-bit crosscompiler installed. We tried
to use that rather than the bi-arch support of the 64-bit compiler, but
failed due to the triple differences.

I've corrected all the wrong orderings in the existing tests and added
a specific test for the multiarch triple strings that are different in
a significant way. This should significantly improve the usability of
Clang when checked out vanilla from upstream onto Ubuntu machines with
an i686 GCC installation for whatever reason.

llvm-svn: 216531
2014-08-27 08:41:41 +00:00
Justin Bogner ce46adb4f8 Driver: Restore -fkeep-inline-functions as an ignored flag
Several options were moved to the clang_ignored_gcc_optimization group
in r213365, but -fkeep-inline-functions was accidentally dropped. This
restores the flag.

Patch by Steven Wu. Thanks!

llvm-svn: 216522
2014-08-27 05:12:35 +00:00
Reid Kleckner 64ecbe22aa Ignore -fdevirtualize and -fdevirtualize-speculatively for gcc compat
llvm-svn: 216477
2014-08-26 19:57:01 +00:00
Joerg Sonnenberger a43604ad50 Convert MC command line flag for fatal assembler warnings into a proper
flag.

llvm-svn: 216472
2014-08-26 18:40:25 +00:00
Timur Iskhodzhanov 6903e10ddf [ASan/Win] Add an extra thunk.lib to handle stack-use-after-return option
With this patch, "check-asan" passes all the tests with both MT and MD ASan RTL if you set COMPILER_RT_BUILD_SHARED_ASAN to ON
(PR20214)

llvm-svn: 216447
2014-08-26 10:08:24 +00:00
Timur Iskhodzhanov 664dff4db7 Follow-up to r216380: update test expectations
llvm-svn: 216381
2014-08-25 12:19:12 +00:00
Reid Kleckner af5fd6a4d5 Fix PR17239 by changing the semantics of the RemainingArgsClass Option kind
This patch aims at fixing PR17239.

This bug happens because the /link (clang-cl.exe argument) is marked as
"consume all remaining arguments". However, when inside a response file,
/link should only consume all remaining arguments inside the response
file where it is located, not the entire command line after expansion.
The LLVM side of the patch will change the semantics of the
RemainingArgsClass kind to always consume only until the end of the
response file when the option originally came from a response file.
There are only two options in this class: dash dash (--) and /link.

This is the Clang side of the patch in http://reviews.llvm.org/D4899

Reviewered By: rafael, rnk

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

Patch by Rafael Auler!

llvm-svn: 216281
2014-08-22 19:29:30 +00:00
Brad Smith f436e9efbe Handle SPARC float command line parameters for SPARCv9.
llvm-svn: 216029
2014-08-19 21:50:15 +00:00
Alexey Samsonov c4f1fc2af1 Update link strategy for sanitizer runtime libraries on Linux:
1. Always put static sanitizer runtimes to the front of the linker
invocation line. This was already done for all sanitizers except UBSan:
in case user provides static libstdc++ we need to make sure that new/delete
operator definitions are picked from sanitizer runtimes instead of libstdc++.
We have to put UBSan runtime first for similar reasons: it depends on some
libstdc++ parts (e.g. __dynamic_cast function), and has to go first in
link line to ensure these functions will be picked up from libstdc++.

2. Put sanitizer libraries system dependencies (-ldl, -lpthread etc.) right
after sanitizer runtimes. This will ensure these libraries participate in
the link even if user provided -Wl,-as-needed flag. This should fix PR15823.

3. In case we link in several sanitizer runtimes (e.g. "ubsan", "ubsan_cxx"
and "san"), add system dependencies (-ldl, -lpthread, ...) only once.

llvm-svn: 215940
2014-08-18 22:10:42 +00:00
Pavel Chupin 4a29468dcd [x32] Handle -m64/-m32 switches by Driver in x32 mode
Summary:
Adding remaining 2 cases handling:
* from x32 to 32 via -m32
* from x32 to 64 via -m64

Test Plan: linux-ld test updated

Reviewers: chandlerc, atanasyan

Subscribers: cfe-commits, zinovy.nis

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

llvm-svn: 215899
2014-08-18 15:38:38 +00:00
Manuel Klimek f560b22a92 Do not rely on bin/ path prefix in tests.
llvm-svn: 215845
2014-08-17 19:11:18 +00:00
Rafael Espindola 69d2ad031b Add a test for -no-canonical-prefixes.
llvm-svn: 215836
2014-08-17 16:22:16 +00:00
Rafael Espindola d76eb44cdf Use a valid arch name in this triple.
llvm-svn: 215726
2014-08-15 16:55:25 +00:00
Joerg Sonnenberger b704534233 Use the big endian emulations for NetBSD/arm in EB mode.
llvm-svn: 215670
2014-08-14 19:12:41 +00:00
Simon Atanasyan d95c67d425 [Driver] Support -muclibc / -mglibc command line options for a couple
of MIPS toolchains.

The uCLibc implemented for multiple architectures. A couple of MIPS toolchains
contains both uCLibc and glibc implementation so these options allow to select
used C library.

Initially -muclibc / -mglibc (as well as -mbionic) have been implemented in gcc
for various architectures so they are not MIPS specific.

llvm-svn: 215552
2014-08-13 14:34:14 +00:00
Joerg Sonnenberger dd13b30c29 For NetBSD, use the same settings for PPC64 as for PPC when it comes to
integrated assembler, libc++ and libgcc. Set emulation for ld for both
platforms for correct -m32 handling.

llvm-svn: 215551
2014-08-13 14:17:32 +00:00
Alexey Samsonov de443c5002 [UBSan] Add returns-nonnull sanitizer.
Summary:
This patch adds a runtime check verifying that functions
annotated with "returns_nonnull" attribute do in fact return nonnull pointers.
It is based on suggestion by Jakub Jelinek:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140623/223693.html.

Test Plan: regression test suite

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

llvm-svn: 215485
2014-08-13 00:26:40 +00:00
Sylvestre Ledru b8198f0222 GCC compatibility: Ignore -fexec-charset=UTF-8 argument. It is the default in Clang. Reject other values.
Summary:
Just like with -finput-charset=UTF-8 in review http://reviews.llvm.org/D4347, I think we should just ignore it when UTF-8 is provided.


Reviewers: rnk, rafael

Reviewed By: rafael

Subscribers: rafael, cfe-commits

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

llvm-svn: 215368
2014-08-11 18:09:03 +00:00
Yaron Keren ec740b3d46 Make this test unsupported when there is no real 'env' from a real shell.
While the test was already requiring shell-preserves-root (such as the
internal shell), it wasn't aware that the MSYS 1.0 env command knows how
to expand root by itself!

From cmd.exe try:

  env SDKROOT=/ cmd //c echo %SDKROOT%

And get:

  C:/MINGW/MSYS/1.0
  
To be certain we have a good 'env' program the test now requires a shell.

llvm-svn: 215298
2014-08-09 21:24:04 +00:00
Joerg Sonnenberger 2bb3a90658 Actually add the object file, skipped by the directory add.
llvm-svn: 215297
2014-08-09 21:06:57 +00:00
Joerg Sonnenberger 17a80e49e7 Use the correct fallback directory for EABIHF targets on NetBSD/arm.
From Matt Thomas.

llvm-svn: 215292
2014-08-09 19:01:52 +00:00
Joerg Sonnenberger 323cea90da NetBSD/aarch64 has no libgcc or libstdc++. Drop arm64 tests.
llvm-svn: 215291
2014-08-09 18:28:36 +00:00
Alexey Samsonov 90490af21d Add -link-cxx-sanitizer driver flag.
Summary:
This flag can be used to force linking of CXX-specific parts
of sanitizer runtimes into the final executable. It gives more precise
control than --driver-mode=g++ and comes handy when user links several
object files with sanitized C++ code into an executable, but wants
to provide libstdc++ himself, instead of relying on Clang dirver's
behavior.

Test Plan: clang regression test suite

Reviewers: chandlerc, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

llvm-svn: 215252
2014-08-08 22:47:17 +00:00
Daniel Sanders 7e7baa9ab8 Partially revert r215204 - [mips] Add -mabicalls/-mno-abicalls to the driver
It wasn't actually a bug that -mabicalls/-mno-abicalls wasn't being passed to
GAS. The only reason we pass it to the integrated assembler is because it shares
the same framework with CodeGen.

llvm-svn: 215236
2014-08-08 18:39:01 +00:00
Daniel Sanders feb613028b [mips] Invert the abicalls feature bit to be noabicalls so that it's possible for -mno-abicalls to take effect.
Also added the testcase that should have been in r215194.

This behaviour has surprised me a few times now. The problem is that the
generated MipsSubtarget::ParseSubtargetFeatures() contains code like this:

   if ((Bits & Mips::FeatureABICalls) != 0) IsABICalls = true;

so '-abicalls' means 'leave it at the default' and '+abicalls' means 'set it to
true'. In this case, (and the similar -modd-spreg case) I'd like the code to be

  IsABICalls = (Bits & Mips::FeatureABICalls) != 0;

or possibly:

   if ((Bits & Mips::FeatureABICalls) != 0)
     IsABICalls = true;
   else
     IsABICalls = false;

and preferably arrange for 'Bits & Mips::FeatureABICalls' to be true by default
(on some triples).

llvm-svn: 215211
2014-08-08 15:47:17 +00:00
Daniel Sanders e805f44c8f [mips] Add -mabicalls/-mno-abicalls to the driver
Based on a patch by Matheus Almeida. I've added testcases and fixed a bug where
the options weren't passed on to GAS.

llvm-svn: 215204
2014-08-08 13:44:50 +00:00
Justin Bogner 4d10c23909 Driver: Add tests for -fprofile-arcs and -fno-profile-arcs
I tried to be lazy and get away with no test in r215051, but Chad
caught me :)

llvm-svn: 215053
2014-08-07 03:58:32 +00:00
Rui Ueyama cfea160681 Remove trailing whitespaces
llvm-svn: 214935
2014-08-05 23:43:21 +00:00
Reid Kleckner 74a6816b33 Fix Driver tests that I broke on Windows in r214924
llvm-svn: 214931
2014-08-05 22:39:07 +00:00
Fariborz Jahanian bcd82afad6 Introduce f[no-]max-unknown-pointer-align=[number] option
to instruct the code generator to not enforce a higher alignment 
than the given number (of bytes) when accessing memory via an opaque 
pointer or reference. Patch reviewed by John McCall (with post-commit
review pending). rdar://16254558

llvm-svn: 214911
2014-08-05 18:37:48 +00:00
Arthur Marble 05b0798916 Added f and m flags to be ignored. These will not display a warning. The revision
for this patch is here: http://reviews.llvm.org/D4570. This will help with the
rebuild of Debian with clang. Here is a link to the errors that Debian is
experiencing: http://clang.debian.net/status.php?version=3.4.2&key=UNKNOWN_ARG

llvm-svn: 214907
2014-08-05 18:21:20 +00:00
Arthur Marble 731f6d380f Added flags that should be ignored for compatibility. These flags will display
a warning. Revision for this patch is here: http://reviews.llvm.org/D4565. This
patch will help with the rebuild of Debian with clang and many other projects
that wish to use clang. Here is a link to the errors that Debian is experiencing:
http://clang.debian.net/status.php?version=3.4.2&key=UNKNOWN_ARG

llvm-svn: 214906
2014-08-05 18:13:48 +00:00
Ben Langmuir 4ad99c3b2e Fix test from r214577 for other timezones
Unsurprisingly, changing a file modification time to a specific
date/time doesn't give the same epoch time everywhere. Just make the
file move into the past and look at only the first few digits of the
epoch time.

llvm-svn: 214589
2014-08-01 22:58:19 +00:00
Ben Langmuir 19e6acbd51 Add -fbuild-session-file as an alternative to -fbuild-session-timestamp
Build systems tend to traffic in files and modification times, so having
them touch a file at the beginning of the build can be easier than
having them update the compile command they use every time they build.

llvm-svn: 214577
2014-08-01 22:12:21 +00:00
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
Bob Wilson 0874e538aa Fix up handling of ARM options for controlling strict alignment.
The -mstrict-align option was originally added in r167619 as a target-
independent option. It was then changed in r167623 to be implemented with an
ARM-specific backend option, even though the code remained in the
target-independent Clang::ConstructJob function. This means that if you used
the -mstrict-align option with a non-ARM target, you would still get the
-arm-strict-align option getting passed to the backend, which was harmless
but gross. The driver option was then replaced by the GCC-compatible
-m[no-]unaligned-access option (r189175) and modified to work with AArch64
(r208075). However, in the process, the help text for -mstrict-align was
incorrectly changed to show it as only being supported for AArch64. Even worse,
the logic for handling these options together with -mkernel was wrong for
AArch64, where -mkernel does not currently imply strict alignment.

This patch fixes up all of those things. Besides the obvious change to the
option help text, it moves the logic into the ARM and AArch64-specific parts
of the driver, so that the option will be correctly ignored for non-ARM
targets. <rdar://problem/17823697>

llvm-svn: 214148
2014-07-29 00:23:18 +00:00
Ulrich Weigand 8afad61a93 [PowerPC] Support ELFv1/ELFv2 ABI selection via -mabi= option
While Clang now supports both ELFv1 and ELFv2 ABIs, their use is currently
hard-coded via the target triple: powerpc64-linux is always ELFv1, while
powerpc64le-linux is always ELFv2.

These are of course the most common scenarios, but in principle it is
possible to support the ELFv2 ABI on big-endian or the ELFv1 ABI on
little-endian systems (and GCC does support that), and there are some
special use cases for that (e.g. certain Linux kernel versions could
only be built using ELFv1 on LE).

This patch implements the Clang side of supporting this, based on the
LLVM commit 214072.  The command line options -mabi=elfv1 or -mabi=elfv2
select the desired ABI if present.  (If not, Clang uses the same default
rules as now.)

Specifically, the patch implements the following changes based on the
presence of the -mabi= option:

In the driver:
- Pass the appropiate -target-abi flag to the back-end
- Select the correct dynamic loader version (/lib64/ld64.so.[12])

In the preprocessor:
- Define _CALL_ELF to the appropriate value (1 or 2)

In the compiler back-end:
- Select the correct ABI in TargetInfo.cpp
- Select the desired ABI for LLVM via feature (elfv1/elfv2)

llvm-svn: 214074
2014-07-28 13:17:52 +00:00
Simon Atanasyan 0c455f3fea [Driver][Mips] Check output of -dynamic-linker arguments by the Clang driver
for a couple of MIPS toolchains.

No functional changes.

llvm-svn: 214025
2014-07-26 09:52:21 +00:00
Tom Stellard 14e03967ab R600: Add processor type for Mullins
llvm-svn: 213999
2014-07-26 01:05:20 +00:00
Bob Wilson 08771c2fed Revert new test from 213993.
It requires an arm backend and also writes output in the test directory.

llvm-svn: 213998
2014-07-26 00:51:28 +00:00
Bob Wilson 25363c00e4 Use -enable-global-merge option to match llvm r210639. <rdar://problem/17803206>
llvm revision 210639 renamed the -global-merge backend option to
-enable-global-merge. This change simply updates clang to match that.

Patch by Steven Wu!

llvm-svn: 213993
2014-07-26 00:37:28 +00:00
Joerg Sonnenberger c888757a2d Now that PIC generation on PPC32 is supported, hook up linking support
for NetBSD.

llvm-svn: 213972
2014-07-25 20:57:24 +00:00
David Majnemer 104fb54dfa clang-cl: Add support for /Zp
CL's /Zp flag is analogous to GCC's -fpack-struct, it controls the
default maximum alignment of records.

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

llvm-svn: 213958
2014-07-25 17:30:10 +00:00
Simon Atanasyan 5116b4a9f9 [Driver][Mips] Remove "fp64" directories from the mips-mti-linux-gnu toolchain
directories description. Released version of this toolchain has not separate
libraries for -mfp64 command line option.

llvm-svn: 213937
2014-07-25 11:20:21 +00:00
Tim Northover 02a979fd1e MachO: use "arm64" as the triple name in modules.
Current versions of ld64 can't cope with "aarch64" being stored. I'm fixing
that, but in the transitionary period we'll need to still emit "arm64".

rdar://problem/17783765

llvm-svn: 213852
2014-07-24 10:25:34 +00:00
Reid Kleckner 491e1acd62 Split -Winvalid-command-line-argument into -Wignored-optimization-argument
Reviewers: rsmith, nlewycky

Subscribers: cfe-commits

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

llvm-svn: 213817
2014-07-23 23:29:01 +00:00
Artyom Skrobov ee3481121c Fix test/Driver/cl-x86-flags.c by providing explicit --target
This isn't very neat, but we haven't found any better ways to
make this test work with non-X86 default target.

llvm-svn: 213769
2014-07-23 17:09:26 +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
Daniel Sanders 54d8ee6d7b [mips] -mno-shared should only be given to the assembler when -fPIC/-fpic/-fPIE/-fpie is not in effect.
This fixes compiler recursion on MIPS32r2.

llvm-svn: 213741
2014-07-23 12:06:13 +00:00
Hans Wennborg 8858a03e2f clang-cl: ignore /showIncludes when combined with /E (PR20336)
Both /showIncludes and /E write to stdout. Allowing both results
in interleaved output and an error when double-closing the file
descriptor, intended to catch issues like this.

llvm-svn: 213589
2014-07-21 23:42:07 +00:00
Arthur Marble c0d0603999 Moved 25 flags to clang_ignored_gcc_optimization_f_Group. Will display a warning
to the user if they try to pass those optimizations. The revision for this patch
is here: http://reviews.llvm.org/D4474. This patch will fix many errors in the
rebuild of Debian with clang. Here is a link to the page for unknown arguments:
http://clang.debian.net/status.php?version=3.4.2&key=UNKNOWN_ARG

llvm-svn: 213365
2014-07-18 11:38:58 +00:00
Kevin Qin 110db6f2ad [AArch64] Implement Clang CLI interface proposal about "-march".
1. Revert "Add default feature for CPUs on AArch64 target in Clang"
at r210625. Then, all enabled feature will by passed explicitly by
-target-feature in -cc1 option.

2. Get "-mfpu" deprecated.

3. Implement support of "-march". Usage is:
    -march=armv8-a+[no]feature
  For instance, "-march=armv8-a+neon+crc+nocrypto". Here "armv8-a" is
  necessary, and CPU names are not acceptable. Candidate features are
  fp, neon, crc and crypto. Where conflicting feature modifiers are
  specified, the right-most feature is used.

4. Implement support of "-mtune". Usage is:
    -march=CPU_NAME
  For instance, "-march=cortex-a57". This option will ONLY get
  micro-architectural feature enabled specifying to target CPU,
  like "+zcm" and "+zcz" for cyclone. Any architectural features
  WON'T be modified.

5. Change usage of "-mcpu" to "-mcpu=CPU_NAME+[no]feature", which is
  an alias to "-march={feature of CPU_NAME}+[no]feature" and
  "-mtune=CPU_NAME" together. Where this option is used in conjunction
  with -march or -mtune, those options take precedence over the
  appropriate part of this option.

llvm-svn: 213353
2014-07-18 07:03:22 +00:00
Daniel Sanders 4dcbe810d4 [mips] Pass the ABI to the integrated assembler and add tests the existing arguments.
Summary:
With this patch (and a corresponding LLVM patch), assembling an empty file with
GCC and Clang -fintegrated-as produce near identical objects. The remaining
differences are:
* GCC/GAS produce objects have a .pdr section
* GCC/GAS produce objects have a .gnu.attributes section
Other differences are insignificant such as precise file offsets and the order
of strings in the string table.

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

llvm-svn: 213241
2014-07-17 09:46:40 +00:00
Arthur Marble 31fb6f4730 Typically linker options are protected with -Xlinker or -Wl,
however certain sloppy Makefiles pass -z options directly to
the compiler. This patch enables clang to recognize these
options (because -z is not used by clang itself).

llvm-svn: 213198
2014-07-16 21:16:16 +00:00
Reid Kleckner c8604f65d3 Add the --target option to clang-cl and use it to fix a test.
llvm-svn: 213180
2014-07-16 18:31:25 +00:00
Hans Wennborg 8250735bb0 Don't use -msse2 in test/Driver/cl-options.c
It's already tested in cl-x86-flags.c, and can only be used
when targeting X86.

llvm-svn: 213179
2014-07-16 18:20:35 +00:00
Simon Atanasyan 9988e3afcc [Driver][Mips] If CPU name is not provided to the driver explicitly use
multilibs from the FSFS toolchain corresponding to the mips32r2/mips64r2 CPUs.

llvm-svn: 213175
2014-07-16 17:34:54 +00:00
Hans Wennborg db829de6d6 clang-cl: expand test coverage for "core" options
llvm-svn: 213170
2014-07-16 16:29:00 +00:00
Hans Wennborg a6c062b283 Expand the wildcard expansion test to also cover '?'
llvm-svn: 213165
2014-07-16 16:14:09 +00:00
Hans Wennborg 8a7c47ff97 clang-cl: make sure we still parse -fms-version= after r213119
The CoreOption flag got lost in the changes.

llvm-svn: 213164
2014-07-16 16:03:56 +00:00
Alp Toker a3c494f0db Revert "clang/test/Driver/crash-report.c: This requires rewriter for -frewrite-includes. [PR20321]"
We've decided to make the core rewriter class and PP rewriters mandatory.
They're only a few hundred lines of code in total and not worth supporting as a
distinct build configuration, especially since doing so disables key compiler
features.

This reverts commit r213150.

Revert "clang/test: Introduce the feature "rewriter" for --enable-clang-rewriter."

This reverts commit r213148.

Revert "Move clang/test/Frontend/rewrite-*.c to clang/test/Frontend/Rewriter/"

This reverts commit r213146.

llvm-svn: 213159
2014-07-16 15:12:48 +00:00
NAKAMURA Takumi 890c895fbc clang/test/Driver/crash-report.c: This requires rewriter for -frewrite-includes. [PR20321]
llvm-svn: 213150
2014-07-16 13:42:43 +00:00
Daniel Sanders 379d44bfdf [mips] Correct the invocation of GAS in several cases.
Summary:
As a result of this patch, assembling an empty file with GCC and Clang (using
GAS as the assembler) now produces identical objects.

-mfp32/-mfpxx/-mfp64 now form a trinity of options. -mfpxx is the default
when the triple vendor is 'img' or 'mti', the ABI is O32, and the CPU is
between mips2 and mips32r2/mips64r2 (inclusive).

-mno-shared is always given to the assembler to match the effect of
-mabicalls (currently unimplemented but Clang acts as if it is given).
Similarly, -call_nonpic is always given to match the effect of -mplt (also
unimplemented and acts as if given) except when the ABI is 64 in which case
-mplt has no effect so -KPIC is given instead.

-mhard-float/-msoft-float are now passed on.

-modd-spreg/-mno-odd-spreg are now passed on.

-mno-mips16 is correctly passed on. The assembler option is -no-mips16 not
-mno-mips16

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

llvm-svn: 213138
2014-07-16 11:52:23 +00:00
Daniel Sanders 2e9427a175 [mips] Add support for -mfpxx and -mno-fpxx.
Differential Revision: http://reviews.llvm.org/D4464

llvm-svn: 213132
2014-07-16 09:57:54 +00:00
Evgeniy Stepanov a333117852 Don't add -Bsymbolic by default on Android.
-Bsymbolic is not a platform requirement and should not
be added unconditionally.

llvm-svn: 213126
2014-07-16 08:46:35 +00:00
Saleem Abdulrasool c68237bc2c Driver: bifurcate extended and basic MSC versioning
This restores the original behaviour of -fmsc-version. The older option
remains as a mechanism for specifying the basic version information. A
secondary option, -fms-compatibility-version permits the user to specify an
extended version to the driver.

The new version takes the value as a dot-separated value rather than the
major * 100 + minor format that -fmsc-version format. This makes it easier to
specify the value as well as a more flexible manner for specifying the value.

Specifying both values is considered an error.

The older parameter is left solely as a driver option, which is normalised into
the newer parameter. This allows us to retain a single code path in the
compiler itself whilst preserving the semantics of the old parameter as well as
avoid having to determine which of two formats are being used by the invocation.

The test changes are due to the fact that the compiler no longer supports the
old option, and is a direct conversion to the new option.

llvm-svn: 213119
2014-07-16 03:13:50 +00:00
Hans Wennborg 7433281b5e Add a test for wildcard expansion on Windows
This depends on LLVM r213114

llvm-svn: 213115
2014-07-16 00:55:31 +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
Ehsan Akhgari eeb7e65c5f clang-cl: Implement the -arch flag
Summary:
This implements the -arch flag for both x86 and x86-64 by letting
them affect the default target features we pass to cc1.  -m machine
flags will override the features set by -arch.

Reviewers: hansw

Subscribers: cfe-commits

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

llvm-svn: 213083
2014-07-15 18:27:51 +00:00
Alp Toker cd3acb5604 Avoid non-attributive uses of 'unsupported' in diagnostics
We don't have a style guide for diagnostic messages, but convention strongly
favours the forms:

  'attribute is not supported', 'unsupported attribute'

We generally avoid:

  'attribute is unsupported', 'non-supported attribute'

llvm-svn: 212972
2014-07-14 19:16:22 +00:00
Alp Toker 86f6934e27 Change the diagnostic group for unsupported gcc optimizations added r212805
Use -Winvalid-command-line-argument here to align with existing gcc opt
diagnostics. Meanwhile -Wunused-command-line-argument is for flags that we
support but were, say, fed into the wrong invocation.

Also tweak wording to make sense with -Werror.

llvm-svn: 212964
2014-07-14 18:11:38 +00:00
Reid Kleckner fc31efe95a Require an x86 registered target for this test by splitting it out
This is a shot in the dark to fix the hexagon bot, so I'm not 100% sure
this is the issue.

llvm-svn: 212871
2014-07-12 00:40:59 +00:00
Reid Kleckner 681ae92083 clang-cl: Make all x86 CPU feature flags available, such as -msse3
Ideally, we would use the /arch cl.exe flag for this stuff.
Unfortunately, MSVC supports only 5 /arch flag values, which isn't
nearly enough to cover all the CPU features that LLVM cares about.  At
the very least, we need to know about SSE3 and SSE4.1 in addition to
SSE, SSE2, AVX, and AVX2.

In the future we should add the relevant /arch mappings in addition to
these gcc-style -m flags.

llvm-svn: 212869
2014-07-12 00:29:05 +00:00
Brad Smith 83510e70a9 oops. correct the prefix.
llvm-svn: 212840
2014-07-11 20:27:39 +00:00
Brad Smith 10cd0f457a Handle SPARC float command line parameters for SPARCv9.
llvm-svn: 212838
2014-07-11 20:12:08 +00:00
Sylvestre Ledru 79e3da9653 Test for warning being silenced
Summary:
Added some tests to see if the new warning would be silenced with a flag.

Patch by Arthur Marble <arthur@info9.net> in the context of Debian Google Summer of code 2014.


Reviewers: sylvestre.ledru

Reviewed By: sylvestre.ledru

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

llvm-svn: 212833
2014-07-11 17:23:13 +00:00
Zinovy Nis 3d16387413 [PATCH] [x32] Introduce -mx32 flag enforcing x32 mode for other triplets. By Pavel Chupin (@pavel.v.chupin).
-mx32 flag setup target environment to GNUX32 and can be used for 
other 32/64-bit triplets (i386-unknown-linux, x86_64-unknown-linux) to
turn on x32 mode. Compatible with GCC -mx32 flag.

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

llvm-svn: 212817
2014-07-11 14:28:45 +00:00
Sylvestre Ledru 1028ae7441 Tiny improvement in a test (missing quote)
llvm-svn: 212806
2014-07-11 11:53:18 +00:00
Sylvestre Ledru 2fe501eef9 GCC compatibility: Create a Group to ignore unsupported optimization.
Returns a warning when using an unknown optimization flag.
This patch includes -finline-limit as one of those ignored flags.
More options will be moved in this group

Patch by Arthur Marble <arthur@info9.net> in the context of
Debian Google Summer of code 2014.

Reviewers: rnk, Sylvestre
llvm-svn: 212805
2014-07-11 11:43:57 +00:00
Diego Novillo 94b276deba Enable -gcolumn-info by default.
This patch flips the default value for -gcolumn-info to be on by
default. I discussed the rationale and provided compile/size data
in:

http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-June/074290.html

This also updates the documentation and some tests that relied on
the lack of column information. Some tests had column information
in the expected output, but it was wrong (the tsan tests). Others
were using the driver to execute.

llvm-svn: 212781
2014-07-10 23:29:28 +00:00
Zinovy Nis 1db9573f03 [x32] Adding X32 target support to driver, including TargetInfo,DescriptionString, flags, paths lookup, etc. Cover changes with new tests. The author of the patch is Pavel Chupin (@pavel.v.chupin).
The changes enable "hello world" on x32 target (x86_64-*-linux-gnux32). s/isX32/IsX32/ also fixed.

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

llvm-svn: 212725
2014-07-10 15:27:19 +00:00
Daniel Sanders 2bf1366ca6 [mips][mips64r6] Add support for mips-img-linux-gnu GCC toolchains
Summary:
* Support the multilib layout used by the mips-img-linux-gnu
* Recognize mips{,64}{,el}-img-linux-gnu as being aliases of mips-img-linux-gnu
* Use the correct dynamic linker for mips-img-linux-gnu
* Make mips32r6/mips64r6 the default CPU for mips-img-linux-gnu

Subscribers: mpf

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

llvm-svn: 212719
2014-07-10 14:40:57 +00:00
Daniel Sanders 28e5d39183 [mips] Add support for -modd-spreg/-mno-odd-spreg
Differential Revision: http://reviews.llvm.org/D4432

llvm-svn: 212700
2014-07-10 10:39:51 +00:00
Daniel Sanders 0c8d95ab85 [mips][mips64r6] Implement -mips32r6 and -mips64r6 aliases to -march=mips32r6 and -march=mips64r6
Differential Revision: http://reviews.llvm.org/D4434

llvm-svn: 212625
2014-07-09 14:21:18 +00:00
Simon Atanasyan 4e16a4250d [Driver][Mips] Support one more MIPS CPU name - octeon.
llvm-svn: 212339
2014-07-04 12:37:04 +00:00
Simon Atanasyan 26610c5960 [Driver][Mips] Support more MIPS CPU names: mips1 - mips5.
llvm-svn: 212338
2014-07-04 12:36:56 +00:00
Sylvestre Ledru 0ccfb3a144 gcc comptability: silent -fdefer-pop & -fno-defer-pop
Reviewers: rafael, rnk

Reviewed By: rnk

Subscribers: rnk, cfe-commits

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

llvm-svn: 212327
2014-07-04 08:59:41 +00:00
Simon Atanasyan 6b3544eb1d [Driver][Mips] Check MIPS CPU name provided to the Clang driver.
llvm-svn: 212260
2014-07-03 08:31:23 +00:00
Daniel Sanders adbbfd1fe9 [mips] Added additional test cases for passing -mabi to the assembler.
Summary:
This patch adds minimal coverage for each -mcpu value to ensure that none of them can pass an empty string in -mabi. 

Prior to r212176, many -mcpu values would trigger this.

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

llvm-svn: 212182
2014-07-02 15:21:50 +00:00
Daniel Sanders b7689ba49d [mips] Make FileCheck prefixes match the CPU they check
Summary:
For example: s/MIPS32-EB-AS/MIPS32R2-EB-AS/ since it is for MIPS32r2 not MIPS32.

This reduces the noise in my next Clang patch.

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

llvm-svn: 212177
2014-07-02 13:21:52 +00:00
Simon Atanasyan a42a84e44c [Driver][Mips] If ABI name is not provided deduce it from the target triple
not from the CPU name. This approach is closer to the method used by gcc driver.

llvm-svn: 212176
2014-07-02 13:20:36 +00:00
David Majnemer f607234fde Driver: Handle /GR- in a compatible way with MSVC
There are slight differences between /GR- and -fno-rtti which made
mapping one to the other inappropriate.

-fno-rtti disables dynamic_cast, typeid, and does not emit RTTI related
information for the v-table.

/GR- does not generate complete object locators and thus will not
reference them in vftables.  However, constructs like dynamic_cast and
typeid are permitted.

This should bring our implementation of RTTI up to semantic parity with
MSVC modulo bugs.

llvm-svn: 212138
2014-07-01 22:24:56 +00:00
Reid Kleckner 3ed22c4d4e clang-cl: Ignore /Zc:inline and /Zc:rvalueCast
These flags enable behavior in MSVC that Clang has by default.

/Zc:inline essentially marks all COMDATs as discardable.  In LLVM
parlance, this means using linkonce_odr linkage, which is what we
already do.

llvm-svn: 212117
2014-07-01 18:27:02 +00:00
Sylvestre Ledru 91f380a499 GCC compatibility: Ignore -finput_charset=UTF-8 argument. It is the default in Clang.
Currently, we fail with an error.

Reviewers: rafael

Reviewed By: rafael

Subscribers: rnk, cfe-commits

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

llvm-svn: 212110
2014-07-01 17:24:27 +00:00
Alexey Samsonov c6496816b1 [UBSan] Don't link UBSan runtime into shared libraries.
It used to be a feature of UBSan (it could sanitize a standalone
shared object instead of the whole program), but now it causes
more problems, like PR20165.

llvm-svn: 212064
2014-06-30 20:27:16 +00:00
Simon Atanasyan 0091a0758b [Driver][Mips] Fix test cases - make ABI name and target triple consistent.
No functional changes.

llvm-svn: 212023
2014-06-30 08:10:01 +00:00
Simon Atanasyan 08c165ba37 [Driver][Mips] Check rejecting of invalid MIPS ABI names in the test.
No functional changes.

llvm-svn: 212022
2014-06-30 08:09:54 +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
Reid Kleckner c542d37995 clang-cl: Map /EHs- to -fno-exceptions
This isn't 100% compatible with MSVC, but it's close enough.  MSVC's /EH
flag doesn't really control exceptions so much as how to clean up after
an exception is thrown.  The upshot is that cl.exe /EHs- will compile
try, throw, and catch statements with a warning, but clang-cl will
reject such constructs with a hard error.  We can't compile such EH
constructs anyway, but this may matter to consumers of the AST.

Reviewers: hans

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

llvm-svn: 211909
2014-06-27 17:02:02 +00:00
Alexander Kornienko 9f2a4a0ab0 Don't check clang binary name, as it can be different in some test setups.
Summary: This unbreaks our internal build after these tests were turned on in r211738.

Reviewers: chandlerc

Reviewed By: chandlerc

Subscribers: benlangmuir, cfe-commits

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

llvm-svn: 211887
2014-06-27 11:18:13 +00:00
Justin Bogner 80effa415c Driver: Pass -ivfsoverlay to module crashdumps
When we create a crashdump involving modules, we build a VFS to
reproduce the problem with. This updates the reproduction script to
use that VFS.

llvm-svn: 211876
2014-06-27 06:35:05 +00:00
Saleem Abdulrasool 4b68a05f3d Driver: use GNU::Link for the Generic_GCC toolchain
This changes the behaviour of the driver for linking to match that of the
Generic_GCC::Assemble.    The default link should use "ld" rather than "gcc" for
the linker as gcc does.  This avoids the unnecessary round-tripping through gcc.
It also is much more reasonable behaviour from the user's perspective.  This
should have been updated with SVN r195554 which changed the behaviour of
Generic_GCC::Assemble.

The gcc_forward test needs to be updated to mark the fact that -march is a flag
for GCC not ld.  This was updated as a typo fix, but added a check for a flag
that is not a link flag.

The bindings test covers the change for testing, and thus no new test was added.

llvm-svn: 211866
2014-06-27 05:06:41 +00:00
NAKAMURA Takumi a217a1a68b clang/test/Driver/fuse-ld.c: Really fix to match dos path.
llvm-svn: 211841
2014-06-27 01:32:59 +00:00
Logan Chien ad86372630 Allow different path separator for windows build.
llvm-svn: 211823
2014-06-27 00:19:33 +00:00
Justin Bogner f05a499339 Driver: Fix a misleading comment and test for what it actually did
llvm-svn: 211806
2014-06-26 20:59:39 +00:00
Logan Chien 606769ecc6 Propset the executables for GetProgramPath().
llvm-svn: 211786
2014-06-26 14:38:46 +00:00
Logan Chien eb9162f0bb Implement the -fuse-ld= option.
This commit implements the -fuse-ld= option, so that the user
can specify -fuse-ld=bfd to use ld.bfd.

This commit re-applies r194328 with some test case changes.
It seems that r194328 was breaking macosx or mingw build
because clang can't find ld.bfd or ld.gold in the given sysroot.
We should use -B to specify the executable search path instead.

Patch originally by David Chisnall.

llvm-svn: 211785
2014-06-26 14:23:45 +00:00
Will Schmidt f048751912 Add ppc64/power8 as a target
llvm-svn: 211778
2014-06-26 13:34:10 +00:00
Reid Kleckner 69071442f0 Forward -u to the linker on gnutools toolchains
Summary:
The BSDs and Darwin all forward the whole 'u' group, but gcc only
forwards -u so far as I can tell.  I only forward -u, since that's a
minimal change, and many people object to magically recognizing and
forwarding linker arguments.

Reviewers: chandlerc, joerg

Subscribers: cfe-commits

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

llvm-svn: 211756
2014-06-26 01:08:54 +00:00
Alp Toker 262510a4ac Remove REQUIRES lines from portable tests
These tests are target-independent and shouldn't ever be suppressed.

llvm-svn: 211738
2014-06-25 22:46:44 +00:00
Alexey Volkov 54ff080e39 Align with new GCC options for x86 Android
32-bit: +ssse3
64-bit: +sse4.2 +popcnt

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

llvm-svn: 211688
2014-06-25 12:15:36 +00:00
Brad Smith 5b05db864b Use appropriate default PIE settings for OpenBSD.
llvm-svn: 211624
2014-06-24 19:51:29 +00:00
Simon Atanasyan 3a46afafef [Driver][Mips] Support mips64-linux-gnuabi64 / mips64el-linux-gnuabi64 target triples.
The patch fixes the bug #19869.
http://llvm.org/bugs/show_bug.cgi?id=19869

llvm-svn: 211619
2014-06-24 19:00:12 +00:00
Daniel Sanders 3b92c5bd41 [mips] Correct linux dynamic linker for -mnan=2008
Summary:
The dynamic linker is named ld-linux-mipsn8.so.1 when -mnan=2008 is given (or
is the default). It remains ld.so.1 for other cases.

This is necessary for MIPS32r6/MIPS64r6 since these ISA's default to -mnan=2008.

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

llvm-svn: 211598
2014-06-24 15:04:16 +00:00
Justin Bogner ce8245b5fd Driver: Restore proper naming of crashdump files
Based on a review of r211411 by Jordan Rose.

llvm-svn: 211572
2014-06-24 08:01:01 +00:00
Saleem Abdulrasool f7062b2313 Driver: correct behaviour of -fmsc-version=MAJOR
Ensure that we properly handle the case where just the major version component
is provided by the user.

Thanks to Alp Toker for pointing out that this was not handled correctly!

llvm-svn: 211506
2014-06-23 17:36:36 +00:00
Justin Bogner a88f0122e3 Driver: In crashdumps with -fmodule, dump the module dependencies
llvm-svn: 211421
2014-06-20 22:59:50 +00:00
Saleem Abdulrasool 9d45e77dca Driver: enhance MSC version compatibility
The version information for Visual Studio is spread over multiple variables.
The newer Windows SDK has started making use of some of the extended versioning
variables that were previously undefined.  Enhance our compatibility definitions
for these cases.

_MSC_VER is defined to be the Major * 100 + Minor.  _MSC_FULL_VER is defined to
be Major * 10000000 + Minor * 100000 + Build.  And _MSC_BUILD is the build
revision of the compiler.

Extend the -fmsc-version option in a compatible manner.  If the value is the
previous form of MMmm, then we assume that the build number is 0.  Otherwise, a
specific build number may be passed by using the form MMmmbbbbb.  Due to
bitwidth limitations of the option, it is currently not possible to define a
revision value.

The version information can be passed as either the decimal encoded value
(_MSC_FULL_VER or _MSC_VER) or as a dot-delimited value.

The change to the TextDiagnostic is to deal with the updated encoding of the
version information.

llvm-svn: 211420
2014-06-20 22:58:35 +00:00
Justin Bogner 332a5e526e Driver: Record that we're in crashdump and push flags to ConstructJob
It's more flexible and arguably better layering to set flags to modify
compiling for diagnostics in the CC1 job themselves, rather than
tweaking the driver flags and letting them propagate.

There is one visible change this causes: crash report files will now
get preprocessed names (.i and friends).

llvm-svn: 211411
2014-06-20 22:16:00 +00:00
Ulrich Weigand 454ac7c6f3 Add file missed in r211360 commit
llvm-svn: 211361
2014-06-20 14:32:39 +00:00
Ulrich Weigand 68e902c360 [PowerPC] Fix ELF interpreter name for powerpc64le-linux
On PowerPC LE the system uses the /lib64/ld64.so.2 dynamic linker name
instead of /lib64/ld64.so.1 (to indicate the ELFv2 ABI version).

This fixes the clang driver to pass the appropriate -dynamic-linker
setting, and adds some more tests to linux-ld.c.

llvm-svn: 211360
2014-06-20 14:19:02 +00:00
Ulrich Weigand a8331b9925 [PowerPC] Add MultiarchIncludeDirs for powerpc64le
There was already partial support for multi-arch on powerpc64le,
but the MultiarchIncludeDirs setting was missing.  This patch
adds the appropriate definition, and also extends the
linux-header-search.cpp test case to verify an Ubuntu 14.04
powerpc64le tree.

llvm-svn: 211359
2014-06-20 13:41:24 +00:00
Oliver Stannard c8e3b5f849 Improve robustness of tests for module flags metadata
Fix clang tests to not break if the ID numbers of module flags metadata
nodes change.

llvm-svn: 211276
2014-06-19 16:10:21 +00:00
Reid Kleckner 7d0c066346 Relax the cl-inputs.c test a little bit in case link.exe is on PATH
llvm-svn: 211224
2014-06-18 21:34:36 +00:00
Hans Wennborg 23d26a3ef7 Make clang-cl accept .lib inputs (PR20065)
Patch by Ehsan Akhgari!

(Tiny tweak by me: renamed PathSegment to LibDir.)

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

llvm-svn: 211189
2014-06-18 17:21:50 +00:00
Saleem Abdulrasool df903939c9 Driver: correct the backend option spelling
The backend option does not have an '-enable' prefix.

llvm-svn: 211177
2014-06-18 16:52:24 +00:00
Hans Wennborg 04c764f6d9 Add support for the /Fi argument to clang-cl (PR20036)
Patch by Ehsan Akhgari!

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

llvm-svn: 211081
2014-06-17 00:19:12 +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
Richard Smith dbd4d4c837 Add -std=c++1z flag for C++17 features.
llvm-svn: 211030
2014-06-16 15:16:56 +00:00
Hans Wennborg e50cec3759 Add support for the /EP argument to clang-cl
This maps the /EP argument to both -E and -P.

Patch by Ehsan Akhgari!

Differential Reviion: http://reviews.llvm.org/D4133

llvm-svn: 210935
2014-06-13 20:59:54 +00:00
Bill Schmidt 1cf7c64fa5 [PPC64LE] Run some existing Altivec tests on powerpc64le as well
There are several Altivec tests that formerly ran only on big-endian
targets (and in some cases only on 32-bit targets).  It is useful to
verify these on little-endian targets as well.

While testing these, I discovered a typo in <altivec.h>.  This is also
fixed by this patch.

llvm-svn: 210928
2014-06-13 18:30:06 +00:00
Alexey Samsonov e595e1ade0 Remove top-level Clang -fsanitize= flags for optional ASan features.
Init-order and use-after-return modes can currently be enabled
by runtime flags. use-after-scope mode is not really working at the
moment.

The only problem I see is that users won't be able to disable extra
instrumentation for init-order and use-after-scope by a top-level Clang flag.
But this instrumentation was implicitly enabled for quite a while and
we didn't hear from users hurt by it.

llvm-svn: 210924
2014-06-13 17:53:44 +00:00
Brad Smith 6d1dfdc011 Missed a space at the end of the line.
llvm-svn: 210884
2014-06-13 03:53:07 +00:00
Brad Smith 378e7f9b78 Use dwarf-2 by default on OpenBSD and FreeBSD.
The Tools.cpp part of the patch partially based on a patch from
FreeBSD's LLVM tree.

llvm-svn: 210883
2014-06-13 03:35:37 +00:00
Hans Wennborg 8f00837110 clang-cl: accept the /C option with /P (PR19978)
(It's also allowed with /EP, but we haven't implemented that option yet.)

llvm-svn: 210695
2014-06-11 19:44:53 +00:00
Saleem Abdulrasool aea65e9b13 Driver: add -m{,no-}long-calls support
This mirrors the GCC option for the ARM backend.  This option enables the
backend option "-enable-arm-long-calls".  The default behaviour is that this is
disabled due to the slight overhead of the generated calls.

If the target of jumps are greater than 64M range of offset-based jumps, then
the target address must be loaded into a register to make an indirect jump.  The
backend support for this has been present, but was not previously controllable
by the proper flag.

llvm-svn: 210398
2014-06-07 19:32:38 +00:00
Evgeniy Stepanov dad9206564 Fix driver warning about -pthread on Android.
-pthread is no-op on Android. Suppress the unused argument warning.

llvm-svn: 210253
2014-06-05 11:41:39 +00:00
Evgeniy Stepanov 6f0ae18a59 Fix driver warning about -shared-libasan on Android.
Asan runtime library is always shared on Android, and -shared-libasan is no-op.
Suppress the unused argument warning.

llvm-svn: 210252
2014-06-05 11:14:00 +00:00
Richard Smith 4244ea9ca1 [ubsan] Don't add a --dynamic-list for ubsan symbols when building a shared
library. That results in the linker resolving all references to weak symbols in
the DSO to the definition from within that DSO. Ironically, this rarely causes
observable problems, except that it causes ubsan's own dynamic type check to
spuriously fail (because we fail to properly merge type_info object names).

llvm-svn: 210220
2014-06-04 23:28:46 +00:00
Rafael Espindola d6f11a70ab Test fixes and improvements.
Remove redundant -fno-stack-protector run with openbsd.
Add -target to the -fstack-protector tests so they pass on openbsd.

Patch by Brad Smith.

llvm-svn: 209991
2014-06-01 13:45:09 +00:00