[Buildroot] Building cargo with per-package directories

Eric Le Bihan eric.le.bihan.dev at free.fr
Thu Dec 27 20:50:15 UTC 2018


On 2018-12-26 15:49, Thomas Petazzoni wrote:
> Hello Eric,
>
> On Wed, 12 Dec 2018 23:50:41 +0100, Eric Le Bihan wrote:
>
> > diff --git a/package/cargo/cargo.mk b/package/cargo/cargo.mk
> > index 1b1053ba41..891901578e 100644
> > --- a/package/cargo/cargo.mk
> > +++ b/package/cargo/cargo.mk
> > @@ -70,7 +70,7 @@ HOST_CARGO_SNAP_OPTS = \
> >  	$(if $(VERBOSE),--verbose)
> >
> >  HOST_CARGO_ENV = \
> > -	RUSTFLAGS="-Clink-arg=-Wl,-rpath,$(HOST_DIR)/lib" \
> > +	RUSTFLAGS="-Clink-arg=-Wl,-rpath,$(HOST_DIR)/lib -Clink-arg=-L$(HOST_DIR)/lib" \
> >  	CARGO_HOME=$(HOST_CARGO_HOME)
> >
> >  define HOST_CARGO_BUILD_CMDS
> > ```
> >
> > [1] https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script
>
> Thanks a lot, I was finally able to test this, and confirm it works
> fine.
>
> I propose to change it to:
>
> 	RUSTFLAGS="$(addprefix -Clink-arg=,$(HOST_LDFLAGS))"
>
> so that if we ever change HOST_LDFLAGS in the future, it will continue
> to work. What do you think ?

I tested this change without issues, so I will post a patch to include
it in the cargo package.

Regards,

--
ELB


More information about the buildroot mailing list