aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/linkers.py
AgeCommit message (Collapse)AuthorFilesLines
2020-08-25Merge pull request #7581 from peterh/aixJussi Pakkanen1-0/+44
Add AIX support
2020-08-22Merge pull request #7447 from scivision/nvcJussi Pakkanen1-1/+5
Add support for NVidia HPC SDK compilers
2020-08-12aix: allow both 32-bit and 64-bit objects in a static libraryPeter Harris1-0/+12
Without the -Xany flag, the ar command will complain when an .o file is compiled for the non-default bit width. This change is necessary to allow 64-bit builds via a native (or cross) file.
2020-08-12aix: detect and support the AIX dynamic linkerPeter Harris1-0/+32
2020-08-02Make meson recognize the Qualcomm LLVM toolchainAntony Chan1-0/+6
Meson calls `path/to/clang++ --version` to guess which build toolchain the user has picked to build the source code. For the Qualcomm LLVM toolchain, the output have an unusual output as shown below: ``` clang version 8.0.12 Snapdragon LLVM ARM Compiler 8.0.12 (based on llvm.org 7.0+) Target: arm-unknown-linux-gnueabi Thread model: posix Repository: (ssh://git-hexagon-aus.qualcomm.com:...) InstalledDir: /pkg/qct/software/llvm/release/arm/8.0.12/bin ``` Another unusual pattern is the output of `path/to/ld.qcld --version`: ``` ARM Linker from Snapdragon LLVM ARM Compiler Version 8.0.12 ARM Linker based on LLVM version: 8.0 ``` The Meson logic is modified accordingly so that Meson can correctly determine toolchain as "LLVM aarch64 cross-compiler on GNU/Linux64 OS". This is the expected output of `meson --native-file native_file.ini --cross-file cross_file.ini build/aarch64-debug/`: ``` ... C++ compiler for the host machine: ... (clang 8.0.12 "clang version 8.0.12") C++ linker for the host machine: ... ld.lld 8.0.12 ... ```
2020-07-14Merge pull request #7422 from alanc/solaris-fixesJussi Pakkanen1-1/+7
Solaris fixes revisited
2020-07-13Fix native builds on Windows ARM64 machinesNirbheek Chauhan1-13/+0
I made the mistake of always selecting the debug CRT for compiler checks on Windows 4 years ago: https://github.com/mesonbuild/meson/pull/543 https://github.com/mesonbuild/meson/pull/614 The idea was to always build the tests with debugging enabled so that the compiler doesn't optimize the tests away. But we stopped doing that a while ago, and also the debug CRT has no relation to that. We should select the CRT in the same way that we do for building targets: based on the options. On Windows ARM64, the debug CRT for ARM64 isn't always available, and the release CRT is available only after installing the runtime package. Without this, we will always try to pick the debug CRT even when --buildtype=debugoptimized or release.
2020-07-13add Nvidia HPC SDK compilersMichael Hirsch, Ph.D1-1/+5
2020-07-07SolarisDynamicLinker: Check if linker supports -z type=pieAlan Coopersmith1-1/+7
As suggested by dcbaker in https://github.com/mesonbuild/meson/pull/7370#discussion_r445145889 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-06-22SolarisDynamicLinker: add get_asneeded_args() & get_pie_args()Alan Coopersmith1-0/+7
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-06-22compilers: Return CompilerArgs from compiler instanceDylan Baker1-0/+4
Since the CompileArgs class already needs to know about the compiler, and we really need at least per-lanaguage if not per-compiler CompilerArgs classes, let's get the CompilerArgs instance from the compiler using a method.
2020-06-11apple: -headerpad args are ignored when bitcode is enabledNirbheek Chauhan1-5/+7
Causes spammy warnings from the linker: ld: warning: -headerpad_max_install_names is ignored when used with -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES)
2020-06-05gnulike linkers (and ar) accept rsp files.Dan Kegel1-0/+7
2020-05-16Let .pc files specify rpath.Dan Kegel1-22/+27
Fixes #4027
2020-05-08Do not pass rpath flags to wasm-ldAndrei Alexeyev1-0/+5
2020-04-21switch python2 %s for python3 .formatMichael1-6/+6
2020-03-23Fix legacy env var support with crossJohn Ericson1-7/+15
Fix #3969
2020-03-21-Add xc16 and c2000 C,Cpp toolchain supportalanNz1-0/+111
2020-03-12Merge pull request #6356 from dcbaker/fix-d-compiler-abstractionsJussi Pakkanen1-2/+13
Fix d compiler abstractions
2020-03-09linkers: Allow optlink to be invoked indirectlyDylan Baker1-2/+9
2020-03-09linkers: Move import_library_args to from VS compiler to linkerDylan Baker1-0/+4
This is the argument to name the implib when using the Visual Studio Linker. This is needed by LDC and DMD when using link.exe or lld-link.exe on windows, and is really a linker argument not a compiler argument.
2020-02-27compilers/linkers: Add a representation for wasm-ldDylan Baker1-0/+29
Emscripten does have a stand alone linker, wasm-ld. This patch adds the linker, adds detection for the linker, and removes the IsLinkerMixin for emscripten. This is a little more correct, and makes the code a lot cleaner and more robust.
2020-02-23Merge pull request #6637 from ↵Jussi Pakkanen1-3/+12
mesonbuild/nirbheek/implement-symbolextractor-windows Implement symbolextractor on windows + some cleanups/fixes
2020-02-22ninjabackend: List PDBs in output list for targetsNirbheek Chauhan1-3/+12
This is more correct, and forces the target(s) to be rebuilt if the PDB files are missing. Increases the minimum required Ninja to 1.7, which is available in Ubuntu 16.04 under backports. We can't do the same for import libraries, because it is impossible for us to know at configure time whether or not an import library will be generated for a given DLL.
2020-02-21linkers: Update the linker names to be more consistentDylan Baker1-13/+37
This makes two basic changes, 1 it moves the name of the linker into the linker class, this should reduce the number of errors and typos, and ensure that a linker always has one name. This then renames the linkers to have more consistent names. Posix/gnu linkers are called ld.<name>: ld.gold, ld.lld, ld.solaris. Apple linkers are renamed ld64.
2020-02-18linkers: typing -> T fixupDylan Baker1-1/+1
There was a particularly old MR merged, from before the typing -> T standardization in meson.
2020-02-18Don't pass --allow-shlib-undefined to lld if it's not supportedAndrei Alexeyev1-1/+12
Fixes builds with llvm-mingw
2020-02-15msvc: add prefix to build type argumentsDmitry Kozlyuk1-0/+3
2020-01-30-Fixed Renesas RX Family compiler to work with latest meson, updated ↵alanNz1-1/+2
cross-file, fixed assembly file use
2020-01-22vs: Write checksums in PE binaries (DLLs and EXEs)Nirbheek Chauhan1-0/+3
This is needed for detecting data corruption, and its absence (or an incorrect value) is also used as a hint by anti-viruses that the binary may be malware. Flag is only supported by MSVC `link.exe`, not `lld-link.exe` https://docs.microsoft.com/en-us/cpp/build/reference/release-set-the-checksum
2020-01-22linkers: Accept both str and List[str] for _apply_prefixNirbheek Chauhan1-6/+10
Simplifies some usage.
2020-01-22linkers: Clarify a comment about rspfilesNirbheek Chauhan1-1/+2
2020-01-08types: import typing as T (fixes #6333)Daniel Mensinger1-156/+156
2019-12-18linkers: Remove get_allow_undefined_args from link.exeDylan Baker1-2/+1
PE DLLs don't work like elf or mach-o, there's no way to define symbols at run time, they must all be defined as import or export at link time. As such there's no value in being able to have undefined symbols in MSVC, nor does meson expose an option to change them Fixes: #6342
2019-12-12Consider compiler arguments in linker detection logicDylan Baker1-9/+0
If a user passes -fuse-ld=gold to gcc or clang, they expect that they'll get ld.gold, not whatever the default is. Meson currently doesn't do that, because it doesn't pass these arguments to the linker detection logic. This patch fixes that. Another case that this is needed is with clang's --target option This is a bad solution, honestly, and it would be better to use $LD or a cross/native file but this is needed for backwards compatability. Fixes #6057
2019-12-11Merge pull request #6207 from dcbaker/linker-optionJussi Pakkanen1-39/+30
Add a way to select the dynamic linker meson uses
2019-12-05Partially revert "lgtm: fix Missing call to __init__ during object ↵Dylan Baker1-19/+16
initialization" This partially reverts commit fe853ee516e1e7b392753a6e8f1f0b9cad6fb54f. In particular this reverts the changes to the DynamicLinker __init__ methods. Frankly this is *bad* because it allows a mixin class (which should not be directly instantiated) to be directly instantiated, and complicates the init process. It also increases the amount of code for zero gain, and makes the code less resilient to refactors.
2019-12-05lgtm: fix Missing call to __init__ during object initializationDaniel Mensinger1-17/+20
Either mark the missing calls as intentional, or explicetly call the right __init__ method and avoid mixing super() and explicit base calss calls.
2019-12-03linkers: make constructor signature of VisualStudioLike linkers the sameDylan Baker1-4/+6
2019-12-03linkers: Correct MSVC-like linkers invoke directly flagDylan Baker1-1/+1
This is returning the inverse of the correct value, which happens to work out because in general the compilers that a link.exe-like linker is paired with accepts the same arguments.
2019-12-03Intel: Dump worthless Xild abstractionsDylan Baker1-22/+7
This dumps xild on mac and linux. After a lot of reading and banging my head I've discovered we (meson) don't care about xild, xild is only useful if your invoke ld directly (not through icc/icpc) and you want to do ipo/lto/wpo. Instead just make icc report what it's actually doing, invoking ld or ld64 (for linux and mac respectively) directly. This allows us to get -fuse-ld working on linux.
2019-12-02Allow selecting the dynamic linkerDylan Baker1-12/+16
This uses the normal meson mechanisms, an LD environment variable or via cross/native files. Fixes: #6057
2019-12-02linkers: Fix Apple and VS-like linkers always_argsDylan Baker1-2/+2
Which would not call the super() method, thus overriding the default behavior when it should have instead extended it.
2019-11-29linkers: AppleDynamicLinker supports -pie.Mihai Moldovan1-0/+3
The linker implementation split up introduced a regression: since the AppleDynamicLinker subclass doesn't expose PIE support, builds using that feature just plainly fail. Add back support for it using the default and supported -pie flag.
2019-11-25dep: MPI make work for intel-cl and improve robustnessMichael Hirsch, Ph.D1-1/+0
optimize intelMPI variables mpi: extract version from non-OpenMPI wrapper
2019-11-19Enable code coverage using LLVM on macOS CatalinaKurtis Rader1-0/+4
Fixes #6188
2019-11-08pass sanitize option to linker on macOSmfurukawa1-0/+5
2019-11-06Fix typos found by codespellWolfgang Stöggl1-1/+1
- Typos were found by codespell v1.16.0
2019-10-09Merge pull request #5833 from dcbaker/remove-compiler-typeJussi Pakkanen1-1/+1
Remove compiler type
2019-10-08linkers: Concatenate -L and the directoryDylan Baker1-1/+1
It is perfectly valid to pass the arguments separately `-L /some/dir/`, however, meson later groups arguments by whether they start with -L or not, which breaks passing the -L and the directory separately. Fixes #6003