summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* [MinGW] Link to correct openmp libraryMartin Storsjo2018-10-231-2/+18
| | | | | | | | Patch by Peiyuan Song! Differential Revision: https://reviews.llvm.org/D53397 llvm-svn: 345003
* Revert "[Driver] Reland again: Default Android toolchains to libc++."Dan Albert2018-10-222-7/+0
| | | | | | More compiler-rt test bot breakages... llvm-svn: 344963
* [Driver] Reland again: Default Android toolchains to libc++.Dan Albert2018-10-222-0/+7
| | | | | | | | | Some of the test data went missing last time I tried to submit this, causing the tests to fail when the build did not include libc++. Original review was https://reviews.llvm.org/D53109. llvm-svn: 344946
* [Driver] allow Android triples to alias for non Android targetsNick Desaulniers2018-10-221-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Partial revert of r330873 ('[Driver] Reland "Android triples are not aliases for other triples."') While we don't want `-target *-linux-android` to alias to non *-linux-android libs and binaries, it turns out we do want the opposite. Ie. We would like for `-target *-linux-gnu` to still be able to use *-android libs and binaries. In fact, this is used to cross assemble and link the Linux kernel for Android devices. `-target *-linux-gnu` needs to be used for the Linux kernel when using the android binutils prebuilts (*-linux-android). The use of `-target *-linux-android` on C source files will cause Clang to perform optimizations based on the presence of bionic (due to r265481 ('Faster stack-protector for Android/AArch64.')) which is invalid within the Linux kernel and will produce a non-bootable kernel image. Of course, you could just use the standard binutils (*-linux-gnu), but Android does not distribute these. So this patch fixes a problem that only occurs when cross assembling and linking a Linux kernel with the Android provided binutils, which is what is done within Android's build system. Reviewers: srhines, pirama, danalbert Reviewed By: srhines, danalbert Subscribers: javed.absar, kristof.beyls, cfe-commits Differential Revision: https://reviews.llvm.org/D53463 llvm-svn: 344941
* Always search sysroot for GCC installsDavid Greene2018-10-221-2/+10
| | | | | | | | | | Previously, if clang was configured with -DGCC_INSTALL_PREFIX, then it would not search a provided sysroot for a gcc install. This caused a number of regression tests to fail. If a sysroot is given, skip searching GCC_INSTALL_PREFIX as it is likely not valid for the provided sysroot. llvm-svn: 344901
* [ARM][AArch64] Add LLVM_FALLTHROUGH to silence warning [NFC]Peter Smith2018-10-221-0/+1
| | | | | | | | | | A follow up to D52784 to add in LLVM_FALLTHROUGH where there is an intentional fall through in a switch statement. This will hopefully silence a GCC warning. Differential Revision: https://reviews.llvm.org/D52784 llvm-svn: 344890
* Revert "[Driver] Reland: Default Android toolchains to libc++."Dan Albert2018-10-192-7/+0
| | | | | | This reverts commit 84677d5009d613232d360fda27e6e41fb5cb6700. llvm-svn: 344806
* [Driver] Reland: Default Android toolchains to libc++.Dan Albert2018-10-192-0/+7
| | | | | | | | The sanitizer builder that was broken by this should now be fixed. Original review was https://reviews.llvm.org/D53109 llvm-svn: 344795
* Add support for -mno-tls-direct-seg-refs to ClangKristina Brooks2018-10-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch exposes functionality added in rL344723 to the Clang driver/frontend as a flag and adds appropriate metadata. Driver tests pass: ``` ninja check-clang-driver -snip- Expected Passes : 472 Expected Failures : 3 Unsupported Tests : 65 ``` Odd failure in CodeGen tests but unrelated to this: ``` ninja check-clang-codegen -snip- /SourceCache/llvm-trunk-8.0/tools/clang/test/CodeGen/builtins-wasm.c:87:10: error: cannot compile this builtin function yet -snip- Failing Tests (1): Clang :: CodeGen/builtins-wasm.c Expected Passes : 1250 Expected Failures : 2 Unsupported Tests : 120 Unexpected Failures: 1 ``` Original commit: [X86] Support for the mno-tls-direct-seg-refs flag Allows to disable direct TLS segment access (%fs or %gs). GCC supports a similar flag, it can be useful in some circumstances, e.g. when a thread context block needs to be updated directly from user space. More info and specific use cases: https://bugs.llvm.org/show_bug.cgi?id=16145 Patch by nruslan (Ruslan Nikolaev). Differential Revision: https://reviews.llvm.org/D53102 llvm-svn: 344739
* Disable code object version 3 for HIP toolchainYaxun Liu2018-10-161-1/+1
| | | | | | | | | AMDGPU backend will switch to code object version 3 by default. Since HIP runtime is not ready, disable it until the runtime is ready. Differential Revision: https://reviews.llvm.org/D53325 llvm-svn: 344630
* [driver][mips] Support MIPS R6 target triplesSimon Atanasyan2018-10-163-32/+76
| | | | | | | | | | | | | | | | This change adds support for the following MIPS target triples: mipsisa32r6-linux-gnu mipsisa32r6el-linux-gnu mipsisa64r6-linux-gnuabi64 mipsisa64r6el-linux-gnuabi64 mipsisa64r6-linux-gnuabin32 mipsisa64r6el-linux-gnuabin32 Patch by Yun Qiang Su. Differential revision: https://reviews.llvm.org/D50850 llvm-svn: 344608
* [driver][mips] Adjust target triple's environment accordingly to provided ↵Simon Atanasyan2018-10-161-6/+19
| | | | | | | | | | | ABI name For MIPS we need to adjust not only architecture name accordingly to ABI provided by the `-mabi` command line option, but also modify triple's environment. For example, for `mips-linux-gnu` triple and `-mabi=n32` option a correct final triple is `mips64-linux-gnuabin32`. llvm-svn: 344603
* [ARM][AArch64] Pass through endian flags to assembler and linker.Peter Smith2018-10-164-7/+37
| | | | | | | | | | | | | | | | | The big-endian arm32 Linux builds are currently failing when the -mbig-endian flag is used but the binutils default on the system is little endian. This also holds when -mlittle-endian is used and the binutils default is big endian. The patch always passes through -EL or -BE to the assembler and linker, taking into account the target and the -mbig-endian and -mlittle-endian flag. Fixes pr38770 Differential Revision: https://reviews.llvm.org/D52784 llvm-svn: 344597
* [mips] Fix handling of GNUABIN32 environment in a target tripleSimon Atanasyan2018-10-153-12/+38
| | | | | | | | | | | | The `GNUABIN32` environment in a target triple implies using the N32 ABI. This patch adds support for this environment and switches on N32 ABI if necessary. Patch by Patch by YunQiang Su. Differential revision: https://reviews.llvm.org/D51464 llvm-svn: 344570
* [Driver] Support direct split DWARF emission for FuchsiaPetr Hosek2018-10-151-4/+6
| | | | | | | | | This enables the driver support for direct split DWARF emission for Fuchsia in addition to Linux. Differential Revision: https://reviews.llvm.org/D53248 llvm-svn: 344556
* Revert 344389 "Revert r344375 "[Driver] check for exit code from SIGPIPE""Nick Desaulniers2018-10-151-7/+18
| | | | | | | | | | | | | | | | | Summary: Add preprocessor guards for UNIX. This reverts commit r344389. Reviewers: rnk, majnemer, jfb Reviewed By: rnk Subscribers: cfe-commits, pirama, srhines Differential Revision: https://reviews.llvm.org/D53210 llvm-svn: 344536
* Re-commit r344234 "clang-cl: Add /showFilenames option (PR31957)"Hans Wennborg2018-10-132-0/+13
| | | | | | | | The test was failing on e.g. PPC which can't target Windows. Fix by requiring X86 target in the test. Also, make sure the output goes to a temporary directory, since CWD may not be writable. llvm-svn: 344462
* [MinGW] Allow using LTO when lld is used as linkerMartin Storsjo2018-10-122-0/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D53195 llvm-svn: 344412
* Consistently make llvm::opt::ArgStringList usage explicit to try and appease ↵Simon Pilgrim2018-10-122-7/+7
| | | | | | MSVC 2015 buildbots. NFCI. llvm-svn: 344398
* Revert r344375 "[Driver] check for exit code from SIGPIPE"Reid Kleckner2018-10-121-16/+7
| | | | | | This doesn't build on Windows. llvm-svn: 344389
* [Driver] check for exit code from SIGPIPENick Desaulniers2018-10-121-7/+16
| | | | | | | | | | | | | | | | | | | | Summary: D53000 adds a special exit code for SIGPIPE (writing to a closed reader), and rather than print a fatal warning, skips printing the error. This can be seen commonly from piping into head, tee, or split. Fixes PR25349, rdar://problem/14285346, b/77310947. Reviewers: jfb Reviewed By: jfb Subscribers: cfe-commits, thakis, srhines Differential Revision: https://reviews.llvm.org/D53001 llvm-svn: 344375
* [Driver] Add defaults for Android ARM FPUs.Dan Albert2018-10-121-0/+7
| | | | | | | | | | | | | | | | | Summary: Android mandates that devices have at least vfpv3-d16 until Marshmallow and NEON after that. Still honor the user's decision, but raise the defaults for Android targets. Reviewers: srhines, pirama, javed.absar, kristof.beyls, peter.smith Reviewed By: peter.smith Subscribers: peter.smith, rengolin, kristof.beyls, chrib, cfe-commits Differential Revision: https://reviews.llvm.org/D53121 llvm-svn: 344367
* Fix MSVC 2015 ambiguous symbol warning introduced by rL344337. NFCI.Simon Pilgrim2018-10-121-1/+1
| | | | llvm-svn: 344352
* Revert "[Driver] Default Android toolchains to libc++."Dan Albert2018-10-112-7/+0
| | | | | | | | | Breaks some of the Android bots because they aren't expecting to need to explicitly set -stdlib. This reverts commit 031072f5048654b01a40f639633de1ff4e2f3dc8. llvm-svn: 344297
* [Driver] Default Android toolchains to libc++.Dan Albert2018-10-112-0/+7
| | | | | | | | | | | | Reviewers: srhines, pirama, EricWF Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53109 llvm-svn: 344296
* [Driver] Default to `-z now` and `-z relro` on Android.Dan Albert2018-10-111-2/+3
| | | | | | | | | | | | | | | | | | Summary: RTLD_LAZY is not supported on Android (though failing to use `-z now` will work since it is assumed by the loader). RelRO is required. Reviewers: srhines, pirama Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53117 llvm-svn: 344295
* [Driver] Fix --hash-style choice for Android.Dan Albert2018-10-111-5/+8
| | | | | | | | | | | | | | | | | Summary: Android supports GNU style hashes as of Marshmallow, so we should be generating both styles for pre-M targets and GNU hashes for newer targets. Reviewers: srhines, pirama Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53118 llvm-svn: 344293
* [HIP] Replace irif library with hip.amdgcn.bcAaron Enye Shi2018-10-111-2/+2
| | | | | | No longer use irif amdgcn library, instead we will use the previous fence functions from new hip.amdgcn.bc bitcode library. Update hip-device-libs.hip test as well. llvm-svn: 344281
* Revert "clang-cl: Add /showFilenames option (PR31957)"Sean Fertile2018-10-112-13/+0
| | | | | | | This reverts https://reviews.llvm.org/rL344234 which is causing failures on several bots due to invalid llvm.linker.options. llvm-svn: 344276
* Some improvements to the OpenBSD driver.Brad Smith2018-10-112-34/+38
| | | | | | | | - OpenBSD has switched to compiler_rt / libcxx - Fix sysroot and lib path handling - Some cleaning up llvm-svn: 344257
* clang-cl: Add /showFilenames option (PR31957)Hans Wennborg2018-10-112-0/+13
| | | | | | | | | | | Add a /showFilenames option for users who want clang to echo the currently compiled filename. MSVC does this echoing by default, and it's useful for showing progress in build systems that doesn't otherwise provide any progress report, such as MSBuild. Differential Revision: https://reviews.llvm.org/D52773 llvm-svn: 344234
* Add a flag to remap manglings when reading profile data information.Richard Smith2018-10-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This can be used to preserve profiling information across codebase changes that have widespread impact on mangled names, but across which most profiling data should still be usable. For example, when switching from libstdc++ to libc++, or from the old libstdc++ ABI to the new ABI, or even from a 32-bit to a 64-bit build. The user can provide a remapping file specifying parts of mangled names that should be treated as equivalent (eg, std::__1 should be treated as equivalent to std::__cxx11), and profile data will be treated as applying to a particular function if its name is equivalent to the name of a function in the profile data under the provided equivalences. See the documentation change for a description of how this is configured. Remapping is supported for both sample-based profiling and instruction profiling. We do not support remapping indirect branch target information, but all other profile data should be remapped appropriately. Support is only added for the new pass manager. If someone wants to also add support for this for the old pass manager, doing so should be straightforward. llvm-svn: 344199
* [Hexagon] Use GetLinkerPath instead of hard-coded string.Sid Manning2018-10-102-3/+5
| | | | | | | | | | | Add GetLinkerPath and set the default to "hexagon-link". Use GetLinkerPath instead of the hard-coded string. This change will allow -fuse-ld to function correctly. Differential revision: https://reviews.llvm.org/D53038 llvm-svn: 344147
* Lift VFS from clang to llvm (NFC)Jonas Devlieghere2018-10-1012-26/+31
| | | | | | | | | | | | | | | | | | | This patch moves the virtual file system form clang to llvm so it can be used by more projects. Concretely the patch: - Moves VirtualFileSystem.{h|cpp} from clang/Basic to llvm/Support. - Moves the corresponding unit test from clang to llvm. - Moves the vfs namespace from clang::vfs to llvm::vfs. - Formats the lines affected by this change, mostly this is the result of the added llvm namespace. RFC on the mailing list: http://lists.llvm.org/pipermail/llvm-dev/2018-October/126657.html Differential revision: https://reviews.llvm.org/D52783 llvm-svn: 344140
* [Driver][cc1][cc1as] Call OptTable::PrintHelp with explicit " [options] file..."Fangrui Song2018-10-101-1/+3
| | | | | | | | | | | | | | Summary: This is to accommodate a change in llvm/lib/Option/OptTable.cpp D51009 Reviewers: rupprecht, alexshap, jhenderson Reviewed By: rupprecht Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51109 llvm-svn: 344098
* [AArch64][ARM] Context sensitive meaning of cryptoSjoerd Meijer2018-10-042-0/+101
| | | | | | | | | | | | | | For AArch64, crypto means: - sm4 + sha3 + sha2 + aes for Armv8.4-A and up, and - sha2 + aes for Armv8.3-A and earlier. For AArch32: Crypto means sha2 + aes, because the Armv8.2-A crypto instructions were added to AArch64 only. Differential Revision: https://reviews.llvm.org/D50179 llvm-svn: 343758
* [HIP] Support early finalization of device code for -fno-gpu-rdcYaxun Liu2018-10-026-54/+136
| | | | | | | | | | | | | | | | | | | | | | | | This patch renames -f{no-}cuda-rdc to -f{no-}gpu-rdc and keeps the original options as aliases. When -fgpu-rdc is off, clang will assume the device code in each translation unit does not call external functions except those in the device library, therefore it is possible to compile the device code in each translation unit to self-contained kernels and embed them in the host object, so that the host object behaves like usual host object which can be linked by lld. The benefits of this feature is: 1. allow users to create static libraries which can be linked by host linker; 2. amortized device code linking time. This patch modifies HIP action builder to insert actions for linking device code and generating HIP fatbin, and pass HIP fatbin to host backend action. It extracts code for constructing command for generating HIP fatbin as a function so that it can be reused by early finalization. It also modifies codegen of HIP host constructor functions to embed the device fatbin when it is available. Differential Revision: https://reviews.llvm.org/D52377 llvm-svn: 343611
* [MinGW] Allow using ASanMartin Storsjo2018-10-013-4/+31
| | | | | | | | | | | | | | | | | | Linking to ASan for MinGW is similar to MSVC, but MinGW always links the MSVCRT dynamically, so there is only one of the MSVC cases to consider. When linking to a shared compiler runtime library on MinGW, the suffix of the import library is .dll.a. The existing case of .dll as suffix for windows in general doesn't seem correct (since this is used for linking). As long as callers never actually set the Shared flag, the default static suffix of .lib also worked fine for import libraries as well. Differential Revision: https://reviews.llvm.org/D52538 llvm-svn: 343537
* [DRIVER][OFFLOAD] Do not invoke unbundler on unsupported file types.Alexey Bataev2018-09-281-0/+18
| | | | | | | | | clang-offload-bundler should not be invoked with the unbundling action when the input file type does not match the action type. For example, .so files should be unbundled during linking phase and should be linked only with the host code. llvm-svn: 343335
* NFC: Fix some darwin linker warnings introduced in r338385Erik Pilkington2018-09-274-8/+8
| | | | | | | | | | The darwin linker was complaining about Toolchains/RISCV.cpp and Toolchains/Arch/RISCV.cpp had the same name. Fix is to just rename Toolchains/RISCV.cpp to Toolchains/RISCVToolchain.cpp. Differential revision: https://reviews.llvm.org/D52574 llvm-svn: 343263
* [OpenMP] Improve search for libomptarget-nvptxJonas Hahnfeld2018-09-271-6/+14
| | | | | | | | | | | | | | | When looking for the bclib Clang considered the default library path first while it preferred directories in LIBRARY_PATH when constructing the invocation of nvlink. The latter actually makes more sense because during development it allows using a non-default runtime library. So change the search for the bclib to start looking in directories given by LIBRARY_PATH. Additionally add a new option --libomptarget-nvptx-path= which will be searched first. This will be handy for testing purposes. Differential Revision: https://reviews.llvm.org/D51686 llvm-svn: 343230
* [driver][mips] Adjust target triple accordingly to provided ABI nameSimon Atanasyan2018-09-271-0/+10
| | | | | | | | | | | | | Explicitly selected MIPS ABI using the `-mabi` option implies corresponding target triple. For 'O32' ABI it's a 32-bit target triple like `mips-linux-gnu`. For 'N32' and 'N64' ABIs it's a 64-bit target triple like `mips64-linux-gnu`. This patch adjusts target triple accordingly these rules like we do for pseudo-target flags '-m64', '-m32' etc already. Differential revision: https://reviews.llvm.org/D52290 llvm-svn: 343169
* llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...)Fangrui Song2018-09-262-7/+6
| | | | | | | | | | | | | | Summary: The convenience wrapper in STLExtras is available since rL342102. Reviewers: rsmith, #clang, dblaikie Reviewed By: rsmith, #clang Subscribers: mgrang, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52576 llvm-svn: 343147
* Revert "[DRIVER][OFFLOAD] Do not invoke unbundler on unsupported fileAlexey Bataev2018-09-251-12/+0
| | | | | | | | | types." It reverts commit r342991 + several other commits intended to fix the tests. Still have some failed tests, need to investigate it. llvm-svn: 343002
* [DRIVER][OFFLOAD] Do not invoke unbundler on unsupported file types.Alexey Bataev2018-09-251-0/+12
| | | | | | | | | clang-offload-bundler should not be invoked with the unbundling action when the input file type does not match the action type. For example, .so files should be unbundled during linking phase and should be linked only with the host code. llvm-svn: 342991
* [AArch64] Support adding X[8-15,18] registers as CSRs.Tri Vo2018-09-251-0/+27
| | | | | | | | | | | | | | | | | | Summary: Making X[8-15,18] registers call-saved is used to support CONFIG_ARM64_LSE_ATOMICS in Linux kernel. Signed-off-by: Tri Vo <trong@android.com> Reviewers: srhines, nickdesaulniers, javed.absar Reviewed By: nickdesaulniers Subscribers: kristof.beyls, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D52399 llvm-svn: 342990
* [clang-cl] Provide separate flags for all the /O variantsHans Wennborg2018-09-251-0/+1
| | | | | | | | | | | | | | | This provides better help text in "clang-cl /?". Also it cleans things up a bit: previously "/Od" could be handled either as a separate flag aliased to "-O0", or by the main optimization flag processing in TranslateOptArg. With this patch, all the flags get aliased back to /O so they're handled by TranslateOptArg. Thanks to Nico for the idea! Differential revision: https://reviews.llvm.org/D52266 llvm-svn: 342977
* Driver: render arguments for the embedded bitcode correctlySaleem Abdulrasool2018-09-241-14/+131
| | | | | | | | | | When embedding bitcode, only a subset of the arguments should be recorded into the bitcode compilation commandline. The frontend job is split into two jobs, one which will generate the bitcode. Ensure that the arguments for the compilation to bitcode is properly stripped so that the embedded arguments are the permitted subset. llvm-svn: 342929
* [CUDA] Added basic support for compiling with CUDA-10.0Artem Belevich2018-09-241-1/+6
| | | | llvm-svn: 342924
* [ARM][AArch64] Add feature +fp16fmlSjoerd Meijer2018-09-242-1/+54
| | | | | | | | | | | | | | | | | | | | | Armv8.4-A adds a few FP16 instructions that can optionally be implemented in CPUs of Armv8.2-A and above. This patch adds a feature to clang to permit selection of these instructions. This interacts with the +fp16 option as follows: Prior to Armv8.4-A: *) +fp16fml implies +fp16 *) +nofp16 implies +nofp16fml From Armv8.4-A: *) The above conditions apply, additionally: +fp16 implies +fp16fml Patch by Bernard Ogden. Differential Revision: https://reviews.llvm.org/D50229 llvm-svn: 342862
OpenPOWER on IntegriCloud