Flang gained -Xlinker only in LLVM 20, so the Apple linker flags added
by commit 18d65b9d4b (LLVMFlang: Fix Fortran shared library creation on
Apple platforms, 2026-09-23) fail with older Flang. For those versions
the flags now go through -Wl, with the install name joined to its flag.
Flang 20 and later keep the -Xlinker form.
Fixes: #28148
Add experimental support for SYCL under an experimental gate. The
IntelLLVM and Adaptivecpp compilers are recognized, as well as upstream
Clang with libsycl support.
Fixes: #27219, #27905
Since commit 1e35163ae8, the WHOLE_ARCHIVE feature is defined in the
linker configuration modules. OHOS had no such files, so
$<LINK_LIBRARY:WHOLE_ARCHIVE,...> failed there.
Add forwarding files to the Linux linker configuration, as done for
Android in commit d2997ab601. Unlike Android, fall back to LLD when the
linker cannot be identified, because the OHOS SDK toolchain file links
with -fuse-ld=lld.
NVIDIA CUDA links with `link.exe` directly, but had no
`CMAKE_CUDA_LINK_DEF_FILE_FLAG` and fell back to the global
`CMAKE_LINK_DEF_FILE_FLAG`. With IntelLLVM enabled in the same build
tree, that holds `/Qoption,link,/DEF:`, which `link.exe` ignores, so a
CUDA DLL exported nothing from its `.def` file. Commit 8b710d8264
(Linker: Generate per-language module -DEF: flags on Windows,
2025-05-28) covered the other Windows toolchains but missed CUDA.
Fixes: #25598
Issue: #26005
IntelLLVM links through the compiler driver, so its link directory
flag is wrapped in `/Qoption,link,`. MSVC and CUDA run `link.exe`
directly. When both are used in one build tree, the IntelLLVM value
of `CMAKE_LIBRARY_PATH_FLAG` leaked onto `link.exe` command lines.
Setting `CMAKE_<LANG>_LIBRARY_PATH_FLAG` per language, as was done
for `CMAKE_<LANG>_LINK_DEF_FILE_FLAG`, gives each link line the
spelling its own linker understands. The variable is now documented.
Fixes: #28116
Fix commit 402d72b6c0 (OrangeC: Add support for compiling Windows
Resources, 2026-03-24, v4.4.0-rc1~444^2~1) to work for both C and CXX.
Inspired-by: Arha Gatram <agatram@nvidia.com>
11adb3b7ae Linker/Windows-MSVC: check for a non-empty linker version
32c12e6901 Modules/CMakeLANGCompiler.cmake.in: quote linker version and frontend variant
31946711d3 CMakeDetermineCompilerSupport: support skipping compiler feature checks
71d908010f Modules/DetermineCompiler: support skipping compiler checks
e267321f93 Modules/DetermineCompiler: avoid the cache for ABI compilations
94f4c64461 Tests/RunCMake/ToolchainSkipsChecks: add tests for skipping compiler checks
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11917
To ensure that the correct linker is selected (host or device link),
use the generic driver (i.e. lld) rather than a specific linker (like lld-link).
Fixes: #27826
We detect the architecture once and store it in `_PellesC_ARCH`.
Do not unset it after the first language is enabled.
This fixes commit bc51518821 (PellesC: Compile for architecture matching
LIB environment variable, 2026-05-07) by removing lines left from an
earlier draft of the change.
Issue: #21536
Reported-by: Serguei E. Leontiev <leo@sai.msu.ru>
Swift supports CodeView/PDB for Windows (with active development ongoing
to make it the default). It is currently usable but does not have the
same fidelity as DWARF, but can be sufficient for many use cases. The
user is able to control this via flags. Wire up the necessary support to
allow `TARGET_PDB_FILE` to be used with Swift/Swift-only targets.
Extend commit 2b2344b412 (MSVC: Add abstraction for runtime checks,
2025-01-22, v4.0.0-rc1~92^2) to cover LLVMFlang. This is necessary
to configure with CMP0184's NEW behavior.
We already do this for MSVC and MinGW. The linker ignores them
if no symbols are needed.
Issue: #21536
Co-authored-by: Serguei E. Leontiev <leo@sai.msu.ru>
Prior to CMake 4.2.0, projects using the EMSDK's toolchain file while
also enabling `TARGET_SUPPORTS_SHARED_LIBS` would link shared libraries
using our default `-shared` flag plus whatever `-sSIDE_MODULE` flag
the project added, if any. CMake 4.2.0 introduced builtin Emscripten
support, but since commit d361bf365e (Emscripten: Drop hard-coded
-sMAIN_MODULE and -sSIDE_MODULE flags, 2025-09-18, v4.2.0-rc1~146^2)
we still leave it to projects to add Emscripten-specific flags needed
to link shared libraries.
Restore the pre-4.2 behavior of adding the `-shared` flag. In
particular, this is needed for upcoming Emscripten support for real
shared libraries.
Issue: #27240
The Pelles C compiler requires MS extensions to support `__declspec`
and other constructs needed to use Windows APIs. Unfortunately the
flag also disables standard definitions, so restore them.
Issue: #21536
Co-authored-by: Serguei E. Leontiev <leo@sai.msu.ru>
The Pelles C compiler does not support ASM, and the `poasm` assembler
uses a distinct syntax. Add a dedicated language as we do for similar
cases from other vendors. Leave documentation commented out for now
because the PellesC toolchain support in general is not yet documented.
Fixes: #27758
Issue: #21536
Co-authored-by: Serguei E. Leontiev <leo@sai.msu.ru>
The PellesC toolchain provides a `porc` tool to compile them.
Note that `polib` fails to archive resource files (`.res`):
POLIB: fatal error: An internal error occurred
Turn off the static library part of the VSResource test.
Issue: #21536
Inspired-by: Serguei E. Leontiev <leo@sai.msu.ru>