summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Tools.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Handle SPARC float command line parameters for SPARCv9.Brad Smith2014-08-191-1/+2
| | | | llvm-svn: 216029
* 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
* Move some code into a helper function. NFC.Rafael Espindola2014-08-151-45/+48
| | | | llvm-svn: 215731
* 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-141-108/+0
| | | | | | 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-131-1/+1
| | | | | | Modifications made by clang-tidy with minor tweaks. llvm-svn: 215557
* [Driver] Support -muclibc / -mglibc command line options for a coupleSimon Atanasyan2014-08-131-1/+10
| | | | | | | | | | | | | 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-131-0/+12
| | | | | | | 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
* 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
* NetBSD/aarch64 has no libgcc or libstdc++. Drop arm64 tests.Joerg Sonnenberger2014-08-091-0/+1
| | | | llvm-svn: 215291
* Add -link-cxx-sanitizer driver flag.Alexey Samsonov2014-08-081-5/+5
| | | | | | | | | | | | | | | | | | | | | | 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-071-2/+4
| | | | | | 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
* 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
* 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
* 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-281-3/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Now that PIC generation on PPC32 is supported, hook up linking supportJoerg Sonnenberger2014-07-251-1/+2
| | | | | | for NetBSD. llvm-svn: 213972
* AArch64: update Clang for merged arm64/aarch64 triples.Tim Northover2014-07-231-25/+7
| | | | | | | | | | | | | | 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
* [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-181-41/+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
* Typically linker options are protected with -Xlinker or -Wl,Arthur Marble2014-07-161-2/+7
| | | | | | | | 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
* [Driver][Mips] Reduce code duplication - use existing functionSimon Atanasyan2014-07-161-11/+11
| | | | | | | | getMipsCPUAndABI() to get MIPS ABI name during multi-library selection. No functional changes. llvm-svn: 213143
* [mips] Correct the invocation of GAS in several cases.Daniel Sanders2014-07-161-8/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [mips] Add support for -mfpxx and -mno-fpxx.Daniel Sanders2014-07-161-0/+4
| | | | | | Differential Revision: http://reviews.llvm.org/D4464 llvm-svn: 213132
* Don't add -Bsymbolic by default on Android.Evgeniy Stepanov2014-07-161-3/+0
| | | | | | | -Bsymbolic is not a platform requirement and should not be added unconditionally. llvm-svn: 213126
* Driver: bifurcate extended and basic MSC versioningSaleem Abdulrasool2014-07-161-7/+41
| | | | | | | | | | | | | | | | | | | | | | | 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
* clang-cl: Implement the -arch flagEhsan Akhgari2014-07-151-2/+28
| | | | | | | | | | | | | | | 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
* [Driver] clang::driver::getARMCPUForMArch() moved to ↵Argyrios Kyrtzidis2014-07-111-83/+2
| | | | | | | | | llvm::Triple::getARMCPUForArch(). Depends on llvm r212846. Suggested by Eric Christopher. llvm-svn: 212858
* Handle SPARC float command line parameters for SPARCv9.Brad Smith2014-07-111-1/+2
| | | | llvm-svn: 212838
* GCC compatibility: Create a Group to ignore unsupported optimization.Sylvestre Ledru2014-07-111-0/+7
| | | | | | | | | | | | 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
* Enable -gcolumn-info by default.Diego Novillo2014-07-101-1/+2
| | | | | | | | | | | | | | | 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
* [x32] Adding X32 target support to driver, including ↵Zinovy Nis2014-07-101-1/+10
| | | | | | | | | | 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
* [mips][mips64r6] Add support for mips-img-linux-gnu GCC toolchainsDaniel Sanders2014-07-101-10/+17
| | | | | | | | | | | | | | 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
* [mips] Add support for -modd-spreg/-mno-odd-spregDaniel Sanders2014-07-101-0/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D4432 llvm-svn: 212700
* [Driver] Expose getARMCPUForMArch() function in the Driver API; NFC.Argyrios Kyrtzidis2014-07-101-3/+8
| | | | llvm-svn: 212666
* Remove unused sys/stat.h includesAlp Toker2014-07-071-1/+0
| | | | | | The facility was abstracted to LLVM in r187364. llvm-svn: 212441
OpenPOWER on IntegriCloud