summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* Update link strategy for sanitizer runtime libraries on Linux:Alexey Samsonov2014-08-181-26/+33
| | | | | | | | | | | | | | | | | | | 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
* [x32] Handle -m64/-m32 switches by Driver in x32 modePavel Chupin2014-08-181-4/+8
| | | | | | | | | | | | | | | | | 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
* Move some code into a helper function. NFC.Rafael Espindola2014-08-151-45/+48
| | | | llvm-svn: 215731
* Use a switch statement for IsIntegratedAssemblerDefault().Brad Smith2014-08-141-7/+13
| | | | llvm-svn: 215678
* Use the big endian emulations for NetBSD/arm in EB mode.Joerg Sonnenberger2014-08-141-2/+17
| | | | llvm-svn: 215670
* Delete support for AuroraUX.Rafael Espindola2014-08-145-178/+1
| | | | | | auroraux.org is not resolving. llvm-svn: 215644
* Revert what looks like an unintended change in r215557.Rafael Espindola2014-08-131-1/+1
| | | | | | Should fix test ulibc driver tests. llvm-svn: 215561
* Header guard canonicalization, clang part.Benjamin Kramer2014-08-134-8/+8
| | | | | | Modifications made by clang-tidy with minor tweaks. llvm-svn: 215557
* [Driver] Support -muclibc / -mglibc command line options for a coupleSimon Atanasyan2014-08-133-4/+31
| | | | | | | | | | | | | 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
* For NetBSD, use the same settings for PPC64 as for PPC when it comes toJoerg Sonnenberger2014-08-133-2/+24
| | | | | | | integrated assembler, libc++ and libgcc. Set emulation for ld for both platforms for correct -m32 handling. llvm-svn: 215551
* Emit diagnostic for -munaligned-access on v6m targetsOliver Stannard2014-08-131-1/+5
| | | | | | | | | | Rather than silently disabling unaligned accesses for v6m targets as in the previous patch to llvm, instead produce a warning saying that this architecture doesn't support unaligned accesses. Patch by Ben Foster llvm-svn: 215531
* ToolChains.cpp: Increase size of Lines vector in DetectDistroHans Wennborg2014-08-111-1/+1
| | | | | | In a Clang bootstrap, the size of this vector was always 11. llvm-svn: 215370
* Increase the size of two SmallVectors in ↵Hans Wennborg2014-08-111-2/+2
| | | | | | | | Generic_GCC::GCCInstallationDetector::init In a bootstrap build of Clang, the size was always greater than 12. llvm-svn: 215369
* GCC compatibility: Ignore -fexec-charset=UTF-8 argument. It is the default ↵Sylvestre Ledru2014-08-111-0/+8
| | | | | | | | | | | | | | | | | | 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
* Use the correct fallback directory for EABIHF targets on NetBSD/arm.Joerg Sonnenberger2014-08-091-2/+4
| | | | | | From Matt Thomas. llvm-svn: 215292
* NetBSD/aarch64 has no libgcc or libstdc++. Drop arm64 tests.Joerg Sonnenberger2014-08-092-0/+2
| | | | llvm-svn: 215291
* Add -link-cxx-sanitizer driver flag.Alexey Samsonov2014-08-082-9/+10
| | | | | | | | | | | | | | | | | | | | | | 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
* Partially revert r215204 - [mips] Add -mabicalls/-mno-abicalls to the driverDaniel Sanders2014-08-081-3/+0
| | | | | | | | 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
* [mips] Invert the abicalls feature bit to be noabicalls so that it's ↵Daniel Sanders2014-08-081-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [mips] Add -mabicalls/-mno-abicalls to the driverDaniel Sanders2014-08-081-0/+12
| | | | | | | 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
* Driver: Add -fno-profile-arcs to go with -fprofile-arcsJustin Bogner2014-08-072-3/+6
| | | | | | This is a trivial gcc-compatible change. llvm-svn: 215051
* Use -Rblah, not -Wblah, to control remark diagnostics. This was always theRichard Smith2014-08-071-9/+1
| | | | | | | | | | | | | | | | | | | | | | intent when we added remark support, but was never implemented in the general case, because the first -R flags didn't need it. (-Rpass= had special handling to accomodate its argument.) -Rno-foo, -Reverything, and -Rno-everything can be used to turn off a remark, or to turn on or off all remarks. Per discussion on cfe-commits, -Weverything does not affect remarks, and -Reverything does not affect warnings or errors. The only "real" -R flag we have right now is -Rmodule-build; that flag is effectively renamed from -Wmodule-build to -Rmodule-build by this change. -Wpass and -Wno-pass (and their friends) are also renamed to -Rpass and -Rno-pass by this change; it's not completely clear whether we intended to have a -Rpass (with no =pattern), but that is unchanged by this commit, other than the flag name. The default pattern is effectively one which matches no passes. In future, we may want to make the default pattern be .*, so that -Reverything works for -Rpass properly. llvm-svn: 215046
* Add back the leading space when printing commands with -###Reid Kleckner2014-08-071-0/+1
| | | | | | This was an unintentional behavior change from r214924. llvm-svn: 215044
* [Driver] Move information about toolchain specific include directoriesSimon Atanasyan2014-08-061-17/+35
| | | | | | | | | | | | from the common driver code to the corresponding `MultilibSet` declarations. Now the `MultilibSet` can hold an optional callback function which is responsible to return a set of include directories specific for the toolchain. That allows to remove MIPS toolchain specific directories from `Linux::AddClangSystemIncludeArgs` method and simplify adding new directories in the future. llvm-svn: 214949
* Make crash diagnostics on Windows the tiniest bit more usefulReid Kleckner2014-08-052-1/+4
| | | | | | | | | | | | | | This escapes any backslashes in the executable path and fixes an issue with a trailing quote when the main file name had to be quoted during printing. It's impossible to test this without putting backslashes or quotes into the executable path, so I didn't add automated tests. The crash diagnostics are still only useful if you're using bash on Windows, though. This should probably be writing a batch file instead. llvm-svn: 214924
* Introduce f[no-]max-unknown-pointer-align=[number] optionFariborz Jahanian2014-08-051-0/+15
| | | | | | | | | 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
* Add coverage mapping generation.Alex Lorenz2014-08-041-0/+8
| | | | | | | | | | This patch adds the '-fcoverage-mapping' option which allows clang to generate the coverage mapping information that can be used to provide code coverage analysis using the execution counts obtained from the instrumentation based profiling (-fprofile-instr-generate). llvm-svn: 214752
* [Driver][Mips] Construct dynamic linker path by string concatination.Simon Atanasyan2014-08-041-12/+17
| | | | | | | | | That reduces a number of `if` operators and prevent a combinatorics explosion if/when more dynamic linker path variants added. No functional changes. llvm-svn: 214712
* Driver: Simplify a use of the path APIJustin Bogner2014-08-031-1/+1
| | | | | | | It's a bit more obvious what's going on if we use path::filename rather than decrementing an iterator here. llvm-svn: 214668
* Tools.cpp: Avoid std::to_string() on -fbuild-session-timestamp to appease ↵NAKAMURA Takumi2014-08-031-3/+4
| | | | | | mingw32 builder. llvm-svn: 214656
* Add -fbuild-session-file as an alternative to -fbuild-session-timestampBen Langmuir2014-08-011-1/+15
| | | | | | | | 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
* Xcore target: Fix CXXStdlibIncludeArgs to check 'nostdinc++' flag too.Robert Lytton2014-08-011-1/+2
| | | | | | | | | | Summary: There are no tests as it is dependant upon the environment variables XCC_C_INCLUDE_PATH & XCC_CPLUS_INCLUDE_PATH being set. Differential Revision: http://reviews.llvm.org/D4621 llvm-svn: 214510
* [Driver][Mips] Add function-wrapper so simplify creation of `Multilib` objects.Simon Atanasyan2014-07-301-74/+27
| | | | | | No functional changes. llvm-svn: 214294
* Support LIBRARY_PATH on all Darwin targets.Bob Wilson2014-07-291-0/+5
| | | | | | | | | | | | | | | 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
* Fix up handling of ARM options for controlling strict alignment.Bob Wilson2014-07-291-23/+18
| | | | | | | | | | | | | | | | | | | | | | 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
* [PowerPC] Support ELFv1/ELFv2 ABI selection via -mabi= optionUlrich Weigand2014-07-282-3/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add missing override keyword to OpenBSD IsIntegratedAssemblerDefault().Brad Smith2014-07-281-1/+1
| | | | llvm-svn: 214060
* Now that PIC generation on PPC32 is supported, hook up linking supportJoerg Sonnenberger2014-07-252-2/+4
| | | | | | for NetBSD. llvm-svn: 213972
* Return a StringRef in getDefaultUniversalArchName.Rafael Espindola2014-07-251-1/+1
| | | | | | Patch by Stephen Drake. llvm-svn: 213964
* [Driver][Mips] Remove "fp64" directories from the mips-mti-linux-gnu toolchainSimon Atanasyan2014-07-251-15/+0
| | | | | | | directories description. Released version of this toolchain has not separate libraries for -mfp64 command line option. llvm-svn: 213937
* MachO: use "arm64" as the triple name in modules.Tim Northover2014-07-241-0/+11
| | | | | | | | | 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
* AArch64: update Clang for merged arm64/aarch64 triples.Tim Northover2014-07-234-49/+14
| | | | | | | | | | | | | | 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
* [mips] -mno-shared should only be given to the assembler when ↵Daniel Sanders2014-07-231-2/+16
| | | | | | | | -fPIC/-fpic/-fPIE/-fpie is not in effect. This fixes compiler recursion on MIPS32r2. llvm-svn: 213741
* [Driver][Mips] Restore FIXME comment was removed accidentally.Simon Atanasyan2014-07-231-0/+2
| | | | llvm-svn: 213734
* clang-cl: ignore /showIncludes when combined with /E (PR20336)Hans Wennborg2014-07-211-2/+5
| | | | | | | | 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
* For i386, gcc 4.9 under Debian (at least) updated its paths to i586-linux-gnuSylvestre Ledru2014-07-181-1/+1
| | | | | | | | | | | (i486-linux-gnu previously). Adding this triple to the list of search. Also impacts clang 3.4.2 Reported on the Debian bug tracking system here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=754963 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=755183 llvm-svn: 213388
* [mips] Use Triple::getVendor() instead of Triple::getVendorName() to ↵Daniel Sanders2014-07-181-1/+1
| | | | | | identify 'mti' vendor triples. llvm-svn: 213383
* [AArch64] Implement Clang CLI interface proposal about "-march".Kevin Qin2014-07-182-46/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Using a std::string instead of a StringRef because the Default case ↵Aaron Ballman2014-07-171-6/+6
| | | | | | | | synthesizes a temporary std::string from a Twine. Assigning that into a StringRef causes the StringRef to refer to a temporary, and bad things happen. This fixes a failing test case on Windows. llvm-svn: 213265
* [mips] Pass the ABI to the integrated assembler and add tests the existing ↵Daniel Sanders2014-07-171-0/+11
| | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud