A new set of files are dedicated to linker configuration.
This set of files enable a fine-tuned configuration based of the linker
type as identified during compiler detection.
Fixes: #25360
Remove `/DAMD64` and `/DARM64EC` flags added by commit 4ea3a88625 (MSVC:
Add support for targeting ARM64EC, 2020-12-30, v3.20.0-rc1~121^2) that
are not longer expected.
When using Gentoo Prefix on Debian, find_library for libm.so fails,
because it needs to locate the lib in $sysroot/usr/lib64/libm.so, i.e.
lib64/ not lib/.
To fix this, do not disable per-arch lib directories when a sysroot is
set.
Fixes: #26069
4af20bb794 NAG-Fortran: Do not repeat preprocessing with Ninja on Apple platforms
91bb8dd872 NAG-Fortran: Fix MODULE library creation on Apple platforms
e056006116 NAG-Fortran: Tell the Ninja generator how to preprocess Fortran sources
765a611956 NAG-Fortran: Added initial default compilation flags
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9407
Wire up the flags needed to support module libraries built and used with
Swift. We need to pass `-bundle` to the linker when linking module
libraries on Darwin, and we need to pass `-export-dynamic` to the linker
when emitting an executable that exports symbols on Linux. This patch
wires up `CMAKE_SHARED_MODULE_CREATE_Swift_FLAGS` and
`CMAKE_SHARED_MODULE_LOADER_Swift_FLAG` on Darwin, and hooks up
`CMAKE_EXE_EXPORTS_Swift_FLAG` on Linux in order to support passing
things correctly.
We can't expose `CMAKE_EXE_LINKER_FLAGS` to Swift, as it contains flags
that the Swift compiler doesn't recognize, but the other
language-specific variables are safe to expose.
Thread-local variables are put in the tdata section on AIX / XCOFF [1]. Unfortunately
the ExportImportList script currently doesn't consider this section when looking for
symbols to export.
This results in linking failures in applications (such as LLVM) when building which expect these thread local variables to be exported from their shared libraries.
[1]: https://www.ibm.com/docs/en/aix/7.3?topic=formats-xcoff-object-file-format
The link flag wrapping added by commit 5d5a712303 (IntelLLVM: Pass
linker flags to the compiler when used as linker, 2022-05-27,
v3.25.0-rc1~344^2~4) is not needed with Visual Studio generators because
MSBuild invokes the linker directly. Furthermore, that commit omitted
wrapping of the per-config linker flags.
Revise the logic to add the link flag wrapping more precisely.
Fixes: #25533
Update the platform module added by commit 462fbd1eca (Add support for
ARTOS platform using GNU C with ac compiler driver, 2015-08-13,
v3.4.0-rc1~201^2) to tell `find_library` to consider library file names
starting in `lib`.
FindEXPAT needs this on ARTOS since commit 13079f382b (FindEXPAT: Fix
for debug and other modified builds, 2023-02-18, v3.27.0-rc1~463^2)
removed its explicit `libexpat` library name candidate.
Fixes: #25776
Extend commit 96a953b1ed (Add options to specify linker tool, 2023-09-27,
v3.29.0-rc1~577^2) with the `CMAKE_Swift_USING_LINKER_*` variables
needed to support `CMAKE_LINKER_TYPE` for Swift.
Use the same flags Xcode adds for `XROS_DEPLOYMENT_TARGET`. They are
`-target arm64-apple-xros1.0` and `-target arm64-apple-xros1.0-simulator`,
where `1.0` is the deployment target version.
Fixes: #25188
In commit 88c740462c (CUDA/Clang: Add support for MSVC ABI on Windows
using GNU-like frontend, 2024-01-17) we updated the message for the
existing check to mention CUDA, but neglected to update the check
itself.
Issue: #25648
When targeting the GNU ABI, we consider `.a` libraries first but also
accept `.lib`. For symmetry, when targeting the MSVC ABI, we now
consider `.lib` first but also accept `.a`.
This adds support for meson-generated static libraries, which are named
with the pattern `lib${foo}.a`:
* https://mesonbuild.com/FAQ.html#why-does-building-my-project-with-msvc-output-static-libraries-called-libfooa
Note that this was previously attempted by
* commit be848a71b0 (MSVC: Teach find_library to consider the 'libfoo.a'
naming convention, 2022-09-19, v3.25.0-rc1~111^2)
but was reverted by
* commit 955d6245c1 (MSVC: Revert "Teach find_library to consider the
'libfoo.a' naming convention", 2022-11-28, v3.25.1~6^2)
due to problems finding GNU ABI libraries in PATH-derived prefixes.
Since then,
* commit 0a81110b84 (find_(library|file|path): Drop PATH-derived search
prefixes, 2023-09-14, v3.28.0-rc1~91^2)
removed the problematic search paths, so we can restore this change.
Fixes: #23975
df025444b2 LinkerId: Identify AIX and SunOS system linkers
c1e48a19a5 LinkerId: Try multiple flags to detect linker id and version
1e42a0cf18 LinkerId: Match linker id and version more robustly
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9057
LLVMFlang 18.0 adds MSVC runtime library selection flags and associated
Fortran runtime library variants. Resolve the corresponding FIXME left
by commit 26bf32cdc6 (LLVMFlang: Add support for targeting MSVC ABI on
Windows, 2023-09-28, v3.28.0-rc1~10^2).
Issue: #24840