summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Enable the SafeStack sanitizer on CloudABI by default.Ed Schouten2016-03-291-0/+4
| | | | | | | | | | | | | | | | | | | Over the last month we've been testing SafeStack extensively. As far as we know, it works perfectly fine. That why I'd like to see us having this enabled by default for CloudABI. This change introduces a getDefaultSanitizers() function that toolchains can use to specify which sanitizers are enabled by default. Once all flags are processed, only flags that had no -fno-sanitize overrides are enabled. Extend the thests for CloudABI to test both the default case and the case in which we want to explicitly disable SafeStack. Reviewed by: eugenis, pcc Differential Revision: http://reviews.llvm.org/D18505 llvm-svn: 264787
* [tsan] Allow -fsanitize=thread for iOS-style simulator targetsDevin Coughlin2016-03-201-1/+6
| | | | | | | | | Update the clang driver to allow -fsanitize=thread when targeting x86_64 iOS and tvOS simulators. Also restrict TSan targeting OS X to only be supported on x86_64 and not i386. Differential Revision: http://reviews.llvm.org/D18280 llvm-svn: 263913
* Remove usage of LLVM_PREFIX.Chaoren Lin2016-03-181-4/+0
| | | | | | | | | | | | Summary: LLVM_PREFIX could be undefined if CMAKE_INSTALL_PREFIX were set to empty. Reviewers: kparzysz, bkramer, chandlerc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17784 llvm-svn: 263766
* [Driver] [Darwin] Fix linking libclang_rt.profile_*sim.aChris Bieneman2016-03-151-28/+2
| | | | | | | | | | | | Summary: isTarget*() calls are order-dependent. This is because iOS Sim *is* iOS. This means checks for the simulator version of the platform must always be ahead of checks for the embedded platform. Reviewers: zaks.anna, bogner Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17947 llvm-svn: 263567
* Make FreeBSD and NetBSD use CLANG_DEFAULT_CXX_STDLIBJonas Hahnfeld2016-03-141-21/+2
| | | | | | | | | Also introduce -stdlib=platform to override the configured value and use it to make the tests always pass. Differential Revision: http://reviews.llvm.org/D17286 llvm-svn: 263434
* Introduce -fembed-bitcode driver optionSteven Wu2016-03-011-0/+7
| | | | | | | | | | | | | | | | | | | | | Summary: This is the clang driver part of the change to embedded bitcode. This includes: 1. -fembed-bitcode option which breaks down the compilation into two stages. The first stage emits optimized bitcode and the second stage compiles bitcode into object file. 2. -fembed-bitcode-marker option which doesn't really break down to two stages to speedup the compilation flow. 3. pass the correct linker flag to darwin linker if tool chains supports embedded bitcode. Reviewers: rsmith, thakis Subscribers: thakis, cfe-commits Differential Revision: http://reviews.llvm.org/D17390 llvm-svn: 262282
* [WebAssembly] Initial driver support for standard library paths.Dan Gohman2016-02-221-0/+5
| | | | llvm-svn: 261560
* Enable SafeStack for CloudABI.Ed Schouten2016-02-171-0/+6
| | | | | | | | | | | | | | | | | Summary: I've got a patchset in my home directory to integrate support for SafeStack into CloudABI's C library. All of the CloudABI unit tests still seem to pass. Pretty sweet! This change adds the necessary changes to Clang to make -fsanitize=safe-stack work on CloudABI. Without it, passing this command line flag throws an error. Reviewers: eugenis, samsonov Differential Revision: http://reviews.llvm.org/D17243 llvm-svn: 261135
* Darwin: fix stdlib handling when CLANG_DEFAULT_STDLIB is setTim Northover2016-02-151-1/+1
| | | | | | | | | I'd accidentally skipped the CMake check in a premature optimisation. I'd also put the original test in completely the wrong place. Thanks Jonas Hahnfeld! llvm-svn: 260898
* As reported in https://llvm.org/bugs/show_bug.cgi?id=25496, on FreeBSD,Dimitry Andric2016-02-141-0/+16
| | | | | | | | | | | | | | | | C++ programs compiled for profiling (using `-pg`) should be linked with `-lc++_p` (or `-lstdc++_p`, depending on the `-stdlib=` setting), not with the regular C++ libraries. Add a `FreeBSD::AddCXXStdlibLibArgs()` override to handle this, and add a test case for it. While here, extend the test case for the proper passing of -lm and -lm_p. Reviewers: compnerd, davide, dws, emaste Reviewed By: compnerd Differential Revision: http://reviews.llvm.org/D16264 llvm-svn: 260851
* Fix remaining Clang-tidy readability-redundant-control-flow warnings; other ↵Eugene Zelenko2016-02-121-7/+0
| | | | | | | | minor fixes. Differential revision: http://reviews.llvm.org/D17218 llvm-svn: 260757
* Darwin: pass -stdlib=libc++ down to cc1 whenever we're targeting libc++Tim Northover2016-02-121-0/+6
| | | | | | | Recent refactoring meant it only got passed down when explicitly specified, which breaks header search on Darwin. llvm-svn: 260755
* [CMake] Add option to switch default C++ stdlibJonas Hahnfeld2016-02-121-19/+11
| | | | | | | | | With this option one can optionally override the architecture dependent default library to use if no -stdlib= is provided on compiler invocation. Differential Revision: http://reviews.llvm.org/D15920 llvm-svn: 260662
* Remove decision logic for old NetBSD development versions, the 7.0Joerg Sonnenberger2016-02-111-1/+1
| | | | | | release made this obsolete. llvm-svn: 260617
* Now that Sparc/Sparc64 backend is mostly usable, provide the sameJoerg Sonnenberger2016-02-111-0/+2
| | | | | | | linking defaults as other NetBSD targets, i.e. compiler_rt-in-libc and libc++ as STL. llvm-svn: 260616
* [asan] Add iOS support for Address SanitizerAnna Zaks2016-02-021-6/+24
| | | | | | Differential Revision: http://reviews.llvm.org/D15624 llvm-svn: 259453
* ARMv7k: simplify logic for deciding sjlj-exceptions.Tim Northover2016-01-271-2/+1
| | | | | | | Slight change of behaviour in the odd armv7+watchos case, which should match the other runtime components. llvm-svn: 258994
* ARMv7k: select ABI based on v7k Arch rather than watchos OS.Tim Northover2016-01-271-1/+3
| | | | | | | | Various bits we'd like to use the new ABI actually compile with "-arch armv7k -miphoneos-version-min=9.0". Not ideal, but also not ridiculous given how slices work. llvm-svn: 258976
* Introduce -fsanitize-stats flag.Peter Collingbourne2016-01-161-0/+7
| | | | | | | | | This is part of a new statistics gathering feature for the sanitizers. See clang/docs/SanitizerStats.rst for further info and docs. Differential Revision: http://reviews.llvm.org/D16175 llvm-svn: 257971
* [CUDA] Invoke ptxas and fatbinary during compilation.Justin Lebar2016-01-141-7/+20
| | | | | | | | | | | | | | | | | | | | Summary: Previously we compiled CUDA device code to PTX assembly and embedded that asm as text in our host binary. Now we compile to PTX assembly and then invoke ptxas to assemble the PTX into a cubin file. We gather the ptx and cubin files for each of our --cuda-gpu-archs and combine them using fatbinary, and then embed that into the host binary. Adds two new command-line flags, -Xcuda_ptxas and -Xcuda_fatbinary, which pass args down to the external tools. Reviewers: tra, echristo Subscribers: cfe-commits, jhen Differential Revision: http://reviews.llvm.org/D16082 llvm-svn: 257809
* [WebAssembly] Configure some simple include paths and runtime library settings.Dan Gohman2016-01-141-0/+23
| | | | llvm-svn: 257774
* [Darwin] Fix deployment target detectionFrederic Riss2016-01-121-1/+1
| | | | | | | | | There was a thinko in the deployment target detection code that made the -isysroot parsing have precedence over the environment variable for tvOS. This patch makes this logic symetric for all platforms (the env variable must have precedence). llvm-svn: 257543
* [Hexagon] Treat -march and -mcpu as equivalentKrzysztof Parzyszek2016-01-061-7/+2
| | | | llvm-svn: 256977
* [Hexagon] Use back_inserter as target iterator in std::copyKrzysztof Parzyszek2016-01-061-1/+2
| | | | llvm-svn: 256934
* Fix C++ support on recent DragonFly BSD releasesDimitry Andric2015-12-271-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: [ Copied from https://llvm.org/bugs/show_bug.cgi?id=25597 ] Clang support for DragonFly BSD is lagging a bit, resulting in poor support for c++. DragonFlyBSD is unique in that it has two base compilers. At the time of the last Clang update for DragonFly, these compilers were GCC 4.4 and GCC 4.7 (default). With DragonFly Release 4.2, GCC 4.4 was replaced with GCC 5.0, partially because the C++11 support of GCC 4.7 was incomplete. The DragonFly project will Release version 4.4 soon. This patch updates the Clang driver to use libstdc++ from GCC 5.2 The support for falling back to the alternate compiler was removed for two reasons: 1) The last release to use GCC 4.7 is DF 4.0 which has already reached EOL 2) GCC 4.7 libstdc++ is insufficient for many "ports" Therefore, I think it is reasonable that the development version of clang expects GCC 5.2 to be in place and not try to fall back to another compiler. The attached patch will do this. The Tools.cpp file was signficantly modified to fix the linking which had been changed somewhere along the line. The rest of the changes should be self-explanatory. Reviewers: joerg, rsmith, davide Subscribers: jrmarino, davide, cfe-commits Differential Revision: http://reviews.llvm.org/D15166 llvm-svn: 256467
* [WebAssembly] Initial linking support.Dan Gohman2015-12-161-0/+13
| | | | | | | | | This begins minimal support for invoking 'ld' from clang for WebAssembly targets. Differential Revision: http://reviews.llvm.org/D15586 llvm-svn: 255848
* [CUDA] renamed cuda_runtime.h wrapper to __cuda_runtime.hArtem Belevich2015-12-161-1/+1
| | | | | | | | | | | | | | Currently it's easy to break CUDA compilation by passing "-isystem /path/to/cuda/include" to compiler which leads to compiler including real cuda_runtime.h from there instead of the wrapper we need. Renaming the wrapper ensures that we can include the wrapper regardless of user-specified include paths and files. Differential Revision: http://reviews.llvm.org/D15534 llvm-svn: 255802
* [Hexagon] Update default paths and argumentsKrzysztof Parzyszek2015-12-141-128/+87
| | | | | | | | | - Removed support for hexagonv3 and earlier. - Added handling of hexagonv55 and hexagonv60. - Added handling of target features (hvx, hvx-double). - Updated paths to reflect current directory layout. llvm-svn: 255502
* Driver: add multilibs for ARM EBSaleem Abdulrasool2015-12-111-0/+12
| | | | | | | | This improves the coverage for the multilib directories used for ARM. Also add tests covering the internal triple (thumbv7-*). The Juno board can be run in this configuration. llvm-svn: 255328
* [PPC64, TSAN] Enable thread sanitizer for PPC64Bill Schmidt2015-12-081-1/+1
| | | | | | | | Patch by Simone Atzeni. This enables the -fsanitize=thread flag for PPC64 and PPC64LE. llvm-svn: 255067
* 80-col and whitespace fixups.Eric Christopher2015-12-071-9/+12
| | | | llvm-svn: 254958
* Revert Sparc and SparcV9 to external assembler. Now that the CPUJoerg Sonnenberger2015-11-271-3/+0
| | | | | | | | handling is corrected, the primary reason for forcing IAS as default is gone and the remaining issues are still somewhat problematic in common situations. llvm-svn: 254199
* Driver: Defer computation of linker path until it is needed.Peter Collingbourne2015-11-201-6/+1
| | | | | | | This allows us to construct Linux toolchains without a valid linker. This is needed for example to build a CUDA device toolchain after r253385. llvm-svn: 253707
* [Myriad]: handle Preprocess job action (-E)Douglas Katzman2015-11-201-0/+1
| | | | llvm-svn: 253647
* Support CMake's clang_rt.profile library naming schemeChris Bieneman2015-11-201-11/+25
| | | | | | | | | | | | Summary: This code is a bit undesirable, but it gets clang to work with the autoconf and cmake-built libclang_rt.profile libraries. Reviewers: bogner Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D14847 llvm-svn: 253625
* [Myriad]: insert -L paths into linker cmd only when they exist.Douglas Katzman2015-11-181-21/+20
| | | | | | Differential Revision: http://reviews.llvm.org/D14754 llvm-svn: 253467
* [CUDA] Make CUDA compilation usable by default.Artem Belevich2015-11-171-1/+5
| | | | | | | | | | | | | | | | | | Currently clang requires several additional command line options in order to enable new features needed during CUDA compilation. This patch makes these options default. * Automatically include cuda_runtime.h if we've found a valid CUDA installation. * Disable automatic CUDA header inclusion during unit tests. * Added test case for command line construction. * Enabled target overloads and relaxed call checks that are needed in order to include CUDA headers. * Added CUDA-7.5 installation path to the CUDA installation search list. * Define __CUDA__ macro to indicate CUDA compilation. llvm-svn: 253389
* [CUDA] Detect and link with CUDA's libdevice bitcode library.Artem Belevich2015-11-171-0/+41
| | | | | | | | | | | - added detection of libdevice bitcode file and API to find one appropriate for the GPU we're compiling for. - pass additional cc1 options for linking with detected libdevice bitcode - added -nocudalib to prevent automatic linking with libdevice - added test cases to verify new functionality Differential Revision: http://reviews.llvm.org/D14556 llvm-svn: 253387
* [CUDA] added include paths for both sides of CUDA compilation.Artem Belevich2015-11-171-0/+9
| | | | | | | | | | | | | | | | | | | | | In order to compile a CUDA file clang must be able to find include files for both both host and device. This patch passes AuxToolchain to AddPreprocessingOptions and uses it to add include paths for the opposite side of compilation. We also must be able to find CUDA include files. If the driver found CUDA installation, it adds appropriate include path to CUDA headers. This can be disabled with '-nocudainc'. - Added include paths for the opposite side of compilation. - Added include paths to detected CUDA installation. - Added -nocudainc to prevent adding CUDA include path. - Added test cases to verify new functionality. Differential Revision: http://reviews.llvm.org/D13170 llvm-svn: 253386
* ARM: fix mismatch between Clang and backend on exception type.Tim Northover2015-11-171-6/+2
| | | | | | | | | | | | "-arch armv7k" is only normally used with a watchos target, but Clang doesn't stop you from giving a "-miphoneos-version-min" option too, converting the triple to "thumbv7k-apple-ios". In this case the backend will decide to use SjLj exceptions, so Clang needs to agree so it can create the correct predefines. Fortunately, there's a handy function to make the decision for us now. llvm-svn: 253355
* [mips] Do not add arch name in the compiler-rt's components.Vasileios Kalintiris2015-11-161-2/+1
| | | | | | | Instead, use the constant "mips" since the libraries are already placed under the multilib's OS suffix. llvm-svn: 253214
* Re-recommit: Add support for the new mips-mti-linux toolchain.Vasileios Kalintiris2015-11-121-3/+162
| | | | | | | | Last time, this caused two Windows buildbots and a single ARM buildbot to fail. I XFAIL'd the failing test on win32,win64 machines in order to see if the ARM buildbot complains again. llvm-svn: 252901
* [Driver] Use platform-appropriate profiling libraries for WatchOS, TVOSVedant Kumar2015-11-101-2/+10
| | | | | | | | | | | | | When adding profiling instrumentation, use libclang_rt.profile_tvos.a for TVOS targets and libclang_rt.profile_watchos.a for WatchOS targets. I've also fixed up a comment and added an assert() that prevents us from defaulting to an incorrect platform. Differential Revision: http://reviews.llvm.org/D14521 Reviewed-by: t.p.northover llvm-svn: 252558
* Extend linux header search to find libc++ headers in c++/vN for any N.Evgeniy Stepanov2015-11-091-6/+22
| | | | llvm-svn: 252514
* [tsan] Add Clang frontend support for TSan on OS XKuba Brecka2015-11-061-0/+3
| | | | | | | | We're currently in process of porting TSan to OS X, and quite a few of the initial support in the runtime library has already landed in trunk. This patch actually enables "-fsanitize=thread" in the frontend. Differential Revision: http://reviews.llvm.org/D14440 llvm-svn: 252310
* Disable SjLj exceptions for watchOSTim Northover2015-10-301-4/+12
| | | | llvm-svn: 251709
* Watch and TV OS: wire up basic ABI choicesTim Northover2015-10-301-3/+1
| | | | | | | This sets the mostly expected Darwin default ABI options for these two platforms. Active changes from these defaults for watchOS are in a later patch. llvm-svn: 251708
* Support watchOS and tvOS driver optionsTim Northover2015-10-301-27/+158
| | | | | | | | This patch should add support for almost all command-line options and driver tinkering necessary to produce a correct "clang -cc1" invocation for watchOS and tvOS. llvm-svn: 251706
* Revert "[mips] Add support for the new mips-mti-linux toolchain."Vasileios Kalintiris2015-10-301-162/+3
| | | | | | | This reverts commits r251633. I'll investigate the test failure off trunk in order to keep the buildbots clean. llvm-svn: 251698
* add support of the latest Ubuntu (Xenial Xerus)Sylvestre Ledru2015-10-291-1/+3
| | | | llvm-svn: 251639
OpenPOWER on IntegriCloud