summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains.cpp
Commit message (Collapse)AuthorAgeFilesLines
* ToolChains.cpp: Fixup r169260, clang/Config/config.h needs to be listed ↵NAKAMURA Takumi2012-12-041-4/+5
| | | | | | *last*, or llvm/Config/llvm-config.h could not be read in header files. llvm-svn: 169268
* Autotools has the same include guard for both Clang and LLVM's config.h.Chandler Carruth2012-12-041-1/+4
| | | | | | | | | | | | Shuffling order causes the wrong one to win. CMake didn't exhibit this problem because Clang's has *no* guards. I'll fix this properly tomorrow when Eric and I can check both build systems and get them to DTRT, but for now unbreak some bots by hoisting this header. llvm-svn: 169260
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-11/+6
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Reapply a subset of r167567 to clean up Darwin-specific code for invoking gcc.Bob Wilson2012-11-231-3/+1
| | | | | | | | | | | 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
* Fix the '-fuse-init-array' option to actually be an option.Chandler Carruth2012-11-211-3/+8
| | | | | | | | | | | | | | | | | | 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
* [Sanitizer] force linking with static sanitizer runtimes on Darwin even if ↵Alexey Samsonov2012-11-211-5/+7
| | | | | | they are not found in resource directory. Add test checking sanitizer linker flags on Darwin. llvm-svn: 168428
* Enable -fuse-init-array for Android X86/MIPS.Logan Chien2012-11-191-1/+2
| | | | | | | | | | | | The dynamic linker of Android does not support .ctors/.dtors. We should emit .init_array and .fini_array regardless the gcc version. NOTE: This patch does not affect the ARM backend, because it is required to generate .init_array and .fini_array for program targeting ARM AAPCS and AEABI. llvm-svn: 168309
* Completely re-work how the Clang driver interprets PIC and PIE options.Chandler Carruth2012-11-191-20/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* UBSan: enable proper linking with UBsan runtime on Darwin. Turn on building ↵Alexey Samsonov2012-11-161-2/+19
| | | | | | ubsan on OS X in 'make' build system. Patch by Jean-Daniel Dupas. llvm-svn: 168168
* Revert r167567, restoring the ability of clang to run gcc in cases where itNick Lewycky2012-11-151-17/+82
| | | | | | can't handle the input file type. This resulted in PR14338. llvm-svn: 168024
* Remove old driver code to grab the iOS simulator version from the -D option.Bob Wilson2012-11-091-73/+6
| | | | | | | We can now rely on the -mios-simulator-version-min command line option and remove the awful hack. <rdar://problem/10304510> llvm-svn: 167603
* Remove more code related to invoking llvm-gcc. <rdar://problem/11991320>Bob Wilson2012-11-081-24/+0
| | | | llvm-svn: 167598
* Rip out a bunch of code for invoking gcc from clang.Bob Wilson2012-11-081-82/+17
| | | | llvm-svn: 167567
* Remove code to fall back to llvm-gcc for i386 kexts.Bob Wilson2012-11-081-15/+2
| | | | | | More cleanups to follow in separate commits.... llvm-svn: 167566
* Follow-up for r167411 to un-break ASan on Mac. Move SanitizerArgs to a ↵Alexey Samsonov2012-11-061-3/+6
| | | | | | header file and use it on Darwin toolchain. llvm-svn: 167460
* Remove first argument from Arg::getValue; it's been unused since r105760.Richard Smith2012-11-011-15/+15
| | | | llvm-svn: 167211
* getArchTypeForDarwinArchName is only used in the clang driver, copy it there.Rafael Espindola2012-10-311-2/+2
| | | | | | I will remove it from llvm in the next commit. llvm-svn: 167156
* Add support of MIPS n32 ABI to the Clang driver. The fix builds correct ↵Simon Atanasyan2012-10-211-10/+30
| | | | | | | | 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
* [Options] Make Option non clang specific.Michael J. Spencer2012-10-191-2/+2
| | | | llvm-svn: 166348
* [Options] make Option a value type.Michael J. Spencer2012-10-191-7/+7
| | | | llvm-svn: 166347
* Revert r166223 and the subsequent commits that depend on it, r166230 & r166235.Argyrios Kyrtzidis2012-10-181-9/+9
| | | | | | This seems to have introduced assertion hit when building compiler-rt. llvm-svn: 166245
* [Options] Make Option non clang specific.Michael J. Spencer2012-10-181-2/+2
| | | | llvm-svn: 166230
* [Options] make Option a value type.Michael J. Spencer2012-10-181-7/+7
| | | | llvm-svn: 166223
* Un-revert r164907 and r164902 (+ follow-ups), 10.6 build fix to follow.Daniel Dunbar2012-10-151-2/+30
| | | | llvm-svn: 165988
* Revert r164907 and r164902 (+ follow-ups). They broke building on 10.6.Nico Weber2012-10-151-30/+2
| | | | | | See PR14013. llvm-svn: 165962
* Revert "[Options] make Option a value type."Eric Christopher2012-10-101-7/+7
| | | | | | | | | | | | | Author: Michael J. Spencer <bigcheesegs@gmail.com> Date: Wed Oct 10 21:48:26 2012 +0000 [Options] make Option a value type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165663 91177308-0d34-0410-b5e6-96231b3b80d8 This reverts commit 0464fd5e4ce2193e786e5adcab6b828f9366dae3. llvm-svn: 165667
* [Options] make Option a value type.Michael J. Spencer2012-10-101-7/+7
| | | | llvm-svn: 165663
* Make Bitrig's clang understand -stdlib= correctly.Chandler Carruth2012-10-081-8/+32
| | | | | | | | | With this patch Bitrig can use a different c++ library without pain and within the normal commandline parameters. Original patch by David Hill, with lots of fixes and cleanup by me. llvm-svn: 165430
* Use getArch instead of getArchName + string compare.Rafael Espindola2012-10-071-7/+7
| | | | llvm-svn: 165370
* Use getArch instead of getArchName.Rafael Espindola2012-10-071-5/+1
| | | | | | | | | | | | The darwin change should be a nop since Triple::getArchTypeForDarwinArchName doesn't know about amd64. If things like amd64-mingw32 are to be rejected, we should print a error earlier on instead of silently using the wrong abi. Remove old comment that looks out of place, this is "in clang". llvm-svn: 165368
* Implement Adnroid MIPS toolchain support:Simon Atanasyan2012-10-031-4/+33
| | | | | | | | | | 1. Add mipsel-linux-android to the list of valid MIPS target triples. 2. Add <gcc install path>/mips-r2 to the list of toolchain specific path prefixes if target is mipsel-linux-android. The patch reviewed by Logan Chien. llvm-svn: 165131
* Add Clang support for iOS6.Bob Wilson2012-09-291-2/+30
| | | | llvm-svn: 164907
* Add armv7s and some other arm variants supported by Mach-O files.Bob Wilson2012-09-291-1/+13
| | | | llvm-svn: 164905
* Implement ToolChain::IsUnwindTablesDefault to reduce code duplication a bit.Rafael Espindola2012-09-231-8/+0
| | | | llvm-svn: 164473
* On Hexagon getArchName() never returns x86_64, simplify the function.Rafael Espindola2012-09-221-3/+1
| | | | llvm-svn: 164470
* Fix pr13749. There is still a lot of code using getArchName that should beRafael Espindola2012-09-221-1/+1
| | | | | | using getArch, but I will try to fix them one at time to add tests. llvm-svn: 164460
* Add C/C++ header locations for the Freescale SDK.Hal Finkel2012-09-181-0/+8
| | | | | | | | | The Freescale SDK is based on OpenEmbedded, and this might be useful for other OpenEmbedded-based configurations as well. With minor modifications, patch by Tobias von Koch! llvm-svn: 164177
* Do not use "lib32" directory to create a library/object filesSimon Atanasyan2012-09-141-7/+24
| | | | | | | | paths when target is MIPS 32-bit. The patch reviewed by Chandler Carruth. llvm-svn: 163898
* This patch introduces A15 as a target in Clang.Silviu Baranga2012-09-131-1/+2
| | | | llvm-svn: 163804
* Android standalone toolchain support.Evgeniy Stepanov2012-09-031-8/+19
| | | | | | | | This change adds detection of C++ headers and libraries paths when building with the standalone toolchain from Android NDK. They are in a slightly unusual place. llvm-svn: 163109
* Rename ANDROIDEABI to Android.Logan Chien2012-09-021-1/+1
| | | | | | | | | | | | | Most of the code guarded with ANDROIDEABI are not ARM-specific, and having no relation with arm-eabi. Thus, it will be more natural to call this environment "Android" instead of "ANDROIDEABI". Note: We are not using ANDROID because several projects are using "-DANDROID" as the conditional compilation flag. llvm-svn: 163088
* Tweak the ARC-requires-10.6 diagnostic according to Jordan's review.John McCall2012-08-271-2/+1
| | | | llvm-svn: 162651
* Screw around with ObjCRuntime some more, changing theJohn McCall2012-08-211-2/+5
| | | | | | | | diagnostics for bad deployment targets and adding a few more predicates. Includes a patch by Jonathan Schleifer to enable ARC for ObjFW. llvm-svn: 162252
* darwin/driver: Support using SDKROOT to define the default for -isysroot.Daniel Dunbar2012-08-171-0/+14
| | | | | | | - The SDKROOT environment variable is the de facto way to set the default SDK for a number of tools, join forces with them. llvm-svn: 162116
* clang support for Bitrig (an OpenBSD fork); patch by David Hill.Eli Friedman2012-08-081-0/+61
| | | | llvm-svn: 161546
* Support ARM hard float (arm-linux-gnueabihf).Jiangning Liu2012-07-311-5/+24
| | | | llvm-svn: 161038
* Force the OS X version to 10.6 for old-style simulator builds.Bob Wilson2012-07-191-0/+5
| | | | | | | | | | | | | The hack of recognizing a -D__IPHONE_OS_VERSION_MIN_REQUIRED option in place of -mios-simulator-version-min leaves the Darwin version unspecified. It can be set separately with -mmacosx-version-min (which makes no sense) or inferred to match the host version (which is unpredictable and usually wrong). This really needs to get cleaned up, but in the meantime, force the OS X version to 10.6 so that the behavior is sane for the iOS simulator. Thanks for Argyrios for the patch. <rdar://problem/11858187> llvm-svn: 160484
* [driver] Fix so that clang can find correct path prefix for libc object filesChad Rosier2012-07-111-0/+5
| | | | | | | from GNU binutils supporting multi-arch folder for ARM target. Patch by Jiangning Liu <jiangning.liu@arm.com>. llvm-svn: 160060
* Adjust this code so that it strictly honorsJohn McCall2012-06-211-4/+6
| | | | | | | | TargetSimulatroVersionFromDefines if present; this also makes it easier to chain things correctly. Noted by an internal review. llvm-svn: 158926
* Restructure how the driver communicates information about theJohn McCall2012-06-201-59/+28
| | | | | | | | | | | | | | | | | | | | | | | | target Objective-C runtime down to the frontend: break this down into a single target runtime kind and version, and compute all the relevant information from that. This makes it relatively painless to add support for new runtimes to the compiler. Make the new -cc1 flag, -fobjc-runtime=blah-x.y.z, available at the driver level as a better and more general alternative to -fgnu-runtime and -fnext-runtime. This new concept of an Objective-C runtime also encompasses what we were previously separating out as the "Objective-C ABI", so fragile vs. non-fragile runtimes are now really modelled as different kinds of runtime, paving the way for better overall differentiation. As a sort of special case, continue to accept the -cc1 flag -fobjc-runtime-has-weak, as a sop to PLCompatibilityWeak. I won't go so far as to say "no functionality change", even ignoring the new driver flag, but subtle changes in driver semantics are almost certainly not intended. llvm-svn: 158793
OpenPOWER on IntegriCloud