summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "Add an -fno-temp-file flag for compilation"Mitch Phillips2019-12-181-3/+0
| | | | | | | This reverts commit d129aa1d5369781deff6c6b854cb612e160d3fb2. This broke the MSan buildbots. More information available in the original PR: https://reviews.llvm.org/D70615
* Add an -fno-temp-file flag for compilationHans Wennborg2019-12-181-0/+3
| | | | | | | | | | | | Our build system does not handle randomly named files created during the build well. We'd prefer to write compilation output directly without creating a temporary file. Function parameters already existed to control this behavior but were not exposed all the way out to the command line. Patch by Zachary Henkel! Differential revision: https://reviews.llvm.org/D70615
* [driver][darwin] Use explicit -mlinker-version in the -platform_version testsAlex Lorenz2019-12-174-8/+8
| | | | | | The driver actually adds a default -mlinker-version, based on HOST_LINK_VERSION cmake variable. The tests should be explicit about which version they're using to trigger the right behavior.
* [driver][darwin] Pass -platform_version flag to the linker instead of the ↵Alex Lorenz2019-12-1710-43/+84
| | | | | | | | | | | -<platform>_version_min flag In Xcode 11, ld added a new flag called -platform_version that can be used instead of the old -<platform>_version_min flags. The new flag allows Clang to pass the SDK version from the driver to the linker. This patch adopts the new -platform_version flag in Clang, and starts using it by default, unless a linker version < 520 is passed to the driver. Differential Revision: https://reviews.llvm.org/D71579
* [lit] Remove lit's REQUIRES-ANY directiveThomas Preud'homme2019-12-175-8/+8
| | | | | | | | | | | | | | | | | Summary: Remove REQUIRES-ANY alias lit directive since it is hardly used and can be easily implemented using an OR expression using REQUIRES. Fixup remaining testcases still using REQUIRES-ANY. Reviewers: probinson, jdenny, gparker42 Reviewed By: gparker42 Subscribers: eugenis, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, delcypher, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits, #sanitizers, llvm-commits Tags: #llvm, #clang, #sanitizers Differential Revision: https://reviews.llvm.org/D71408
* [MinGW] Implicitly add .exe suffix if not providedMartin Storsjö2019-12-172-0/+23
| | | | | | | | | | | | | | | | | GCC implicitly adds an .exe suffix if it is given an output file name, but the file name doesn't contain a suffix, and there are certain users of GCC that rely on this behaviour (and run into issues when trying to use Clang instead of GCC). And MSVC's cl.exe also does the same (but not link.exe). However, GCC only does this when actually running on windows, not when operating as a cross compiler. As GCC doesn't have this behaviour when cross compiling, we definitely shouldn't introduce the behaviour in such cases (as it would break at least as many cases as this fixes). Differential Revision: https://reviews.llvm.org/D71400
* [Driver] Default to -momit-leaf-frame-pointer for AArch64Fangrui Song2019-12-132-2/+4
| | | | | | | | | | | | | | | | | This matches https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html > -momit-leaf-frame-pointer > -mno-omit-leaf-frame-pointer > > Omit or keep the frame pointer in leaf functions. The former behavior is the default. -mno-omit-leaf-frame-pointer is currently a no-op because TargetOptions::DisableFramePointerElim is only considered for non-leaf functions. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D71167
* [Driver] Use .init_array for all gcc installations and simplify Generic_ELF ↵Fangrui Song2019-12-131-1/+1
| | | | | | | | | | | | | | | | | -fno-use-init-array rules D39317 made clang use .init_array when no gcc installations is found. This change changes all gcc installations to use .init_array . GCC 4.7 by default stopped providing .ctors/.dtors compatible crt files, and stopped emitting .ctors for __attribute__((constructor)). .init_array should always work. FreeBSD rules are moved to FreeBSD.cpp to make Generic_ELF rules clean. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D71434
* Default to -fuse-init-arrayFangrui Song2019-12-1212-50/+29
| | | | | | | | | | | | | | | | | | | Very few ELF platforms still use .ctors/.dtors now. Linux (glibc: 1999-07), DragonFlyBSD, FreeBSD (2012-03) and Solaris have supported .init_array for many years. Some architectures like AArch64/RISC-V default to .init_array . GNU ld and gold can even convert .ctors to .init_array . It makes more sense to flip the CC1 default, and only uses -fno-use-init-array on platforms that don't support .init_array . For example, OpenBSD did not support DT_INIT_ARRAY before Aug 2016 (https://github.com/openbsd/src/commit/86fa57a2792c6374b0849dd7b818a11e676e60ba) I may miss some ELF platforms that still use .ctors, but their maintainers can easily diagnose such problems. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D71393
* [Remarks][Driver] Ask for line tables when remarks are enabledFrancis Visoiu Mistrih2019-12-111-0/+6
| | | | | | | | | | | | | | | | Serialized remarks contain debug locations for each remark, by storing a file path, a line, and a column. Also, remarks support being embedded in a .dSYM bundle using a separate section in object files, that is found by `dsymutil` through the debug map. In order for tools to map addresses to source and display remarks in the source, we need line tables, and in order for `dsymutil` to find the object files containing the remark section, we need to keep the debug map around. Differential Revision: https://reviews.llvm.org/D71325
* [OpenMP] Use the OpenMP-IR-BuilderJohannes Doerfert2019-12-111-0/+6
| | | | | | | | | | | | | | | This is a follow up patch to use the OpenMP-IR-Builder, as discussed on the mailing list ([1] and later) and at the US Dev Meeting'19. [1] http://lists.flang-compiler.org/pipermail/flang-dev_lists.flang-compiler.org/2019-May/000197.html Reviewers: kiranchandramohan, ABataev, RaviNarayanaswamy, gtbercea, grokos, sdmitriev, JonChesterfield, hfinkel, fghanim Subscribers: ppenzin, penzn, llvm-commits, cfe-commits, jfb, guansong, bollu, hiraditya, mgorny Tags: #clang Differential Revision: https://reviews.llvm.org/D69922
* [DWARF5][SplitDwarf] Set default state for -fsplit-dwarf-inlining to be false.Alexey Lapshin2019-12-111-1/+4
| | | | | | | | | The -fsplit-dwarf-inlining option does not conform to DWARF5 standard. It creates children for Skeleton compilation unit. We need default behavior to be DWARF5 compatible. Thus set default state for -fsplit-dwarf-inlining into "false". Differential Revision: https://reviews.llvm.org/D71304
* [Remarks][Driver] Error on -foptimization-record-file with multiple -arch ↵Francis Visoiu Mistrih2019-12-091-0/+3
| | | | | | | | | options This adds a check for the usage of -foptimization-record-file with multiple -arch options. This is not permitted since it would require us to rename the file requested by the user to avoid overwriting it for the second cc1 invocation.
* Reland 198fbcb8, "Driver: Don't look for libc++ headers in the install ↵Peter Collingbourne2019-12-092-5/+15
| | | | | | | | | | | | | | | | | | | | | | directory on Android.", which was reverted in b3249027. Fixed the test case to set --sysroot, which lets it succeed in the case where a directory named "/usr/include/c++/v1" or "/usr/local/include/c++/v1" exists. Original commit message: > The NDK uses a separate set of libc++ headers in the sysroot. Any headers > in the installation directory are not going to work on Android, not least > because they use a different name for the inline namespace (std::__1 instead > of std::__ndk1). > > This effectively makes it impossible to produce a single toolchain that is > capable of targeting both Android and another platform that expects libc++ > headers to be installed in the installation directory, such as Mac. > > In order to allow this scenario to work, stop looking for headers in the > install directory on Android. Differential Revision: https://reviews.llvm.org/D71154
* Revert "Driver: Don't look for libc++ headers in the install directory on ↵David Zarzycki2019-12-082-13/+5
| | | | | | | | Android." This reverts commit 198fbcb817492ff45946e3f7517de15e8cdf0607. This breaks Fedora 31.
* Driver: Don't look for libc++ headers in the install directory on Android.Peter Collingbourne2019-12-062-5/+13
| | | | | | | | | | | | | | | | The NDK uses a separate set of libc++ headers in the sysroot. Any headers in the installation directory are not going to work on Android, not least because they use a different name for the inline namespace (std::__1 instead of std::__ndk1). This effectively makes it impossible to produce a single toolchain that is capable of targeting both Android and another platform that expects libc++ headers to be installed in the installation directory, such as Mac. In order to allow this scenario to work, stop looking for headers in the install directory on Android. Differential Revision: https://reviews.llvm.org/D71154
* clang/AMDGPU: Fix default for frame-pointer attributeMatt Arsenault2019-12-071-0/+8
| | | | Enabling optimization should allow frame pointer elimination.
* [AMDGPU][HIP] Improve opt-level handlingScott Linder2019-12-054-9/+118
| | | | | | | | | | | | | | | | | Summary: The HIP toolchain invokes `llc` without an explicit opt-level, meaning it always uses the default (-O2). This makes it impossible to use -O1, for example. The HIP toolchain also coerces -Os/-Oz to -O2 even when invoking opt, and it coerces -Og to -O2 rather than -O1. Forward the opt-level to `llc` as well as `opt`, and only coerce levels where it is required. Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70987
* Also check /Fo when deciding on the .gcna / .gcda filename (PR44208)Hans Wennborg2019-12-051-0/+3
| | | | Differential revision: https://reviews.llvm.org/D71012
* Reapply af57dbf12e54 "Add support for options -frounding-math, ↵Melanie Blower2019-12-053-4/+155
| | | | | | | | | | | | ftrapping-math, -ffp-model=, and -ffp-exception-behavior=" Patch was reverted because https://bugs.llvm.org/show_bug.cgi?id=44048 The original patch is modified to set the strictfp IR attribute explicitly in CodeGen instead of as a side effect of IRBuilder. In the 2nd attempt to reapply there was a windows lit test fail, the tests were fixed to use wildcard matching. Differential Revision: https://reviews.llvm.org/D62731
* Revert " Reapply af57dbf12e54 "Add support for options ↵Melanie Blower2019-12-043-155/+4
| | | | | | | -frounding-math, ftrapping-math, -ffp-model=, and -ffp-exception-behavior="" This reverts commit cdbed2dd856c14687efd741c2d8321686102acb8. Build break on Windows (lit fail)
* Reapply af57dbf12e54 "Add support for options -frounding-math, ↵Melanie Blower2019-12-043-4/+155
| | | | | | | | | | ftrapping-math, -ffp-model=, and -ffp-exception-behavior=" Patch was reverted because https://bugs.llvm.org/show_bug.cgi?id=44048 The original patch is modified to set the strictfp IR attribute explicitly in CodeGen instead of as a side effect of IRBuilder Differential Revision: https://reviews.llvm.org/D62731
* [HIP] Remove opencl.amdgcn.libYaxun (Sam) Liu2019-12-041-1/+0
| | | | Differential Revision: https://reviews.llvm.org/D70980
* [Support] Add ProcName to TimeTraceProfilerRussell Gallop2019-12-031-1/+1
| | | | | | | | | | This was hard-coded to "clang". This change allows it to to be used on processes other than clang (such as lld). This gets reported as clang-10 on Linux and clang.exe on Windows so adapted test to accommodate this. Differential Revision: https://reviews.llvm.org/D70950
* [clang test] Do not assume default targetThomas Preud'homme2019-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: clang test Driver/darwin-opt-record.c assumes the default target is x86_64 by its uses of the -arch x86_64 and -arch x86_64h and thus fail on systems where it is not the case. Adding a target x86_64-apple-darwin10 reveals another problem: the driver refuses 2 -arch for an assembly output so this commit also changes the output to be an object file. Reviewers: thegameg Reviewed By: thegameg Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70748
* Add AIX assembler supportstevewan2019-12-024-0/+73
| | | | | | | | | | | | | | | | Summary: A skeleton of AIX toolchain and system linker support has been introduced in D68340, and this is a follow on patch to it. This patch adds support to system assembler invocation to the AIX toolchain. Reviewers: daltenty, hubert.reinterpretcast, jasonliu, Xiangling_L, dlj Reviewed By: daltenty, hubert.reinterpretcast Subscribers: wuzish, nemanjai, kbarton, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69620
* Revert "[ARM] Allocatable Global Register Variables for ARM"Carey Williams2019-11-291-35/+0
| | | | This reverts commit 2d739f98d8a53e38bf9faa88cdb6b0c2a363fb77.
* On Windows, fix fuse-ld.c test when lld is provided explictly in -DCMAKE_LINKERAlexandre Ganea2019-11-291-2/+2
|
* Initial implementation of -fmacro-prefix-map and -ffile-prefix-mapDan McGregor2019-11-262-9/+29
| | | | | | | | | GCC 8 implements -fmacro-prefix-map. Like -fdebug-prefix-map, it replaces a string prefix for the __FILE__ macro. -ffile-prefix-map is the union of -fdebug-prefix-map and -fmacro-prefix-map Reviewed By: rnk, Lekensteyn, maskray Differential Revision: https://reviews.llvm.org/D49466
* [Driver] Fix incorrect GNU triplet for PowerPC on SUSE LinuxAaron Puchert2019-11-236-0/+15
| | | | | | | | | | | | | | | Summary: On SUSE distributions for 32-bit PowerPC, gcc is configured as a 64-bit compiler using the GNU triplet "powerpc64-suse-linux", but invoked with "-m32" by default. Thus, the correct GNU triplet for 32-bit PowerPC SUSE distributions is "powerpc64-suse-linux" and not "powerpc-suse-linux". Reviewers: jrtc27, nemanjai, glaubitz Reviewed By: nemanjai Differential Revision: https://reviews.llvm.org/D55326
* [RISCV] Add missing REQUIRES to clang testsDavid Zarzycki2019-11-232-2/+2
| | | | Fixes: e0f22fe04a5c9eb244ff0533549743b7deb03b99
* [WebAssembly] Use wasm-opt and LTO libraries when available.Dan Gohman2019-11-221-0/+6
| | | | | | | | | | When there's a wasm-opt in the PATH, run the it to optimize LLVM's output. This fixes PR43796. And, add an "llvm-lto" directory to the sysroot library search paths, so that sysroots can provide LTO-enabled system libraries. Differential Revision: https://reviews.llvm.org/D70500
* [Driver] Make -static-libgcc imply static libunwindJosh Kunz2019-11-221-1/+9
| | | | | | | | | | | | | | | | | | In the GNU toolchain, `-static-libgcc` implies that the unwindlib will be linked statically. However, when `--unwindlib=libunwind`, this flag is ignored, and a bare `-lunwind` is added to the linker args. Unfortunately, this means that if both `libunwind.so`, and `libunwind.a` are present in the library path, `libunwind.so` will be chosen in all cases where `-static` is not set. This change makes `-static-libgcc` affect the `-l` flag produced by `--unwindlib=libunwind`. After this patch, providing `-static-libgcc --unwindlib=libunwind` will cause the driver to explicitly emit `-l:libunwind.a` to statically link libunwind. For all other cases it will emit `-l:libunwind.so` matching current behavior with a more explicit link line. https://reviews.llvm.org/D70416
* [RISCV] Use compiler-rt if no GCC installation detectedEdward Jones2019-11-224-37/+83
| | | | | | | | If a GCC installation is not detected, then this attempts to use compiler-rt and the compiler-rt crtbegin/crtend implementations as a fallback. Differential Revision: https://reviews.llvm.org/D68407
* [RISCV] Support mutilib in baremetal environmentZakk Chen2019-11-2127-8/+114
| | | | | | | | | | | | 1. Currently only support the set of multilibs same to riscv-gnu-toolchain. 2. Fix testcase typo causes fail on Windows. 3. Fix testcases to set empty sysroot. Reviewers: espindola, asb, kito-cheng, lenary Reviewed By: lenary Differential Revision: https://reviews.llvm.org/D67508
* [Clang] Enable RISC-V support for FuchsiaPetr Hosek2019-11-213-3/+26
| | | | | | | | We don't have a full sysroot yet, so for now we only include compiler support and compiler-rt builtins, the rest of the runtimes will get enabled later. Differential Revision: https://reviews.llvm.org/D70477
* Revert "[RISCV] Support mutilib in baremetal environment"Zakk Chen2019-11-2127-114/+8
| | | | | This reverts commit df876a026981b7a125b31bbb85ba4b1144edb0f9. Clang::riscv32-toolchain.c Clang::riscv64-toolchain.c fails on Windows.
* [RISCV] Support mutilib in baremetal environmentZakk Chen2019-11-2127-8/+114
| | | | | | | | | | | 1. Currently only support the set of multilibs same to riscv-gnu-toolchain. 2. Fix testcase typo causes fail on Windows Reviewers: espindola, asb, kito-cheng, lenary Reviewed By: lenary Differential Revision: https://reviews.llvm.org/D67508
* Revert "[RISCV] Support mutilib in baremetal environment"Nico Weber2019-11-1927-114/+8
| | | | | This reverts commit b6d7bbfa004310777cd41448ffc377aea082fc8c. Driver/riscv64-toolchain.c fails on Windows.
* [RISCV] Support mutilib in baremetal environmentZakk Chen2019-11-1927-8/+114
| | | | | | | | | | Currently only support the set of multilibs same to riscv-gnu-toolchain. Reviewers: espindola, asb, kito-cheng, lenary Reviewed By: lenary Differential Revision: https://reviews.llvm.org/D67508
* Populate CUDA flags on FreeBSD too, as many other toolchains do.Dimitry Andric2019-11-181-0/+289
| | | | | | | | | | | | | | | | Summary: This allows `clang` to be used to compile CUDA programs. Compiled simple helloworld.cu with this. Reviewers: dim, emaste, tra, yaxunl, ABataev Reviewed By: tra Subscribers: dim, emaste, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69990
* Reland: [Remarks][Driver] Use different remark files when targeting multiple ↵Francis Visoiu Mistrih2019-11-181-0/+8
| | | | | | | | | | | | | | | | | | architectures When the driver is targeting multiple architectures at once, for things like Universal Mach-Os, we need to emit different remark files for each cc1 invocation to avoid overwriting the files from a different invocation. For example: $ clang -c -o foo.o -fsave-optimization-record -arch x86_64 -arch x86_64h will create two remark files: * foo-x86_64.opt.yaml * foo-x86_64h.opt.yaml
* Revert "[Remarks][Driver] Use different remark files when targeting multiple ↵Reid Kleckner2019-11-181-6/+0
| | | | | | | | architectures" This reverts commit b4e2b112b58154a89171df39dae80044865ff4ff. Test doesn't appear to pass on Windows, maybe all non-Mac.
* Temporarily Revert "Add support for options -frounding-math, ftrapping-math, ↵Eric Christopher2019-11-183-148/+4
| | | | | | | | -ffp-model=, and -ffp-exception-behavior=" and a follow-up NFC rearrangement as it's causing a crash on valid. Testcase is on the original review thread. This reverts commits af57dbf12e54f3a8ff48534bf1078f4de104c1cd and e6584b2b7b2de06f1e59aac41971760cac1e1b79
* [Remarks][Driver] Use different remark files when targeting multiple ↵Francis Visoiu Mistrih2019-11-181-0/+6
| | | | | | | | | | | | | | | | | | architectures When the driver is targeting multiple architectures at once, for things like Universal Mach-Os, we need to emit different remark files for each cc1 invocation to avoid overwriting the files from a different invocation. For example: $ clang -c -o foo.o -fsave-optimization-record -arch x86_64 -arch x86_64h will create two remark files: * foo-x86_64.opt.yaml * foo-x86_64h.opt.yaml
* [RISCV] Set triple based on -march flagSimon Cook2019-11-181-0/+12
| | | | | | | | | For RISC-V the value provided to -march should determine whether to compile for 32- or 64-bit RISC-V irrespective of the target provided to the Clang driver. This adds a test for this flag for RISC-V and sets the Target architecture correctly in these cases. Differential Revision: https://reviews.llvm.org/D54214
* [ARM] Allocatable Global Register Variables for ARMAnna Welker2019-11-181-0/+35
| | | | | | | | | | | | Provides support for using r6-r11 as globally scoped register variables. This requires a -ffixed-rN flag in order to reserve rN against general allocation. If for a given GRV declaration the corresponding flag is not found, or the the register in question is the target's FP, we fail with a diagnostic. Differential Revision: https://reviews.llvm.org/D68862
* clang: enable unwind tables on FreeBSD !amd64Ed Maste2019-11-151-0/+4
| | | | | | | | | | | | | | | | | | | There doesn't seem to be much sense in defaulting "on" unwind tables on amd64 and not on other arches. It causes surprising differences between platforms, such as the PR below[1]. Prior to this change, FreeBSD inherited the default implementation of the method from the Gnu.h Generic_Elf => Generic_GCC parent class, which returned true only for amd64 targets. Override that and opt on always, similar to, e.g., NetBSD's driver. [1] https://bugs.freebsd.org/241562 Patch by cem (Conrad Meyer). Reviewed By: dim Differential Revision: https://reviews.llvm.org/D70110
* [RISCV] Match GCC `-march`/`-mabi` driver defaultsSam Elliott2019-11-152-12/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Clang/LLVM is a cross-compiler, and so we don't have to make a choice about `-march`/`-mabi` at build-time, but we may have to compute a default `-march`/`-mabi` when compiling a program. Until now, each place that has needed a default `-march` has calculated one itself. This patch adds a single place where a default `-march` is calculated, in order to avoid calculating different defaults in different places. This patch adds a new function `riscv::getRISCVArch` which encapsulates this logic based on GCC's for computing a default `-march` value when none is provided. This patch also updates the logic in `riscv::getRISCVABI` to match the logic in GCC's build system for computing a default `-mabi`. This patch also updates anywhere that `-march` is used to now use the new function which can compute a default. In particular, we now explicitly pass a `-march` value down to the gnu assembler. GCC has convoluted logic in its build system to choose a default `-march`/`-mabi` based on build options, which would be good to match. This patch is based on the logic in GCC 9.2.0. This commit's logic is different to GCC's only for baremetal targets, where we default to rv32imac/ilp32 or rv64imac/lp64 depending on the target triple. Tests have been updated to match the new logic. Reviewers: asb, luismarques, rogfer01, kito-cheng, khchen Reviewed By: asb, luismarques Subscribers: sameer.abuasal, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, pzheng, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69383
* Unbreak the clang test suite when hexagon-link is not availableDavid Zarzycki2019-11-151-1/+1
| | | | | All of the other tests are of the form {{hexagon-link|ld}} so this probably should be too.
OpenPOWER on IntegriCloud