Skip to contentSkip to conversation

package/aichat: require SSE2 on i386 target

PATCH Applied Alexander Shirokov 2 participants 8 messages Jun 17 – Nov 8

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/aichat: require SSE2 on i386 target

The ring crate enforces SSE/SSE2 availability on x86 at compile time, leading to build failures on targets where they are not supported.

Add a new dependency to avoid selecting aichat on such targets.

The failure was reported by autobuild [1]:

    error[E0080]: evaluation panicked: assertion failed: cfg!(target_feature = "sse") && cfg!(target_feature = "sse2")
    --> /home/autobuild/autobuild/instance-38/output-1/build/aichat-0.30.0/VENDOR/ring/src/cpu/intel.rs:26:9
       |
    26 |         assert!(cfg!(target_feature = "sse") && cfg!(target_feature = "sse2"));
       |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    evaluation of `cpu::intel::abi_assumptions::_ASSUMES_SSE2` failed here

[1] https://autobuild.buildroot.org/results/c38a21c80490d5012c5b7bd926e778b406b5f26a/build-end.log

---
 package/aichat/Config.in | 2 ++
 1 file changed, 2 insertions(+)
package/aichat/Config.in +2 -0
index e1bd177076..f828f4b1c3 100644
@@ -1,6 +1,8 @@
 config BR2_PACKAGE_AICHAT
 	bool "aichat"
 	depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
+	# i386: needs SSE2 for `ring` crate
+	depends on !(BR2_i386 && !BR2_X86_CPU_HAS_SSE2)
 	select BR2_PACKAGE_HOST_RUSTC
 	help
 	  AIChat helps seamlessly integrate different LLM models,
Signature · 6 lines
2.54.0

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

PATCH 1/2 package/aichat: require SSE2 on i386 target

Hi All,

Just a brief note: while I started with the simplest fix (disabling the package), the root cause may lie in a different area.

As I can see, the broot package is now failing as well. It appears to be related to SSE too (at least according to the function names).

For example [1]:

error[E0425]: cannot find function defilter_avg_sse2_inner in this scope
--> /home/thomas/autobuild/instance-1/output-1/build/broot-1.55.0/VENDOR/zune-png/src/filters/sse4.rs:332:9

    	|
	213 | / unsafe fn de_filter_paeth_sse41_inner<const SIZE: usize>(
	214 | |     prev_row: &[u8], raw: &[u8], current: &mut [u8]
	215 | | ) {
	216 | |     let zero = _mm_setzero_si128();
	...   |
	266 | | }
    	| |_- similarly named function `de_filter_paeth_sse41_inner` defined here
	...
	332 |           defilter_avg_sse2_inner::<SIZE>(prev_row, raw, current);
    	|           ^^^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `de_filter_paeth_sse41_inner`

I'll investigate more carefully to avoid having to fix or work around the issue in each package individually.

I'm also sure that if this is a common problem, it will affect other Rust packages as well.

If you have any thoughts or ideas, feel free to share.

Thank you

[1] https://autobuild.buildroot.org/results/156abd4e214e230d36426fd407a7edb030fe0f31/build-end.log
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw

Hello,

Quoted 5 lines · Alexander Shirokov

Hi All,

Just a brief note: while I started with the simplest fix (disabling the package), the root cause may lie in a different area.

Quoted 7 lines

As I can see, the broot package is now failing as well. It appears to be related to SSE too (at least according to the function names).

For example [1]:

error[E0425]: cannot find function defilter_avg_sse2_inner in this scope
--> /home/thomas/autobuild/instance-1/output-1/build/broot-1.55.0/VENDOR/zune-png/src/filters/sse4.rs:332:9

That's from a different crate, right? So it's a different problem from the ring create requiring SSE2.

Quoted 2 lines

I'll investigate more carefully to avoid having to fix or work around the issue in each package individually.

Did you come to any conclusion regarding this?

Thanks!

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
#3 lore raw

PATCH 1/2 package/aichat: require SSE2 on i386 target

Hello Thomas,

Sorry for the delayed response.

According to my findings, this was broken from the very beginning (commit 2e1d51533cc0c28d5fd86edd90adce250ade5b18).

The problem happens on BR2_ARCH="i586", which does not support SSE2 instructions. So, it was my fault. I didn't add the precise architecture requirements, which allowed the package to be selected on an architecture where the build will 100% fail.

Regards,
Alexander
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw

PATCH 2/2 DEVELOPERS: move aichat to maintainer entry

In reply to Alexander Shirokov
---
 DEVELOPERS | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
DEVELOPERS +1 -3
index d591c62805..61a7fc4104 100644
@@ -87,6 +87,7 @@ N:	Aleksandr Makarov <[email protected]>
 F:	package/cpp-httplib/
 
 N:	Alexander Shirokov <[email protected]>
+F:	package/aichat/
 F:	package/broot/
 F:	package/kibi/
 F:	package/nnn/
@@ -131,9 +132,6 @@ F:	package/openpgm/
 N:	Aleksandr Makarov <[email protected]>
 F:	package/libest/
 
-N:	Alexander Shirokov <[email protected]>
-F:	package/aichat/
-
 N:	Alexander Sverdlin <[email protected]>
 F:	package/mini-snmpd/
 
Signature · 6 lines
2.54.0

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

Re: [Buildroot] [v1, 2/2] DEVELOPERS: move aichat to maintainer entry

Quoted 1 line · Alexander Shirokov

Applied to master, thanks!

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
#6 lore raw

Re: [Buildroot] [v1, 2/2] DEVELOPERS: move aichat to maintainer entry

In reply to Alexander Shirokov

In reply of:

Quoted 1 line

Applied to 2026.08.x. Thanks

Quoted 17 lines
---
 DEVELOPERS | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
DEVELOPERS +1 -0
index d591c62805..61a7fc4104 100644
@@ -87,6 +87,7 @@ N:	Aleksandr Makarov <[email protected]>
 F:	package/cpp-httplib/
 
 N:	Alexander Shirokov <[email protected]>
+F:	package/aichat/
 F:	package/broot/
 F:	package/kibi/
 F:	package/nnn/

DEVELOPERS F: package/openpgm/ · line 137

Quoted 9 lines
DEVELOPERS +0 -3
@@ -131,9 +132,6 @@ F:	package/openpgm/
 N:	Aleksandr Makarov <[email protected]>
 F:	package/libest/
 
-N:	Alexander Shirokov <[email protected]>
-F:	package/aichat/
-
 N:	Alexander Sverdlin <[email protected]>
 F:	package/mini-snmpd/
 

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

#7 lore raw
In reply to Alexander Shirokov

Hello,

Quoted 14 lines · Alexander Shirokov

The ring crate enforces SSE/SSE2 availability on x86 at compile time, leading to build failures on targets where they are not supported.

Add a new dependency to avoid selecting aichat on such targets.

The failure was reported by autobuild [1]:

    error[E0080]: evaluation panicked: assertion failed: cfg!(target_feature = "sse") && cfg!(target_feature = "sse2")
    --> /home/autobuild/autobuild/instance-38/output-1/build/aichat-0.30.0/VENDOR/ring/src/cpu/intel.rs:26:9
       |
    26 |         assert!(cfg!(target_feature = "sse") && cfg!(target_feature = "sse2"));
       |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    evaluation of `cpu::intel::abi_assumptions::_ASSUMES_SSE2` failed here
Quoted 3 lines

[1] https://autobuild.buildroot.org/results/c38a21c80490d5012c5b7bd926e778b406b5f26a/build-end.log

Could you trace back which version of aichat first started exposing the problem? We need to understand if our LTS branches are affected or not. Adding a Fixes: tag pointing to the Buildroot commit who introduced the issue is best, like this:

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

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