aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/Tools.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-01-08Driver: Use the new ELF lld linker for AMDGPUTom Stellard1-4/+0
Summary: 'gnu-old' has been deprecated in favor or 'gnu'. Reviewers: arsenm, ruiu, rafael Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15953 llvm-svn: 257175
2016-01-07Make sure we claim arguments that are going to be passed to a gcc tool,Eric Christopher1-5/+6
even if they're not going to be used to avoid unused option warnings. llvm-svn: 257040
2016-01-07Replace a loop with the call that does the same thing.Eric Christopher1-2/+1
llvm-svn: 257014
2016-01-07[WebAssembly] Enable -fvisibility=hidden by default.Dan Gohman1-0/+15
This, along with many things in the WebAssembly target, is experimental. Feedback is welcome. llvm-svn: 257006
2016-01-07[WebAssembly] Enable -ffunction-sections and -fdata-sections by default.Dan Gohman1-3/+8
These remain user-overridable with -fno-function-sections and -fno-data-sections. llvm-svn: 257005
2016-01-07[WebAssembly] Only enable --gc-sections when optimizations are enabled.Dan Gohman1-1/+2
Also, revamp the wasm-toolchain.c test and add a test to ensure that a user-supplied --no-gc-sections comes after --gc-sections. llvm-svn: 257004
2016-01-06[WebAssembly] Add --gc-sections to the link line.Dan Gohman1-0/+5
This will eventually be accompanied with a change to enable -ffunction-sections and -fdata-sections by default, which is currently delayed by some development process issues. llvm-svn: 256967
2016-01-06[Driver] Add support for -fno-builtin-foo options.Chad Rosier1-3/+25
Addresses PR4941 and rdar://6756912. http://reviews.llvm.org/D15195 llvm-svn: 256937
2016-01-06[Analyzer] Change the default SA checkers for PS4Sean Eveson1-8/+15
Summary: This patch removes security.*, unix.API and unix.Vfork from the default checkers for PS4. Reviewers: dcoughlin, zaks.anna Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15888 llvm-svn: 256926
2016-01-06Add -fno-movt frontend option, to disable movt/movw on ARMDimitry Andric1-2/+2
Summary: In rL256641, @davide turned off movt generation by default for FreeBSD. This was because our ld is very old, and did not support the relocations for it. However, Ian Lepore added the support very recently, so we would like to revert rL256641, and replace it with a new `-fno-movt` frontend option. This way, it can be turned off when needed. Reviewers: dexonsmith, echristo, emaste, davide Subscribers: andrew, aemerson, rengolin, davide, cfe-commits, ahatanak, emaste Differential Revision: http://reviews.llvm.org/D15899 llvm-svn: 256920
2016-01-06Change the set of actions built for external gcc tools.Eric Christopher1-0/+5
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
2016-01-05[PGO] Enable clang to pass compiler-rt profile support library to linker on ↵Nathan Slingerland1-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
2016-01-05[AArch64] Teaches clang about Samsung Exynos-M1MinSeong Kim1-1/+1
Adds core tuning support for new Samsung Exynos-M1 core (ARMv8-A). Differential Revision: http://reviews.llvm.org/D15664 llvm-svn: 256829
2015-12-30Disable generating movt on FreeBSD.Davide Italiano1-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
2015-12-28Fix up a comment and a bit of trailing whitespace.Eric Christopher1-2/+2
llvm-svn: 256525
2015-12-28We check for dwarf 5 in the backend, so go ahead and pass it along viaEric Christopher1-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
2015-12-27On {mips,mipsel,mips64,mips64el}-freebsd, we need to pass any -G option to ↵Dimitry Andric1-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
2015-12-27Fix C++ support on recent DragonFly BSD releasesDimitry Andric1-28/+10
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
2015-12-27For FreeBSD on mips, pass -G options to the linkerDimitry Andric1-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
2015-12-22Pull out a bunch of duplicated option handling code into its ownEric Christopher1-41/+24
function and use for the targets that can easily support it. llvm-svn: 256230
2015-12-21[WebAssembly] Remove the -target command-line flag from the ld commandline.Dan Gohman1-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
2015-12-21[clang-cl] Add support for /BreproDavid Majnemer1-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
2015-12-21[Driver] Pass -O* to the gold plugin via -plugin-optJames Molloy1-0/+13
The gold plugin understands -O0..-O3, but these are not currently being passed to it. llvm-svn: 256146
2015-12-19Driver part of debugger tuning.Paul Robinson1-24/+64
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
2015-12-19Use a command line alias to remove the need to rewrite a subtargetEric Christopher1-8/+0
feature for command line compatibility. llvm-svn: 256076
2015-12-18PIC should not be enabled by default on Darwin with -static.Bob Wilson1-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
2015-12-16[WebAssembly] Initial linking support.Dan Gohman1-0/+28
This begins minimal support for invoking 'ld' from clang for WebAssembly targets. Differential Revision: http://reviews.llvm.org/D15586 llvm-svn: 255848
2015-12-16[PS4] Fix the unit test to be compatible with clang driver. NFCSumanth Gundapaneni1-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
2015-12-16[PS4][Profile] add "--dependent-lib=libclang_rt.profile-x86_64.a" toPaul Robinson1-19/+21
the CC1 command line when enabling code coverage. Patch by Ying Yi! Differential Revision: http://reviews.llvm.org/D15222 llvm-svn: 255784
2015-12-16[cfi] Exclude ubsan runtime library from non-diag CFI builds (driver changes).Evgeniy Stepanov1-0/+2
Split the CFI runtime in two: cfi and cfi_diag. The latter includes UBSan runtime to allow printing diagnostics. llvm-svn: 255736
2015-12-15Cross-DSO control flow integrity (Clang part).Evgeniy Stepanov1-0/+2
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
2015-12-14[Power PC] add soft float support for ppc32Petar Jovanovic1-2/+58
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
2015-12-14[Hexagon] Update default paths and argumentsKrzysztof Parzyszek1-79/+134
- 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
2015-12-08Replace a bunch of duplicate conditions with the call from types::.Eric Christopher1-10/+4
llvm-svn: 254986
2015-12-08Remove name from FIXME.Eric Christopher1-1/+1
llvm-svn: 254985
2015-12-0880-column fixup.Eric Christopher1-1/+2
llvm-svn: 254973
2015-12-08Update comment.Eric Christopher1-2/+2
llvm-svn: 254972
2015-12-07[ThinLTO] Option to invoke ThinLTO backend passes and importingTeresa Johnson1-0/+7
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
2015-12-02Fix the clang driver when "-nostdlib" is presentSumanth Gundapaneni1-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
2015-12-02Teaches clang about Cortex-A35.Christof Douma1-1/+1
Adds support for the new Cortex-A35 ARMv8-A core. Differential Revision: http://reviews.llvm.org/D15142 llvm-svn: 254505
2015-11-26[AArch64] Add command-line options for Statistical Profiling ExtensionOliver Stannard1-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
2015-11-26[AArch64] Add command-line options for ARMv8.2-AOliver Stannard1-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
2015-11-23Disable frame pointer elimination when using -pg Xinliang David Li1-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
2015-11-23Revert part of r253813Martell Malone1-7/+0
The new lld gnu frontend does not support the -target option llvm-svn: 253874
2015-11-23Revert r253846 (build bot failure))Xinliang David Li1-4/+0
llvm-svn: 253851
2015-11-23Disable frame pointer elimination when using -pgXinliang David Li1-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
2015-11-22Driver: Specifically tell the linker the target for mingw-w64Martell Malone1-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
2015-11-20Driver: Defer computation of linker path until it is needed.Peter Collingbourne1-5/+5
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
2015-11-20Revert r253582: "clang-cl: Make /W4 imply -Wall -Wextra (PR25563)"Hans Wennborg1-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
2015-11-20[Myriad]: handle Preprocess job action (-E)Douglas Katzman1-8/+11
llvm-svn: 253647