From 43f24060f3e0065b44b1909d88bcc8e2882e9e5e Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 21 Jun 2023 12:02:06 -0700 Subject: modules/rust: Add a `link_with` kwarg to the test method This was requested by Mesa, where a bunch of `declare_dependency` objects are being created as a workaround for the lack of this keyword --- docs/markdown/snippets/rust_test_link_with.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 docs/markdown/snippets/rust_test_link_with.md (limited to 'docs/markdown/snippets') diff --git a/docs/markdown/snippets/rust_test_link_with.md b/docs/markdown/snippets/rust_test_link_with.md new file mode 100644 index 0000000..9c2b7d6 --- /dev/null +++ b/docs/markdown/snippets/rust_test_link_with.md @@ -0,0 +1,4 @@ +## Add a `link_with` keyword to `rust.test()` + +This can already be be worked around by creating `declare_dependency()` objects +to pass to the `dependencies` keyword, but this cuts out the middle man. -- cgit v1.1 From c5b16ab8b957d53b75c73bb24144a4f61c86234d Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 21 Jun 2023 12:15:07 -0700 Subject: modules/rust: Add a machine file property for extra clang args with bindgen It's currently impossible to inject extra clang arguments when using bindgen, which is problematic when cross compiling since you may need critical arguments like `--target=...`. Because such arguments must be passed after the `--` it's impossible to inject them currently without going to something like a wrapper script. Fixes: #11805 --- docs/markdown/snippets/rust_extra_clang_bindgen_arguments.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 docs/markdown/snippets/rust_extra_clang_bindgen_arguments.md (limited to 'docs/markdown/snippets') diff --git a/docs/markdown/snippets/rust_extra_clang_bindgen_arguments.md b/docs/markdown/snippets/rust_extra_clang_bindgen_arguments.md new file mode 100644 index 0000000..71268d4 --- /dev/null +++ b/docs/markdown/snippets/rust_extra_clang_bindgen_arguments.md @@ -0,0 +1,8 @@ +## A machine file may be used to pass extra arguments to clang in a bindgen call + +Because of the way that bindgen proxies arguments to clang the only choice to +add extra arguments currently is to wrap bindgen in a script, since the +arguments must come after a `--`. This is inelegant, and not very portable. Now +a `bindgen_clang_arguments` field may be placed in the machine file for the host +machine, and these arguments will be added to every bindgen call for clang. This +is intended to be useful for things like injecting `--target` arguments. -- cgit v1.1 From 5d16bd5308f0edd9d53b82ff6a961241c7188423 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 22 Jun 2023 09:56:11 -0700 Subject: modules/rust: Add a keyword argument to pass extra args to the rust compiler This may be necessary to, for example, stop rustc complaining about unused functions --- docs/markdown/snippets/rust_bindegen_extra_args.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 docs/markdown/snippets/rust_bindegen_extra_args.md (limited to 'docs/markdown/snippets') diff --git a/docs/markdown/snippets/rust_bindegen_extra_args.md b/docs/markdown/snippets/rust_bindegen_extra_args.md new file mode 100644 index 0000000..209d0bc --- /dev/null +++ b/docs/markdown/snippets/rust_bindegen_extra_args.md @@ -0,0 +1,3 @@ +## rust.bindgen allows passing extra arguments to rustc + +This may be necessary to pass extra `cfg`s or to change warning levels. -- cgit v1.1