summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* Change the set of actions built for external gcc tools.Eric Christopher2016-01-062-0/+9
| | | | | | | | A gcc tool has an "integrated" assembler (usually gas) that it will call to produce an object. Let it use that assembler so that we don't have to deal with assembly syntax incompatibilities. llvm-svn: 256919
* [Clang/Support/Windows/Unix] Command lines created by clang may exceed the ↵Oleg Ranevskyy2016-01-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | command length limit set by the OS Summary: LLVM part of the patch is D15831. When clang runs an external tool such as a linker it may create a command line that exceeds the length limit. Clang uses the llvm::sys::argumentsFitWithinSystemLimits function to check if command line length fits the OS limitation. There are two problems in this function that may cause exceeding of the limit: 1. It ignores the length of the program path in its calculations. On the other hand, clang adds the program path to the command line when it runs the program. 2. It assumes no space character is inserted after the last argument, which is not true for Windows. The flattenArgs function adds the trailing space for *each* argument. The result of this is that the terminating NULL character is not counted and may be placed beyond the length limit if the command line is exactly 32768 characters long. The WinAPI's CreateProcess does not find the NULL character and fails. Reviewers: rafael, asl Subscribers: asl, llvm-commits Differential Revision: http://reviews.llvm.org/D15832 llvm-svn: 256865
* [PGO] Enable clang to pass compiler-rt profile support library to linker on ↵Nathan Slingerland2016-01-051-0/+2
| | | | | | | | | | | | | | Windows Summary: This change enables clang to automatically link binaries built with the -fprofile-instr-generate against the clang_rt.profile-i386.lib library. Reviewers: davidxl, dnovillo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15833 llvm-svn: 256855
* [AArch64] Teaches clang about Samsung Exynos-M1MinSeong Kim2016-01-051-1/+1
| | | | | | | | Adds core tuning support for new Samsung Exynos-M1 core (ARMv8-A). Differential Revision: http://reviews.llvm.org/D15664 llvm-svn: 256829
* Disable generating movt on FreeBSD.Davide Italiano2015-12-301-2/+2
| | | | | | | | | | It's sort of an hack, but we have no choice. The linker in the base system doesn't handle that correctly (yet). Once FreeBSD will import lld, this can be backed out. Patch by: Andrew Turner! llvm-svn: 256641
* Fix up a comment and a bit of trailing whitespace.Eric Christopher2015-12-281-2/+2
| | | | llvm-svn: 256525
* We check for dwarf 5 in the backend, so go ahead and pass it along viaEric Christopher2015-12-281-1/+2
| | | | | | | | | | the front end as well. Note that DWARF5 isn't finalized and any feature support is subject to change and accepting of the option doesn't mean we're supporting the full range of the current standard. llvm-svn: 256516
* On {mips,mipsel,mips64,mips64el}-freebsd, we need to pass any -G option to ↵Dimitry Andric2015-12-271-0/+6
| | | | | | | | | | | | | | | | the assembler. Summary: See also: https://sourceware.org/binutils/docs/as/MIPS-Options.html#index-g_t_0040code_007b_002dG_007d-option-_0028MIPS_0029-1392 Reviewers: theraven, atanasyan, brooks, emaste Subscribers: rnk, emaste, cfe-commits, seanbruno, dim Differential Revision: http://reviews.llvm.org/D10137 llvm-svn: 256468
* Fix C++ support on recent DragonFly BSD releasesDimitry Andric2015-12-272-32/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* For FreeBSD on mips, pass -G options to the linkerDimitry Andric2015-12-271-0/+11
| | | | | | | | | | | | | | | | | Summary: On {mips,mipsel,mips64,mips64el}-freebsd, we need to pass any -G option to the linker. See also: https://gcc.gnu.org/onlinedocs/gcc/MIPS-Options.html#index-G-2007 This has been adapted from https://reviews.freebsd.org/D1190, with an added test case. Reviewers: theraven, atanasyan, emaste Subscribers: brooks, tomatabacu, cfe-commits, seanbruno, emaste Differential Revision: http://reviews.llvm.org/D9114 llvm-svn: 256461
* Pull out a bunch of duplicated option handling code into its ownEric Christopher2015-12-221-41/+24
| | | | | | function and use for the targets that can easily support it. llvm-svn: 256230
* [WebAssembly] Remove the -target command-line flag from the ld commandline.Dan Gohman2015-12-211-2/+0
| | | | | | | | This flag isn't needed, or permitted, with the "ld" flavor of lld. Also, add a basic ld commandline test. llvm-svn: 256216
* [clang-cl] Add support for /BreproDavid Majnemer2015-12-211-0/+9
| | | | | | | | | | | | The /Brepro flag controls whether or not the compiler should embed timestamps into the object file. Object files which do not embed timestamps are not suitable for incremental linking but are suitable for hermetic build systems and staged self-hosts of clang. A normal clang spelling of this flag has been added, -mincremental-linker-compatible. llvm-svn: 256204
* [Driver] Pass -O* to the gold plugin via -plugin-optJames Molloy2015-12-211-0/+13
| | | | | | The gold plugin understands -O0..-O3, but these are not currently being passed to it. llvm-svn: 256146
* Driver part of debugger tuning.Paul Robinson2015-12-192-24/+74
| | | | | | | | | | | | | | | | Adds driver options named -glldb and -gsce to mean -g plus tuning for lldb and SCE debuggers respectively; the existing -ggdb option does the same for gdb. Existing options -ggdb0, -ggdb1 etc. unpack into -ggdb -g<N>. (There will not be -glldb<N> or -gsce<N> options.) The tuning gets a target-specific default in the driver, and is passed into cc1 with the new -debugger-tuning option. As fallout, fixes where '-gsplit-dwarf -g0' would ignore the -g0 part on Linux. Differential Revision: http://reviews.llvm.org/D15651 llvm-svn: 256104
* Use a command line alias to remove the need to rewrite a subtargetEric Christopher2015-12-191-8/+0
| | | | | | feature for command line compatibility. llvm-svn: 256076
* PIC should not be enabled by default on Darwin with -static.Bob Wilson2015-12-181-0/+3
| | | | | | | | | | | r245667 changed -static so that it doesn't override an explicit -fPIC option, but -static should still change the default for Darwin for -fno-PIC. This matches longstanding GCC and Clang behavior on Darwin and changing it would be disruptive, with no significant benefit. http://reviews.llvm.org/D15455 rdar://problem/23811045 llvm-svn: 256026
* [WebAssembly] Initial linking support.Dan Gohman2015-12-164-2/+60
| | | | | | | | | This begins minimal support for invoking 'ld' from clang for WebAssembly targets. Differential Revision: http://reviews.llvm.org/D15586 llvm-svn: 255848
* [PS4] Fix the unit test to be compatible with clang driver. NFCSumanth Gundapaneni2015-12-161-1/+1
| | | | | | | | | | ".exe" extension is inherently checked by llvm::fs::can_execute() This patch fixes the linker extension in clang driver and updates the unit test to accommodate the the check string on windows. Differential Revision:http://reviews.llvm.org/D15577 llvm-svn: 255814
* [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
* [PS4][Profile] add "--dependent-lib=libclang_rt.profile-x86_64.a" toPaul Robinson2015-12-161-19/+21
| | | | | | | | | | the CC1 command line when enabling code coverage. Patch by Ying Yi! Differential Revision: http://reviews.llvm.org/D15222 llvm-svn: 255784
* [cfi] Exclude ubsan runtime library from non-diag CFI builds (driver changes).Evgeniy Stepanov2015-12-162-1/+7
| | | | | | | Split the CFI runtime in two: cfi and cfi_diag. The latter includes UBSan runtime to allow printing diagnostics. llvm-svn: 255736
* Cross-DSO control flow integrity (Clang part).Evgeniy Stepanov2015-12-152-1/+20
| | | | | | | | | | | | | | Clang-side cross-DSO CFI. * Adds a command line flag -f[no-]sanitize-cfi-cross-dso. * Links a runtime library when enabled. * Emits __cfi_slowpath calls is bitset test fails. * Emits extra hash-based bitsets for external CFI checks. * Sets a module flag to enable __cfi_check generation during LTO. This mode does not yet support diagnostics. llvm-svn: 255694
* [Power PC] add soft float support for ppc32Petar Jovanovic2015-12-142-2/+68
| | | | | | | | | | | | This patch enables soft float support for ppc32 architecture and fixes the ABI for variadic functions. This is the first in a set of patches for soft float support in LLVM. Patch by Strahinja Petrovic. Differential Revision: http://reviews.llvm.org/D13351 llvm-svn: 255515
* [Hexagon] Update default paths and argumentsKrzysztof Parzyszek2015-12-143-213/+230
| | | | | | | | | - 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
* [Hexagon] Use integrated assembler by defaultKrzysztof Parzyszek2015-12-091-0/+3
| | | | llvm-svn: 255127
* [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
* Replace a bunch of duplicate conditions with the call from types::.Eric Christopher2015-12-081-10/+4
| | | | llvm-svn: 254986
* Remove name from FIXME.Eric Christopher2015-12-081-1/+1
| | | | llvm-svn: 254985
* 80-column fixup.Eric Christopher2015-12-081-1/+2
| | | | llvm-svn: 254973
* Update comment.Eric Christopher2015-12-081-2/+2
| | | | llvm-svn: 254972
* 80-col and whitespace fixups.Eric Christopher2015-12-071-9/+12
| | | | llvm-svn: 254958
* [ThinLTO] Option to invoke ThinLTO backend passes and importingTeresa Johnson2015-12-072-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adds new option -fthinlto-index=<file> to invoke the LTO pipeline along with function importing via clang using the supplied function summary index file. This supports invoking the parallel ThinLTO backend processes in a distributed build environment via clang. Additionally, this causes the module linker to be invoked on the bitcode file being compiled to perform any necessary promotion and renaming of locals that are exported via the function summary index file. Add a couple tests that confirm we get expected errors when we try to use the new option on a file that isn't bitcode, or specify an invalid index file. The tests also confirm that we trigger the expected function import pass. Depends on D15024 Reviewers: joker.eph, dexonsmith Subscribers: joker.eph, davidxl, cfe-commits Differential Revision: http://reviews.llvm.org/D15025 llvm-svn: 254927
* Fix the clang driver when "-nostdlib" is presentSumanth Gundapaneni2015-12-021-2/+1
| | | | | | | | | | This patch is a fix to r252901 which changed the behavior of clang driver. In the presence of "-nostdlib" none of the standard libraries should be passed to link line. Differential Revision: http://reviews.llvm.org/D15130 llvm-svn: 254535
* Teaches clang about Cortex-A35.Christof Douma2015-12-021-1/+1
| | | | | | | | Adds support for the new Cortex-A35 ARMv8-A core. Differential Revision: http://reviews.llvm.org/D15142 llvm-svn: 254505
* 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
* [AArch64] Add command-line options for Statistical Profiling ExtensionOliver Stannard2015-11-261-0/+2
| | | | | | | | | | This adds the "+profile" and +noprofile" suffixes for the -march and -mcpu options, to allow enabling or disabling the options Statistical Profiling Extension to ARMv8.2-A. Differential Revision: http://reviews.llvm.org/D15023 llvm-svn: 254161
* [AArch64] Add command-line options for ARMv8.2-AOliver Stannard2015-11-261-0/+4
| | | | | | | | | | | This adds new values for the -march option (armv8.2a and armv8.2-a, which are aliases of each other), and new suffixes for the -march and -mcpu options (+fp16 and +nofp16), to allow targeting the ARMv8.2-A architecture and it's optional half-precision floating-point extension. Differential Revision: http://reviews.llvm.org/D15022 llvm-svn: 254160
* Driver: protect from empty -L argsMartell Malone2015-11-261-1/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D12466 llvm-svn: 254117
* Fix rewrite of reserved library name in case of -nodefaultlibsNirav Dave2015-11-241-1/+2
| | | | | | | | | | | | The Driver only checked if nostdlib was set when deciding to add reserved_lib_stdcxx, but as nostdlib is always exactly nodefaultlibs and nostartfiles we should be checking one (clearly nodefaultlibs in the case) as well. This appears to be the only such instance of this in the codebase. Differential Revision: http://reviews.llvm.org/D14935 llvm-svn: 253990
* Fix alignment of r253898Martell Malone2015-11-231-10/+8
| | | | llvm-svn: 253899
* Driver: fallback to the location of clang if no sysroot,Martell Malone2015-11-231-15/+11
| | | | | | | | | | | | | | hard coding /usr makes little sense for mingw-w64. If we have portable toolchains having /usr breaks that. If the clang we use is in /usr/bin or /usr/sbin etc this will still detect as though it was hard coded to /usr This makes the most sense going forward for mingw-w64 toolchains on both linux and mac Differential Revision: http://reviews.llvm.org/D14164 llvm-svn: 253898
* Disable frame pointer elimination when using -pg Xinliang David Li2015-11-231-0/+4
| | | | | | | | | | | | | | | | (Re-apply patch after bug fixing) This diff makes sure that the driver does not pass -fomit-frame-pointer or -momit-leaf-frame-pointer to the frontend when -pg is used. Currently, clang gives an error if -fomit-frame-pointer is used in combination with -pg, but -momit-leaf-frame-pointer was forgotten. Also, disable frame pointer elimination in the frontend when -pg is set. Patch by Stefan Kempf. llvm-svn: 253886
* Revert part of r253813Martell Malone2015-11-231-7/+0
| | | | | | The new lld gnu frontend does not support the -target option llvm-svn: 253874
* Revert r253846 (build bot failure))Xinliang David Li2015-11-231-4/+0
| | | | llvm-svn: 253851
* Disable frame pointer elimination when using -pgXinliang David Li2015-11-231-0/+4
| | | | | | | | | | | | | | This diff makes sure that the driver does not pass -fomit-frame-pointer or -momit-leaf-frame-pointer to the frontend when -pg is used. Currently, clang gives an error if -fomit-frame-pointer is used in combination with -pg, but -momit-leaf-frame-pointer was forgotten. Also, disable frame pointer elimination in the frontend when -pg is set. Patch by Stefan Kempf. llvm-svn: 253846
* Driver: Specifically tell the linker the target for mingw-w64Martell Malone2015-11-221-1/+8
| | | | | | | | | Cross compiling from linux and OSX results in Error: Exec format. This is because the linker is expecting ELF formated objects. By passing the target we can explicitly tell the linker that it should be linking COFF objects regardless of the host. llvm-svn: 253813
* Driver: Defer computation of linker path until it is needed.Peter Collingbourne2015-11-204-14/+7
| | | | | | | 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
* Revert r253582: "clang-cl: Make /W4 imply -Wall -Wextra (PR25563)"Hans Wennborg2015-11-201-20/+0
| | | | | | | | | | The patch expanded the flag *at the end*, breaking invocations like: clang-cl /W4 -Wno-unused-parameter Reverting for now. llvm-svn: 253678
OpenPOWER on IntegriCloud