aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/Tools.cpp
AgeCommit message (Collapse)AuthorFilesLines
2012-12-01Remove restriction on combining ubsan with asan or tsan. This has worked for ↵Richard Smith1-5/+4
a while. llvm-svn: 169066
2012-11-29Add ARM cortex-a5 subtargetQuentin Colombet1-2/+2
llvm-svn: 168958
2012-11-29Revert commit revision r168953, to change the commit message, which was emptyQuentin Colombet1-2/+2
llvm-svn: 168956
2012-11-29(no commit message)Quentin Colombet1-2/+2
llvm-svn: 168953
2012-11-29This patch exposes to Clang users three more sanitizers are experimental ↵Alexey Samsonov1-0/+7
features of ASan: 1) init-order sanitizer: initialization-order checker. Status: usable, but may produce false positives w/o proper blacklisting. 2) use-after-return sanitizer Status: implemented, but heavily understed. Should be optional, as it significanlty slows program down. 3) use-after-scope sanitizer Status: in progress. llvm-svn: 168950
2012-11-29Make sure that we put the rest of the sanitizer libraries on the link lineEric Christopher1-7/+5
before libstdc++ like we do with ubsan. llvm-svn: 168918
2012-11-29[driver] -mkernel implies -mstrict-align; don't add the redundant option.Chad Rosier1-1/+2
rdar://12771737 llvm-svn: 168841
2012-11-28Refactor -fsanitize, -f*-sanitizer arguments parsing. Provide a more careful ↵Alexey Samsonov1-44/+4
diagnostic for invalid sets of sanitizers llvm-svn: 168794
2012-11-23PR14306: Move -fbounds-checking to -fsanitize=bounds.Joey Gouly1-8/+4
llvm-svn: 168510
2012-11-23Reapply a subset of r167567 to clean up Darwin-specific code for invoking gcc.Bob Wilson1-612/+10
Unlike my previous attempt at this, this patch leaves intact the check for whether clang can handle the input file type, and for non-Darwin toolchains it will invoke gcc for things it cannot handle. For Darwin toolchains, the behavior reported in pr14338 still occurs with this patch, but that is a definite improvement from what happens currently, where it just crashes with an assertion failure. llvm-svn: 168505
2012-11-21Fix the '-fuse-init-array' option to actually be an option.Chandler Carruth1-1/+1
Previously, this flag to CC1 was never exposed at the clang driver layer, and if you happened to enable it (by being on Android or GCC 4.7 platform), you couldn't *disable* it, because there was no 'no' variant. The whole thing was confusingly implemented. Now, the target-specific flag processing gets the driver arg list, and we use standard hasFlag with a default based on the GCC version and/or Android platform. The user can still pass the 'no-' variant to forcibly disable the flag, or pass the positive variant to clang itself to enable the flag. The test has also been substantially cleaned up and extended to cover these use cases. llvm-svn: 168473
2012-11-19Add -ldl for non-static libgcc in Android.Logan Chien1-3/+11
According to Android ABI, we have to link with libdl.so, if we are linking with non-static libgcc. Besides, this also fixes MIPS link error of undefined references to `_Unwind_Find_FDE' and `dl_iterate_phdr'. llvm-svn: 168310
2012-11-19Completely re-work how the Clang driver interprets PIC and PIE options.Chandler Carruth1-67/+74
There were numerous issues here that were all entangled, and so I've tried to do a general simplification of the logic. 1) The logic was mimicing actual GCC bugs, rather than "features". These have been fixed in trunk GCC, and this fixes Clang as well. Notably, the logic was always intended to be last-match-wins like any other flag. 2) The logic for handling '-mdynamic-no-pic' was preposterously unclear. It also allowed the use of this flag on non-Darwin platforms where it has no actual meaning. Now this option is handled directly based on tests of how llvm-gcc behaves, and it is only supported on Darwin. 3) The APIs for the Driver's ToolChains had the implementation ugliness of dynamic-no-pic leaking through them. They also had the implementation details of the LLVM relocation model flag names leaking through. 4) The actual results of passing these flags was incorrect on Darwin in many cases. For example, Darwin *always* uses PIC level 2 if it uses in PIC level, and Darwin *always* uses PIC on 64-bit regardless of the flags specified, including -fPIE. Darwin never compiles in PIE mode, but it can *link* in PIE mode. 5) Also, PIC was not always being enabled even when PIE was. This isn't a supported mode at all and may have caused some fallout in builds with complex PIC and PIE interactions. The result is (I hope) cleaner and clearer for readers. I've also left comments and tests about some of the truly strage behavior that is observed on Darwin platforms. We have no real testing of Windows platforms and PIC, but I don't have the tools handy to figure that out. Hopefully others can beef up our testing here. Unfortunately, I can't test this for every platform. =/ If folks have dependencies on these flags that aren't covered by tests, they may break. I've audited and ensured that all the changes in behavior of the existing tests are intentional and good. In particular I've tried to make sure the Darwin behavior (which is more suprising than the Linux behavior) also matches that of 'gcc' on my mac. llvm-svn: 168297
2012-11-16Revert r167799. It's not really correct, and it doesn't fix the problem that ↵Bill Wendling1-16/+9
it was intended to fix. llvm-svn: 168217
2012-11-16UBSan: enable proper linking with UBsan runtime on Darwin. Turn on building ↵Alexey Samsonov1-4/+5
ubsan on OS X in 'make' build system. Patch by Jean-Daniel Dupas. llvm-svn: 168168
2012-11-15block extended signatur option. Change previous optionFariborz Jahanian1-0/+5
to a cc1 -fencode-extended-block-signature and pass it to cc1 and recognize this option to produce extended block type signature. // rdar://12109031 llvm-svn: 168063
2012-11-15Revert r167567, restoring the ability of clang to run gcc in cases where itNick Lewycky1-10/+612
can't handle the input file type. This resulted in PR14338. llvm-svn: 168024
2012-11-13This patch makes the behavior of clang consistent with the behavior of gcc ↵Benjamin Kramer1-7/+19
4.6 in cases where both -fPIC and -fPIE is used. - Separately check if -fPIE was specified in the command line and define both __PIC__ and __PIE__ when -fPIE is used. We need to check this separately because -fPIE will infer -fPIC even if its not explicitly used. - Fixed existing tests. - Added new tests for cases where both -fPIC and -fPIE is used. Author: Tareq A. Siraj <tareq.a.siraj@intel.com> Fixes: PR13221 Review: http://llvm-reviews.chandlerc.com/D94 llvm-svn: 167846
2012-11-13Disable accelerator tables when compiling with LTO.Bill Wendling1-9/+16
LTO doesn't generate correct accelerator tables. This is due to the general lack correct of debug info for LTO. Disable it when using LTO. <rdar://problem/12401423> llvm-svn: 167799
2012-11-09Implement -mstrict-align using '-backend-option -arm-strict-align' as this savesChad Rosier1-1/+2
us from having to make any backend changes. llvm-svn: 167623
2012-11-09[driver] Add a -mstrict-align compiler option for ARM targets.Chad Rosier1-0/+3
rdar://12340498 llvm-svn: 167619
2012-11-08Rip out a bunch of code for invoking gcc from clang.Bob Wilson1-612/+10
llvm-svn: 167567
2012-11-06clang/lib/Driver/Tools.cpp: Fix abuse of StringRef.NAKAMURA Takumi1-1/+1
llvm-svn: 167494
2012-11-06Follow-up for r167411 to un-break ASan on Mac. Move SanitizerArgs to a ↵Alexey Samsonov1-113/+26
header file and use it on Darwin toolchain. llvm-svn: 167460
2012-11-06Per discussion on cfe-commits, treat -faddress-sanitizer,Richard Smith1-13/+27
-fno-address-sanitizer, -fthread-sanitizer, -fno-thread-sanitizer, and -fcatch-undefined-behavior as deprecated: produce a warning if they are used pointing to the corresponding -fsanitize= option. In passing add the missing '-' to some diagnostics. llvm-svn: 167429
2012-11-05Use the individual -fsanitize=<...> arguments to control which of the UBSanRichard Smith1-6/+0
checks to enable. Remove frontend support for -fcatch-undefined-behavior, -faddress-sanitizer and -fthread-sanitizer now that they don't do anything. llvm-svn: 167413
2012-11-05Add -fsanitize=<sanitizers> argument to driver and frontend, and addRichard Smith1-21/+162
-fno-sanitize=<sanitizers> argument to driver. These allow ASan, TSan, and the various UBSan checks to be enabled and disabled separately. Right now, the different modes can't be combined, but the intention is that combining UBSan and the other sanitizers will be permitted in the near future. Currently, the UBSan checks will all be enabled if any of them is; that will be fixed by the next patch. llvm-svn: 167411
2012-11-02Improve x86 android support:Rafael Espindola1-5/+8
* -Bsymbolic must be added for x86 as well. * Default CPU name also set to 'core2' for x86 android. Patch by Edwin Vane. llvm-svn: 167307
2012-11-02Add -lpthread when building with Ubsan on Linux, in preparation for making ↵Richard Smith1-0/+1
libclang-rt.ubsan pull in sanitizer_common, which in turn depends on pthreads. llvm-svn: 167305
2012-11-01Remove first argument from Arg::getValue; it's been unused since r105760.Richard Smith1-60/+60
llvm-svn: 167211
2012-10-31getArchTypeForDarwinArchName is only used in the clang driver, copy it there.Rafael Espindola1-0/+31
I will remove it from llvm in the next commit. llvm-svn: 167156
2012-10-30[driver] Older versions of ld expect '-L<dir>' not '-L <dir>'. In Xcode4 andChad Rosier1-8/+30
later, '-L <dir>' is allowed, but rewrite these in the driver as '-L<dir>' to maintain backward compatibility. The same is true for the -I option. rdar://12366753 llvm-svn: 167054
2012-10-27Reverted back the changes made in 166868 and in 166869Mahesha S1-1/+0
llvm-svn: 166871
2012-10-27-------------------------------------------------Mahesha S1-0/+2
Feature: OpenMP support in CLANG: Sub-Feature: Support for option -fopenmp Files Changed/Added: * include/clang/Driver/Options.td (C) * include/clang/Basic/LangOptions.def (C) * lib/Driver/Tools.cpp (C) * lib/Frontend/CompilerInvocation.cpp (C) Test Cases Changed/Added: * test/Driver/clang_fopenmp_opt.c (A) ------------------------------------------------- llvm-svn: 166868
2012-10-25-fcatch-undefined-behavior checking for appropriate vptr value: Clang ↵Richard Smith1-1/+3
CodeGen side. llvm-svn: 166661
2012-10-23Handle -pthread, -pg and -shared correctly on bitrig.Rafael Espindola1-2/+8
Patch by David Hill. llvm-svn: 166483
2012-10-22[Options] Add prefixes to options.Michael J. Spencer1-3/+3
Each option has a set of prefixes. When matching an argument such as -funroll-loops. First the leading - is removed as it is a prefix. Then a lower_bound search for "funroll-loops" is done against the option table by option name. From there each option prefix + option name combination is tested against the argument. This allows us to support Microsoft style options where both / and - are valid prefixes. It also simplifies the cases we already have where options come in both - and -- forms. Almost every option for gnu-ld happens to have this form. llvm-svn: 166444
2012-10-22driver/Darwin: Default to AAPCS for M-class CPUs.Daniel Dunbar1-1/+10
- This is an assumption that is currently hardwired into the backend, we need to do this in order for the frontend and backend to agree. llvm-svn: 166428
2012-10-21Add support of MIPS n32 ABI to the Clang driver. The fix builds correct ↵Simon Atanasyan1-6/+23
library/object files paths and passes appropriate command line options to the linker if user provides -mabi=n32 option. The patch reviewed by Rafael Espindola. llvm-svn: 166389
2012-10-19[Options] Make Option non clang specific.Michael J. Spencer1-2/+8
llvm-svn: 166348
2012-10-18Revert r166223 and the subsequent commits that depend on it, r166230 & r166235.Argyrios Kyrtzidis1-8/+2
This seems to have introduced assertion hit when building compiler-rt. llvm-svn: 166245
2012-10-18Add a new option for and disable column number information as thereEric Christopher1-0/+2
are no known current users of column info. Robustify and fix up a few tests in the process. Reduces the size of debug information by a small amount. Part of PR14106 llvm-svn: 166236
2012-10-18[Options] Make Option non clang specific.Michael J. Spencer1-2/+8
llvm-svn: 166230
2012-10-16GNUstep runtime version default to 1.6, generate correct property attributeDavid Chisnall1-1/+1
metadata. llvm-svn: 166023
2012-10-15Un-revert r164907 and r164902 (+ follow-ups), 10.6 build fix to follow.Daniel Dunbar1-9/+22
llvm-svn: 165988
2012-10-15Revert r164907 and r164902 (+ follow-ups). They broke building on 10.6.Nico Weber1-22/+9
See PR14013. llvm-svn: 165962
2012-10-09[driver] Remove redundant cases due to overlapping commits between Ted ↵Chad Rosier1-2/+0
(r165531, 165532) and I (r165534), but leave the test case in place. llvm-svn: 165537
2012-10-09-fcatch-undefined-behavior: emit calls to the runtime library whenever one ↵Richard Smith1-0/+18
of the checks fails. llvm-svn: 165536
2012-10-09[driver] Remove the -W[no-][int-conversion|constant-conversion|enum-conversion]Chad Rosier1-0/+2
options when clang invokes cc1plus for i386 kexts. rdar://12459188 llvm-svn: 165534
2012-10-09Don't forward -Wenum-conversion to cc1plus.Ted Kremenek1-0/+1
llvm-svn: 165532