aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/Driver.cpp
AgeCommit message (Collapse)AuthorFilesLines
2025-04-21Enable `-m32`, `-maix32` and `-maix64` for Flang on AIX. (#136202)Daniel Chen1-5/+10
This PR enables `-m32`, -`maix32` and `-maix64` for AIX only. For other platforms, the driver will issue an error that `-m32` is not supported.
2025-04-19[clang] Use llvm::SmallVector::pop_back_val (NFC) (#136451)Kazu Hirata1-2/+1
2025-04-09[HIP] use offload wrapper for non-device-only non-rdc (#132869)Yaxun (Sam) Liu1-18/+41
Currently HIP still uses offload bundler for non-rdc mode for the new offload driver. This patch switches to use offload wrapper for non-device-only non-rdc mode when new offload driver is enabled. This makes the rdc and non-rdc compilation more consistent and speeds up compilation since the offload wrapper supports parallel compilation for different GPU arch's. It is implemented by adding a linker wrapper action for each assemble action of input file. Linker wrapper action differentiates this special type of work vs normal linker wrapper work by the fle type. This type of work results in object instead of image. The linker wrapper adds "-r" for it and only includes the object file as input, not the host libraries. For device-only non-RDC mode, the new driver keeps the original behavior.
2025-03-26[NFC][Driver][HIP] Fix mixing `amdgcnspirv` and `gfxXXX` via ↵Alex Voicu1-2/+5
`--offload-arch` (#133024) Due to `amdgcnspirv` piggybacking on the HIPAMDToolchain, it loses its immediately apparent SPIR-Vness, which makes the Driver want to go all the way to Assembly emmission. This was problematic as we were trying to `llvm-link` SPIR-V, before trying to translate it. This patch ensures that we do the right thing and stop at bitcode emission if we are mixing `amdgcnspirv` and concrete targets.
2025-03-14[NFC][AMDGPU] Replace more direct arch comparison with isAMDGCN() (#131379)Shilei Tian1-4/+2
This is an extension of #131357. Hopefully this would be the last one.
2025-03-14[Clang] Remove use of 'temporary' toolchains for offload deduction (#131332)Joseph Huber1-16/+8
Summary: We need a toolchain to get the GPU architectures when compiling with OpenMP. This kind of breaks the toolchain model because these are cached all over the place. Instead of making a new one, just create both of them unconditionally. It's not like this is saving any work since we still needed to create both toolchains in the earlier case. Fixes: https://github.com/llvm/llvm-project/issues/131325
2025-03-12[Driver] Avoid repeated hash lookups (NFC) (#130888)Kazu Hirata1-7/+4
2025-03-10[HLSL][Driver] Use temporary files correctly (#130436)Chris B1-6/+28
This updates the DXV and Metal Converter actions to properly use temporary files created by the driver. I've abstracted away a check to determine if an action is the last in the sequence because we may have between 1 and 3 actions depending on the arguments and environment.
2025-03-07[DXC] Add `-metal` flag to DXC driver (#130173)Chris B1-0/+10
This adds a flag to the DXC driver to enable calling the metal shader converter if it is available to convert the final shader output for metal.
2025-03-06Reland "[HIP] Use original file path for CUID" (#111885)Yaxun (Sam) Liu1-4/+1
This patch fixes the buildbots failure of lit tests on MacOS. Since clang driver options depend on toolchain, we cannot hardcode CUID hash. On MacOS there is an extra -mlinker-version= option.
2025-02-21[z/OS] Add option to target older versions of LE on z/OS (#123399)Sean Perry1-0/+72
Add an option similar to the -qtarget option in XL to allow the user to say they want to be able to run the generated program on an older version of the LE environment. This option will do two things: - set the `__TARGET_LIBS` macro so the system headers exclude newer interfaces when targeting older environments - set the arch level to match the minimum arch level for that older version of LE. It doesn't happen right now since all of the supported LE versions have a the same minimum ach level. So the option doesn't change this yet. The user can specify three different kinds of arguments: 1. -mzos-target=zosv*V*r*R* - where V & R are the version and release 2. -mzos-target=0x4vrrmmmm - v, r, m, p are the hex values for the version, release, and modlevel 3. -mzos-target=current - uses the latest version of LE the system headers have support for
2025-02-06[Clang][NFC] Clean up fetching the offloading toolchain (#125095)Joseph Huber1-98/+98
Summary: This patch cleans up how we query the offloading toolchain. We create a single that is more similar to the existing `getToolChain` driver function and make all the offloading handlers use it.
2025-02-05[Clang] Make `-Xarch_` handling generic for all toolchains (#125421)Joseph Huber1-2/+3
Summary: Currently, `-Xarch_` is handled specially between different toolchains, (i.e. Mach-O). This patch unifies the handling so that it can be used generically. The main benefit here is that we now have a more generic version of `-Xopenmp-target=`, which should probably just be deprecated. Additionally, it allows us to specially pass arguments to different architectures for offloading. This patch is done in preparation for making selecting offloading toolchains more generic, this will be helpful while people are moving toward compile jobs that include multiple toolchains (SPIR-V, AMDGCN, NVPTX).
2025-01-31[Clang] Make OpenMP offloading consistently use the bound architecture (#125135)Joseph Huber1-22/+23
Summary: OpenMP was weirdly split between using the bound architecture from `--offload-arch=` and the old `-march=` option which only worked for single jobs. This patch removes that special handling. The main benefit here is that we can now use `getToolchainArgs` without it throwing an error. I'm assuming SYCL doesn't care about this because they don't use an architecture.
2025-01-30[Clang] Remove ARCMigrate (#119269)Sirraide1-4/+2
In the discussion around #116792, @rjmccall mentioned that ARCMigrate has been obsoleted and that we could go ahead and remove it from Clang, so this patch does just that.
2025-01-29[clang] UEFI handle unsupported triples. (#124824)Prabhuk1-0/+4
The only architecture currently being supported (still a WIP) is x86_64. Other UEFI triples targeting other architectures will now report an `unknown target triple` error.
2025-01-27Revert "[AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directly (#99687)"Joseph Huber1-14/+2
Breaks some downstream AMD stuff apparently. This reverts commit 6ff86f2c0a5b58b07921ee895f0d16d8cd3d4015.
2025-01-27[AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directly (#99687)Joseph Huber1-2/+14
Summary: The `getToolChain` pass uses the triple to determine which toolchain to create. Currently the `amdgcn-amd-amdhsa` triple maps to the `ROCmToolChain` which uses things expected to be provided by `ROCm`. This is neded for OpenCL, but directly targeting C++ does not want this since it's primarily being used for creating GPU runtime code. As far as I know I'm the only user of this, so this shouldn't change anything. Unfortunately, there's no good logic for detercting this, so I simply checked ahead of time if the input is either `foo.cl` or `-x cl foo.c` to choose between the two. This allows us to use the AMDGPU target normally, as otherwise it will error without passing `-nogpulib`.
2025-01-16[Multilib] Custom flags processing for library selection (#110659)Victor Campos1-5/+24
This patch is the third step to extend the current multilib system to support the selection of library variants which do not correspond to existing command-line options. Proposal can be found in https://discourse.llvm.org/t/rfc-multilib-custom-flags/81058 The multilib mechanism supports libraries that target code generation or language options such as --target, -mcpu, -mfpu, -mbranch-protection. However, some library variants are particular to features that do not correspond to any command-line options. Examples include variants for multithreading and semihosting. This work introduces a way to instruct the multilib system to consider these features in library selection. This particular patch is comprised of the core processing of these flags. - Custom flags in the command-line are read and forwarded to the multilib system. If multiple flag values are present for the same flag declaration, the last one wins. Default flag values are inserted for flag declarations for which no value was given. - Feed `MacroDefines` back into the driver. Each item `<string>` in the `MacroDefines` list is formatted as `-D<string>`. Library variants should list their requirement on one or more custom flags like they do for any other flag. The new command-line option is passed as-is to the multilib system, therefore it should be listed in the format `-fmultilib-flag=<str>`. Moreover, a variant that does not specify a requirement on any particular flag can be matched against any value of that flag. If the user specifies `-fmultilib-flag=<name>` with a name that is invalid, but close enough to any valid flag value name in terms of edit distance, a suggesting error is shown: ``` error: unsupported option '-fmultilib-flag=invalidname'; did you mean '-fmultilib-flag=validname'? ``` The candidate with the smallest edit distance is chosen for the suggestion, up to a certain maximum value (implementation detail), after which a non-suggesting error is shown instead: ``` error: unsupported option '-fmultilib-flag=invalidname' ```
2025-01-15[CUDA][HIP] Support CUID in new driver (#122859)Yaxun (Sam) Liu1-51/+65
CUID is needed by CUDA/HIP for supporting accessing static device variables in host function. Currently CUID is only supported by the old driver for CUDA/HIP. The new driver does not support it, which causes CUDA/HIP programs using static device variables in host functions to fail with the new driver for CUDA/HIP. This patch refactors the CUID support in the old driver so that CUID is supported by both the old and the new drivers for CUDA/HIP.
2025-01-15[C++20] [Modules] [Driver] Support -print-library-module-manifest-path for ↵Chuanqi Xu1-3/+18
libstdc++ Given libstdc++ has landed std module, the build systems may need clang to find the configuration file to understand how to build the std module. This patch did this. Tested with locally installed GCC-trunk.
2025-01-13Fix print module manifest file for macos (#122370)Bill Hoffman1-0/+5
This commit fixes -print-library-module-manifest-path on macos. Currently, this only works on linux systems. This is because on macos systems the library and header files are installed in a different location. The module manifest is next to the libraries and the search function was not looking in both places. There is also a test included.
2025-01-11[Driver] Avoid repeated map lookups (NFC) (#122625)Kazu Hirata1-2/+2
2025-01-10[CUDA] Move CUDA to new driver by default (#122312)Joseph Huber1-2/+4
Summary: This patch updates the --offload-new-driver flag to be default for CUDA. This mostly just required updating a lot of tests to use the old format. I tried to update them where possible, but some were directly checking the old format. https://discourse.llvm.org/t/rfc-use-the-new-offloding-driver-for-cuda-and-hip-compilation-by-default/77468/18
2025-01-09[HLSL] Explicitly set the SPIR-V version with spv-target-env (#121961)Steven Perron1-3/+8
In DXC, setting the vulkan version automatically sets the target spir-v version to the maximum spir-v version that the vulkan version must support. So for Vulkan 1.2, we set the spir-v version to spirv 1.5 because every implementation of Vulkan 1.2 must support spirv 1.5, but not spir-v 1.6.
2025-01-07[Darwin][Driver][clang] apple-none-macho orders the resource directory after ↵Ian Anderson1-0/+2
internal-externc-isystem when nostdlibinc is used (#122035) Embedded development often needs to use a different C standard library, replacing the existing one normally passed as -internal-externc-isystem. This works fine for an apple-macos target, but apple-none-macho doesn't work because the MachO driver doesn't implement AddClangSystemIncludeArgs to add the resource directory as -internal-isystem like most other drivers do. Move most of the search path logic from Darwin and DarwinClang down into an AppleMachO toolchain between the MachO and Darwin toolchains. Also define __MACH__ for apple-none-macho, as Swift expects all MachO targets to have that defined.
2025-01-07[SystemZ][z/OS] Add z/OS customization file (#111182)Sean Perry1-1/+36
On z/OS, the location of the system libraries and side decks (aka equivalent to libc, etc) are not in a predefined location. The system does have a default location but sysadmins can change this and frequently do. See the -mzos-hlq* options we have for z/OS. To avoid every user needing to specify these -mzos-hlq* options, we added support for a system install default config file that is always read independent of the usual config file. The compiler will read this customization config file before reading the usual config files. The customization file is called clang.cfg and is located in: - the etc dir within the compiler installation dir. - or specified by the CLANG_CONFIG_PATH env var. This env var can either be a directory or the fill path name of the file.
2025-01-07Revert "[Darwin][Driver][clang] apple-none-macho orders the resource ↵Nico Weber1-2/+0
directory after internal-externc-isystem when nostdlibinc is used (#120507)" This reverts commit 653a54727eaa18c43447ad686c987db67f1dda74. Breaks tests, see https://github.com/llvm/llvm-project/pull/120507#issuecomment-2575246281
2025-01-06[Darwin][Driver][clang] apple-none-macho orders the resource directory after ↵Ian Anderson1-0/+2
internal-externc-isystem when nostdlibinc is used (#120507) Embedded development often needs to use a different C standard library, replacing the existing one normally passed as -internal-externc-isystem. This works fine for an apple-macos target, but apple-none-macho doesn't work because the MachO driver doesn't implement AddClangSystemIncludeArgs to add the resource directory as -internal-isystem like most other drivers do. Move most of the search path logic from Darwin and DarwinClang down into an AppleMachO toolchain between the MachO and Darwin toolchains. Also define \_\_MACH__ for apple-none-macho, as Swift expects all MachO targets to have that defined.
2025-01-06[Driver][SYCL] Add initial SYCL offload compilation support (#117268)Michael Toguchi1-3/+87
Introduces the SYCL based toolchain and initial toolchain construction when using the '-fsycl' option. This option will enable SYCL based offloading, creating a SPIR-V based IR file packaged into the compiled host object. This includes early support for creating the host/device object using the new offloading model. The device object is created using the spir64-unknown-unknown target triple. New/Updated Options: -fsycl Enables SYCL offloading for host and device -fsycl-device-only Enables device only compilation for SYCL -fsycl-host-only Enables host only compilation for SYCL RFC Reference: https://discourse.llvm.org/t/rfc-sycl-driver-enhancements/74092 This is a reland of: https://github.com/llvm/llvm-project/pull/107493
2025-01-02[Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to ↵Nick Sarnie1-4/+8
generic SPIR-V (#120145) This is the first of a series of patches to add support for OpenMP offloading to SPIR-V through liboffload with the first intended target being Intel GPUs. This patch implements the basic driver and `clang-linker-wrapper` work for JIT mode. There are still many missing pieces, so this is not yet usable. We introduce `spirv64-intel-unknown` as the only currently supported triple. The user-facing argument to enable offloading will be `-fopenmp -fopenmp-targets=spirv64-intel` Add a new `SPIRVOpenMPToolChain` toolchain based on the existing general SPIR-V toolchain which will call all the required SPIR-V tools (and eventually the SPIR-V backend) as well as add the corresponding device RTL as an argument to the linker. We can't get through the front end consistently yet, so it's difficult to add any LIT tests that execute any tools, but front end changes are planned very shortly, and then we can add those tests. --------- Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
2024-12-12[clang][Driver] Support simplified triple versions for config files (#111387)Bo Anderson1-14/+39
Currently, the config file system loads the full target triple, e.g. `arm64-apple-darwin23.6.0.cfg`. This is however not very useful as this is a moving target. In the case of macOS, that target moves every ~2 months. We can improve this by adding fallbacks that simplify the version component of the triple. This pull request adds support for loading `arm64-apple-darwin23.cfg` and `arm64-apple-darwin.cfg`. See the included test for a demonstration on how it works.
2024-12-10Eliminate duplicate call in Clang driver (NFC)Aaron Puchert1-8/+3
The only difference is the usage of `JobAction* JA` versus `Action* A` in one argument, but `JA = cast<JobAction>(A)`, and the called function is inherited from `Action`.
2024-12-07[clang][driver] Use $ prefix with config file options to have them added ↵Paul Osmialowski1-14/+49
after all of the command line options (#117573) Currently, if a -l (or -Wl,) flag is added into a config file (e.g. clang.cfg), it is situated before any object file in the effective command line. If the library requested by given -l flag is static, its symbols will not be made visible to any of the object files provided by the user. Also, the presence of any of the linker flags in a config file confuses the driver whenever the user invokes clang without any parameters (see issue #67209). This patch attempts to solve both of the problems, by allowing a split of the arguments list into two parts. The head part of the list will be used as before, but the tail part will be appended after the command line flags provided by the user and only when it is known that the linking should occur. The $-prefixed arguments will be added to the tail part.
2024-12-06[Driver][OpenMP] Fix OpenMP target-toolchain-option parser (#115375)Jefferson Le Quellec1-0/+6
## Description This PR fixes a segmentation fault that occurs when passing options requiring arguments via `-Xopenmp-target=<triple>`. The issue was that the function `Driver::getOffloadArchs` did not properly parse the extracted option, but instead assumed it was valid, leading to a crash when incomplete arguments were provided. ## Backtrace ```sh llvm-project/build/bin/clang++ main.cpp -fopenmp=libomp -fopenmp-targets=powerpc64le-ibm-linux-gnu -Xopenmp-target=powerpc64le-ibm-linux-gnu -o PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script. Stack dump: 0. Program arguments: llvm-project/build/bin/clang++ main.cpp -fopenmp=libomp -fopenmp-targets=powerpc64le-ibm-linux-gnu -Xopenmp-target=powerpc64le-ibm-linux-gnu -o 1. Compilation construction 2. Building compilation actions #0 0x0000562fb21c363b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (llvm-project/build/bin/clang+++0x392f63b) #1 0x0000562fb21c0e3c SignalHandler(int) Signals.cpp:0:0 #2 0x00007fcbf6c81420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420) #3 0x0000562fb1fa5d70 llvm::opt::Option::matches(llvm::opt::OptSpecifier) const (llvm-project/build/bin/clang+++0x3711d70) #4 0x0000562fb2a78e7d clang::driver::Driver::getOffloadArchs(clang::driver::Compilation&, llvm::opt::DerivedArgList const&, clang::driver::Action::OffloadKind, clang::driver::ToolChain const*, bool) const (llvm-project/build/bin/clang+++0x41e4e7d) #5 0x0000562fb2a7a9aa clang::driver::Driver::BuildOffloadingActions(clang::driver::Compilation&, llvm::opt::DerivedArgList&, std::pair<clang::driver::types::ID, llvm::opt::Arg const*> const&, clang::driver::Action*) const (.part.1164) Driver.cpp:0:0 #6 0x0000562fb2a7c093 clang::driver::Driver::BuildActions(clang::driver::Compilation&, llvm::opt::DerivedArgList&, llvm::SmallVector<std::pair<clang::driver::types::ID, llvm::opt::Arg const*>, 16u> const&, llvm::SmallVector<clang::driver::Action*, 3u>&) const (llvm-project/build/bin/clang+++0x41e8093) #7 0x0000562fb2a8395d clang::driver::Driver::BuildCompilation(llvm::ArrayRef<char const*>) (llvm-project/build/bin/clang+++0x41ef95d) #8 0x0000562faf92684c clang_main(int, char**, llvm::ToolContext const&) (llvm-project/build/bin/clang+++0x109284c) #9 0x0000562faf826cc6 main (llvm-project/build/bin/clang+++0xf92cc6) #10 0x00007fcbf6699083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3 #11 0x0000562faf923a5e _start (llvm-project/build/bin/clang+++0x108fa5e) [1] 2628042 segmentation fault (core dumped) main.cpp -fopenmp=libomp -fopenmp-targets=powerpc64le-ibm-linux-gnu -o ```
2024-11-29[Driver] BuildCompilation: remove unused BaseArg. NFCFangrui Song1-22/+10
setBaseArg, only used by -XArch_* options, are called in BuildJobs. When processing --config and CL /clang:, BaseArg is always nullptr. The unneeded parameter was introduced in https://reviews.llvm.org/D24933
2024-11-29[Clang][Driver] report unsupported option error when link + compile in same ↵Reno Dakota1-7/+6
process (#116476) Fixes: https://github.com/llvm/llvm-project/issues/116278 This change updates clang to report unsupported option errors regardless of the command line argument order. When clang is invoked with a source file and without `-c` it will both compile and link. When an unsupported option is also part of the command line clang should generated an error. However, if the source file name comes before an object file, eg: `-lc`, the error is ignored. ``` $ clang --target=x86_64 -lc hello.c -mhtm clang: error: unsupported option '-mhtm' for target 'x86_64' $ echo $? 1 ``` but if `-lc` comes after `hello.c` the error is dropped ``` $ clang --target=x86_64 hello.c -mhtm -lc $ echo $? 0 ``` after this change clang will report the error regardless of the command line argument order.
2024-11-22[flang][Driver] Support -print-supported-cpus and associated aliases (#117199)Tarun Prabhu1-3/+4
The aliases are -mcpu=help and -mtune=help. There is still an issue with the output which prints an example line that references clang. That is not fixed here because it is printed in llvm/MC/SubtargetInfo.cpp. Some more thought is needed to determine how best to handle this. Fixes #117010
2024-11-15[Driver] Remove unused includes (NFC) (#116316)Kazu Hirata1-1/+0
Identified with misc-include-cleaner.
2024-11-15Revert "[Driver][SYCL] Add initial SYCL offload compilation support" (#116381)Aaron Ballman1-94/+1
Reverts llvm/llvm-project#107493 Failing bots include: https://lab.llvm.org/buildbot/#/builders/190/builds/9546 https://lab.llvm.org/buildbot/#/builders/46/builds/7938
2024-11-15[Driver][SYCL] Add initial SYCL offload compilation support (#107493)Michael Toguchi1-1/+94
Introduces the SYCL based toolchain and initial toolchain construction when using the '-fsycl' option. This option will enable SYCL based offloading, creating a SPIR-V based IR file packaged into the compiled host object. This includes early support for creating the host/device object using the new offloading model. The device object is created using the spir64-unknown-unknown target triple. New/Updated Options: -fsycl Enables SYCL offloading for host and device -fsycl-device-only Enables device only compilation for SYCL -fsycl-host-only Enables host only compilation for SYCL RFC Reference: https://discourse.llvm.org/t/rfc-sycl-driver-enhancements/74092
2024-11-12Revert "[clang][flang] Support -time in both clang and flang"Tarun Prabhu1-3/+0
Reverts llvm/llvm-project#109165 This created a buildbot failure on [Fuchsia](https://lab.llvm.org/buildbot/#/builders/11/builds/8080).
2024-11-12[clang][flang] Support -time in both clang and flangTarun Prabhu1-0/+3
The -time option prints timing information for the subcommands (compiler, linker) in a format similar to that used by gcc/gfortran. This partially addresses requests from #89888
2024-11-05[clang] Check '-Wp,' arg has values before accesing (#113677)Jaime González1-0/+1
Executing `clang -Wp,` without any argument value causes Undefined Behavior due to accessing a SmallVector without elements Executing clang in debug mode raises an assert and Valgrind complains as follow: ``` $ valgrind bin/clang -Wp, ==18620== Memcheck, a memory error detector ==18620== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al. ==18620== Using Valgrind-3.22.0 and LibVEX; rerun with -h for copyright info ==18620== Command: bin/clang -Wp, ==18620== ==18620== Conditional jump or move depends on uninitialised value(s) ==18620== at 0x44F215B: clang::driver::Driver::TranslateInputArgs(llvm::opt::InputArgList const&) const (in /home/jaime/devel/llvm-project/build/bin/clang-20) ==18620== by 0x4515831: clang::driver::Driver::BuildCompilation(llvm::ArrayRef<char const*>) (in /home/jaime/devel/llvm-project/build/bin/clang-20) ==18620== by 0x10B3435: clang_main(int, char**, llvm::ToolContext const&) (in /home/jaime/devel/llvm-project/build/bin/clang-20) ==18620== by 0xF78F99: main (in /home/jaime/devel/llvm-project/build/bin/clang-20) ==18620== ... ```
2024-11-05[clang][Driver][HIP] Add support for mixing AMDGCNSPIRV & concrete ↵Alex Voicu1-11/+9
`offload-arch`s. (#113509) This removes the temporary ban on mixing AMDGCN flavoured SPIR-V and concrete targets (e.g. `gfx900`) in the same HIPAMD compilation. This is done primarily by tweaking the effective / observable triple when the target is `amdgcnspirv`, which seamlessly composes with the existing infra. The test is stolen from #75357.
2024-11-03[clang][Driver] Allow -fuse-lld=lld-link when lto is enabled on ↵Zhaoshi Zheng1-1/+1
*windows-msvc targets (#113966) Follow-up on https://github.com/llvm/llvm-project/pull/109607, we have a use case on Windows-on-ARM64 where `cmake -G "Unix Makefiles"` generates `-fuse-ld=lld-link`, which is accidentally disallowed by PR#109607.
2024-10-31[Clang][SYCL] Introduce clang-sycl-linker to link SYCL offloading device ↵Arvind Sudarsanam1-0/+5
code (Part 1 of many) (#112245) This PR is one of the many PRs in the SYCL upstreaming effort focusing on device code linking during the SYCL offload compilation process. RFC: https://discourse.llvm.org/t/rfc-offloading-design-for-sycl-offload-kind-and-spir-targets/74088 In this PR, we introduce a new tool that will be used to perform device code linking for SYCL offload kind. It accepts SYCL device objects in LLVM IR bitcode format and will generate a fully linked device object that can then be wrapped and linked into the host object. A primary use case for this tool is to perform device code linking for objects with SYCL offload kind inside the clang-linker-wrapper. It can also be invoked via clang driver as follows: `clang --target=spirv64 --sycl-link input.bc` Device code linking for SYCL offloading kind has a number of known quirks that makes it difficult to use in a unified offloading setting. Two of the primary issues are: 1. Several finalization steps are required to be run on the fully-linked LLVM IR bitcode to gaurantee conformance to SYCL standards. This step is unique to SYCL offloading compilation flow. 2. SPIR-V LLVM Translator tool is an extenal tool and hence SPIR-V IR code generation cannot be done as part of LTO. This limitation will be lifted once SPIR-V backend is available as a viable LLVM backend. Hence, we introduce this new tool to provide a clean wrapper to perform SYCL device linking. Co-Author: Michael Toguchi Thanks --------- Signed-off-by: Arvind Sudarsanam <arvind.sudarsanam@intel.com>
2024-10-14[LLVM] [Clang] Support for Gentoo `*t64` triples (64-bit time_t ABIs) (#111302)Michał Górny1-1/+4
Gentoo is planning to introduce a `*t64` suffix for triples that will be used by 32-bit platforms that use 64-bit `time_t`. Add support for parsing and accepting these triples, and while at it make clang automatically enable the necessary glibc feature macros when this suffix is used. An open question is whether we can backport this to LLVM 19.x. After all, adding new triplets to Triple sounds like an ABI change — though I suppose we can minimize the risk of breaking something if we move new enum values to the very end.
2024-10-10[flang][driver] rename flang-new to flang (#110023)Brad Richardson1-1/+1
This does a global rename from `flang-new` to `flang`. I also removed/changed any TODOs that I found related to making this change. --------- Co-authored-by: H. Vetinari <h.vetinari@gmx.com> Co-authored-by: Andrzej Warzynski <andrzej.warzynski@arm.com>
2024-10-07[clang][Driver] Rename "FatalError" key to "Error" in multilib.yaml (#110804)Simon Tatham1-1/+1
This is a late-breaking change to #105684, suggested after the original patch was already landed.