Skip to contentSkip to conversation

package/nettest: not available for the i586 Rust targets

PATCH In review Bogdan Radulescu 2 participants 5 messages Oct 11 – Oct 13

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/nettest: not available for the i586 Rust targets

nettest depends, through rustls, quinn and rcgen, on the ring crate, which refuses to build for 32-bit x86 targets without SSE and SSE2:

  error[E0080]: evaluation panicked: assertion failed: cfg!(target_feature = "sse") && cfg!(target_feature = "sse2")
    --> .../VENDOR/ring/src/cpu/intel.rs:26:9

Buildroot uses the i586-unknown-linux-{gnu,musl} Rust targets when BR2_ARCH is "i586" (i586, pentium-mmx, geode, c3, winchip...), and those targets do not enable SSE/SSE2. The i686 Rust targets enable SSE2 by default, so ring builds fine there.

Make nettest unavailable when the Rust target architecture is i586.

---
 package/nettest/Config.in | 2 ++
 1 file changed, 2 insertions(+)
package/nettest/Config.in +2 -0
index 0ec4dcdc4a..6b9eccfa7c 100644
@@ -1,6 +1,8 @@
 config BR2_PACKAGE_NETTEST
 	bool "nettest"
 	depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
+	# ring needs SSE/SSE2, which the i586 Rust targets lack
+	depends on BR2_PACKAGE_HOST_RUSTC_ARCH != "i586"
 	select BR2_PACKAGE_HOST_RUSTC
 	help
 	  nettest measures download and upload throughput, latency,
Signature · 6 lines
2.55.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hello,

Thanks a lot for your patch!

Quoted 6 lines · Bogdan Radulescu

nettest depends, through rustls, quinn and rcgen, on the ring crate, which refuses to build for 32-bit x86 targets without SSE and SSE2:

  error[E0080]: evaluation panicked: assertion failed: cfg!(target_feature = "sse") && cfg!(target_feature = "sse2")
    --> .../VENDOR/ring/src/cpu/intel.rs:26:9
Quoted 8 lines

Buildroot uses the i586-unknown-linux-{gnu,musl} Rust targets when BR2_ARCH is "i586" (i586, pentium-mmx, geode, c3, winchip...), and those targets do not enable SSE/SSE2. The i686 Rust targets enable SSE2 by default, so ring builds fine there.

Make nettest unavailable when the Rust target architecture is i586.

Could you trace back which Buildroot introduced the issue in the first place?

Adding a tag:

Fixes <commit hash> ("<commit title>")

would be ideal. If the problem exists since the package was introduced, then you can simply to the commit introducing the package as the commit being fixed.

package/nettest/Config.in line 5

Quoted 2 lines
package/nettest/Config.in +2 -0
+	# ring needs SSE/SSE2, which the i586 Rust targets lack
+	depends on BR2_PACKAGE_HOST_RUSTC_ARCH != "i586"

I believe you should rather have a dependency on SSE2, like
https://patchwork.buildroot.org/project/buildroot/patch/[email protected]/
does.

Indeed, there are some i686 platforms that do not have SSE2, and they would continue to fail building even with your patch.

Could you work on a v2 to address those two comments?

Thanks a lot!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Hello Thomas,

Quoted 24 lines · Thomas Petazzoni

Hello,

Thanks a lot for your patch!

Quoted 6 lines · Bogdan Radulescu

nettest depends, through rustls, quinn and rcgen, on the ring crate, which refuses to build for 32-bit x86 targets without SSE and SSE2:

  error[E0080]: evaluation panicked: assertion failed: cfg!(target_feature = "sse") && cfg!(target_feature = "sse2")
    --> .../VENDOR/ring/src/cpu/intel.rs:26:9
Quoted 8 lines

Buildroot uses the i586-unknown-linux-{gnu,musl} Rust targets when BR2_ARCH is "i586" (i586, pentium-mmx, geode, c3, winchip...), and those targets do not enable SSE/SSE2. The i686 Rust targets enable SSE2 by default, so ring builds fine there.

Make nettest unavailable when the Rust target architecture is i586.

Could you trace back which Buildroot introduced the issue in the first place?

Quoted 7 lines

Adding a tag:

Fixes <commit hash> ("<commit title>")

would be ideal. If the problem exists since the package was introduced, then you can simply to the commit introducing the package as the commit being fixed.

Yes, the issue has been there since the package was introduced.

Quoted 4 lines

package/nettest/Config.in line 5

Quoted 3 lines
package/nettest/Config.in +2 -0
+     # ring needs SSE/SSE2, which the i586 Rust targets lack
+     depends on BR2_PACKAGE_HOST_RUSTC_ARCH != "i586"
Quoted 9 lines

I believe you should rather have a dependency on SSE2, like
https://patchwork.buildroot.org/project/buildroot/patch/[email protected]/
does.

Indeed, there are some i686 platforms that do not have SSE2, and they would continue to fail building even with your patch.

Could you work on a v2 to address those two comments?

I absolutely agree with your suggestion, and I submitted the v2 patch.

Quoted 7 lines

Thanks a lot!

Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training
https://bootlin.com

Thank you too for your support!

Best regards,
Bogdan
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

PATCH v2 1/1 package/nettest: needs SSE2 on i386

In reply to Bogdan Radulescu

nettest depends, through rustls, quinn and rcgen, on the ring crate, which refuses to build for 32-bit x86 targets without SSE and SSE2:

  error[E0080]: evaluation panicked: assertion failed: cfg!(target_feature = "sse") && cfg!(target_feature = "sse2")
    --> .../VENDOR/ring/src/cpu/intel.rs:26:9

This affects i586 and i686-class CPUs that lack SSE2 Make nettest depend on SSE2 support when building for i386.

---
Changes v1 -> v2:
- depend on BR2_X86_CPU_HAS_SSE2 on i386 instead of excluding the i586 Rust target, so i686 CPUs without SSE2 are also covered
- add Fixes: tag pointing to the commit introducing the package

 package/nettest/Config.in | 2 ++
 1 file changed, 2 insertions(+)
package/nettest/Config.in +2 -0
index 0ec4dcdc4a..096ae79406 100644
@@ -1,6 +1,8 @@
 config BR2_PACKAGE_NETTEST
 	bool "nettest"
 	depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
+	# i386: needs SSE2 for the ring crate
+	depends on !(BR2_i386 && !BR2_X86_CPU_HAS_SSE2)
 	select BR2_PACKAGE_HOST_RUSTC
 	help
 	  nettest measures download and upload throughput, latency,
Signature · 6 lines
2.55.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

Re: [Buildroot] [PATCH v2] package/nettest: needs SSE2 on i386

Quoted 6 lines · Bogdan Radulescu

nettest depends, through rustls, quinn and rcgen, on the ring crate, which refuses to build for 32-bit x86 targets without SSE and SSE2:

  error[E0080]: evaluation panicked: assertion failed: cfg!(target_feature = "sse") && cfg!(target_feature = "sse2")
    --> .../VENDOR/ring/src/cpu/intel.rs:26:9
Quoted 6 lines

This affects i586 and i686-class CPUs that lack SSE2 Make nettest depend on SSE2 support when building for i386.

Applied to master, thanks a lot!

Best regards,

Thomas Petazzoni

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot