* [Buildroot] [PATCH] package/rust: set musl-root for musl toolchains
@ 2022-02-25 8:30 Romain Naour
2022-03-12 20:25 ` Arnout Vandecappelle
2022-03-20 18:14 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Romain Naour @ 2022-02-25 8:30 UTC (permalink / raw)
To: buildroot; +Cc: Romain Naour
Without musl-root in config.toml the build stop with the following error:
thread 'main' panicked at 'couldn't find libc.a in musl libdir: output/host/arm-buildroot-linux-musleabihf/sysroot/lib/lib', src/bootstrap/sanity.rs:192:25
musl-root is needed to provide the path to libc.a and libunwind.a because
rust link them statically into the standard library and liblibc [1].
For other libc, musl-root is not used and ignored [2].
[1] https://github.com/rust-lang/rust/commit/cd980b3bee5bd48e8a6cd4c0d7c8e0fb0fdb64dd
[2] https://github.com/rust-lang/rust/blob/1.58.1/src/bootstrap/sanity.rs#L181
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
Runtime tested with TestRust with ripgrep and bat packages.
---
package/rust/rust.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/package/rust/rust.mk b/package/rust/rust.mk
index 4a6b04dc8c..c2e0a361dd 100644
--- a/package/rust/rust.mk
+++ b/package/rust/rust.mk
@@ -56,6 +56,7 @@ define HOST_RUST_CONFIGURE_CMDS
echo 'sysconfdir = "$(HOST_DIR)/etc"'; \
echo '[rust]'; \
echo 'channel = "stable"'; \
+ echo 'musl-root = "$(STAGING_DIR)"' ; \
echo '[target.$(RUSTC_TARGET_NAME)]'; \
echo 'cc = "$(TARGET_CROSS)gcc"'; \
echo '[llvm]'; \
--
2.35.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH] package/rust: set musl-root for musl toolchains
2022-02-25 8:30 [Buildroot] [PATCH] package/rust: set musl-root for musl toolchains Romain Naour
@ 2022-03-12 20:25 ` Arnout Vandecappelle
2022-03-20 18:14 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Arnout Vandecappelle @ 2022-03-12 20:25 UTC (permalink / raw)
To: Romain Naour, buildroot
On 25/02/2022 09:30, Romain Naour wrote:
> Without musl-root in config.toml the build stop with the following error:
>
> thread 'main' panicked at 'couldn't find libc.a in musl libdir: output/host/arm-buildroot-linux-musleabihf/sysroot/lib/lib', src/bootstrap/sanity.rs:192:25
>
> musl-root is needed to provide the path to libc.a and libunwind.a because
> rust link them statically into the standard library and liblibc [1].
>
> For other libc, musl-root is not used and ignored [2].
>
> [1] https://github.com/rust-lang/rust/commit/cd980b3bee5bd48e8a6cd4c0d7c8e0fb0fdb64dd
> [2] https://github.com/rust-lang/rust/blob/1.58.1/src/bootstrap/sanity.rs#L181
>
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
Applied to master, thanks.
Regards,
Arnout
> ---
> Runtime tested with TestRust with ripgrep and bat packages.
> ---
> package/rust/rust.mk | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/package/rust/rust.mk b/package/rust/rust.mk
> index 4a6b04dc8c..c2e0a361dd 100644
> --- a/package/rust/rust.mk
> +++ b/package/rust/rust.mk
> @@ -56,6 +56,7 @@ define HOST_RUST_CONFIGURE_CMDS
> echo 'sysconfdir = "$(HOST_DIR)/etc"'; \
> echo '[rust]'; \
> echo 'channel = "stable"'; \
> + echo 'musl-root = "$(STAGING_DIR)"' ; \
> echo '[target.$(RUSTC_TARGET_NAME)]'; \
> echo 'cc = "$(TARGET_CROSS)gcc"'; \
> echo '[llvm]'; \
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH] package/rust: set musl-root for musl toolchains
2022-02-25 8:30 [Buildroot] [PATCH] package/rust: set musl-root for musl toolchains Romain Naour
2022-03-12 20:25 ` Arnout Vandecappelle
@ 2022-03-20 18:14 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2022-03-20 18:14 UTC (permalink / raw)
To: Romain Naour; +Cc: buildroot
>>>>> "Romain" == Romain Naour <romain.naour@gmail.com> writes:
> Without musl-root in config.toml the build stop with the following error:
> thread 'main' panicked at 'couldn't find libc.a in musl libdir:
> output/host/arm-buildroot-linux-musleabihf/sysroot/lib/lib',
> src/bootstrap/sanity.rs:192:25
> musl-root is needed to provide the path to libc.a and libunwind.a because
> rust link them statically into the standard library and liblibc [1].
> For other libc, musl-root is not used and ignored [2].
> [1] https://github.com/rust-lang/rust/commit/cd980b3bee5bd48e8a6cd4c0d7c8e0fb0fdb64dd
> [2] https://github.com/rust-lang/rust/blob/1.58.1/src/bootstrap/sanity.rs#L181
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> ---
> Runtime tested with TestRust with ripgrep and bat packages.
Committed to 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] 3+ messages in thread
end of thread, other threads:[~2022-03-20 18:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-25 8:30 [Buildroot] [PATCH] package/rust: set musl-root for musl toolchains Romain Naour
2022-03-12 20:25 ` Arnout Vandecappelle
2022-03-20 18:14 ` 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.