aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/linkers
AgeCommit message (Collapse)AuthorFilesLines
7 daysMerge pull request #13681 from EngJay/13678-fix-ti-cgt-supportJussi Pakkanen1-0/+3
Fix TI C2000 support
2024-10-18add getter for id so linker can be identifiedJason Scott1-0/+3
2024-09-29metrowerks: Whine when trying to build a shared librarymid-kid1-5/+3
Also cleaned up redundant functions in the subclass.
2024-09-27linkers: Fix linker detection with clang on SolarisAlan Coopersmith1-21/+24
Fixes: #13711
2024-09-24linkers: Disable -rpath-link with ld.zigccTristan Ross1-1/+3
Zig issue https://github.com/ziglang/zig/issues/18713
2024-09-24linkers: basic support for the 'zig cc' linkerAndrei Alexeyev2-0/+10
2024-08-20linkers: skip -export_dynamic flag before MacOS 10.7Wolfgang Walther1-1/+3
The flag was only introduced in ld 224.1, as mentioned in the initial PR #13291. Resolves #13543
2024-08-09linkers: fix LLD linker response file handlingBenoit Pierre1-3/+3
Correct base classes so GNU-like linkers all default to supporting response files.
2024-08-08Fix compiling ObjC/ObjC++ on Windows/MinGWJonathan Schleifer1-0/+3
Co-Authored-By: L. E. Segovia <amy@amyspark.me>
2024-08-07linkers: Fix RSP syntax for linkers invoked with clangKacper MichajƂow2-9/+22
Fixes: #8981 Fixes: 2be074b1d445fcd30535bcf7518f8ce0738bcbf3 Signed-off-by: Kacper MichajƂow <kasper93@gmail.com>
2024-07-04linkers: Loosen the check for GNU interface style in LLD for WindowsMartin Storsjö1-1/+1
Don't require the string to be enclosed in parentheses. https://github.com/llvm/llvm-project/pull/97323 changed the LLD version printout to no longer be enclosed in parentheses, which made Meson fail to detect the linker style used here. The LLD change is being reverted in https://github.com/llvm/llvm-project/pull/97698 in order to fix building with existing Meson versions, but for the future, loosen the check slightly, to not require the parentheses.
2024-06-29linkers: Fix AppleDynamicLinker not returning any rpaths to removePiotr BrzeziƄski1-2/+4
Fixes regression from commit 78e9009ff9d36925e04f329f9082841002ddd848. The above commit relied on rpath_dirs_to_remove being present and correctly filled, which was never the case for the AppleDynamicLinker. The result was that all the build-dir-only RPATHs were being carried over to the installed files. This commit implements returning the list of RPATHs to remove in AppleDynamicLinker, doing pretty much the same thing as what's in the GnuLikeDynamicLinkerMixin. Thanks to that, depfixer now correctly removes build-time Meson-created RPATHs, as it used to before 1.4.1.
2024-06-26compilers: pass Environment to openmp_flagsDylan Baker1-1/+1
This will be needed by the Apple compiler
2024-06-05Add -export_dynamic flag for AppleDynamicLinkerWolfgang Walther1-0/+3
The apple linker uses -export_dynamic instead of --export-dynamic [1]. This should be set when setting export_dynamic: true. Resolves #13290 [1]: https://opensource.apple.com/source/ld64/ld64-609/doc/man/man1/ld.1.auto.html
2024-05-19pylint: fix false positive for missing else branchEli Schwartz1-1/+1
We cover every case as if/elif/elif. mypy can handle this fine, but pylint doesn't do control flow or type checking and thinks in the missing else case, the variable might not be defined. For mypy as well, doing this instance check is unnecessary as it can be inferred. So just micro-optimize the check and allow pylint to safely analyze the logic.
2024-05-15Merge pull request #11421 from mon/ti-armclangJussi Pakkanen2-4/+25
Basic support for TI Arm Clang toolchain
2024-04-05Merge pull request #12144 from amyspark/fix-msvc-clangcl-linker-flag-detectionJussi Pakkanen2-0/+9
linkers: Fix detection of link arguments to Clang(-cl) + MSVC
2024-03-13Basic support for TI ARM-CLANG toolchainWilliam Toohey2-4/+25
2024-03-12Added support for Texas Instruments C6000 compiler.Petr Machacek1-0/+6
2024-03-03compilers: only wrap multiple input libraries with start/end groupEli Schwartz1-2/+2
When only a single input file shows up in an arglist, it makes no sense to inject `-W,--start-group -lone -Wl,--end-group`, since there is nothing being grouped together. It's just longer command lines for nothing.
2024-02-25compilers: Forward Meson's preference of lld-link to clang-clL. E. Segovia1-0/+3
The latter prefers LINK.exe by default, which rejects GNU-like linker flags.
2024-02-25linkers: Fix detection of link arguments to Clang(-cl) + MSVCL. E. Segovia1-0/+6
Currently, not only Meson lacks a way to induce a "--fatal-warnings" on LINK.exe, it is also unable to pass flags appropriately when using clang-cl or Microsoft's stock clang. This commit fixes it by implementing `fatal_warnings()` in the MSVCDynamicLinker and ClangCLDynamicLinker classes, and by implementing the requisite conversion steps in linker_to_compiler_args for ClangCompiler.
2024-01-18linkers_detect: detect xtools (Apple ld64 derivative)Fabian Groffen1-0/+5
xtools is in use on Gentoo Prefix x86_64 and ppc based Darwin installs. Pick it up as a valid linker. Since xtools is answering with a version to --version, as opposed to ld64, detection of xtools in the ld64 handling block is not possible, since --version already succeeded. Bug: https://bugs.gentoo.org/868516 Bug: https://github.com/mesonbuild/meson/issues/10805 Signed-off-by: Fabian Groffen <grobian@gentoo.org> Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2023-12-23Remove `get_buildtype_args` functionCharles Brunet1-32/+27
This is a first step to make `buildtype` a true alias of `debug` and `optimization` options. See #10808. Relates to: - #11645 - #12096 - #5920 - #5814 - #8220 - #8493 - #9540 - #10487 - #12265 - #8308 - #8214 - #7194 - #11732
2023-12-13Use SPDX-License-Identifier consistentlyDylan Baker4-48/+4
This replaces all of the Apache blurbs at the start of each file with an `# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing uses to be consistent in capitalization, and to be placed above any copyright notices. This removes nearly 3000 lines of boilerplate from the project (only python files), which no developer cares to look at. SPDX is in common use, particularly in the Linux kernel, and is the recommended format for Meson's own `project(license: )` field
2023-12-06macos: Do not emit -undefined,error for Sonoma compatibilityAndres Freund1-1/+9
Emitting -undefined,error was correct,, but starting with Xcode 15 / Sonoma, doing so triggers "ld: warning: -undefined error is deprecated". Given that "-undefined error" is documented to be the linker's default behaviour, this warning seems ill advised. However, it does create a lot of noise. As "-undefined error" is the default behaviour, the least bad way to deal with this seems to be to just not emit anything. Of course that only works as long as nothing else injects -undefined dynamic_lookup, or such. Complain to Apple. Fixes: https://github.com/mesonbuild/meson/issues/12450
2023-12-03Handle macos linker reporting error message in pluring during detectionAndres Freund1-2/+3
Previously macos reported "ld: unknown option: --version" when being passed --version, but now sometimes it reports in plural, albeit without an obvious pattern when. To handle that, simply just check for the prefix without the : Fixes: https://github.com/mesonbuild/meson/issues/12552
2023-10-12MSVCDynamicLinker: prevent duplicated /nologo argumentCharles Brunet1-1/+1
2023-10-05msvc: unify debug filename handlingDudemanguy1-2/+1
The MSVC code is extremely confusing, and it turns out it actually constructs debug (pdb) files names/path independently in separate places. This is really hard to parse. Instead, refactor it so that the source of the debug filename is within the target itself (get_debug_filename). Add a couple of generic methods to retrieve the full path of the debug filename name in the backend and use that when needed.
2023-09-06backends/ninja: run `ranlib -c $out` when using the apple arDylan Baker1-0/+4
Apple's AR is old, and doesn't add externed symbols to the symbol table, instead relying on the user calling ranlib with -c. We need to do that for the user
2023-08-11treewide: automatic rewriting of all comment-style type annotationsEli Schwartz1-2/+2
Performed using https://github.com/ilevkivskyi/com2ann This has no actual effect on the codebase as type checkers (still) support both and negligible effect on runtime performance since __future__ annotations ameliorates that. Technically, the bytecode would be bigger for non function-local annotations, of which we have many either way. So if it doesn't really matter, why do a large-scale refactor? Simple: because people keep wanting to, but it's getting nickle-and-dimed. If we're going to do this we might as well do it consistently in one shot, using tooling that guarantees repeatability and correctness. Repeat with: ``` com2ann mesonbuild/ ```
2023-07-25make 'gui_app' an interpreter only conceptDylan Baker1-13/+0
Since it's deprecated anyway, we don't really want to plumb it all the way down into the build and backend layers. Instead, we can just turn it into a `win_subsystem` value in the interpreter if `win_subsystem` isn't already set.
2023-07-19mypy: add more mixin base classesEli Schwartz1-3/+3
These don't have new errors or old ignored ones, but add them anyway so we can generally validate their sanity.
2023-07-19linkers: fix mypy errors that were ignored due to lack of inheritanceEli Schwartz1-4/+11
A linker mixin has to be able to align with the base linker it will be used for, in order to reference super(). Since they weren't inherited, calls to super() resulted in mypy errors, which we ignored, and casting. Use the same trick we use for compilers, and make the linker inherit from the base linker type when running under mypy, and from object at runtime.
2023-07-19linkers: reorganize code so that linker base classes always come firstEli Schwartz1-199/+200
So that we can later reference them.
2023-07-17Merge pull request #11976 from tristan957/cleanupsJussi Pakkanen1-26/+26
Some various type related cleanups
2023-07-12Fix return type of debugfile functionsTristan Partin1-2/+2
It was returning None in some cases while being marked as returning string.
2023-07-12Match the method signatures of parent classesTristan Partin1-5/+5
Names and types of some methods did not match their parent methods.
2023-07-12Annotate naked fundamental Python typesTristan Partin1-6/+6
Although mypy wasn't complaining, pyright was.
2023-07-12Replace some type comments with annotationsTristan Partin1-13/+13
2023-07-10Fix Xcode 15 beta linker detection. Closes #11958.Jussi Pakkanen1-1/+1
2023-06-27Archive shared library in AIX (#11850)Aditya Kamath1-0/+24
* Archive shared library in AIX This code change to ensure we archive shared libraries in AIX. The things we do are: Archive shared library Install archived shared library Build all must build the archived shared library blibpath must have the archived shared library dependency. * Archive shared library in AIX. Made changes as per the review comments given in the first PR request. They are:- Use self.environment.machines[t.for_machine].is_aix() Remove trial spaces Use of val instead of internal Changed comments wherever requested * Space after octothorpe * Fixed failed test case causing build break during install section * Moved AIX specific code to AIXDynamicLinker from backend * Fix indentation, trailing spaces, add type annotations and Linux/macOS build break * Remove some more trailing space issues * Fixed the wrong return type in linkers
2023-06-26linkers: delay implementations import until detect is runEli Schwartz4-185/+77
This saves on a 1500-line import at startup and may be skipped entirely if no compiled languages are used. In exchange, we move the implementation to a new file that is imported instead. Followup to commit ab20eb5bbc21ae855bcd211131132d2778602bcf.
2023-06-26fix regression in handling output overwriting for ar-like linkersEli Schwartz1-0/+2
Linkers that aren't actually ar, were refactored into a base class in commit 253ff71e6b801786290b6ecb23aea61dcfeebeca, which however didn't take into account that we were doing checks for this.
2023-06-14WIP: refactor loggable popen calls for consistencyEli Schwartz1-16/+4
2023-06-08dependencies/llvm: strip default include dirsKarol Herbst1-2/+2
Fixes an issue with rust.bindgen if a cmake LLVM dependency with the system include_type is getting used as a dependency.
2023-04-24Initial support for Metrowerks C/C++ compilerNomura2-0/+77
2023-04-11fix various spelling issuesJosh Soref2-3/+3
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-02-01treewide: add future annotations importEli Schwartz1-0/+1
2023-01-10linkers: detect ld64 as AppleDynamicLinkerjack2-6/+28