summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains/Gnu.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [XRay][Driver] Do not link in XRay runtime in shared libsDean Michael Berris2017-09-261-0/+5
| | | | | | | | | | | | | | | | | | | | Summary: This change ensures that we don't link in the XRay runtime when building shared libraries with clang. This doesn't prevent us from building shared libraris tht have XRay instrumentation sleds, but it does prevent us from linking in the static XRay runtime into a shared library. The XRay runtime currently doesn't support dynamic registration of instrumentation sleds in shared objects, which we'll start enabling in the future. That work has to happen in the back-end and in the runtime. Reviewers: rnk, pelikan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D38226 llvm-svn: 314188
* Revert "[XRay][Driver] Do not link in XRay runtime in shared libs"Dean Michael Berris2017-09-261-5/+0
| | | | | | Reverts r314177. llvm-svn: 314178
* [XRay][Driver] Do not link in XRay runtime in shared libsDean Michael Berris2017-09-251-0/+5
| | | | | | | | | | | | | | | | | | | | Summary: This change ensures that we don't link in the XRay runtime when building shared libraries with clang. This doesn't prevent us from building shared libraris tht have XRay instrumentation sleds, but it does prevent us from linking in the static XRay runtime into a shared library. The XRay runtime currently doesn't support dynamic registration of instrumentation sleds in shared objects, which we'll start enabling in the future. That work has to happen in the back-end and in the runtime. Reviewers: rnk, pelikan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D38226 llvm-svn: 314177
* [mips] Replace Triple::Environment check by the isGNUEnvironment() call. NFCSimon Atanasyan2017-09-071-2/+2
| | | | llvm-svn: 312701
* [OpenMP] OpenMP device offloading code generation produces a cubin file ↵Gheorghe-Teodor Bercea2017-08-081-125/+0
| | | | | | | | which is then integrated in the host binary using the host linker. Diff: D29654 llvm-svn: 310362
* Revert r310291, r310300 and r310332 because of test failure on DarwinAlex Lorenz2017-08-081-0/+125
| | | | | | | | | | | | | | | | | | | | | The commit r310291 introduced the failure. r310332 was a test fix commit and r310300 was a followup commit. I reverted these two to avoid merge conflicts when reverting. The 'openmp-offload.c' test is failing on Darwin because the following run lines: // RUN: touch %t1.o // RUN: touch %t2.o // RUN: %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -save-temps -no-canonical-prefixes %t1.o %t2.o 2>&1 \ // RUN: | FileCheck -check-prefix=CHK-TWOCUBIN %s trigger the following assertion: Driver.cpp:3418: assert(CachedResults.find(ActionTC) != CachedResults.end() && "Result does not exist??"); llvm-svn: 310345
* [OpenMP] Integrate OpenMP target region cubin into host binaryGheorghe-Teodor Bercea2017-08-071-125/+0
| | | | | | | | | | | | | | Summary: OpenMP device offloading code generation produces a cubin file which is then integrated in the host binary using the host linker. Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, rnk, hfinkel, tstellar Reviewed By: hfinkel Subscribers: sfantao, rnk, rengolin, cfe-commits Differential Revision: https://reviews.llvm.org/D29654 llvm-svn: 310291
* [Driver][Darwin] Pass -munwind-table when !UseSjLjExceptions.Akira Hatanaka2017-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 310006
* Update to use enum classes for various ARM *Kind enumsFlorian Hahn2017-07-271-1/+1
| | | | | | | | | | | | | | Summary: This updates the relevant Clang parts for the LLVM change D35882. Reviewers: rengolin, chandlerc, javed.absar, rovka Reviewed By: rovka Subscribers: aemerson, cfe-commits, kristof.beyls Differential Revision: https://reviews.llvm.org/D35884 llvm-svn: 309289
* [PowerPC] Pass CPU to assembler with -no-integrated-asNemanja Ivanovic2017-07-271-6/+13
| | | | | | | | | This just adds the CPU to a list of commands passed to GAS when not using the integrated assembler. Differential Revision: https://reviews.llvm.org/D33820 llvm-svn: 309256
* Introduce -nostdlib++ flag to disable linking the C++ standard library.Nico Weber2017-07-251-7/+9
| | | | | | | | | | | | | | | Projects that want to statically link their own C++ standard library currently need to pass -nostdlib or -nodefaultlibs, which also disables linking of the builtins library, -lm, and so on. Alternatively, they could use `clang` instead of `clang++`, but that already disables implicit addition of -lm on some toolchains. Add a dedicated flag -nostdlib++ that disables just linking of libc++ / libstdc++. This is analogous to -nostdinc++. https://reviews.llvm.org/D35780 llvm-svn: 308997
* Unconditionally use .init_array instead of .ctors on Solaris.Aaron Ballman2017-07-141-1/+2
| | | | | | Patch by Fedor Sergeev llvm-svn: 308038
* [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 llvm-svn: 307272
* [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 llvm-svn: 306280
* 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. llvm-svn: 306115
* 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' llvm-svn: 305182
* 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. llvm-svn: 305165
* [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 llvm-svn: 304229
* 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 llvm-svn: 303873
* 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. llvm-svn: 302207
* 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 llvm-svn: 300969
* [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 llvm-svn: 300689
* [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 llvm-svn: 300571
* 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. llvm-svn: 300328
* [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 llvm-svn: 298835
* [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 llvm-svn: 298670
* [XRay] Use AddCXXStdlibLibArgs. NFCI.Jonas Hahnfeld2017-03-081-4/+3
| | | | | | This function already does the very same thing. llvm-svn: 297271
* [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 llvm-svn: 297250
OpenPOWER on IntegriCloud