meson/test cases/rust
Alyssa Ross ab17bd2393 rust: fix -C prefer-dynamic behavior
I noticed when building a project that uses a proc macro that Meson
passed -C prefer-dynamic for the executable, and not the proc macro,
while cargo passed -C prefer-dynamic for the proc macro, but not for
the executable.  Meson's behavior broke setting -C panic=abort on the
executable.

As far as we can tell, because we explicitly pass each library path to
rustc, the only thing -C prefer-dynamic affects in Meson is how the
standard libraries are linked.  Generally, one does not want the
standard libraries to be dynamically linked, because if the Rust
compiler is ever updated, anything linked against the old standard
libraries will likely break, due to the lack of a stable Rust ABI.
Therefore, I've reorganised Meson's behavior around the principle that
the standard libraries should only be dynamically linked when Rust
dynamic linking has already been opted into in some other way.  The
details of how this manifests are now explained in the documentation.
2023-06-21 18:05:16 -04:00
..
1 basic rust: add support for b_ndebug 2023-04-21 15:18:56 +05:30
2 sharedlib Implement rustc controlled whole-archive linking 2023-02-22 15:35:50 -08:00
3 staticlib Implement rustc controlled whole-archive linking 2023-02-22 15:35:50 -08:00
4 polyglot Fix typos discovered by codespell 2021-10-10 16:12:25 -04:00
5 polyglot static rust: Add system libs used by rust std to staticlib external deps 2023-05-20 10:35:42 -04:00
6 named staticlib test: merge installed_files.txt into test.json 2020-02-25 21:47:42 +01:00
7 private crate collision test: merge installed_files.txt into test.json 2020-02-25 21:47:42 +01:00
8 many files Support Rust targets with more than one source file. Closes #3632. 2018-06-17 15:39:59 +03:00
9 unit tests fix various spelling issues 2023-04-11 19:21:05 -04:00
10 language stds rust: implement support for --edition 2020-11-05 21:24:20 +02:00
11 generated main tests/rust: Add a generated library to generated main test 2021-01-21 10:59:15 -08:00
12 bindgen propagate the most accurate node to error messages 2023-04-04 15:06:17 -04:00
13 external c dependencies Make `dependency('foo', static: true, method: 'cmake') link statically 2023-05-13 11:18:11 +03:00
14 external libm Fix typos discovered by codespell 2021-10-10 16:12:25 -04:00
15 polyglot sharedlib Add test to build a mixed C/Rust shared library. 2021-03-10 14:55:57 -08:00
16 internal c dependencies rust: Don't pass dependency compile arguments to the compiler 2023-04-14 06:11:44 -04:00
17 staticlib link staticlib rust: Add new `rust_dependency_map` target configuration 2023-04-21 15:35:06 -04:00
18 proc-macro rust: fix -C prefer-dynamic behavior 2023-06-21 18:05:16 -04:00
19 structured sources fix various spelling issues 2023-04-11 19:21:05 -04:00