aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/ToolChains.h
AgeCommit message (Collapse)Author
2014-02-24Define an Emscripten toolchain.Dan Gohman
This is pretty minimal right now; eventually this may subsume code currently in the emscripten wrapper scripts.
2013-04-30Add support for -stdlib=libc++ in the NetBSD toolchain.Joerg Sonnenberger
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180766 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-20Supports Sourcery CodeBench Mips toolchain directories tree.Simon Atanasyan
Sourcery CodeBench and modern FSF Mips toolchains require a bit more complicated algorithm to calculate headers, libraries and sysroot paths than implemented by Clang driver now. The main problem is that all these paths depend on a set of command line arguments additionally to a target triple value. For example, let $TC is a toolchain installation directory. If we compile big-endian 32-bit mips code, crtbegin.o is in the $TC/lib/gcc/mips-linux-gnu/4.7.2 folder and the toolchain's linker requires --sysroot=$TC/mips-linux-gnu/libc argument. If we compile little-endian 32-bit soft-float mips code, crtbegin.o is in the $TC/lib/gcc/mips-linux-gnu/4.7.2/soft-float/el folder and the toolchain's linker requires --sysroot=$TC/mips-linux-gnu/libc/soft-float/el argument. 1. Calculate MultiarchSuffix using all necessary command line options and use this MultiarchSuffix to detect crtbegin.o location in the GCCInstallationDetector::ScanLibDirForGCCTriple() routine. 2. If a user does not provide --sysroot argument to the driver explicitly, calculate new sysroot value based on command line options. Then use this calculated sysroot path: a. To populate a file search paths list in the Linux::Linux() constructor. b. To find Mips toolchain specific include headers directories in the Linux::AddClangSystemIncludeArgs() routine. c. To provide -–sysroot argument for a linker. Note: - The FSF's tree slightly differs (folder names) and is not supported yet. - New addExternCSystemIncludeIfExits() routine is a temporary solution. I plan to move path existence check to the addExternCSystemInclude() routine by a separate commit. The patch reviewed by Rafael Espindola. http://llvm-reviews.chandlerc.com/D644 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179934 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-09If the user requested a zero-base-shadow sanitizer, infer -pie and -fPIC ↵Peter Collingbourne
when appropriate. Differential Revision: http://llvm-reviews.chandlerc.com/D502 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179082 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20Remove the Tools DensMap from the toolchain.Rafael Espindola
Each toolchain has a set of tools, but they are all of known types. It can have a linker, an assembler, a "clang" (compile, analyze, ...) a non-clang compiler, etc. Instead of keeping a map, just have member variable for each type of tool. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177479 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19Finish refactoring the tool selection logic.Rafael Espindola
The general pattern now is that Foobar::constructTool only creates tools defined in the tools::foobar namespace and then delegates to the parent. The remaining duplicated code is now in the tools themselves. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177368 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18Centralize the recording of which tools have been constructed.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177319 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18Use early returns when checking if we already constructed a tool and whenRafael Espindola
delegating to Generic_GCC::SelectTool (it already updates the tool map). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177305 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18Remove unused argument.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177303 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18Pass an ArgList to every toolchain constructor. Remove the useIntegratedAsRafael Espindola
argument. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177301 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18Remove unused argument.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177293 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-06Driver: add support for new style multiarch in Ubuntu 13.04Dmitri Gribenko
Patch by Sanne Wouda. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176557 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-03Default to enabling default-synthesized ivars on all platformsDavid Chisnall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176419 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31Add support for AArch64 target.Tim Northover
In cooperation with the LLVM patch, this should implement all scalar front-end parts of the C and C++ ABIs for AArch64. This patch excludes the NEON support also reviewed due to an outbreak of batshit insanity in our legal department. That will be committed soon bringing the changes to precisely what has been approved. Further reviews would be gratefully received. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174055 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-13Initial support for FreeBSD on ARM.Rafael Espindola
Patch by Andrew Turner. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170096 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06Hexagon TC: Reimplement Link::ConstructJob to callMatthew Curtis
linker directly Rather than calling gcc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169512 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06Hexagon TC: Move getHexagonTargetCPU from Tools.cpp toMatthew Curtis
ToolChains.cpp This is in anticipation of forthcoming library path changes. Also ... - Fixes some inconsistencies in how the arch is passed to tools. - Add test cases for various forms of arch flags git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169505 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-06Hexagon TC: Update toolchain to add appropriate includeMatthew Curtis
paths - Inherit from Linux rather than ToolChain - Override AddClangSystemIncludeArgs and AddClangCXXStdlibIncludeArgs to properly set include paths. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169495 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-27Remove an extra semicolon.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168707 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-21Fix the '-fuse-init-array' option to actually be an option.Chandler Carruth
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168473 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-21[Sanitizer] force linking with static sanitizer runtimes on Darwin even if ↵Alexey Samsonov
they are not found in resource directory. Add test checking sanitizer linker flags on Darwin. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168428 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-19Completely re-work how the Clang driver interprets PIC and PIE options.Chandler Carruth
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168297 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-15block extended signatur option. Change previous optionFariborz Jahanian
to a cc1 -fencode-extended-block-signature and pass it to cc1 and recognize this option to produce extended block type signature. // rdar://12109031 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168063 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-09Remove old driver code to grab the iOS simulator version from the -D option.Bob Wilson
We can now rely on the -mios-simulator-version-min command line option and remove the awful hack. <rdar://problem/10304510> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167603 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-08Remove more code related to invoking llvm-gcc. <rdar://problem/11991320>Bob Wilson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167598 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-21Add support of MIPS n32 ABI to the Clang driver. The fix builds correct ↵Simon Atanasyan
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166389 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-23Implement ToolChain::IsUnwindTablesDefault to reduce code duplication a bit.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164473 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-21Screw around with ObjCRuntime some more, changing theJohn McCall
diagnostics for bad deployment targets and adding a few more predicates. Includes a patch by Jonathan Schleifer to enable ARC for ObjFW. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162252 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-08clang support for Bitrig (an OpenBSD fork); patch by David Hill.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161546 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-03Make property synthesis the default on Windows.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161266 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-04Hoist the logic for selecting the Objective-C dispatch method into the runtimeDavid Chisnall
class, from the target. No functionality change, just less duplicated logic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159710 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-20Restructure how the driver communicates information about theJohn McCall
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158793 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-19Add a -fuse-init-array option to cc1 and map to the UseInitArray targetRafael Espindola
option. On the driver, check if we are using libraries from gcc 4.7 or newer and if so pass -fuse-init-array to the frontend. The crtbegin*.o files in gcc 4.7 no longer call the constructors listed in .ctors, so we have to use .init_array. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158694 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-09Move the iOSVersionMin string to a header so as to avoid a dangling pointer.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156497 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03Rip out old code for finding libraries in GCC's directories.Bob Wilson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156058 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02Driver: Turn the default value for -fmath-errno into a proper target hook ↵Benjamin Kramer
and disable it by default on more platforms. For now -fno-math-errno is the default on BSD-derived platforms (Darwin, DragonFlyBSD, FreeBSD, NetBSD, OpenBSD). If the default is not right for your platform, please yell. I only verified the result with the default compilers on Darwin and FreeBSD. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155990 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-09Make a modern Objective-C runtime the default target for *BSD. Don't yet ↵David Chisnall
change this on GNU/Linux, where the GCC runtime still tends to be used. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154315 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-10Use VersionTuple to manage macosx versions in the driver. No functionality ↵Benjamin Kramer
change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152504 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-06Enable default @synthesize by default.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152140 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-06Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,Ted Kremenek
NSNumber, and boolean literals. This includes both Sema and Codegen support. Included is also support for new Objective-C container subscripting. My apologies for the large patch. It was very difficult to break apart. The patch introduces changes to the driver as well to cause clang to link in additional runtime support when needed to support the new language features. Docs are forthcoming to document the implementation and behavior of these features. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152137 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-29[driver] Emit an error when trying to use ARC on macosx earlier than 10.6Argyrios Kyrtzidis
rdar://10459258 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151706 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-27Re-enable the Darwin ARM integrated assembler.Jim Grosbach
All known nightly-test failures are fixed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151595 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25Temporarily revert r151288:Chad Rosier
ARM: enable the integrated assembler by default for Darwin. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151454 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-23ARM: enable the integrated assembler by default for Darwin.Jim Grosbach
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151288 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19Implement a -gcc-toolchain command line option that does the same asRafael Espindola
configure's --with-gcc-toolchain. The configure option is now just a default value for the command line one. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150898 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15First pass at Solaris toolchain support. This version compiles and links helloDavid Chisnall
world on Solaris 11 for both x86 and x86-64 using the built-in assembler and Solaris (not GNU) ld, however it currently relies on a hard-coded GCC location to find crtbegin.o and crtend.o, as well as libgcc and libgcc_eh. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150580 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11Begin refactoring to use the newly added triple predicates forChandler Carruth
simplicity. Also addresses a FIXME, although not one that could be observed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150294 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31Revert r149083 which is not the direction we're going in the ClangChandler Carruth
driver based on discussions with Doug Gregor. There are several issues: 1) The patch was not reviewed prior to commit and there were review comments. 2) The design of the functionality (triple-prefixed tool invocation) isn't the design we want for Clang going forward: it focuses on the "user triple" rather than on the "toolchain triple", and forces that bit of state into the API of every single toolchain instead of handling it automatically in the common base classes. 3) The tests provided are not stable. They fail on a few Linux variants (Gentoo among them) and on mingw32 and some other environments. I *am* interested in the Clang driver being able to invoke triple-prefixed tools, but we need to design that feature the right way. This patch just extends the previous hack without fixing the underlying problems with it. I'm working on a new design for this that I will mail for review by tomorrow. I am aware that this removes functionality that NetBSD relies on, but this is ToT, not a release. This functionality hasn't been properly designed, implemented, and tested yet. We can't "regress" until we get something that really works, both with the immediate use cases and with long term maintenance of the Clang driver. For reference, the original commit log: Keep track of the original target the user specified before normalization. This used to be captured in DefaultTargetTriple and is used for the (optional) $triple-$tool lookup for cross-compilation. Do this properly by making it an attribute of the toolchain and use it in combination with the computed triple as index for the toolchain lookup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149337 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26Keep track of the original target the user specified beforeJoerg Sonnenberger
normalization. This used to be captured in DefaultTargetTriple and is used for the (optional) $triple-$tool lookup for cross-compilation. Do this properly by making it an attribute of the toolchain and use it in combination with the computed triple as index for the toolchain lookup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149083 91177308-0d34-0410-b5e6-96231b3b80d8