summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* [Driver] add initial support for alpine linuxMartell Malone2017-11-192-3/+11
| | | | | | | | | | | | set -pie as default for musl linux targets add detection of alpine linux append appropriate compile flags for alpine Reviewers: rnk Differential Revision: https://reviews.llvm.org/D39588 llvm-svn: 318608
* Switch -mcount and -finstrument-functions to emit EnterExitInstrumenter ↵Hans Wennborg2017-11-141-1/+2
| | | | | | | | | | | | | | | | attributes This updates -mcount to use the new attribute names (LLVM r318195), and switches over -finstrument-functions to also use these attributes rather than inserting instrumentation in the frontend. It also adds a new flag, -finstrument-functions-after-inlining, which makes the cygprofile instrumentation get inserted after inlining rather than before. Differential Revision: https://reviews.llvm.org/D39331 llvm-svn: 318199
* Update a link to the old code.google.com bug trackerHans Wennborg2017-11-131-1/+1
| | | | llvm-svn: 318109
* [clang] Remove redundant return [NFC]Mandeep Singh Grang2017-11-131-2/+0
| | | | | | | | | | | | | | Reviewers: rsmith, sfantao, mcrosier Reviewed By: mcrosier Subscribers: jholewinski, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D39915 llvm-svn: 318074
* Add CLANG_DEFAULT_OBJCOPY to allow Clang to use llvm-objcopy for dwarf fissionJake Ehrlich2017-11-111-1/+2
| | | | | | | | | | | | llvm-objcopy is getting to where it can be used in non-trivial ways (such as for dwarf fission in clang). It now supports dwarf fission but this feature hasn't been thoroughly tested yet. This change allows people to optionally build clang to use llvm-objcopy rather than GNU objcopy. By default GNU objcopy is still used so nothing should change. Differential Revision: https://reviews.llvm.org/D39029 llvm-svn: 317960
* AMDGPU/NFC: Move getAMDGPUTargetFeatures to AMDGPU toolchainKonstantin Zhuravlyov2017-11-103-19/+24
| | | | | | Differential Revision: https://reviews.llvm.org/D39877 llvm-svn: 317909
* Revert "[XRay][darwin] Initial XRay in Darwin Support"Dean Michael Berris2017-11-102-15/+0
| | | | | | This reverts r317875. llvm-svn: 317877
* [XRay][darwin] Initial XRay in Darwin SupportDean Michael Berris2017-11-102-0/+15
| | | | | | | | | | | | | | | | | | | | | | Summary: This change implements the changes required in both clang and compiler-rt to allow building XRay-instrumented binaries in Darwin. For now we limit this to x86_64. We also start building the XRay runtime library in compiler-rt for osx. A caveat to this is that we don't have the tests set up and running yet, which we'll do in a set of follow-on changes. This patch uses the monorepo layout for the coordinated change across multiple projects. Reviewers: kubamracek Subscribers: mgorny, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D39114 llvm-svn: 317875
* [Driver] Make clang/cc conforms to UNIX standardSteven Wu2017-11-101-6/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is basically reverting r261774 with a tweak for clang-cl. UNIX standard states: When c99 encounters a compilation error that causes an object file not to be created, it shall write a diagnostic to standard error and continue to compile other source code operands, but it shall not perform the link phase and it shall return a non-zero exit status The same goes for c89 or cc. And they are all alias or shims pointing to clang on Darwin. The original commit was intended for CUDA so the error message doesn't get emit twice for both host and device. It seems that the clang driver has been changed to model the CUDA dependency differently. Now the driver behaves the same without this commit. rdar://problem/32223263 Reviewers: thakis, dexonsmith, tra Reviewed By: tra Subscribers: jlebar, cfe-commits Differential Revision: https://reviews.llvm.org/D39502 llvm-svn: 317860
* New clang option -fno-plt which avoids the PLT and lazy binding while making ↵Sriraman Tallam2017-11-071-0/+4
| | | | | | | | external calls. Differential Revision: https://reviews.llvm.org/D39079 llvm-svn: 317605
* Vary Windows toolchain selection by -fuse-ldDave Lee2017-11-061-1/+7
| | | | | | | | | | | | | | | | | Summary: This change allows binutils to be used for linking with MSVC. Currently, when using an MSVC target and `-fuse-ld=bfd`, the driver produces an invalid linker invocation. Reviewers: rnk, compnerd Reviewed By: compnerd Subscribers: smeenai, cfe-commits Differential Revision: https://reviews.llvm.org/D39509 llvm-svn: 317511
* [Driver] MinGW: Remove custom linker detectionMartell Malone2017-11-041-10/+2
| | | | | | | | | | | | | | | | | | This is a re-apply of rL313082 which was reverted in rL313088 In rL289668 the ability to specify the default linker at compile time was added but because the MinGW driver used custom detection we could not take advantage of this new CMAKE flag CLANG_DEFAULT_LINKER. rL289668 added no test cases and the mingw driver was either overlooked or purposefully skipped because it has some custom linker tests Removing them here because they are covered by the generic case. Reviewers: rnk Differntial Revision: https://reviews.llvm.org/D37727 llvm-svn: 317397
* [Driver] Add Scudo as a possible -fsanitize= optionKostya Kortchinsky2017-11-033-16/+20
| | | | | | | | | | | | | | | | | | | | | | Summary: This change adds Scudo as a possible Sanitizer option via -fsanitize=. This allows for easier static & shared linking of the Scudo library, it allows us to enforce PIE (otherwise the security of the allocator is moot), and check for incompatible Sanitizers combo. In its current form, Scudo is not compatible with any other Sanitizer, but the plan is to make it work in conjunction with UBsan (-fsanitize=scudo,undefined), which will require additional work outside of the scope of this change. Reviewers: eugenis, kcc, alekseyshl Reviewed By: eugenis, alekseyshl Subscribers: llvm-commits, srhines Differential Revision: https://reviews.llvm.org/D39334 llvm-svn: 317337
* [CUDA] Mark CUDA as a no-errno platform.Justin Lebar2017-11-031-0/+1
| | | | | | | | | | | | | | | | | | | | Summary: CUDA doesn't support errno at all, so this is the right thing -- or at least, in the right direction. But also, this unbreaks the CUDA test-suite math tests [0] after D39481. __cuda_cmath.h forwards nexttoward() to __builtin_nexttoward, which, after that patch, was lowering to a libcall that doesn't exist in NVPTX. [0] http://lab.llvm.org:8011/builders/clang-cuda-build/builds/14999 Reviewers: tra Subscribers: sanjoy, cfe-commits Differential Revision: https://reviews.llvm.org/D39586 llvm-svn: 317297
* Add default calling convention support for regcall.Erich Keane2017-11-021-1/+6
| | | | | | | | | | | Added support for regcall as default calling convention. Also added code to exclude main when applying default calling conventions. Patch-By: eandrews Differential Revision: https://reviews.llvm.org/D39210 llvm-svn: 317268
* [CFI] Add CFI-icall pointer type generalizationVlad Tsyrklevich2017-10-311-0/+10
| | | | | | | | | | | | | | | | | | | | | | | Summary: This change allows generalizing pointers in type signatures used for cfi-icall by enabling the -fsanitize-cfi-icall-generalize-pointers flag. This works by 1) emitting an additional generalized type signature metadata node for functions and 2) llvm.type.test()ing for the generalized type for translation units with the flag specified. This flag is incompatible with -fsanitize-cfi-cross-dso because it would require emitting twice as many type hashes which would increase artifact size. Reviewers: pcc, eugenis Reviewed By: pcc Subscribers: kcc Differential Revision: https://reviews.llvm.org/D39358 llvm-svn: 317044
* Driver: default to `unsigned int` `wchar_t` for ARMSaleem Abdulrasool2017-10-291-1/+6
| | | | | | | | | | AAPCS and AAPCS64 mandate that `wchar_t` with `-fno-short-wchar` is an `unsigned int` rather than a `signed int`. Ensure that the driver does not flip the signedness of `wchar_t` for those targets. Add additional tests to ensure that this does not regress. llvm-svn: 316858
* [WebAssembly] Add crt1.o with calling lldSam Clegg2017-10-272-8/+9
| | | | | | | | | Also, for OS unknown targets like wasm, don't include 'unknown' in the library path. This is a fix for rL316719. Differential Revision: https://reviews.llvm.org/D39354 llvm-svn: 316777
* [WebAssembly] Include libclang_rt.builtins in the standard waySam Clegg2017-10-273-11/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D39218 llvm-svn: 316719
* Use -fuse-init-array if no gcc installation is found.Nico Weber2017-10-261-1/+2
| | | | | | | | | | | | | | | | clang currently uses .init_array instead of .ctors on Linux if it detects gcc 4.7+. Make it so that it also uses .init_array if no gcc installation is found at all – if there's no old gcc, there's nothing we need to be compatible with. icecc for example runs clang in a very small chroot, so before this change clang would use .ctors if run under icecc. And lld currently silently mislinks inputs with .ctors sections, so before this clang + icecc + lld would produce broken binaries. (But this seems like a good change independent of that lld bug.) https://reviews.llvm.org/D39317 llvm-svn: 316713
* [LSan] Enable -fsanitize=leak for PPC64 Linux.Alex Shlyapnikov2017-10-261-1/+1
| | | | | | | | | | | | Summary: . Reviewers: eugenis Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39312 llvm-svn: 316636
* [CUDA] Print an error if you try to compile with < sm_30 on CUDA 9.Justin Lebar2017-10-252-8/+10
| | | | | | | | | | | | | | Summary: CUDA 9's minimum sm is sm_30. Ideally we should also make sm_30 the default when compiling with CUDA 9, but that seems harder than it should be. Subscribers: sanjoy Differential Revision: https://reviews.llvm.org/D39109 llvm-svn: 316611
* Enable -pie and --enable-new-dtags by default on Android.Evgeniy Stepanov2017-10-253-6/+18
| | | | | | | | | | | | | | | Summary: Also enable -no-pie on Gnu toolchain (previously available on Darwin only). Non-PIE executables won't even start on recent Android, and DT_RPATH is ignored by the loader. Reviewers: srhines, danalbert Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D38430 llvm-svn: 316606
* Add support of the next Debian (Debian buster - version 10)Sylvestre Ledru2017-10-251-0/+2
| | | | llvm-svn: 316579
* Add support of the next Ubuntu (Ubuntu 18.04 - Bionic Beaver)Sylvestre Ledru2017-10-251-0/+1
| | | | llvm-svn: 316577
* [AArch64] Fix PR34625 -mtune without -mcpu should not set -target-cpuPeter Smith2017-10-241-6/+10
| | | | | | | | | | | | | | | | | | | | When -mtune is used on AArch64 the -target-cpu is passed the value of the cpu given to -mtune. As well as setting micro-architectural features of the -mtune cpu, this will also add the architectural features such as support for instructions. This can result in the backend using instructions that are supported in the -mtune cpu but not supported in the target architecture. For example use of the v8.1-a LSE extensions with -march=v8. This change removes the setting of -target-cpu for -mtune, the -mcpu must be used to set -target-cpu. This has the effect of removing all non-hard coded benefits of mtune but it does produce correct output when -mtune cpu with a later architecture than v8 is used. Fixes PR34625 Differential Revision: https://reviews.llvm.org/D39179 llvm-svn: 316424
* [Driver] Use ld.lld directly for Fuchsia rather than passing flavorPetr Hosek2017-10-232-5/+3
| | | | | | | | | | | Passing a flavor to LLD requires command line argument, but if these are being passed through a response file, this will fail because LLD needs to know which driver to use before processing the response file. Use ld.lld directly instead to avoid this issue. Differential Revision: https://reviews.llvm.org/D39176 llvm-svn: 316379
* Fix a typo with -fno-double-square-bracket-attributes and add a test to ↵Aaron Ballman2017-10-211-0/+3
| | | | | | demonstrate that it works as expected in C++11 mode. Additionally corrected the handling of -fdouble-square-bracket-attributes to be properly passed down to the cc1 option. llvm-svn: 316275
* Allow /showIncludes with /PErich Keane2017-10-201-1/+3
| | | | | | | | | | | | | | | | | r213589 was checked in as a solution to https://bugs.llvm.org/show_bug.cgi?id=20336. However, it is possible to use /EP with /P to suppress #line directives AND output to a file. There is no reason in that case to suppress /showIncludes. This was reported here: https://bugs.llvm.org/show_bug.cgi?id=34997 Differential Revision: https://reviews.llvm.org/D39104 llvm-svn: 316225
* Revert r316193.Richard Smith2017-10-202-9/+2
| | | | | | | This patch breaks users using -fno-canonical-prefixes, for whom resolving symlinks is not acceptable. llvm-svn: 316195
* Try to shorten system header paths when using -MD depfilesPeter Wu2017-10-192-2/+9
| | | | | | | | | | | | | | | | | | | | | GCC tries to shorten system headers in depfiles using its real path (resolving components like ".." and following symlinks). Mimic this feature to ensure that the Ninja build tool detects the correct dependencies when a symlink changes directory levels, see https://github.com/ninja-build/ninja/issues/1330 An option to disable this feature is added in case "these changed header paths may conflict with some compilation environments", see https://gcc.gnu.org/ml/gcc-patches/2012-09/msg00287.html Note that the original feature request for GCC (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52974) also included paths preprocessed output (-E) and diagnostics. That is not implemented now since I am not sure if it breaks something else. Differential Revision: https://reviews.llvm.org/D37954 llvm-svn: 316193
* [Driver] Fix use after free in Hexagon toolchain code.Benjamin Kramer2017-10-181-3/+3
| | | | | | No functionality change intended. llvm-svn: 316127
* [Hexagon] Handling of new HVX flags and target-featuresSumanth Gundapaneni2017-10-183-3/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has the following changes A new flag "-mhvx-length={64B|128B}" is introduced to specify the length of the vector. Previously we have used "-mhvx-double" for 128 Bytes. This adds the target-feature "+hvx-length{64|128}b" The "-mhvx" flag must be provided on command line to enable HVX for Hexagon. If no -mhvx-length flag is specified, a default length is picked from the arch mentioned in this priority order from either -mhvx=vxx or -mcpu. For v60 and v62 the default length is 64 Byte. For unknown versions, the length is 128 Byte. The -mhvx flag adds the target-feature "+hvxv{hvx_version}" The 64 Byte mode is soon going to be deprecated. A warning is emitted if 64 Byte is enabled. A warning is still emitted for the default 64 Byte as well. This warning can be suppressed with a -Wno flag. The "-mhvx-double" and "-mno-hvx-double" flags are deprecated. A warning is emitted if the driver sees them on commandline. "-mhvx-double" is an alias to "-mhvx-length=128B" The compilation will error out if -mhvx-length is specified with out an -mhvx/-mhvx= flag The macro HVX_LENGTH is defined and is set to the length of the vector. Eg: #define HVX_LENGTH 64 The macro HVX_ARCH is defined and is set to the version of the HVX. Eg: #define HVX_ARCH 62 Differential Revision: https://reviews.llvm.org/D38852 llvm-svn: 316102
* [CMake][OpenMP] Customize default offloading archJonas Hahnfeld2017-10-172-21/+5
| | | | | | | | | For the shuffle instructions in reductions we need at least sm_30 but the user may want to customize the default architecture. Differential Revision: https://reviews.llvm.org/D38883 llvm-svn: 315996
* Do not link clang_rt.cfi on Android.Evgeniy Stepanov2017-10-161-7/+13
| | | | | | | | | | | | | | | Summary: The OS provides cross-dso CFI support starting with Android O. Trapping mode does not require any runtime at all, and diagnostic mode requires just ubsan-standalone. Reviewers: pcc Subscribers: srhines, cfe-commits Differential Revision: https://reviews.llvm.org/D38908 llvm-svn: 315921
* [Bitfield] Add an option to access bitfield in a fine-grained manner.Wei Mi2017-10-161-0/+3
| | | | | | | | Currently all the consecutive bitfields are wrapped as a large integer unless there is unamed zero sized bitfield in between. The patch provides an alternative manner which makes the bitfield to be accessed as separate memory location if it has legal integer width and is naturally aligned. Such separate bitfield may split the original consecutive bitfields into subgroups of consecutive bitfields, and each subgroup will be wrapped as an integer. Now This is all controlled by an option -ffine-grained-bitfield-accesses. The alternative of bitfield access manner can improve the access efficiency of those bitfields with legal width and being aligned, but may reduce the chance of load/store combining of other bitfields, so it depends on how the bitfields are defined and actually accessed to choose when to use the option. For now the option is off by default. Differential revision: https://reviews.llvm.org/D36562 llvm-svn: 315915
* [CUDA] Require libdevice only if neededJonas Hahnfeld2017-10-161-13/+4
| | | | | | | | | If the user passes -nocudalib, we can live without it being present. Simplify the code by just checking whether LibDeviceMap is empty. Differential Revision: https://reviews.llvm.org/D38901 llvm-svn: 315902
* Driver: use ld64.lld when -fuse-ld=lld for darwinMartell Malone2017-10-151-1/+5
| | | | | | | | | | | | | | | | | | | When using lld on macOS the current level of detection between ld and ld64 forces us to rename lld to ld. For ELF targets we have the ld.lld alias so for MACHO we should have ld64.lld so we can use lld without replacing the system compiler. This also solves the additional issue of cross compiling for MACHO where renaming lld to ld with only target ELF. This is the clang driver component change to use this new alias. Reviewers: ruiu, rnk Differential Revision: https://reviews.llvm.org/D38290 llvm-svn: 315867
* [driver] [cl] Add/fix c++17/c++latestMartell Malone2017-10-151-1/+2
| | | | | | | | Patch by: daxpedda Differential Revision: https://reviews.llvm.org/D38123 llvm-svn: 315864
* Revert "[ADT] Make Twine's copy constructor private."Zachary Turner2017-10-112-2/+2
| | | | | | | | | | This reverts commit 4e4ee1c507e2707bb3c208e1e1b6551c3015cbf5. This is failing due to some code that isn't built on MSVC so I didn't catch. Not immediately obvious how to fix this at first glance, so I'm reverting for now. llvm-svn: 315536
* [ADT] Make Twine's copy constructor private.Zachary Turner2017-10-112-2/+2
| | | | | | | | | | | | | | | | | There's a lot of misuse of Twine scattered around LLVM. This ranges in severity from benign (returning a Twine from a function by value that is just a string literal) to pretty sketchy (storing a Twine by value in a class). While there are some uses for copying Twines, most of the very compelling ones are confined to the Twine class implementation itself, and other uses are either dubious or easily worked around. This patch makes Twine's copy constructor private, and fixes up all callsites. Differential Revision: https://reviews.llvm.org/D38767 llvm-svn: 315530
* [Driver] Export symbols needed to use profile runtimeVedant Kumar2017-10-111-0/+29
| | | | | | | | | | | | | | | Apple's API verification tool (tapi) checks that the symbols exported from a program match a whitelist. When the program uses the profile runtime, some additional symbols which are typically not part of the regular whitelist must be exported. If we're using symbol export directives along with the profile runtime on Darwin, the driver needs to export the additional symbols to avoid verification failures. rdar://problem/30067753 llvm-svn: 315518
* Testing commit access.Hamza Sood2017-10-091-1/+1
| | | | llvm-svn: 315231
* [Driver] Fix -static-libsan / -shared-libsan on DarwinVedant Kumar2017-10-072-2/+4
| | | | | | | Don't ignore these flags on Darwin. The old behavior of using the dynamic runtime when neither flag is passed is preserved. llvm-svn: 315142
* Driver: hoist the `wchar_t` handling to the driverSaleem Abdulrasool2017-10-061-18/+31
| | | | | | | | | | | | | | | | Move the logic for determining the `wchar_t` type information into the driver. Rather than passing the single bit of information of `-fshort-wchar` indicate to the frontend the desired type of `wchar_t` through a new `-cc1` option of `-fwchar-type` and indicate the signedness through `-f{,no-}signed-wchar`. This replicates the current logic which was spread throughout Basic into the `RenderCharacterOptions`. Most of the changes to the tests are to ensure that the frontend uses the correct type. Add a new test set under `test/Driver/wchar_t.c` to ensure that we calculate the proper types for the various cases. llvm-svn: 315126
* [MS] Raise the default value of _MSC_VER to 1911, which is VS 2017Reid Kleckner2017-10-061-3/+2
| | | | | | | | | | | | | | | | Summary: This raises our default past 1900, which controls whether char16_t is a builtin type or not. Implements PR34243 Reviewers: hans Subscribers: STL_MSFT, rsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D38646 llvm-svn: 315107
* Cleanup and generalize -shared-libasan.Evgeniy Stepanov2017-10-054-16/+25
| | | | | | | | | | | | | | | | | | | | Summary: * Rename -shared-libasan to -shared-libsan, keeping the old name as alias. * Add -static-libsan for targets that default to shared. * Remove an Android special case. It is now possible (but untested) to use static compiler-rt libraries there. * Support libclang_rt.ubsan_standalone as a shared library. Unlike GCC, this change applies -shared-libsan / -static-libsan to all sanitizers. I don't see a point in multiple flags like -shared-libubsan, considering that most sanitizers are not compatible with each other, and each link has basically a single shared/static choice. Reviewers: vitalybuka, kcc, rsmith Subscribers: srhines, cfe-commits Differential Revision: https://reviews.llvm.org/D38525 llvm-svn: 315015
* Enabling new pass manager in LTO (and thinLTO) link step.Sean Fertile2017-10-051-0/+8
| | | | | | | | | | | Passes 'new-pass-manager' option to the linker plugin when the new pass manager is enabled. Patch by Graham Yiu. Differential Revision: https://reviews.llvm.org/D38517 llvm-svn: 314964
* [Hexagon] Move getHexagonTargetFeatures to Hexagon.cpp (NFC)Sumanth Gundapaneni2017-10-043-16/+21
| | | | | | Differential Revision: https://reviews.llvm.org/D38548 llvm-svn: 314926
* [OpenMP] Fix passing of -m arguments correctlyJonas Hahnfeld2017-10-042-63/+63
| | | | | | | | | | The recent fix in D38258 was wrong: getAuxTriple() only returns non-null values for the CUDA toolchain. That is why the now added test for PPC and X86 failed. Differential Revision: https://reviews.llvm.org/D38372 llvm-svn: 314902
OpenPOWER on IntegriCloud