Commit Graph

1364 Commits

Author SHA1 Message Date
Bob Wilson 721d4b858d Enable stack protectors by default for iOS. <rdar://problem/8836680>
llvm-svn: 146552
2011-12-14 06:08:25 +00:00
Nick Lewycky 12eae8085c Fix "control may reach end of non-void function" warning.
llvm-svn: 146448
2011-12-12 23:36:07 +00:00
Tony Linthicum 76329bf83f Hexagon backend support
llvm-svn: 146413
2011-12-12 21:14:55 +00:00
Daniel Dunbar 19939cc380 Driver: Handle -f{no-}honor-infinities, -f{no-}honor-nans, and
-ffinite-math-only.
 - No test case yet, I don't know how to construct a situation where this
   matters.

llvm-svn: 146297
2011-12-09 23:41:18 +00:00
Chandler Carruth 0b84291222 Fix the --hash-style option when the target is MIPS as it is
incompatible with the MIPS ABI.

Patch by Simon Atanasyan.

llvm-svn: 146243
2011-12-09 04:45:18 +00:00
Eli Friedman 83de51301a Misc Minix-specific changes to clang:
. move compiler-rt to a separate directory so the -L argument only includes compiler-rt (thanks joerg)
. build all clang subdirs
. switches the Minix platform to ELF
. normalizes toolchain invocation

Patch by Ben Gras.

llvm-svn: 146206
2011-12-08 23:54:21 +00:00
Hal Finkel 221e11e864 Allow clang to find gcc libs on suse ppc64
llvm-svn: 146142
2011-12-08 05:50:03 +00:00
Bob Wilson 8c9052bd31 Minor cleanup. Avoid redundant getTriple() calls.
llvm-svn: 146122
2011-12-08 01:10:19 +00:00
Daniel Dunbar 3ca41d4758 Driver/Linux: Fix the ASAN library path to match current compiler-rt
integration.

llvm-svn: 146098
2011-12-07 23:22:17 +00:00
Daniel Dunbar f4916cde76 Driver: Add a --rtlib={compiler-rt,libgcc} argument which I plan to use to allow
dual support for compiler-rt on Linux, during bringup.

llvm-svn: 146094
2011-12-07 23:03:15 +00:00
Eli Friedman 1f1e35e034 Fix multilib library paths on ppc64 Linux. Patch by Michael Kostylev. PR11472.
llvm-svn: 146016
2011-12-07 04:00:53 +00:00
Kostya Serebryany 0b692ce7ca [asan] Mac: do not link dynamic libs with the asan-rt, use -undefined dynamic_lookup for dynamic libs. Style fixes. Patch by glider@google.com
llvm-svn: 145955
2011-12-06 19:18:44 +00:00
Nick Lewycky f4d3f7a0b9 Stack realignment is a tristate. Add -mno-stackrealign to turn off all stack
realignment, even with locals with alignment exceeding the ABI guarantee.

llvm-svn: 145909
2011-12-06 03:33:03 +00:00
Joerg Sonnenberger db66ed0e4c Add -mstack-alignment=X and fix -mstackrealign handling now that the
backend options are gone.

llvm-svn: 145868
2011-12-05 23:05:23 +00:00
Kostya Serebryany 4dd9e4765d [asan] don't require libstdc++ for asan on linux. Mac fix will go separately
llvm-svn: 145823
2011-12-05 18:32:37 +00:00
Daniel Dunbar 1d6469fcb1 Driver/Darwin: Add ASAN runtime library link support.
llvm-svn: 145651
2011-12-01 23:40:18 +00:00
Akira Hatanaka 5e9dde3782 Get the -march argument based on the target MIPS architecture or cpu and pass
it to GNU assembler. In addition, change function getMipsArchFromCPU() so that
it can be reused in ConstructJob(). 

Patch by Simon Atanasyan.

llvm-svn: 145509
2011-11-30 19:31:38 +00:00
Kostya Serebryany 7bca6c24ec when -faddress-sanitizer is present, add required flags to the linker command (linux-only)
llvm-svn: 145467
2011-11-30 01:39:16 +00:00
Akira Hatanaka a21f5dab3c Change processor names. Patch by Simon Atanasyan.
llvm-svn: 145453
2011-11-29 23:09:24 +00:00
NAKAMURA Takumi 64404a3b2c [Win32] Catch exceptions (eg. segfault) on waiting for invoked clang from the driver.
clang/lib/Driver/Driver.cpp: Don't pass through negative exit status, or parent would be confused.

llvm::sys::Program::Wait(): Suppose 0x8000XXXX and 0xC000XXXX as abnormal exit code and pass it as negative value.

Win32 Exception Handler: Exit with ExceptionCode on an unhandle exception.

llvm-svn: 145389
2011-11-29 07:47:04 +00:00
Eli Friedman 4a4932c29b A couple driver fixes for PPC Linux. Patches by Michael Kostylev. PR11444/PR11445.
llvm-svn: 145321
2011-11-28 23:46:52 +00:00
Richard Smith 9a56882e53 Add driver arguments -ftemplate-depth=N and -fconstexpr-depth=N, with the same
semantics and defaults as the corresponding g++ arguments. The historical g++
argument -ftemplate-depth-N is kept for compatibility, but modern g++ versions
no longer document that option.

Add -cc1 argument -fconstexpr-depth N to implement the corresponding
functionality.

The -ftemplate-depth=N part of this fixes PR9890.

llvm-svn: 145045
2011-11-21 19:36:32 +00:00
Roman Divacky d150ad3f07 Change the linker emulation name for FreeBSD/PPC32.
Submitted by Andreas Tobler!

llvm-svn: 145041
2011-11-21 16:50:32 +00:00
Peter Collingbourne 119cfaa595 Teach the driver about failure result files, which are compilation
output files that are valid regardless of whether the compilation
succeeded or failed (but not if we crash).  Add depfiles to the
failure result file list.

llvm-svn: 145018
2011-11-21 00:01:05 +00:00
Benjamin Kramer 7824360017 Driver: Remove the signal number from the "command failed" diagnostic.
- With the current implementation of sys::Program this always printed "2".
- The command execution code will output the right number anyway (including the signal name).

llvm-svn: 144993
2011-11-19 10:24:49 +00:00
Daniel Dunbar 4f41440cf9 clang/Darwin: Use the compiler-rt provided profile library.
llvm-svn: 144869
2011-11-17 00:36:57 +00:00
Kostya Serebryany 8855ff61cb Add -f[no-]address-sanitizer flag
llvm-svn: 144800
2011-11-16 17:34:26 +00:00
Matt Beaumont-Gay 8e9aae5999 Don't track depfiles as result files which need to be cleaned up on failure.
This is a partial revert of r143846. While cleaning up after a crash is
probably a good idea, we were also deleting .d files if the compilation failed
due to invalid input, which is not the desired behavior. The test is XFAIL'd
until the cleanup code can be reworked to do the right thing.

llvm-svn: 144590
2011-11-14 23:24:52 +00:00
Bob Wilson 1a9ad0fbee Search for libstdc++.dylib in llvm-gcc's files on darwin10. rdar://10419079
llvm-svn: 144381
2011-11-11 07:47:04 +00:00
Eli Friedman 7771c835cd Add Linux multiarch include directories for mips/mipsel. Patch from Simon Atanasyan.
llvm-svn: 144358
2011-11-11 03:05:19 +00:00
Ted Kremenek e73d9ed1a2 Add top-level driver option '--serialize-diagnostics' for serialize compiler diagnostics to a file.
llvm-svn: 144339
2011-11-11 00:07:43 +00:00
Chandler Carruth 6e46ca2c10 Fix an issue that Duncan discovered on a specific (no longer current)
version of Ubuntu. It has a very broken multiarch configuration, and so
we need special logic to handle it correctly. Fixing and testing this
uncovered a few other trivial issues with the logic that are fixed as
well.

I added tests to cover this as it is hard to notice if you install
recent versions of the OS.

llvm-svn: 144165
2011-11-09 03:46:20 +00:00
Eli Friedman 27b8c4f3fb Misc fixes for clang driver on Mips Linux. Patch by Simon Atanasyan.
llvm-svn: 144108
2011-11-08 19:43:37 +00:00
Chandler Carruth 475ab6ad7b Add a default system include of '/include'. This isn't particularly
useful when using Clang as a system-compiler, but its harmless. When
using Clang as a cross-compiler, this can be very handy as quite a few
toolchains ship their libc headers here rather than under
'/usr/include'.

For reference, this is the beginning of my work to also make the Clang
driver more suitable as a cross-compiler.

llvm-svn: 144089
2011-11-08 17:19:47 +00:00
Chad Rosier 8fe3b115cd Whitespace.
llvm-svn: 144002
2011-11-07 19:52:29 +00:00
Chad Rosier 1746e37cb8 Tablegenify -g options.
llvm-svn: 144001
2011-11-07 19:51:54 +00:00
Benjamin Kramer f5fbe436bc Fix an unsafe use of Twine.
llvm-svn: 143962
2011-11-07 16:02:25 +00:00
Chandler Carruth a62ba81682 Rip out one of the features I added for the driver-include-management.
We don't actually need a separate flag for non-sysrooted paths as the
driver has to manage the sysroot anyways. The driver is not infrequently
adding paths to the header search based on their existence on the
filesystem. For that, it has to add the sysroot anyways, we should pass
it on down to CC1 already joined. More importantly, the driver cannot in
all cases distinguish between sysrooted paths and paths that are
relative to the Clang binary's installation directory. Essentially, we
always need to ignore the system root for these internal header search
options. It turns out in most of the places we were already providing
the system root in the driver, and then another one in CC1 so this fixes
several bugs.

llvm-svn: 143917
2011-11-07 09:17:31 +00:00
Chandler Carruth f470173e46 Fix Linux libc++ usage. Somehow this slipped through during the port.
Test cases for this and all the rest of the port are still in the works,
but will wait for a fixed computer and post 3.0 merging...

llvm-svn: 143916
2011-11-07 09:01:17 +00:00
Chandler Carruth efad16ad6b Begin lifting some of the one-off checking logic into generic helper
routines on the base toolchain class.

llvm-svn: 143900
2011-11-06 23:39:37 +00:00
Chandler Carruth 4c90fba23e Move the GCC installation detection logic down into the Generic_GCC
toolchain. The logic is mostly generic already, and where possible
should be made more generic. Also, it has no impact other than to expose
a set of methods which each toolchain can then query to setup their
desired configuration. These should be available to toolchains beyond
just Linux.

llvm-svn: 143899
2011-11-06 23:39:34 +00:00
Chandler Carruth 0c0981ee47 Remove an old OpenSUSE hack that is no longer needed -- it is exactly
the same as a directory added further down in the new logic.

llvm-svn: 143897
2011-11-06 23:10:49 +00:00
Chandler Carruth d0b93d6daf Remove the HasMultilib check. It was essentially useless. The driver now
looks for evidence of a multilib installation, and adds the appropriate
bits to the search paths.

llvm-svn: 143896
2011-11-06 23:09:05 +00:00
Chandler Carruth 0ad080e720 The version objects need to actually store the version strings; they
aren't guaranteed to live long enough otherwise.

llvm-svn: 143875
2011-11-06 10:51:30 +00:00
Chandler Carruth f5d4df9e44 Throw the switch and move all Linux header search over to the GCC
detection system that is providing the library paths and crt object
files.

This, modulo any bugs that need to be shaken out, resolves numerous bugs
with how we handle header paths. Here are a few that I know of:
- We no longer need to enumerate all GCC versions searched.
- OpenSUSE searched GCC versions in the wrong order.
- There were typos when selecting various patterns, etc.
- We aren't stating quite some many directories now.
- SysRoot didn't always work in a reasonable way.

I'm working on tests for this, but the tests are making me and Lit sad.
The real testing for this type of driver change is to try it out on
various distributions. I'll hit the common ones right away, and start
more thorough testing tomorrow after some sleep.

llvm-svn: 143874
2011-11-06 10:31:01 +00:00
Chandler Carruth 7e62da2845 Add a missing triple spotted by inspecting and testing of the include
path triples. Also order the 32-bit triples a bit more reasonably.

llvm-svn: 143873
2011-11-06 10:30:58 +00:00
Chandler Carruth d95843aa8a Lift the GCCVersion type into the header file and start persisting it in
the detected GCC installation. This allows us to expose another aspect
of what we detected: the GCC version. This will be used shortly.

llvm-svn: 143871
2011-11-06 09:39:46 +00:00
Chandler Carruth 4be70dd963 Switch some of these interfaces from std::string to StringRef and Twine.
This will facilitate further use and recombinations of them.

llvm-svn: 143869
2011-11-06 09:21:54 +00:00
Chandler Carruth 5b77c6c618 Take a better approach to detecting and selecting multiarch include
directories. This way we stop at the first multiarch directory found on
the system. This achieves the real intended result of pruning
non-existent directories.

llvm-svn: 143866
2011-11-06 08:21:07 +00:00
Chandler Carruth 5da43e83d2 Revert r143864, as the problem I was actually looking at can be solved
a better way. The more I think about it the more worried I am that this
hammer is simply too large. We should only be reaching out to the
filesystem when doing interesting "detection" things, not gratuitously.

Original commit message:
Start pruning down the set of flags passed to CC1 for header search.
This cleans up the CC1 invocations, and reduces the overhead there.
We're still hammering the filesystem looking for the C++ standard
libraries though.

The only reservation I have about this policy is the case of virtualized
files inside of CC1, but it's not clear what the best way to solve that
is. The Driver consistently queries the actual filesystem to make its
decisions. Changing that would be a very large undertaking. It might be
worthwhile, but it's not an immediate goal.

llvm-svn: 143865
2011-11-06 08:21:04 +00:00