summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver/linux-ld.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix an logic error in the clang driver preventing crtfastmath.o from linking ↵Benjamin Kramer2014-03-251-1/+22
| | | | | | | | | | | | | | when -Ofast is used without -ffast-math In gcc using -Ofast forces linking of crtfastmath.o. In the current clang crtfastmath.o is only linked when -ffast-math/-funsafe-math-optimizations passed. It can lead to performance issues, when using only -Ofast without explicit -ffast-math (I faced with it). My patch fixes inconsistency with gcc behaviour and also introduces few tests on it. Patch by Zinovy Nis! Differential Revision: http://llvm-reviews.chandlerc.com/D3114 llvm-svn: 204742
* Add EXPERIMENTAL --rtlib=compiler-rt to GNU ClangRenato Golin2014-02-131-0/+40
| | | | | | | | | | | | | | | | | | This commit is not strictly correct nor accounts for all uses (shared objects, for example), but it allows one to test the compiler-rt library on GNU targets. Using this patch to run the test-suite has already shown me problems on ARM. Since this is a Darwin-only flag, nobody is using it, so it shouldn't be a problem. I will need extension to deal with the shared cases, but since we're not compiling libclang_rt.so, that's not yet applicable. Many other problems will have to be fixed first in compiler-rt (such as removing the 'arch' name from it and making it trully multi-arch, moving it to the default lib directory, make both .a and .so variants, etc). llvm-svn: 201307
* [Mips] Add support for mips64el-linux-android triple.Simon Atanasyan2014-01-251-0/+23
| | | | llvm-svn: 200081
* Improve x86 android support, add x86_64 android targetAlexey Bataev2014-01-231-0/+41
| | | | llvm-svn: 199875
* Teach Clang to look in its installation libdir for libraries (such asChandler Carruth2014-01-211-0/+26
| | | | | | | | | | | | | | | | libc++) when the installation is within the system root. This doesn't really help cross compiles much, but we don't (currently) have a great story around libc++, cross compiles, and who is responsible for building and/or installing the libraries. However, it handles the very common case of non-cross builds in a way entirely consistent with GCC, so I'm hopeful this won't really hose anyone. This is the second patch that I think should be backported to 3.4 to give folks an easy to checkout and install working Clang+libc++ toolchain. llvm-svn: 199769
* Rename target i386-linux-android to i686-linux-androidAlexey Bataev2014-01-131-4/+4
| | | | llvm-svn: 199073
* Use the right dynamic linker for SPARC Linux executables.Jakob Stoklund Olesen2014-01-101-0/+2
| | | | llvm-svn: 198923
* Give the linker the right ELF type for SPARC targets.Jakob Stoklund Olesen2014-01-101-0/+12
| | | | llvm-svn: 198912
* Teach the driver to not try to use 'lib32' multilib spellings on ARMChandler Carruth2013-10-291-4/+40
| | | | | | | | | | | | | | | | | | | | | | | which doesn't use that multilib. As a consequence, fix Clang's support for cross compiling environments that were relying on this quirk to ensure the correct library search path ordering. This also re-instates the new test cases from Rafael's r193528 for cross-compiling to ARM on Ubuntu 13.10 without any of the changes to the existing test cases (they were no longer needed). This solution was the result of a lot of IRC debugging and trying to understand *exactly* what quirk was being relied upon. It took some time for me to figure out that it was the use of 'lib32' is a multilib that was throwing a wrench in the works. In case you are thinking that its silly to use a multilib of 'lib' at all, entertainingly, GCC does so as well (you can see it with the .../lib/../lib/crt1.o pattern it uses), and the 2-phase sequence of search paths (multilib followed by non-multilib) has observable (if dubious) consequences. =/ Yuck. llvm-svn: 193601
* Revert "Support cross linking to arm on ubuntu."Rafael Espindola2013-10-281-44/+8
| | | | | | | | This reverts commit r193528 (and fixes). It broke Chandler's setup. llvm-svn: 193554
* More windows path handling.Rafael Espindola2013-10-281-2/+2
| | | | llvm-svn: 193533
* Relax test to pass with windows paths.Rafael Espindola2013-10-281-8/+8
| | | | llvm-svn: 193532
* Support cross linking to arm on ubuntu.Rafael Espindola2013-10-281-8/+44
| | | | | | | | | | With this patch we correctly determine that ubuntu's ARM tree is not biarch and use "lib" istead of "lib32". Without this patch the search inside the arm tree for the crt files was failing and we would end up trying to use the i686 ones in lib32. llvm-svn: 193528
* Don't check for -L options that gcc doesn't use.Rafael Espindola2013-10-251-2/+0
| | | | | | | GCC on fedora 18 ARM only uses 2 -L options. Clang prints two extra ones, but we should not include them in the test as they are not required. llvm-svn: 193430
* Accept both / and \\ to fix the windows bots.Rafael Espindola2013-06-241-64/+64
| | | | llvm-svn: 184790
* Update two options to my proposed syntax for user-facing driver options:Chandler Carruth2013-06-201-67/+67
| | | | | | | | | | | | | | | | | | | -gcc-toolchain foo -> --gcc-toolchain=foo -target foo -> --target=foo I've added legacy aliases for the original spellings. I've updated the canonical tests to check both spellings, and switched all of the -gcc-toolchain usages elsewhere in the test suite to use the new one. I've updated some of the usages of -target to the new syntax, but will finish that in a separate entirely mechanical change once I'm sure this won't get rolled back for some reason (It touches a *huge* number of RUN lines in the test suite unsurprisingly). A nice result is that the three most common flags I end up using when doing cross compiles are all now consistent: --target=, --sysroot=, and --gcc-toolchain=. llvm-svn: 184408
* When we're compiling with -pg make sure to link with gcrt1.o on linux. BeEric Christopher2013-06-071-0/+6
| | | | | | | | | | sure to do this always, this matches the behavior for the gcc driver. Fixes PR16251. Based on a patch by Qiao Yang. llvm-svn: 183591
* Add driver support for fedora 18 on ARM.Rafael Espindola2013-04-141-0/+16
| | | | llvm-svn: 179484
* Check for warnings in a bunch of the linker invocations, and add oneChandler Carruth2013-03-041-0/+11
| | | | | | | | | | | with both -static-libgcc and -static on the commandline. Fix a warning in the latter case due to a backwards short circuiting || operator in the driver. No real functionality changed here, just allows the driver to properly consume -static-libgcc when -static is also specified. llvm-svn: 176429
* Beef up the testing of our 'ld' invocation on linux to cover staticChandler Carruth2013-03-041-0/+43
| | | | | | linking. About to fix a bug here and there was no good test case. llvm-svn: 176427
* Revert r169557. It seems that the test is too restrictedLogan Chien2012-12-061-4/+4
| | | | | | and will break the build on buildbot. llvm-svn: 169562
* Add i686-linux-android for gcc toolchain detection.Logan Chien2012-12-061-4/+4
| | | | | | | | | * Look for i686-linux-android under <sysroot>/lib/gcc. * This patch also slightly enhance the test suite for Android GCC toolchain detection. llvm-svn: 169557
* Add -ldl for non-static libgcc in Android.Logan Chien2012-11-191-0/+3
| | | | | | | | | | | 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
* Improve x86 android support:Rafael Espindola2012-11-021-0/+20
| | | | | | | | * -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
* Add support of MIPS n32 ABI to the Clang driver. The fix builds correct ↵Simon Atanasyan2012-10-211-0/+52
| | | | | | | | 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
* The clang driver has a fairly fancy support for executing gcc instead ofRafael Espindola2012-10-091-4/+4
| | | | | | | | | | | | | | clang itself. This dates back to clang's early days and while it looks like some of it is still used (for kext for example), other parts are probably dead. Remove the -ccc-clang-archs option and associated code. I don't think there is any remaining setup where clang doesn't support an architecture but it can expect an working gcc cross compiler to be available. A nice side effect is that tests no longer need to differentiate architectures that are included in production builds of clang and those that are not. llvm-svn: 165545
* Driver: Link crtfastmath.o if it's available and -ffast-math is specified.Benjamin Kramer2012-10-041-0/+21
| | | | | | | | | | | | crtfastmath.o contains routines to set the floating point flags to a faster, unsafe mode. Linking it in speeds up code dealing with denormals significantly (PR14024). For now this is only enabled on linux where I can test it and crtfastmath.o is widely available. We may want to provide a similar file with compiler-rt eventually and/or enable it on other platforms too. llvm-svn: 165240
* Implement Adnroid MIPS toolchain support:Simon Atanasyan2012-10-031-0/+19
| | | | | | | | | | 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 C/C++ header locations for the Freescale SDK.Hal Finkel2012-09-181-0/+20
| | | | | | | | | 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-0/+33
| | | | | | | | paths when target is MIPS 32-bit. The patch reviewed by Chandler Carruth. llvm-svn: 163898
* Wrong crtbegin/crtend pair used for PIE on Android.Evgeniy Stepanov2012-09-101-0/+17
| | | | | | | | Android uses the same flavour of crt*.o for PIE and non-PIE executables, and a different one for DSOs. GNU/Linux, on the other hand, uses one set of crt*.o for non-PIE executables, and another for both PIE executables and DSOs. llvm-svn: 163500
* Android standalone toolchain support.Evgeniy Stepanov2012-09-031-6/+6
| | | | | | | | 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-0/+14
| | | | | | | | | | | | | 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
* Support ARM hard float (arm-linux-gnueabihf).Jiangning Liu2012-07-311-0/+33
| | | | llvm-svn: 161038
* Fix dynamic object linker for ARM GNUEABIHF.Jiangning Liu2012-07-301-0/+15
| | | | llvm-svn: 160958
* MIPS: Add support for 64-bit MIPS targets: mips64 / mips64el.Simon Atanasyan2012-04-261-0/+22
| | | | llvm-svn: 155656
* MIPS: Add tests to check the debian multiarch stuff for mips and mipsel targets.Simon Atanasyan2012-04-261-0/+24
| | | | llvm-svn: 155628
* Clang driver support for linking on Android.Evgeniy Stepanov2012-04-251-0/+36
| | | | llvm-svn: 155541
* MIPS: Provide a correct path to the dynamic linker when build for MIPS ↵Simon Atanasyan2012-04-061-1/+10
| | | | | | 64-bit targets. llvm-svn: 154200
* Fix using Clang as a cross compiler installed on a host machine and notChandler Carruth2012-04-061-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add support for PPC and PPC64 multiarch toolchains on Debain.Chandler Carruth2012-02-261-0/+51
| | | | | | | | | | | | | | | | | 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
* rename -ccc-host-triple into -targetSebastian Pop2012-01-201-18/+18
| | | | llvm-svn: 148582
* Revert r148138; it's causing test failures.Eli Friedman2012-01-131-18/+18
| | | | llvm-svn: 148141
* rename -ccc-host-triple into -targetSebastian Pop2012-01-131-18/+18
| | | | llvm-svn: 148138
* Teach the link-step test to verify that we don't pass bad --hash-styleChandler Carruth2011-12-171-0/+23
| | | | | | flags on MIPS paltforms. llvm-svn: 146837
* add tree test for suse on ppc64 (r146142)Hal Finkel2011-12-081-0/+12
| | | | llvm-svn: 146176
* Fix an issue that Duncan discovered on a specific (no longer current)Chandler Carruth2011-11-091-0/+14
| | | | | | | | | | | | version of Ubuntu. It has a very broken multiarch configuration, and so we need special logic to handle it correctly. Fixing and testing this uncovered a few other trivial issues with the logic that are fixed as well. I added tests to cover this as it is hard to notice if you install recent versions of the OS. llvm-svn: 144165
* Enhance the GCC version parsing and comparison logic to handle some moreChandler Carruth2011-11-051-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | edge cases and have better behavior. Specifically, we should actually prefer the general '4.6' version string over the '4.6.1' string, as '4.6.2' should be able to replace it without breaking rpaths or any other place that these paths have been embedded. Debian-based distributions are already using a path structure with symlinks to achieve in-place upgrades for patch versions. Now our parsing reflects this and we select the shorter paths instead of the longer paths. A separate issue was that we would not parse a leading patch version number even in the presence of a suffix. The above change makes this more problematic as it would cause a suffix being added to make us treat the entire thing as patch-version-agnostic, which it isn't. This changes the logic to distinguish between '4.4.x' and 4.4.1-x', and retain that the latter has *some* patch number information. Currently, we always bias toward the shorter and more canonical version strings. If it becomes important we can add more Debian like rules to produce sequences such as '4.4.1b' > '4.4.1' > '4.4.1-rc3' > '4.4.1-rc2' > '4.4.1-pre5', but I'm very doubtful this will ever matter or be desirable. I've made the tests for this logic a bit more interesting, and added some specific tests for logic that is now different. llvm-svn: 143841
* Use the InstalledDir correctly, and test it correctly as well. =/ ShouldChandler Carruth2011-10-051-13/+13
| | | | | | have noticed this previously, sorry. llvm-svn: 141167
* Teach Clang to cope with GCC installations that have unusual patchChandler Carruth2011-10-051-0/+27
| | | | | | | "versions". Currently, these are just dropped on the floor, A concrete version number will always win out. llvm-svn: 141159
OpenPOWER on IntegriCloud