aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/linkers
AgeCommit message (Collapse)AuthorFilesLines
2022-04-30linkers: Add support for mold linkerFini Jastrow2-6/+15
[why] Support for the relatively new mold linker is missing. If someone wants to use mold as linker `LDFLAGS="-B/path/to/mold"` has to be added instead of the usual `CC_LD=mold meson ...` or `CXX_LD=mold meson ...`. [how] Allow `mold' as linker for clang and newer GCC versions (that versions that have support). The error message can be a bit off, because it is generic for all GNU like compilers, but I guess that is ok. (i.e. 'mold' is not listed as possible linker, even if it would be possible for the given compiler.) [note] GCC Version 12.0.1 is not sufficient to say `mold` is supported. The expected release with support will be 12.1.0. On the other hand people that use the un-released 12.0.1 will probably have built it from trunk. Allowing 12.0.1 is helping bleeding edge developers to use mold in Meson already now. Fixes: #9072 Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-03-07move a bunch of imports into TYPE_CHECKING blocksEli Schwartz1-3/+5
These are only used for type checking, so don't bother importing them at runtime. Generally add future annotations at the same time, to make sure that existing uses of these imports don't need to be quoted.
2022-03-07treewide: string-quote the first argument to T.castEli Schwartz1-1/+1
Using future annotations, type annotations become strings at runtime and don't impact performance. This is not possible to do with T.cast though, because it is a function argument instead of an annotation. Quote the type argument everywhere in order to have the same effect as future annotations. This also allows linters to better detect in some cases that a given import is typing-only.
2022-02-02Genericise TI compiler and add MSP430 supportWilliam Toohey2-7/+21
2021-12-30fix type annotations for compiler toolchain rpathsEli Schwartz1-12/+12
We pass around a tuple of rpaths, because rpaths *can* be more than one. But all the annotations said it would be a str instead.
2021-10-27Changing xc16's linker from 'xc16-gcc.exe' to 'xc16-gcc'. Windows willgeorgev931-2/+2
still find the correct linker and now linux will be able to use its xc16-gcc as the linker.
2021-10-27fix various flake8 whitespace errorsEli Schwartz2-6/+6
2021-10-18linkers: detect LLD when built with PACKAGE_VENDORPaolo Bonzini1-3/+3
https://github.com/Homebrew/homebrew-core/commit/e7c972b6062af753e564104e58d1fa20c0d1ad7a added PACKAGE_VENDOR to lld, causing the -v output to start with "Homebrew LLD" rather than just "LLD". Meson no longer detects it and fails the test_ld_environment_variable_lld unit test. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-10-10Fix typos discovered by codespellChristian Clauss1-1/+1
2021-10-10ar linker: generate thin archives for uninstalled static librariesEli Schwartz1-8/+19
Since they will never be used outside of the build directory, they do not need to literally contain the .o files, and references will be sufficient. This covers a major use of object libraries, which is that the static library would potentially take up a lot of space by including another copy of every .o file. Fixes #9292 Fixes #8057 Fixes #2129
2021-10-10linkers: reorganize Ar linker into a base classEli Schwartz1-29/+24
The `init__()` method basically existed solely to be overridden by every derivative class. Better to use it only in the class that needs it. This fixes several warnings, including missing calls to init because we skipped ArLinker due to not wanting it... also get rid of a pointless popen return code saved as pc, which we never checked.
2021-10-03fix typo in error message breaking newline escapeEli Schwartz1-1/+1
Broken in commit 3feaea6b29197cd224fbce0ac65fd43d08c3beac.
2021-10-02Improve linker detection failure error message.Jussi Pakkanen1-3/+5
2021-09-10Comments on nagfor options setup.Mat Cross1-1/+8
2021-09-10Implemented some missing operation for the NAG Fortran Compiler.Mat Cross2-0/+32
2021-08-31pylint: turn on superflous-parensDylan Baker1-1/+1
We have a lot of these. Some of them are harmless, if unidiomatic, such as `if (condition)`, others are potentially dangerous `assert(...)`, as `assert(condtion)` works as expected, but `assert(condition, message)` will result in an assertion that never triggers, as what you're actually asserting is `bool(tuple[2])`, which will always be true.
2021-07-18Cuda: Fix linking with shared versioned internal libsDavid Seifert1-2/+6
2021-07-18Merge pull request #8996 from bonzini/fix8746Jussi Pakkanen1-24/+11
Do not add SONAME to shared modules
2021-07-17Update linkers.pyIan Harvey1-0/+6
Add /subsystem:xxx to xilink command line, either as specified in the build settings or as "console" by default.
2021-07-14linkers: remove is_shared_module argument to get_soname_argsPaolo Bonzini1-22/+11
The argument is now unused, drop it.
2021-07-14do not add SONAME to shared modulesPaolo Bonzini1-2/+0
For an ELF targets, shared_module() builds a module with SONAME field (using -Wl,-soname argument). This is wrong: only the shared_library() needs SONAME, while shared_module() does not. Moreover, tools such as debian's dpkg-shlibdeps use presence of SONAME field as an indicator that this is shared library as opposed to shared module (e.g., for the module it is okay to have unresolved symbols which are imported from the executable which loads the module, while a library should have all symbols resolved). This was in fact already the behavior on Darwin; extend it to ELF targets as well. Fixes: #8746 Reported-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-07-05condense linesEli Schwartz1-6/+3
2021-07-05simplify mesonlib imports for the sake of line lengthsEli Schwartz1-11/+12
2021-07-05more f-strings too complex to be caught by pyupgradeEli Schwartz1-4/+4
2021-07-01C2000: linker uses now binary setting defined within the cross-filemiebka1-2/+2
2021-06-25Split compiler detection from EnvironmentDaniel Mensinger2-0/+227
This moves all the compiler detection logic into the new compilers.detect module. This dramatically reduces the size and complexity of Environment.
2021-06-25linkers: move linkers.py into the linkers packageDaniel Mensinger2-0/+1544