| Age | Commit message (Collapse) | Author |
|
This adds support for DEF files to rust and removes
some hasattr duck typing.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
.def files are a linker concept, and they should not be shoehorned
into the Compiler.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
|
|
|
|
|
|
Same logic as the openmp flags
|
|
I've done the compile and link flags in one commit since they're so
closely related
|
|
|
|
For the same reason that the StaticLinker needs this, we need it in the
DynamicLinker as well.
|
|
There are a number of places where we treat StaticLinker and Compiler as
polymorphic, as such the StaticLinker cannot need extra parameters.
|
|
1. Generate OMF objs with `-Zomf' compiler flags
2. Generate OMF libs with `.lib' suffix using `emxomfar' as a librarian
|
|
|
|
|
|
No other linker warns for duplicate libraries, and (especially with
rustc) specifying --fatal-warnings may cause the warnings to trigger
and a wrong result from has_multi_link_arguments.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
The Microchip XC32 compiler is a GCC-based compiler implemented using
existing GNU compiler classes. As the XC32 version and GCC version do
not match mixins have been implemented to override versions used in
versions checks where applicable.
|
|
According to https://clang.llvm.org/docs/CommandGuide/clang.html#cmdoption-flto,
the -object_path_lto flag is needed to preserve the intermediate object
files.
|
|
|
|
Allow adding extra directories to the rpath. Rust needs this when Rustup
is in use.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
ELD is Qualcomm's open-source embedded linker.
https://github.com/qualcomm/eld
Signed-off-by: Kushal Pal <kushpal@qti.qualcomm.com>
|
|
```
$ LDFLAGS="-fuse-ld=lld" meson setup builddir/
[...]
linker = lld_cls(
compiler, for_machine, comp_class.LINKER_PREFIX, override, system=system, version=v)
TypeError: LLVMDynamicLinker.__init__() got an unexpected keyword argument 'system'
```
Fixes regression in commit cece1a7e9992a3bbcc35f90777ba22ba9d62b538. We
pass system=system to the linker construction, which worked fine for
Apple LLVM LD64 as that inherited `__init__` from DynamicLinker. But
non-Apple LLD had an overridden `__init__` which wasn't adapted.
Even if it is thrown away and never used, since LLVM isn't an Apple
linker, we still need to obey the argument contract.
|
|
iOS should not use -undefined,dynamic_lookup; whereas macOS should revert from
-dynamiclib to -bundle, as was the case before commit cfb5a48e0 ("linkers: darwin:
do not use -bundle for shared_modules", 2025-03-24), because Postgres wants to
use -bundle_loader and that is only possible together with -bundle.
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Apple linkers need to use different arguments on macOS and iOS-like platforms.
Pass the system to the constructor so that it can be examined.
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
In AIX, when we use ar -q to archive then if there is a shared object already existing with the same name a duplicate one is created if one tries to archive again.
Meson archives shared library during build time and relinks again during install time. At this stage when shared object is again made and archived again, creating two shared objects in the archive.
When we use "ar -rs" then we ensure it is only one.
Reference: https://www.ibm.com/docs/en/aix/7.1?topic=ar-command
This patch is a fix to the same.
Before patch output:
rwxr-xr-x 0/0 5018 Apr 14 05:57 2025 libmylib.so
rwxr-xr-x 0/0 5018 Apr 14 05:58 2025 libmylib.so
After patch output:
rwxr-xr-x 0/0 5018 Apr 14 07:23 2025 libmylib.so
|
|
Use the custom suffix instead of .dylib, so that executables that are linked to
a custom-suffix library can be ran from the build tree.
Fixes: #14470
|
|
This will be used by rustdoc tests because the Test objects takes a
single string for the command and everything else goes in the args.
But apart from this, the need to split the executable from the
arguments is common so create new methods to do it.
While at it, fix brokenness in the handling of the zig compiler, which
is checking against "zig" but failing to detect e.g. "/usr/bin/zig".
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Both dynamic libraries and bundles these days can be dynamically loaded
using the dl APIs (e.g. dlopen, dlclose). It is not possible to include
bundles on a linker command line as if they were shared libraries,
but that's pretty much the only difference.
However, bundles fail the Apple verification for iOS:
2025-02-10 13:54:09.095 ERROR: Validation failed (409) The binary is invalid.
The executable 'Runner.app/Frameworks/numpy._core._operand_flag_tests.framework/numpy._core._operand_flag_tests'
has type 'BUNDLE' that is not valid. Only 'EXECUTE' is permitted.
2025-02-10 13:54:09.096 ERROR: Validation failed (409) Missing load commands.
The executable at 'Runner.app/Frameworks/numpy._core._operand_flag_tests.framework'
does not have the necessary load commands. Try rebuilding the app with the latest
Xcode version. If you are using third party development tools, contact the provider.
So switch to -dynamiclib for shared modules as well.
Fixes: #14240
|
|
More specifically, the bug had been fixed shortly before we implemented
this workaround. It's documented as only necessary for the binutils
brand specifically, and was fixed upstream in 2.28. We can avoid
producing these arguments at all on newer (post-2016) versions of
binutils, so gate this behind a version check.
This can significantly reduce the size of compiler command lines in some
cases, as it encodes the full build directory. It also helps that one
person who decides to put commas into their build directory name (which
`-Wl,...` interprets as multiple arguments, rather than a single
directory string).
Bug: https://github.com/mesonbuild/meson/pull/1898
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=20535
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=16936
|
|
In the preceding commit we have started to perform compiler checks for
the value of `b_sanitize`, which allows us to detect sanitizers that
aren't supported by the compiler toolchain. But we haven't yet loosened
the option itself to accept arbitrary values, so until now it's still
only possible to pass sanitizer combinations known by Meson, which is
quite restrictive.
Lift that restriction by adapting the `b_sanitize` option to become a
free-form array. Like this, users can pass whatever combination of
comma-separated sanitizers to Meson, which will then figure out whether
that combination is supported via the compiler checks. This lifts a
couple of restrictions and makes the supporting infrastructure way more
future proof.
A couple of notes regarding backwards compatibility:
- All previous values of `b_sanitize` will remain valid as the syntax
for free-form array values and valid combo choices is the same. We
also treat 'none' specially so that we know to convert it into an
empty array.
- Even though the option has been converted into a free-form array,
callers of `get_option('b_sanitize')` continue to get a string as
value. We may eventually want to introduce a kwarg to alter this
behaviour, but for now it is expected to be good enough for most use
cases.
Fixes #8283
Fixes #7761
Fixes #5154
Fixes #1582
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
|
|
|
|
rpaths are calculated in bytes, and that's also how depfixer processes
them. We need to ensure that the ascii padding we use (bytes == unicode)
is the correct offset for the install rpath - build rpath (both
specified in unicode which then gets converted to bytes).
In the event of a unicode install_rpath, we can get into a situation
where the install rpath is longer than the padding, since we assumed
that the install_rpath was shorter than it actually is -- because we
counted the length in characters instead of the length in bytes.
This then broke installation for people who e.g. install into a prefix
inside their home directory, when their home directory contains
multibyte unicode characters.
Bug: https://gitlab.gnome.org/GNOME/gnome-builder/-/issues/2280
|
|
|
|
|
|
Fix TI C2000 support
|
|
|
|
Also cleaned up redundant functions in the subclass.
|
|
Zig issue https://github.com/ziglang/zig/issues/18713
|
|
|
|
The flag was only introduced in ld 224.1, as mentioned in the initial PR
#13291.
Resolves #13543
|
|
Correct base classes so GNU-like linkers all default to supporting response files.
|
|
Co-Authored-By: L. E. Segovia <amy@amyspark.me>
|
|
Fixes: #8981
Fixes: 2be074b1d445fcd30535bcf7518f8ce0738bcbf3
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
|
|
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.
|
|
This will be needed by the Apple compiler
|
|
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
|
|
Basic support for TI Arm Clang toolchain
|
|
linkers: Fix detection of link arguments to Clang(-cl) + MSVC
|
|
|
|
|
|
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.
|