Commit Graph

6 Commits

Author SHA1 Message Date
Dylan Baker c0db0b73da Implement rustc controlled whole-archive linking
Rustc as of version 1.61.0 has support for controlling when
whole-archive linking takes place, previous to this it tried to make a
good guess about what you wanted, which worked most of the time. This is
now implemented.

Additionally, rustc makes some assumptions about library names
(specifically static names), that meson does not keep. This can be fixed
with rustc 1.67, where a new +verbatim modifier has been added. We can
then force rustc to use the name we give it. Before that, we can sneak
through `/WHOELARCHIVE:` in cases of dynamic linking (into a dll or
exe), but we can't force the archiver to do what we want (rustc
considers the archiver to be an implementation detail). The only
solution I can come up with is to copy the library to the format that
rustc expects. I've run into some issues with that as well, so we warn
in that case.

The decisions to leave static into static broken on MSVC for 1.61–1.66
was made because:

 1) The work around is non-trivial, and we would have to support that
    workaround for a long time
 2) The number of users of Rust in Meson is small
 3) The number of users of Rust in Meson on Windows, with MSVC is tiny
 4) Using rustup to update rustc on windows is trivial, and solves the
    problem completely

Fixes: #10723
Fixes: #11247

Co-authored-by: Nirbheek Chauhan <nirbheek@centricular.com>
2023-02-22 15:35:50 -08:00
Daniel Mensinger 8e60b8c146
test: merge installed_files.txt into test.json 2020-02-25 21:47:42 +01:00
Jussi Pakkanen 94ca81b228 Add Rust generated pdbs to list of installed files. 2019-06-21 23:11:56 +03:00
Nirbheek Chauhan 45c8557dc6 Fix tests for the new library/executable naming scheme
Also add new tests for the platform-specific and compiler-specific
versioning scheme.

A rough summary is:

1. A bug in how run_tests.py:validate_install checked for files has been
   fixed. Earlier it wasn't checking the install directory properly.
2. Shared libraries are no longer installed in common tests, and the
   library name/path testing is now done in platform-specific tests.
3. Executables are now always called something?exe in the
   installed_files.txt file, and the suffix automatically corrected
   depending on the platform.
4. If a test installs a file called 'no-installed-files', the installed
   files for that test are not validated. This is required to implement
   compiler-specific tests for library names/paths such as MSVC vs MinGW
5. The platform-specific file renaming in run_tests.py has been mostly
   removed since it is broken for shared libraries and isn't needed for
   static libraries.
6. run_tests.py now reports all missing and extra files. The logic for
   finding these has been reworked.
2016-07-01 20:50:47 +05:30
Jussi Pakkanen d952812b1b Fix Rust to work with 1.3 release. Closes #277. 2015-10-11 23:30:52 +03:00
Jussi Pakkanen 2d23a44e6e Deal with Rust static libraries, too. 2014-06-23 20:53:20 +03:00