summaryrefslogtreecommitdiffstats
path: root/lib/Driver/ToolChains/Gnu.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merging r310006:Hans Wennborg2017-08-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r310006 | ahatanak | 2017-08-03 16:55:42 -0700 (Thu, 03 Aug 2017) | 22 lines [Driver][Darwin] Pass -munwind-table when !UseSjLjExceptions. This commit fixes a bug where clang/llvm doesn't emit an unwind table for a function when it is marked noexcept. Without this patch, the following code terminates with an uncaught exception on ARM64: int foo1() noexcept { try { throw 0; } catch (int i) { return 0; } return 1; } int main() { return foo1(); } rdar://problem/32411865 Differential Revision: https://reviews.llvm.org/D35693 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_50@310677 91177308-0d34-0410-b5e6-96231b3b80d8
* Unconditionally use .init_array instead of .ctors on Solaris.Aaron Ballman2017-07-141-1/+2
| | | | | | Patch by Fedor Sergeev git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308038 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenMP] Extend CLANG target options with device offloading kind.Gheorghe-Teodor Bercea2017-07-061-1/+2
| | | | | | | | | | | | | | Summary: Pass the type of the device offloading when building the tool chain for a particular target architecture. This is required when supporting multiple tool chains that target a single device type. In our particular use case, the OpenMP and CUDA tool chains will use the same ```addClangTargetOptions ``` method. This enables the reuse of common options and ensures control over options only supported by a particular tool chain. Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, jlebar, hfinkel, tstellar, Hahnfeld Reviewed By: hfinkel Subscribers: jgravelle-google, aheejin, rengolin, jfb, dschuff, sbc100, cfe-commits Differential Revision: https://reviews.llvm.org/D29647 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307272 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Enable IAS by default for Android 64-bit MIPS target (N64)Petar Jovanovic2017-06-261-3/+5
| | | | | | | | | | IAS is already used for MIPS64 in majority of Android projects. Android MIPS64 uses N64 ABI. Set IAS as a default now. Differential Revision: https://reviews.llvm.org/D34514 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306280 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Revert r305164/5/7."Saleem Abdulrasool2017-06-231-0/+19
| | | | | | | | | | | | | | | | | | | | | | | Restore the `-gz` option to the driver with some minor tweaks to handle the additional case for `-Wa,--compress-debug-sections`. This intends to make the compression of the debug information controllable from the driver. The following is the behaviour: -gz enable compression (ambiguous for format, will default to zlib-gnu) -gz=none disable compression -gz=zlib-gnu enable compression (deprecated GNU style zlib compression) -gz=zlib enable compression (zlib based compression) Although -Wa,-compress-debug-sections works, it should be discouraged when using the driver to invoke the assembler. However, we permit the assembler to accept the GNU as style argument --compress-debug-sections to maintain compatibility. Note, -gz/-gz= does *NOT* imply -g. That is, you need to additionally specific -g for debug information to be generated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306115 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r305164/5/7.Daniel Jasper2017-06-121-19/+0
| | | | | | | | | | | | | | cc1as does not currently access the "--" version of this flag. At the very least this needs to be fixed and proper test cases need to be added. Simple reproducer: clang -Wa,--compress-debug-sections /tmp/test.cc Result: error: unknown argument: '--compress-debug-sections' git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305182 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: add support for `-gz` and `-gz=`Saleem Abdulrasool2017-06-111-0/+19
| | | | | | | | | | | | | | | | | These options control the behaviour of the compression of debug info sections on ELF targets. Our behaviour slightly diverges from the behaviour of GCC. `-gz` maps to the `-compress-debug-sections` rather than `-compress-debug-sections=zlib` or `-compress-debug-sections=zlib-gnu`. This small divergence allows us to be compatible across versions of binutils (=zlib support was introduced in 2.26, while earlier versions only support =zlib-gnu). This also allows users to not have to worry about the version of the assembler they may be using if they are not using the IAS. Previously, users would have had to go through the internal option `-compress-debug-sectionss` and pass that through to the assembler, which is no longer needed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305165 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenMP][Driver] Put target binary for each offload target into aAlexey Bataev2017-05-301-6/+6
| | | | | | | | | | | | | | separate section, by Sergey Dmitriev Linker script that is generated by the clang driver for creating fat binary puts target binaries for all offload targets into a single ELF section .omp_offloading. This is not convenient because it greatly complicates operations with the final fat binary once it is linked. For example extracting target binary for a particular target from such fat executable would not be an easy task if you have more than one offload target. Attached patch changes clang driver to put target binary for each offload target into a separate ELF section .omp_offloading.<target triple>. Differential Revision: https://reviews.llvm.org/D33254 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304229 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't defer to the GCC driver for linking arm-baremetalJonathan Roelofs2017-05-251-0/+43
| | | | | | | | | | | | | | | Also comes with a cmake cache for building the runtime bits: $ cmake <normal cmake flags> \ -DBAREMETAL_ARMV6M_SYSROOT=/path/to/sysroot \ -DBAREMETAL_ARMV7M_SYSROOT=/path/to/sysroot \ -DBAREMETAL_ARMV7EM_SYSROOT=/path/to/sysroot \ -C /path/to/clang/cmake/caches/BaremetalARM.cmake \ /path/to/llvm https://reviews.llvm.org/D33259 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303873 91177308-0d34-0410-b5e6-96231b3b80d8
* Document that Multilib flags must be actual flagsJonathan Roelofs2017-05-051-10/+12
| | | | | | | | This is because -print-multi-lib depends on them being flags for correctness. Fixes a case of this in the arm-android multilib selection logic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302207 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for openSUSE ARM TriplesIsmail Donmez2017-04-211-1/+3
| | | | | | | | | | | | | | Summary: Add support for armv6hl-suse-linux-gnueabi and armv7hl-suse-linux-gnueabi triples used by openSUSE/SUSE. Reviewers: cfe-commits, rovka, compnerd, rengolin Reviewed By: rengolin Subscribers: aemerson, rengolin, bkramer, chandlerc Differential Revision: https://reviews.llvm.org/D32347 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300969 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Unify linking of OpenMP runtime. NFCI.Jonas Hahnfeld2017-04-191-27/+5
| | | | | | | | While at it, extend test for FreeBSD and check for -lrt iff on Linux. Differential Revision: https://reviews.llvm.org/D30087 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300689 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64][clang] Pass cpu/arch information to assembler for AArch64.Manoj Gupta2017-04-181-0/+6
| | | | | | | | | | | | | | | | Summary: Pass Cpu/Arch options to assembler for AArch64 with no-integrated-as. This fixes PR20019. Reviewers: richard.barton.arm, kristof.beyls, rengolin Reviewed By: rengolin Subscribers: srhines, pirama, aemerson, rengolin, cfe-commits Differential Revision: https://reviews.llvm.org/D32132 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300571 91177308-0d34-0410-b5e6-96231b3b80d8
* Make Gentoo GNU GCC Config override whitespace tolerantErich Keane2017-04-141-0/+1
| | | | | | | | | | | | The config-*triple* file handling isn't tolerant of leading/trailing whitespace, making it not terribly obvious when a single extraneous tab/space/etc will cause the override to be ignored. This patch simply trims the lines to ensure that it is tolerant of whitespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300328 91177308-0d34-0410-b5e6-96231b3b80d8
* [XRay][clang] Remove dependency on libatomic for XRay buildsDean Michael Berris2017-03-271-1/+0
| | | | | | | | | | | | | | | | Summary: This change depends on D31381 where we change the implementation to use sanitizer_common provided atomic operations library. Fixes http://llvm.org/PR32274. Reviewers: pelikan, dblaikie Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31382 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298835 91177308-0d34-0410-b5e6-96231b3b80d8
* [XRay] Do not depend on C++ stdlib for XRay buildsDean Michael Berris2017-03-241-2/+0
| | | | | | | | | | | | | | Summary: Now that XRay doesn't require a runtime dependency on a C++ standard library, we remove that dependency from the clang linker flags. Reviewers: saugustine, pelikan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31313 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298670 91177308-0d34-0410-b5e6-96231b3b80d8
* [XRay] Use AddCXXStdlibLibArgs. NFCI.Jonas Hahnfeld2017-03-081-4/+3
| | | | | | This function already does the very same thing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297271 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Consolidate tools and toolchains by target platform. (NFC)David L. Jones2017-03-081-0/+2429
Summary: (This is a move-only refactoring patch. There are no functionality changes.) This patch splits apart the Clang driver's tool and toolchain implementation files. Each target platform toolchain is moved to its own file, along with the closest-related tools. Each target platform toolchain has separate headers and implementation files, so the hierarchy of classes is unchanged. There are some remaining shared free functions, mostly from Tools.cpp. Several of these move to their own architecture-specific files, similar to r296056. Some of them are only used by a single target platform; since the tools and toolchains are now together, some helpers now live in a platform-specific file. The balance are helpers related to manipulating argument lists, so they are now in a new file pair, CommonArgs.h and .cpp. I've tried to cluster the code logically, which is fairly straightforward for most of the target platforms and shared architectures. I think I've made reasonable choices for these, as well as the various shared helpers; but of course, I'm happy to hear feedback in the review. There are some particular things I don't like about this patch, but haven't been able to find a better overall solution. The first is the proliferation of files: there are several files that are tiny because the toolchain is not very different from its base (usually the Gnu tools/toolchain). I think this is mostly a reflection of the true complexity, though, so it may not be "fixable" in any reasonable sense. The second thing I don't like are the includes like "../Something.h". I've avoided this largely by clustering into the current file structure. However, a few of these includes remain, and in those cases it doesn't make sense to me to sink an existing file any deeper. Reviewers: rsmith, mehdi_amini, compnerd, rnk, javed.absar Subscribers: emaste, jfb, danalbert, srhines, dschuff, jyknight, nemanjai, nhaehnle, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D30372 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297250 91177308-0d34-0410-b5e6-96231b3b80d8