[Bug 287998] lang/rust: building with SSE2=off fails

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 04 Jul 2025 08:30:27 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=287998

            Bug ID: 287998
           Summary: lang/rust: building with SSE2=off fails
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: rust@FreeBSD.org
          Reporter: d8zNeCFG@aon.at
          Assignee: rust@FreeBSD.org
             Flags: maintainer-feedback?(rust@FreeBSD.org)

Scenario:
- FreeBSD stable/14 0cc03e473ed7 with minor patches
- ports latest, with some patches (see below)
- i386 VM under bhyve
- Using portmaster for upgrading; this tries to build rust-1.88.0
-
lang/rust/files/extra-patch-compiler_rustc__target_src_spec_targets_i686__unknown__freebsd.rs
changed as follows (there was a remark in some bug report mentioning this, I do
not know anymore which one):
 -    base.cpu = "pentium4".into();
 +    base.cpu = "pentiumpro".into();
- This has been done because I am using code compiled by rust (especially
x11/xorg) on very old i386 machines, and I want to ensure that it can be
executed there
- In the config flags, SSE2 has been set to off, which is not the default.

Result:
- The build fails with error messages like

error: this function definition uses SIMD vector type `f32` which (with the
chosen ABI) requires the `sse` target feature, which is not enabled
  --> library/core/src/num/flt2dec/decoder.rs:49:5
   |
49 |     fn min_pos_norm_value() -> Self {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
   |
   = help: consider enabling it globally (`-C target-feature=+sse`) or locally
(`#[target_feature(enable="sse")]`)

Expected result:
- This was working up to rust-1.87.0, it would be nice to have it working still

Even if this is not really a valid bug report because of my local changes it
would be nice to get some advice how to proceed, apart from cleaning out my old
junk ;-).

For example, would setting SSE2 to the default "on" produce a compiler which
can still be told not to use SSE2 instructions in code it generates?

-- Martin

-- 
You are receiving this mail because:
You are the assignee for the bug.