summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Add a -fuse-init-array option to cc1 and map to the UseInitArray targetRafael Espindola2012-06-191-1/+7
| | | | | | | | | 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. llvm-svn: 158694
* [driver] When creating the compiler invocation out of command-lineArgyrios Kyrtzidis2012-05-211-7/+11
| | | | | | | | arguments, force use of clang frontend for the driver. Fixes rdar://11356765. llvm-svn: 157205
* add embedded linux variants that occur in the fieldGabor Greif2012-05-151-2/+4
| | | | llvm-svn: 156813
* Roll logic into a single if statement, per David's suggestion.Chad Rosier2012-05-091-3/+2
| | | | llvm-svn: 156502
* Use the triple directly, rather then getTriple().Chad Rosier2012-05-091-1/+1
| | | | llvm-svn: 156501
* Now the proper fix for r156497. Sorry for the churn.Chad Rosier2012-05-091-4/+5
| | | | llvm-svn: 156498
* Move the iOSVersionMin string to a header so as to avoid a dangling pointer.Chad Rosier2012-05-091-1/+0
| | | | llvm-svn: 156497
* [driver] Use the iOS target triple to infer the deployment target.Chad Rosier2012-05-091-2/+8
| | | | | | rdar://11409204 llvm-svn: 156489
* Rip out old code for finding libraries in GCC's directories.Bob Wilson2012-05-031-70/+0
| | | | llvm-svn: 156058
* Add support for openSUSE 12.2, from Ismail Donmez!Douglas Gregor2012-04-301-1/+3
| | | | llvm-svn: 155860
* [driver] Don't try to set the deployment target when there is no boundChad Rosier2012-04-271-1/+2
| | | | | | | | | architecture; this was happening for tools such as lipo and dsymutil. Also, if no -arch option has been specified, set the architecture based on the TC default. rdar://11329656 llvm-svn: 155730
* Revert 155679; Not a typo.Chad Rosier2012-04-271-1/+1
| | | | llvm-svn: 155708
* Typo.Chad Rosier2012-04-271-1/+1
| | | | llvm-svn: 155679
* MIPS: Add support for 64-bit MIPS targets: mips64 / mips64el.Simon Atanasyan2012-04-261-1/+36
| | | | llvm-svn: 155656
* fix GCC version comparison wrt. equal patch suffices (and squash two typos)Gabor Greif2012-04-181-2/+3
| | | | llvm-svn: 154997
* fix a typoGabor Greif2012-04-171-1/+1
| | | | llvm-svn: 154920
* Fix using Clang as a cross compiler installed on a host machine and notChandler Carruth2012-04-061-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | inside of a sysroot targeting a system+sysroot which is "similar" or "compatible" with the host system. This shows up when trying to build system images on largely compatible hardware as-if fully cross compiled. The problem is that previously we *perfectly* mimiced GCC here, and it turns out GCC has a bug that no one has really stumbled across. GCC will try to look in thy system prefix ('/usr/local' f.ex.) into which it is instaled to find libraries installed along side GCC that should be preferred to the base system libraries ('/usr' f.ex.). This seems not unreasonable, but it has a very unfortunate consequence when combined with a '--sysroot' which does *not* contain the GCC installation we're using to complete the toolchain. That results in some of the host system's library directories being searched during the link. Now, it so happens that most folks doing stuff like this use '--with-sysroot' and '--disable-multilib' when configuring GCC. Even better, they're usually not cross-compiling to a target that is similar to the host. As a result, searching the host for libraries doesn't really matter -- most of the time weird directories get appended that don't exist (no arm triple lib directory, etc). Even if you're cross-compiling from 32-bit to 64-bit x86 or vice-versa, disabling multilib makes it less likely that you'll actually find viable libraries on the host. But that's just luck. We shouldn't rely on this, and this patch disables looking in the system prefix containing the GCC installation if that system prefix is *outside* of the sysroot. For empty sysroots, this has no effect. Similarly, when using the GCC *inside* of the sysroot, we still track wherever it is installed within the sysroot and look there for libraries. But now we can use a cross compiler GCC installation outside the system root, and only look for the crtbegin.o in the GCC installation, and look for all the other libraries inside the system root. This should fix PR12478, allowing Clang to be used when building a ChromiumOS image without polluting the image with libraries from the host system. llvm-svn: 154176
* Use VersionTuple to manage macosx versions in the driver. No functionality ↵Benjamin Kramer2012-03-101-7/+3
| | | | | | change. llvm-svn: 152504
* Add new code migrator support for migrating existing Objective-C code to useTed Kremenek2012-03-061-0/+2
| | | | | | | | | | | the new Objective-C NSArray/NSDictionary/NSNumber literal syntax. This introduces a new library, libEdit, which provides a new way to support migration of code that improves on the original ARC migrator. We now believe that most of its functionality can be refactored into the existing libraries, and thus this new library may shortly disappear. llvm-svn: 152141
* Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,Ted Kremenek2012-03-061-0/+5
| | | | | | | | | | | | | 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. llvm-svn: 152137
* [driver] Emit an error when trying to use ARC on macosx earlier than 10.6Argyrios Kyrtzidis2012-02-291-0/+4
| | | | | | rdar://10459258 llvm-svn: 151706
* A follow-up to r151482 which added support for powerpc and powerpc64Chandler Carruth2012-02-261-0/+10
| | | | | | | | | | | | | | | | | Debian multiarch libraries, this should in theory add support for those platform's header search rules. I don't have a system to check this with, so review appreciated. I've added the corresponding tests referring to the debian multiarch tree. We are starting to have a relatively completely tested Linux platform for header search and library search, with several interesting peculiarities. We should point people at the debian_multiarch_tree when suggesting new tests. Folks with Debian systems that can check this for correctness, it would be much appreciated. The missing chunks I know of are testing bi-arch peudo-cross-compiling toolchains betwen 32-bit and 64-bit variants of platforms, and the MIPS and ARM Debian toolchains. llvm-svn: 151484
* Add support for PPC and PPC64 multiarch toolchains on Debain.Chandler Carruth2012-02-261-0/+9
| | | | | | | | | | | | | | | | | Patch from Michel Dänzer, sent our way via Jeremy Huddleston who added 64-bit support. I just added one other place where powerpc64-linux-gnu was missing (we only had powerpc64-unknown-linux-gnu). I've also added a tree to test out the debian multiarch stuff. I don't use debian regularly, so I'm not certain this is entirely accurate. If anyone wants to check it against a debian system and fix any inaccuracies, fire away. This way at least folks can see how this is *supposed* to be tested. It'd be particularly good to get the Debian MIPS toolchains tested in this way. llvm-svn: 151482
* Implement a -gcc-toolchain command line option that does the same asRafael Espindola2012-02-191-24/+35
| | | | | | | configure's --with-gcc-toolchain. The configure option is now just a default value for the command line one. llvm-svn: 150898
* First pass at Solaris toolchain support. This version compiles and links helloDavid Chisnall2012-02-151-0/+35
| | | | | | | | 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. llvm-svn: 150580
* include clang's config.h unconditionally (v2)Dylan Noblesmith2012-02-141-5/+1
| | | | | | | | | | And remove HAVE_CLANG_CONFIG_H, now that the header is generated in the autoconf build, too. Reverts r149571/restores r149504, now that config.h is generated correctly by LLVM's configure in all build configurations. llvm-svn: 150487
* Delete a simplistic helper function now that llvm::Triple can provideChandler Carruth2012-02-131-13/+3
| | | | | | this functionality. llvm-svn: 150358
* Begin refactoring to use the newly added triple predicates forChandler Carruth2012-02-111-6/+1
| | | | | | | simplicity. Also addresses a FIXME, although not one that could be observed. llvm-svn: 150294
* - Turn the other distribution checks into range compares.Benjamin Kramer2012-02-061-18/+14
| | | | | | | - Turn openSUSE version parsing into a StringSwitch - Add an entry for Fedora release 16 (Verne) llvm-svn: 149872
* Consolidate the ubuntu detection logic a bit, add an entry for Ubuntu 12.04 ↵Benjamin Kramer2012-02-061-28/+20
| | | | | | aka precise pangolin. llvm-svn: 149869
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-051-2/+2
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Basic: import OwningPtr<> into clang namespaceDylan Noblesmith2012-02-051-1/+1
| | | | llvm-svn: 149798
* Replace the old --with-cxx-* configure options with a single ↵Rafael Espindola2012-02-031-48/+13
| | | | | | | | | --with-gcc-toolchain that just uses the new toolchain probing logic. This fixes linking with -m32 on 64 bit systems (the /32 dir was not being added to the search). llvm-svn: 149652
* back out r149504Dylan Noblesmith2012-02-021-1/+5
| | | | | | Too many weird build failures. llvm-svn: 149571
* include clang's config.h unconditionallyDylan Noblesmith2012-02-011-5/+1
| | | | | | | | | | | | | And remove HAVE_CLANG_CONFIG_H, now that the header is generated in the autoconf build, too. (clang r149497 / llvm r149498) Also include the config.h header after all other headers, per the LLVM coding standards. It also turns out WindowsToolChain.cpp wasn't using the config header at all, so that include's just deleted now. llvm-svn: 149504
* Use new Triple::getMacOSXVersion function.Bob Wilson2012-01-311-31/+6
| | | | llvm-svn: 149439
* Fix more fallout from the introduction of "macosx" and "ios" triples.Bob Wilson2012-01-311-10/+37
| | | | | | | | | | | | The Darwin toolchain constructor was assuming that all Darwin triples would have an OS string starting with "darwin". Triples starting with "macosx" would misinterpret the version number, and "ios" triples would completely miss the version number (or worse) because the OS name is not 6 characters long. We lose some sanity checking of triple strings here, since the Triple.getOSVersion function doesn't do all the checking that the previous code did, but this still seems like a step in the right direction. llvm-svn: 149422
* Revert r149083 which is not the direction we're going in the ClangChandler Carruth2012-01-311-36/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 149337
* Remove the ToolTriple logic in NetBSD, which was completely broken byJoerg Sonnenberger2012-01-261-2/+2
| | | | | | | | the recent refactoring. All interesting NetBSD release have a GNU as version on i386 that supports --32, so don't bother with the conditional setting of it. llvm-svn: 149087
* Remove obviously incorrect branch.Joerg Sonnenberger2012-01-261-2/+1
| | | | llvm-svn: 149084
* Keep track of the original target the user specified beforeJoerg Sonnenberger2012-01-261-24/+36
| | | | | | | | | | 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. llvm-svn: 149083
* Revert r148249: "Make the auto-detection hack for the iOS simulator set the ↵Bob Wilson2012-01-261-25/+22
| | | | | | | | target triple correctly." There were some problems with this, so I'm backing it out for now. llvm-svn: 149040
* Reintroduce r148981 with significantly improved regression test. Now itChandler Carruth2012-01-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | both actually tests what it wants to, doesn't have bogus and broken assertions in it, and is also formatted much more cleanly and consistently. Probably still some more that can be improved here, but its much better. Original commit message: ---- Try to unbreak the FreeBSD toolchain's detection of 32-bit targets inside a 64-bit freebsd machine with the 32-bit compatibility layer installed. The FreeBSD image always has the /usr/lib32 directory, so test for the more concrete existence of crt1.o. Also enhance the tests for freebsd to clarify what these trees look like and exercise the new code. Thanks to all the FreeBSD folks for helping me understand what caused the failure and how we might fix it. =] That helps a lot. Also, yay build bots. llvm-svn: 149011
* Revert r148981 because it fails test/Driver/freebsd.cArgyrios Kyrtzidis2012-01-251-3/+3
| | | | | | | | | | | | | | | | | | | | Original log: Author: chandlerc <chandlerc@91177308-0d34-0410-b5e6-96231b3b80d8> Date: Wed Jan 25 21:32:31 2012 +0000 Try to unbreak the FreeBSD toolchain's detection of 32-bit targets inside a 64-bit freebsd machine with the 32-bit compatibility layer installed. The FreeBSD image always has the /usr/lib32 directory, so test for the more concrete existence of crt1.o. Also enhance the tests for freebsd to clarify what these trees look like and exercise the new code. Thanks to all the FreeBSD folks for helping me understand what caused the failure and how we might fix it. =] That helps a lot. Also, yay build bots. llvm-svn: 148993
* Try to unbreak the FreeBSD toolchain's detection of 32-bit targetsChandler Carruth2012-01-251-3/+3
| | | | | | | | | | | | | | inside a 64-bit freebsd machine with the 32-bit compatibility layer installed. The FreeBSD image always has the /usr/lib32 directory, so test for the more concrete existence of crt1.o. Also enhance the tests for freebsd to clarify what these trees look like and exercise the new code. Thanks to all the FreeBSD folks for helping me understand what caused the failure and how we might fix it. =] That helps a lot. Also, yay build bots. llvm-svn: 148981
OpenPOWER on IntegriCloud