* [Buildroot] [PATCHv3] package/rustc: needs C++ compiler with musl based toolchain
@ 2022-07-27 8:37 Romain Naour
2022-07-28 14:51 ` Nicolas TRAN
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Romain Naour @ 2022-07-27 8:37 UTC (permalink / raw)
To: buildroot; +Cc: Romain Naour
While building host-rust with a musl based toolchain without C++ compiler,
the build fail since libunwind bundled in rust sources needs a C++ compiler.
cargo:warning=i686-buildroot-linux-musl-gcc.br_real: error: [...]/host-rust-1.62.0/src/llvm-project/libunwind/src/Unwind-EHABI.cpp: C++ compiler not installed on this system
Note: the issues can't be reproduced with a glibc based toolchain
without C++ probaly due to extra steps required to support musl libc.
We could add the C++ dependency direclty to host-rustc but it would
requires adding the C++ reverse dependencies to all rust packages.
Instread, we add the C++ dependency to BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
only when a musl toolchain is used. So we can still install a prebuilt
rust compiler but without the rust standard library (rust-std).
Usually we should not add toolchain dependencies in a _ARCH_SUPPORTS option but
BR2_PACKAGE_HOST_RUSTC_TARGET_TIER... options contains already some
BR2_TOOLCHAIN_USES_GLIBC or BR2_TOOLCHAIN_USES_MUSL.
Fixes:
http://autobuild.buildroot.org/results/636/636fb39c8f1b8c05e4ca451ac506cd63c7166d82
Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
v3: add a global C++ dependency to BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS (Yann)
update comment to use "C++ cross compiler"
v2: move the C++ dependency to BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
after James's review and discussion with Thomas and Arnout
---
package/rustc/Config.in.host | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/package/rustc/Config.in.host b/package/rustc/Config.in.host
index fec8726aee..822de68dbb 100644
--- a/package/rustc/Config.in.host
+++ b/package/rustc/Config.in.host
@@ -110,11 +110,15 @@ config BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_PLATFORMS
default y if BR2_sparc64 && BR2_TOOLCHAIN_USES_GLIBC
# All target rust packages should depend on this option
+# Note: With musl based toolchain, we need a C++ cross compiler to
+# build host-rust some target libraries (libunwind) from llvm source
+# code bundled in rust sources.
config BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
bool
default y if BR2_PACKAGE_HOST_RUSTC_TARGET_TIER1_PLATFORMS
default y if BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_HOST_TOOLS_PLATFORMS
default y if BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_PLATFORMS
+ depends on BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_USES_MUSL
depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
config BR2_PACKAGE_HOST_RUSTC_ARCH
--
2.34.3
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [Buildroot] [PATCHv3] package/rustc: needs C++ compiler with musl based toolchain
2022-07-27 8:37 [Buildroot] [PATCHv3] package/rustc: needs C++ compiler with musl based toolchain Romain Naour
@ 2022-07-28 14:51 ` Nicolas TRAN
2022-08-30 19:20 ` Yann E. MORIN
2022-07-28 21:07 ` James Hilliard
2022-08-30 19:16 ` Yann E. MORIN
2 siblings, 1 reply; 8+ messages in thread
From: Nicolas TRAN @ 2022-07-28 14:51 UTC (permalink / raw)
To: Romain Naour; +Cc: buildroot
[-- Attachment #1.1: Type: text/plain, Size: 2940 bytes --]
Reviewed-by: Nicolas Tran <nicolas.tran@smile.fr <romain.naour@smile.fr>>
On Wed, Jul 27, 2022 at 10:38 AM Romain Naour <romain.naour@smile.fr> wrote:
> While building host-rust with a musl based toolchain without C++ compiler,
> the build fail since libunwind bundled in rust sources needs a C++
> compiler.
>
> cargo:warning=i686-buildroot-linux-musl-gcc.br_real: error:
> [...]/host-rust-1.62.0/src/llvm-project/libunwind/src/Unwind-EHABI.cpp: C++
> compiler not installed on this system
>
> Note: the issues can't be reproduced with a glibc based toolchain
> without C++ probaly due to extra steps required to support musl libc.
>
> We could add the C++ dependency direclty to host-rustc but it would
> requires adding the C++ reverse dependencies to all rust packages.
>
> Instread, we add the C++ dependency to
> BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
> only when a musl toolchain is used. So we can still install a prebuilt
> rust compiler but without the rust standard library (rust-std).
>
> Usually we should not add toolchain dependencies in a _ARCH_SUPPORTS
> option but
> BR2_PACKAGE_HOST_RUSTC_TARGET_TIER... options contains already some
> BR2_TOOLCHAIN_USES_GLIBC or BR2_TOOLCHAIN_USES_MUSL.
>
> Fixes:
>
> http://autobuild.buildroot.org/results/636/636fb39c8f1b8c05e4ca451ac506cd63c7166d82
>
> Signed-off-by: Romain Naour <romain.naour@smile.fr>
> ---
> v3: add a global C++ dependency to
> BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS (Yann)
> update comment to use "C++ cross compiler"
> v2: move the C++ dependency to BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
> after James's review and discussion with Thomas and Arnout
> ---
> package/rustc/Config.in.host | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/package/rustc/Config.in.host b/package/rustc/Config.in.host
> index fec8726aee..822de68dbb 100644
> --- a/package/rustc/Config.in.host
> +++ b/package/rustc/Config.in.host
> @@ -110,11 +110,15 @@ config BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_PLATFORMS
> default y if BR2_sparc64 && BR2_TOOLCHAIN_USES_GLIBC
>
> # All target rust packages should depend on this option
> +# Note: With musl based toolchain, we need a C++ cross compiler to
> +# build host-rust some target libraries (libunwind) from llvm source
> +# code bundled in rust sources.
> config BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
> bool
> default y if BR2_PACKAGE_HOST_RUSTC_TARGET_TIER1_PLATFORMS
> default y if
> BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_HOST_TOOLS_PLATFORMS
> default y if BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_PLATFORMS
> + depends on BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_USES_MUSL
> depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
>
> config BR2_PACKAGE_HOST_RUSTC_ARCH
> --
> 2.34.3
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
>
[-- Attachment #1.2: Type: text/html, Size: 3915 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCHv3] package/rustc: needs C++ compiler with musl based toolchain
2022-07-28 14:51 ` Nicolas TRAN
@ 2022-08-30 19:20 ` Yann E. MORIN
0 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2022-08-30 19:20 UTC (permalink / raw)
To: Nicolas TRAN; +Cc: Romain Naour, buildroot
Nicolas, All,
On 2022-07-28 16:51 +0200, Nicolas TRAN spake thusly:
> Reviewed- by: Nicolas Tran < [1]nicolas.tran@smile.fr>
You sent an HTML mail, it got completely borked, and your revieed-by tag
was picked weirdly by patchwork:
Reviewed-by: Nicolas Tran <nicolas.tran@smile.fr <romain.naour@smile.fr>>
I've fixed that when applying.
Regards,
Yann E. MORIN.
> On Wed, Jul 27, 2022 at 10:38 AM Romain Naour < [2]romain.naour@smile.fr> wrote:
>
> While building host-rust with a musl based toolchain without C++ compiler,
> the build fail since libunwind bundled in rust sources needs a C++ compiler.
>
> cargo:warning=i686-buildroot-linux-musl-gcc.br_real: error:
> [...]/host-rust-1.62.0/src/llvm-project/libunwind/src/Unwind-EHABI.cpp: C++ compiler not installed on this system
>
> Note: the issues can't be reproduced with a glibc based toolchain
> without C++ probaly due to extra steps required to support musl libc.
>
> We could add the C++ dependency direclty to host-rustc but it would
> requires adding the C++ reverse dependencies to all rust packages.
>
> Instread, we add the C++ dependency to BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
> only when a musl toolchain is used. So we can still install a prebuilt
> rust compiler but without the rust standard library (rust-std).
>
> Usually we should not add toolchain dependencies in a _ARCH_SUPPORTS option but
> BR2_PACKAGE_HOST_RUSTC_TARGET_TIER... options contains already some
> BR2_TOOLCHAIN_USES_GLIBC or BR2_TOOLCHAIN_USES_MUSL.
>
> Fixes:
> [3]http://autobuild.buildroot.org/results/636/636fb39c8f1b8c05e4ca451ac506cd63c7166d82
>
> Signed-off-by: Romain Naour < [4]romain.naour@smile.fr>
> ---
> v3: add a global C++ dependency to BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS (Yann)
> update comment to use "C++ cross compiler"
> v2: move the C++ dependency to BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
> after James's review and discussion with Thomas and Arnout
> ---
> package/rustc/Config.in.host | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/package/rustc/Config.in.host b/package/rustc/Config.in.host
> index fec8726aee..822de68dbb 100644
> --- a/package/rustc/Config.in.host
> +++ b/package/rustc/Config.in.host
> @@ -110,11 +110,15 @@ config BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_PLATFORMS
> default y if BR2_sparc64 && BR2_TOOLCHAIN_USES_GLIBC
>
> # All target rust packages should depend on this option
> +# Note: With musl based toolchain, we need a C++ cross compiler to
> +# build host-rust some target libraries (libunwind) from llvm source
> +# code bundled in rust sources.
> config BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
> bool
> default y if BR2_PACKAGE_HOST_RUSTC_TARGET_TIER1_PLATFORMS
> default y if BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_HOST_TOOLS_PLATFORMS
> default y if BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_PLATFORMS
> + depends on BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_USES_MUSL
> depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
>
> config BR2_PACKAGE_HOST_RUSTC_ARCH
> --
> 2.34.3
>
> _______________________________________________
> buildroot mailing list
> [5]buildroot@buildroot.org
> [6]https://lists.buildroot.org/mailman/listinfo/buildroot
>
> Links:
> 1. mailto:romain.naour@smile.fr
> 2. mailto:romain.naour@smile.fr
> 3. http://autobuild.buildroot.org/results/636/636fb39c8f1b8c05e4ca451ac506cd63c7166d82
> 4. mailto:romain.naour@smile.fr
> 5. mailto:buildroot@buildroot.org
> 6. https://lists.buildroot.org/mailman/listinfo/buildroot
> _______________________________________________
> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCHv3] package/rustc: needs C++ compiler with musl based toolchain
2022-07-27 8:37 [Buildroot] [PATCHv3] package/rustc: needs C++ compiler with musl based toolchain Romain Naour
2022-07-28 14:51 ` Nicolas TRAN
@ 2022-07-28 21:07 ` James Hilliard
2022-08-30 19:22 ` Yann E. MORIN
2022-08-30 19:16 ` Yann E. MORIN
2 siblings, 1 reply; 8+ messages in thread
From: James Hilliard @ 2022-07-28 21:07 UTC (permalink / raw)
To: Romain Naour; +Cc: buildroot
On Wed, Jul 27, 2022 at 2:38 AM Romain Naour <romain.naour@smile.fr> wrote:
>
> While building host-rust with a musl based toolchain without C++ compiler,
> the build fail since libunwind bundled in rust sources needs a C++ compiler.
>
> cargo:warning=i686-buildroot-linux-musl-gcc.br_real: error: [...]/host-rust-1.62.0/src/llvm-project/libunwind/src/Unwind-EHABI.cpp: C++ compiler not installed on this system
AFAIU rust should be able to use normal(ie non-llvm) libunwind which doesn't
require C++:
https://github.com/buildroot/buildroot/blob/master/package/libunwind/libunwind.mk
>
> Note: the issues can't be reproduced with a glibc based toolchain
> without C++ probaly due to extra steps required to support musl libc.
>
> We could add the C++ dependency direclty to host-rustc but it would
> requires adding the C++ reverse dependencies to all rust packages.
>
> Instread, we add the C++ dependency to BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
> only when a musl toolchain is used. So we can still install a prebuilt
> rust compiler but without the rust standard library (rust-std).
>
> Usually we should not add toolchain dependencies in a _ARCH_SUPPORTS option but
> BR2_PACKAGE_HOST_RUSTC_TARGET_TIER... options contains already some
> BR2_TOOLCHAIN_USES_GLIBC or BR2_TOOLCHAIN_USES_MUSL.
>
> Fixes:
> http://autobuild.buildroot.org/results/636/636fb39c8f1b8c05e4ca451ac506cd63c7166d82
>
> Signed-off-by: Romain Naour <romain.naour@smile.fr>
> ---
> v3: add a global C++ dependency to BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS (Yann)
> update comment to use "C++ cross compiler"
> v2: move the C++ dependency to BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
> after James's review and discussion with Thomas and Arnout
> ---
> package/rustc/Config.in.host | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/package/rustc/Config.in.host b/package/rustc/Config.in.host
> index fec8726aee..822de68dbb 100644
> --- a/package/rustc/Config.in.host
> +++ b/package/rustc/Config.in.host
> @@ -110,11 +110,15 @@ config BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_PLATFORMS
> default y if BR2_sparc64 && BR2_TOOLCHAIN_USES_GLIBC
>
> # All target rust packages should depend on this option
> +# Note: With musl based toolchain, we need a C++ cross compiler to
> +# build host-rust some target libraries (libunwind) from llvm source
> +# code bundled in rust sources.
> config BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
> bool
> default y if BR2_PACKAGE_HOST_RUSTC_TARGET_TIER1_PLATFORMS
> default y if BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_HOST_TOOLS_PLATFORMS
> default y if BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_PLATFORMS
> + depends on BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_USES_MUSL
> depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
>
> config BR2_PACKAGE_HOST_RUSTC_ARCH
> --
> 2.34.3
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCHv3] package/rustc: needs C++ compiler with musl based toolchain
2022-07-28 21:07 ` James Hilliard
@ 2022-08-30 19:22 ` Yann E. MORIN
2022-09-01 18:33 ` James Hilliard
0 siblings, 1 reply; 8+ messages in thread
From: Yann E. MORIN @ 2022-08-30 19:22 UTC (permalink / raw)
To: James Hilliard; +Cc: Romain Naour, buildroot
James, All,
On 2022-07-28 15:07 -0600, James Hilliard spake thusly:
> On Wed, Jul 27, 2022 at 2:38 AM Romain Naour <romain.naour@smile.fr> wrote:
> > While building host-rust with a musl based toolchain without C++ compiler,
> > the build fail since libunwind bundled in rust sources needs a C++ compiler.
> >
> > cargo:warning=i686-buildroot-linux-musl-gcc.br_real: error: [...]/host-rust-1.62.0/src/llvm-project/libunwind/src/Unwind-EHABI.cpp: C++ compiler not installed on this system
> AFAIU rust should be able to use normal(ie non-llvm) libunwind which doesn't
> require C++:
> https://github.com/buildroot/buildroot/blob/master/package/libunwind/libunwind.mk
I've applied Romain's patch as a stop-gap measure, until someone comes
up with a better solution, like implementing your proposal of using an
unbundled libunwind.
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCHv3] package/rustc: needs C++ compiler with musl based toolchain
2022-08-30 19:22 ` Yann E. MORIN
@ 2022-09-01 18:33 ` James Hilliard
0 siblings, 0 replies; 8+ messages in thread
From: James Hilliard @ 2022-09-01 18:33 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: Romain Naour, buildroot
On Tue, Aug 30, 2022 at 1:22 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> James, All,
>
> On 2022-07-28 15:07 -0600, James Hilliard spake thusly:
> > On Wed, Jul 27, 2022 at 2:38 AM Romain Naour <romain.naour@smile.fr> wrote:
> > > While building host-rust with a musl based toolchain without C++ compiler,
> > > the build fail since libunwind bundled in rust sources needs a C++ compiler.
> > >
> > > cargo:warning=i686-buildroot-linux-musl-gcc.br_real: error: [...]/host-rust-1.62.0/src/llvm-project/libunwind/src/Unwind-EHABI.cpp: C++ compiler not installed on this system
> > AFAIU rust should be able to use normal(ie non-llvm) libunwind which doesn't
> > require C++:
> > https://github.com/buildroot/buildroot/blob/master/package/libunwind/libunwind.mk
>
> I've applied Romain's patch as a stop-gap measure, until someone comes
> up with a better solution, like implementing your proposal of using an
> unbundled libunwind.
FYI I sent some preliminary patches improving unbundled libunwind target
arch support:
https://patchwork.ozlabs.org/project/buildroot/patch/20220811063502.1823571-1-james.hilliard1@gmail.com/
https://patchwork.ozlabs.org/project/buildroot/patch/20220811063502.1823571-2-james.hilliard1@gmail.com/
>
> Regards,
> Yann E. MORIN.
>
> --
> .-----------------.--------------------.------------------.--------------------.
> | 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCHv3] package/rustc: needs C++ compiler with musl based toolchain
2022-07-27 8:37 [Buildroot] [PATCHv3] package/rustc: needs C++ compiler with musl based toolchain Romain Naour
2022-07-28 14:51 ` Nicolas TRAN
2022-07-28 21:07 ` James Hilliard
@ 2022-08-30 19:16 ` Yann E. MORIN
2022-09-18 6:48 ` Peter Korsgaard
2 siblings, 1 reply; 8+ messages in thread
From: Yann E. MORIN @ 2022-08-30 19:16 UTC (permalink / raw)
To: Romain Naour; +Cc: buildroot
Romain, All,
On 2022-07-27 10:37 +0200, Romain Naour spake thusly:
> While building host-rust with a musl based toolchain without C++ compiler,
> the build fail since libunwind bundled in rust sources needs a C++ compiler.
>
> cargo:warning=i686-buildroot-linux-musl-gcc.br_real: error: [...]/host-rust-1.62.0/src/llvm-project/libunwind/src/Unwind-EHABI.cpp: C++ compiler not installed on this system
>
> Note: the issues can't be reproduced with a glibc based toolchain
> without C++ probaly due to extra steps required to support musl libc.
>
> We could add the C++ dependency direclty to host-rustc but it would
> requires adding the C++ reverse dependencies to all rust packages.
>
> Instread, we add the C++ dependency to BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
> only when a musl toolchain is used. So we can still install a prebuilt
> rust compiler but without the rust standard library (rust-std).
>
> Usually we should not add toolchain dependencies in a _ARCH_SUPPORTS option but
> BR2_PACKAGE_HOST_RUSTC_TARGET_TIER... options contains already some
> BR2_TOOLCHAIN_USES_GLIBC or BR2_TOOLCHAIN_USES_MUSL.
>
> Fixes:
> http://autobuild.buildroot.org/results/636/636fb39c8f1b8c05e4ca451ac506cd63c7166d82
>
> Signed-off-by: Romain Naour <romain.naour@smile.fr>
By lack of a better alternative (like using a standalone libunwind as
James suggested): applied to master, thanks.
Regards,
Yann E. MORIN.
> ---
> v3: add a global C++ dependency to BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS (Yann)
> update comment to use "C++ cross compiler"
> v2: move the C++ dependency to BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
> after James's review and discussion with Thomas and Arnout
> ---
> package/rustc/Config.in.host | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/package/rustc/Config.in.host b/package/rustc/Config.in.host
> index fec8726aee..822de68dbb 100644
> --- a/package/rustc/Config.in.host
> +++ b/package/rustc/Config.in.host
> @@ -110,11 +110,15 @@ config BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_PLATFORMS
> default y if BR2_sparc64 && BR2_TOOLCHAIN_USES_GLIBC
>
> # All target rust packages should depend on this option
> +# Note: With musl based toolchain, we need a C++ cross compiler to
> +# build host-rust some target libraries (libunwind) from llvm source
> +# code bundled in rust sources.
> config BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
> bool
> default y if BR2_PACKAGE_HOST_RUSTC_TARGET_TIER1_PLATFORMS
> default y if BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_HOST_TOOLS_PLATFORMS
> default y if BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_PLATFORMS
> + depends on BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_USES_MUSL
> depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
>
> config BR2_PACKAGE_HOST_RUSTC_ARCH
> --
> 2.34.3
>
> _______________________________________________
> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Buildroot] [PATCHv3] package/rustc: needs C++ compiler with musl based toolchain
2022-08-30 19:16 ` Yann E. MORIN
@ 2022-09-18 6:48 ` Peter Korsgaard
0 siblings, 0 replies; 8+ messages in thread
From: Peter Korsgaard @ 2022-09-18 6:48 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: Romain Naour, buildroot
>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:
> Romain, All,
> On 2022-07-27 10:37 +0200, Romain Naour spake thusly:
>> While building host-rust with a musl based toolchain without C++ compiler,
>> the build fail since libunwind bundled in rust sources needs a C++ compiler.
>>
>> cargo:warning=i686-buildroot-linux-musl-gcc.br_real: error:
>> [...]/host-rust-1.62.0/src/llvm-project/libunwind/src/Unwind-EHABI.cpp:
>> C++ compiler not installed on this system
>>
>> Note: the issues can't be reproduced with a glibc based toolchain
>> without C++ probaly due to extra steps required to support musl libc.
>>
>> We could add the C++ dependency direclty to host-rustc but it would
>> requires adding the C++ reverse dependencies to all rust packages.
>>
>> Instread, we add the C++ dependency to BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
>> only when a musl toolchain is used. So we can still install a prebuilt
>> rust compiler but without the rust standard library (rust-std).
>>
>> Usually we should not add toolchain dependencies in a _ARCH_SUPPORTS option but
>> BR2_PACKAGE_HOST_RUSTC_TARGET_TIER... options contains already some
>> BR2_TOOLCHAIN_USES_GLIBC or BR2_TOOLCHAIN_USES_MUSL.
>>
>> Fixes:
>> http://autobuild.buildroot.org/results/636/636fb39c8f1b8c05e4ca451ac506cd63c7166d82
>>
>> Signed-off-by: Romain Naour <romain.naour@smile.fr>
> By lack of a better alternative (like using a standalone libunwind as
> James suggested): applied to master, thanks.
Committed to 2022.05.x and 2022.02.x, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-09-18 6:49 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-27 8:37 [Buildroot] [PATCHv3] package/rustc: needs C++ compiler with musl based toolchain Romain Naour
2022-07-28 14:51 ` Nicolas TRAN
2022-08-30 19:20 ` Yann E. MORIN
2022-07-28 21:07 ` James Hilliard
2022-08-30 19:22 ` Yann E. MORIN
2022-09-01 18:33 ` James Hilliard
2022-08-30 19:16 ` Yann E. MORIN
2022-09-18 6:48 ` Peter Korsgaard
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.