All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: James Hilliard <james.hilliard1@gmail.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v3 1/1] package/pkg-cargo: ensure host/target rustflags are properly split
Date: Mon, 10 Apr 2023 18:40:31 +0200	[thread overview]
Message-ID: <20230410164031.GC2819@scaer> (raw)
In-Reply-To: <20230410083252.138426-1-james.hilliard1@gmail.com>

James, all,

On 2023-04-10 02:32 -0600, James Hilliard spake thusly:
> Set HOST_LDFLAGS RUSTFLAGS via the host-config feature, see:
> https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#host-config
> 
> We have to enable this nightly feature first using:
> CARGO_UNSTABLE_HOST_CONFIG="true"
> 
> Separately set target RUSTFLAGS for the target triple specific env
> variable.
> 
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>

FTR, Arnout did a review of a previous iteration, and proposed a commt
log with a lot more details and explanations on the actual reasons why
we have to do this change:

    https://lore.kernel.org/buildroot/0a2e0dd8-b579-644a-9d83-af88e40d40de@mind.be/

Could you please reveview what he wrote, and incorporate that in your
commit log (and amend/extend further if needed), and then respin,
please?

Regards,
Yann E. MORIN.

> ---
> Changes v2 -> v3:
>   - rebase
> Changes v1 -> v2:
>   - add RUSTFLAGS to HOST_PKG_CARGO_ENV
> ---
>  package/pkg-cargo.mk | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/package/pkg-cargo.mk b/package/pkg-cargo.mk
> index 5600c8e97e..264bf5a1ae 100644
> --- a/package/pkg-cargo.mk
> +++ b/package/pkg-cargo.mk
> @@ -34,7 +34,10 @@ PKG_COMMON_CARGO_ENV = \
>  # using nighly features on stable releases, i.e features that are not
>  # yet considered stable.
>  #
> -# CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" "enables the nightly
> +# CARGO_UNSTABLE_HOST_CONFIG="true" enables the host specific
> +# configuration feature
> +#
> +# CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" enables the nightly
>  # configuration option target-applies-to-host value to be set
>  #
>  # CARGO_TARGET_APPLIES_TO_HOST="false" is actually setting the value
> @@ -43,9 +46,11 @@ PKG_COMMON_CARGO_ENV = \
>  PKG_CARGO_ENV = \
>  	$(PKG_COMMON_CARGO_ENV) \
>  	__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS="nightly" \
> +	CARGO_UNSTABLE_HOST_CONFIG="true" \
>  	CARGO_UNSTABLE_TARGET_APPLIES_TO_HOST="true" \
>  	CARGO_TARGET_APPLIES_TO_HOST="false" \
>  	CARGO_BUILD_TARGET="$(RUSTC_TARGET_NAME)" \
> +	CARGO_HOST_RUSTFLAGS="$(addprefix -C link-args=,$(HOST_LDFLAGS))" \
>  	CARGO_TARGET_$(call UPPERCASE,$(RUSTC_TARGET_NAME))_LINKER=$(notdir $(TARGET_CROSS))gcc
>  
>  #
> @@ -53,7 +58,8 @@ PKG_CARGO_ENV = \
>  # and should be removed when fixed upstream
>  #
>  ifeq ($(NORMALIZED_ARCH),arm)
> -	PKG_CARGO_ENV += RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition"
> +	PKG_CARGO_ENV += \
> +		CARGO_TARGET_$(call UPPERCASE,$(RUSTC_TARGET_NAME))_RUSTFLAGS="-Clink-arg=-Wl,--allow-multiple-definition"
>  endif
>  
>  HOST_PKG_CARGO_ENV = \
> -- 
> 2.34.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2023-04-10 16:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-10  8:32 [Buildroot] [PATCH v3 1/1] package/pkg-cargo: ensure host/target rustflags are properly split James Hilliard
2023-04-10 16:40 ` Yann E. MORIN [this message]
2023-04-10 19:02   ` Arnout Vandecappelle
2023-04-10 20:19     ` James Hilliard
2023-04-11  7:40 ` Arnout Vandecappelle
2023-04-23  9:04   ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230410164031.GC2819@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=james.hilliard1@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.