linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rust: Allow reusing locally installed gpio library
@ 2023-01-24  8:23 Viresh Kumar
  2023-01-24  9:16 ` Bartosz Golaszewski
  0 siblings, 1 reply; 3+ messages in thread
From: Viresh Kumar @ 2023-01-24  8:23 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Kent Gibson
  Cc: Viresh Kumar, Vincent Guittot, linux-gpio, Alex Bennée

The rust crates builds fine when built with the 'make' command, as
static linking works fine. But when referenced from a remote rust crate,
it gives following error:

error: could not find native static library `gpiod`, perhaps an -L flag is missing?

This happens since we only support 'static' LIB-KIND currently. Remove
the same to allow others to work too.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 bindings/rust/libgpiod-sys/build.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bindings/rust/libgpiod-sys/build.rs b/bindings/rust/libgpiod-sys/build.rs
index 274069eb9e9d..e3ed04afa141 100644
--- a/bindings/rust/libgpiod-sys/build.rs
+++ b/bindings/rust/libgpiod-sys/build.rs
@@ -37,5 +37,5 @@ fn main() {
     generate_bindings();
 
     println!("cargo:rustc-link-search=./../../lib/.libs/");
-    println!("cargo:rustc-link-lib=static=gpiod");
+    println!("cargo:rustc-link-lib=gpiod");
 }
-- 
2.31.1.272.g89b43f80a514


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] rust: Allow reusing locally installed gpio library
  2023-01-24  8:23 [PATCH] rust: Allow reusing locally installed gpio library Viresh Kumar
@ 2023-01-24  9:16 ` Bartosz Golaszewski
  2023-01-24  9:18   ` Viresh Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Bartosz Golaszewski @ 2023-01-24  9:16 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Linus Walleij, Kent Gibson, Vincent Guittot, linux-gpio,
	Alex Bennée

On Tue, Jan 24, 2023 at 9:24 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> The rust crates builds fine when built with the 'make' command, as
> static linking works fine. But when referenced from a remote rust crate,
> it gives following error:
>
> error: could not find native static library `gpiod`, perhaps an -L flag is missing?
>
> This happens since we only support 'static' LIB-KIND currently. Remove
> the same to allow others to work too.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  bindings/rust/libgpiod-sys/build.rs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/bindings/rust/libgpiod-sys/build.rs b/bindings/rust/libgpiod-sys/build.rs
> index 274069eb9e9d..e3ed04afa141 100644
> --- a/bindings/rust/libgpiod-sys/build.rs
> +++ b/bindings/rust/libgpiod-sys/build.rs
> @@ -37,5 +37,5 @@ fn main() {
>      generate_bindings();
>
>      println!("cargo:rustc-link-search=./../../lib/.libs/");
> -    println!("cargo:rustc-link-lib=static=gpiod");
> +    println!("cargo:rustc-link-lib=gpiod");
>  }
> --
> 2.31.1.272.g89b43f80a514
>

I don't understand how that works very well but I trust you know what
you're doing so applied.

Bart

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] rust: Allow reusing locally installed gpio library
  2023-01-24  9:16 ` Bartosz Golaszewski
@ 2023-01-24  9:18   ` Viresh Kumar
  0 siblings, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2023-01-24  9:18 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Linus Walleij, Kent Gibson, Vincent Guittot, linux-gpio,
	Alex Bennée

On 24-01-23, 10:16, Bartosz Golaszewski wrote:
> I don't understand how that works very well but I trust you know what
> you're doing so applied.

Thanks. Here are some details:

https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-liblib

-- 
viresh

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-24  9:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-24  8:23 [PATCH] rust: Allow reusing locally installed gpio library Viresh Kumar
2023-01-24  9:16 ` Bartosz Golaszewski
2023-01-24  9:18   ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).