Commit Graph

2023 Commits

Author SHA1 Message Date
Rafael Espindola 03bc68268f Convert last use of PathV1.h in Compilation.cpp
The way we decide which file to remove is fairly odd. I took a quick look at
maybe changing that, but it would be a more work than I want to put at this
right now, so I left pair of FIXMEs.

llvm-svn: 184766
2013-06-24 17:59:44 +00:00
Rafael Espindola a466b9aeb9 Convert a use of PathV1.h
llvm-svn: 184753
2013-06-24 16:46:15 +00:00
Chandler Carruth e4458b3204 The profile library must come before the C library so that it can use
atexit.

llvm-svn: 184708
2013-06-24 09:38:45 +00:00
Chandler Carruth 363817092e Fix the addition of Clang's profile runtime library to the link step
when specifying --coverage (or related) flags.

The system for doing this was based on the old LLVM-hosted profile_rt
library, and hadn't been updated for Linux to use the new compiler-rt
library. Also, it couldn't possibly work on multiarch or biarch systems
in many cases. The whole thing now works much the same as the sanitizer
libraries that are built and used out of the compiler-rt repo.

Note that other target OSes haven't been updated because I don't know if
they're doing anything special with the installation path of profile_rt.
I suspect however that *all* of these are wrong and would encourage
maintainers of each target to take a hard look at how compiler-rt
runtime libraries are linked on their platforms.

llvm-svn: 184666
2013-06-23 11:28:48 +00:00
Chandler Carruth b427c56399 Reword and reformat some of the "Multiarch" code in the toolchain setup.
There are fundamentally two different things that were getting conflated
here.

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

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

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

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

llvm-svn: 184632
2013-06-22 11:35:51 +00:00
Chandler Carruth d6c62b66b5 Update a comment to clarify that searching the target triple bin
directory for programs used by the driver is actually the standard
behavior we want to be compatible with GCC cross compilers -- it isn't
specific to SUSE or any other distro.

Also start fleshing out testing of the different cross compilation
patterns, both with a new very bare-bones tree of cross compilers and by
extending the multilib trees. Currently, we don't correctly model doing
a cross compile using the non-triple target of a bi-arch GCC install,
but I'll add support for that (and tests) next.

llvm-svn: 184499
2013-06-20 23:37:54 +00:00
Evgeniy Stepanov edc91428a2 Add -fno-assume-sane-operator-new when building with MSan.
A workaroudn for PR16386. MSan's operator new aften has side-effects that are
miscompiled without this flag.

llvm-svn: 184410
2013-06-20 10:49:46 +00:00
Richard Smith 8e5e97690d Fix typo in r184308.
llvm-svn: 184391
2013-06-20 01:33:59 +00:00
Renato Golin 96d7cd9d10 Revert "Adds support for openSUSE ARM v5/v7 triples."
This reverts commit 312e51ca484976c2b1254952ff23d5162ca8edc2.

llvm-svn: 184324
2013-06-19 17:28:50 +00:00
Renato Golin b1c12ce4ef Adds support for openSUSE ARM v5/v7 triples.
Now, with a comma.

Patch by İsmail Dönmez

llvm-svn: 184323
2013-06-19 17:28:42 +00:00
Reid Kleckner 3793d5ed30 [Driver] Don't forward source file input args to gcc
gcc's inputs are already added by the InputInfoList passed to
Action::ConstructJob.

Fixes a regression from r183989.  This was manifesting when targetting
mingw as an extra input argument to gcc when assembling.  It presumably
affects other situations where clang calls gcc.

Prior to r183989, forwardToGCC() was returning false because the INPUT
option defined in OptParser.td had the DriverOption flag set on it.
LLVM's Option library does not set this flag for INPUT.

Reviewers: espindola

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

llvm-svn: 184308
2013-06-19 15:09:06 +00:00
James Molloy 4da7f88d2c Revert r184302 on Renato's behalf - it broke the bots and he's asked me to revert as he's unavailable.
llvm-svn: 184307
2013-06-19 15:03:14 +00:00
Renato Golin f86ae72e6d Adds support for openSUSE ARM v5/v7 triples.
Patch by İsmail Dönmez

llvm-svn: 184302
2013-06-19 14:03:51 +00:00
Rafael Espindola 8be5c0550e Use llvm::sys::fs::can_execute.
llvm-svn: 184297
2013-06-19 13:24:29 +00:00
Manman Ren 9691f7fa35 Debug Info: support for gdwarf-2 gdwarf-3 gdwarf-4
These options will add a module flag with name "Dwarf Version".
The behavior flag is currently set to Warning, so when two values disagree,
a warning will be emitted.

llvm-svn: 184276
2013-06-19 01:46:49 +00:00
Rafael Espindola fc92e84586 Use llvm::sys::fs::can_write.
llvm-svn: 184234
2013-06-18 20:58:25 +00:00
John McCall 1fe2a8c87e Add support for -fpcc-struct-return. Patch by Arthur O'Dwyer!
llvm-svn: 184166
2013-06-18 02:46:29 +00:00
Eric Christopher eec89c202e Accept and ignore -fdebug-types-section for now. This will be used
later with dwarf4 type hashing.

llvm-svn: 184152
2013-06-18 00:03:50 +00:00
Rafael Espindola 1600a53bc0 Include PathV1.h only where it is used.
llvm-svn: 184090
2013-06-17 17:23:47 +00:00
Reid Kleckner 724c21c05b [Driver] Remove the using namespace directives from headers
This adds a bunch of llvm::opt name specifiers to all the uses of types
from that namespace.

Reviewers: espindola

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

llvm-svn: 184079
2013-06-17 13:59:19 +00:00
Reid Kleckner 898229ab4b [Driver] Refactor clang driver to use LLVM's Option library
The big changes are:
- Deleting Driver/(Arg|Opt)*
- Rewriting includes to llvm/Option/ and re-sorting
- 'using namespace llvm::opt' in clang::driver
- Fixing the autoconf build by adding option everywhere

As discussed in the review, this change includes using directives in
header files.  I'll make follow up changes to remove those in favor of
name specifiers.

Reviewers: espindola

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

llvm-svn: 183989
2013-06-14 17:17:23 +00:00
Tim Northover fbb56b7bd9 Remove implicit fallthrough from AArch64 to Mips in lib selection
Nothing useful to AArch64 will (should!) be found in any Mips-specific
directories.

Patch by Luke Zarko.

llvm-svn: 183956
2013-06-13 22:54:55 +00:00
Rafael Espindola cb4bb19070 Use the sys::ExecuteAndWait that takes StringRefs.
Also don't depend on Program.h including PathV1.h.

llvm-svn: 183935
2013-06-13 20:08:52 +00:00
Tim Northover 92509c1c0c Teach clang about the armv4/armv4t distinction
When choosing a default CPU, clang used to pick ARM7TDMI (which has Thumb) even
when the more restrictive armv4 triple was specified. This should fix that.

Patch by Jeroen Hofstee.

llvm-svn: 183905
2013-06-13 15:02:46 +00:00
Sylvestre Ledru 93c47b74bb Add Ubuntu Saucy to the list of known Ubuntu releases
Thanks to Dmitry Shachnev for the patch
See bug #16317

llvm-svn: 183899
2013-06-13 11:52:27 +00:00
Rafael Espindola a3346d8765 Use the global functions instead of the Program methods.
llvm-svn: 183861
2013-06-12 20:44:26 +00:00
Rafael Espindola 8fb2a7e7ac Try to fix the windows build.
llvm-svn: 183783
2013-06-11 20:06:05 +00:00
Eric Christopher ac0217424c When we're compiling with -pg make sure to link with gcrt1.o on linux. Be
sure to do this always, this matches the behavior for the gcc driver.

Fixes PR16251.

Based on a patch by Qiao Yang.

llvm-svn: 183591
2013-06-07 23:25:01 +00:00
Eric Christopher 30aa6b6243 If we're splitting the dwarf for fission and don't want to use the
integrated assembler then go ahead and still split the dwarf anyhow.

Add two tests, one to exercise existing behavior of not splitting
when we're just emitting assembly files and the other to test
that we split when we're not in integrated as mode.

llvm-svn: 183355
2013-06-05 23:58:15 +00:00
Rafael Espindola 044f783bc0 Default to PIE and using stack protection on OpenBSD.
Patch by Matthew Dempsky.

llvm-svn: 183295
2013-06-05 04:28:55 +00:00
Peter Collingbourne 9d9e1fc479 Driver: implement --dyld-prefix option.
This option is used to select a dynamic loader prefix to be used
at runtime. Currently this is implemented for the Linux toolchain.

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

llvm-svn: 182744
2013-05-27 21:40:20 +00:00
Sergey Matveev 1814e9eae3 Add -fsanitize=leak to driver options.
If -fsanitize=leak is specified, link the program with the
LeakSanitizer runtime. Ignore this option when -fsanitize=address is specified,
because AddressSanitizer has this functionality built in.

llvm-svn: 182729
2013-05-27 11:17:01 +00:00
Evgeniy Stepanov 758b5071d1 Add -lrt to sanitizer link arguments.
Sanitizer runtime intercepts functions from librt. Not doing this will fail
if the librt dependency is not present at program startup (ex. comes from a
dlopen()ed library).

llvm-svn: 182645
2013-05-24 14:28:03 +00:00
Bill Wendling 4814317516 Constify the 'dump' method so that it can be called by a const object.
llvm-svn: 182620
2013-05-23 23:10:23 +00:00
Evgeniy Stepanov dd54c337c4 Extend default blacklist logic to MSan and TSan.
llvm-svn: 182269
2013-05-20 14:10:58 +00:00
Chandler Carruth 0d4b9e61de Fix a logic bug in the handling of -fmath-errno in the driver. We would
imply -fno-math-errno if the user passed -fno-fast-math OR -ffast-math,
regardless of in which order and regardless of the tool chain default.

I've fixed this to follow the logic:

1) If the last dominating flag is -fno-math-errno, -ffast-math, or
   -Ofast, then do not use math-errno.
2) If the last dominating flag is an explicit -fmath-errno, do use
   math-errno.
3) Otherwise, use the toolchain default.

This, for example, allows the flag sequence
'-ffast-math ... -fno-fast-math' with no mention of '-fmath-errno' or
'-fno-math-errno' to preserve the toolchain default. Most notably, this
should prevent users trying to disable fast-math optimizations on Darwin
and BSD platforms from simultaneously enabling (pointless) -fmath-errno.

I've enhanced the tests (after more reorganization) to cover this and
other weird permutations of flags and targets.

llvm-svn: 182203
2013-05-18 20:47:36 +00:00
Simon Atanasyan c580b3248c [Mips] Add -mldc1-sdc1 / -mno-ldc1-sdc1 command line options.
llvm-svn: 181660
2013-05-11 06:33:44 +00:00
Richard Smith a3d3bd215b C++1y: Add a step limit to constexpr evaluation, to catch runaway loops.
llvm-svn: 181388
2013-05-08 02:12:03 +00:00
Ulrich Weigand 47445073f8 Add SystemZ support
This patch then adds all the usual platform-specific pieces for SystemZ:
driver support, basic target info, register names and constraints,
ABI info and vararg support.  It also adds new tests to verify pre-defined
macros and inline asm, and updates a test for the minimum alignment change.

This version of the patch incorporates feedback from reviews by
Eric Christopher and John McCall.  Thanks to all reviewers!

Patch by Richard Sandiford.

llvm-svn: 181211
2013-05-06 16:26:41 +00:00
Tom Stellard b38600c4a9 R600: Update GPU variants in -mcpu option
We've added the RS880 variant in the LLVM backend to represent an R600
GPU with no vertex cache, so we need to update the GPU mappings for
-mcpu.

llvm-svn: 181202
2013-05-06 16:12:05 +00:00
Chad Rosier 357672316b [driver] Allow multiple -arch options with -save-temps by adding the arch name
to the temporary files.
rdar://13218604

llvm-svn: 180813
2013-04-30 22:01:21 +00:00
Rafael Espindola 34cfafde9d Always use / when computing mips specific paths.
We were getting paths with both / and \ in them. This should fix mips-cs-ld.c
on the windows bots.

llvm-svn: 180783
2013-04-30 12:24:40 +00:00
Simon Atanasyan 036d16d916 [Mips] Pass -mips16, -mmicromips, -mdsp and -mdspr2 flags to the
assembler.

llvm-svn: 180775
2013-04-30 07:47:13 +00:00
Joerg Sonnenberger 428ef1e368 Add support for -stdlib=libc++ in the NetBSD toolchain.
llvm-svn: 180766
2013-04-30 01:21:43 +00:00
Benjamin Kramer 85f5aa1e6d Exit early when $PWD isn't set. Remove unused unistd.h include.
llvm-svn: 180670
2013-04-27 08:42:33 +00:00
Benjamin Kramer 698d7c86f0 Use LLVM's preferred current_path API instead of calling getcwd(3) directly.
The existing code also failed to allocate a buffer for it so getcwd corrupted
the stack. sys::fs::current_path takes care of the memory management.

llvm-svn: 180669
2013-04-27 08:12:29 +00:00
Chad Rosier 1675c0e6e3 [driver] Revert r180652 and 180658 and temporarily #define MAXPATHLEN to
make the gdb tests and the Windows bots happy.

The Path::GetCurrentDirectory API is not equivalent to ::getcwd(), so 
r180652 causes a gdb tests to fail.  On the other hand, <sys/param.h> 
isn't defined on Windows systems, so that causes Windows builds to fail.
rdar://12237559

llvm-svn: 180661
2013-04-27 01:14:43 +00:00
Chad Rosier df001f7fb2 Fix the dangling pointer.
llvm-svn: 180658
2013-04-27 00:57:18 +00:00
Chad Rosier 5a8341d6be [driver] Use the llvm equivalent of getcwd(). Hopefully, this makes the Windows
bots recover.
rdar://12237559

llvm-svn: 180652
2013-04-27 00:11:10 +00:00
Chad Rosier a35d5a38fe [driver] Implement the -fdebug-compilation-dir in a way that is compatible with
gcc.  No test case included as I'm having problems finding a test case where
the inode/dev don't match.

llvm-svn: 180628
2013-04-26 20:49:50 +00:00