Skip to content

Commit b039f2e

Browse files
committed
lang/rust: enable SSE2 by default on i386
Upstream Rust always requires SSE2 for x86. But back in 2017[^1][^2] we patched lang/rust to disable SSE2 for i386. At the time, it was reported that some people were still using non-SSE2 capable hardware. More recently, LLVM bugs have been discovered[^3][^4] that can result in rounding bugs and reduced accuracy when using f64 on non-SSE hardware. In weird cases, they can even cause wilder unpredictable behavior, like segfaults. Revert our change for the sake of Pentium 4 (and later) users. But add an SSE2 option. Disabling it will allow the port to be used on Pentium 3 and older CPUs. [^1]: d65b288 [^2]: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=223415 [^3]: rust-lang/rust#114479 [^4]: llvm/llvm-project#44218 Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D47227
1 parent fe3a6cd commit b039f2e

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

UPDATING

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ they are unavoidable.
55
You should get into the habit of checking this file for changes each time
66
you update your ports collection, before attempting any port upgrades.
77

8+
20241109:
9+
AFFECTS: all users of i386
10+
11+
12+
On i386 the lang/rust port has been updated to require SSE2 by default. Not
13+
only does the compiler itself require SSE2, but it unconditionally generates
14+
code that requires it, too. Over 500 ports include Rust code (www/firefox,
15+
security/py-cryptography, etc). Official binary packages of all of those
16+
ports will no longer work on Pentium III and older hardware. PIII users must
17+
now build their own lang/rust packages, clearing the SSE2 option, and rebuild
18+
any dependent ports.
19+
820
20241104:
921
AFFECTS: users of mail/fetchmail
1022

lang/rust/Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PORTNAME= rust
22
PORTVERSION?= 1.82.0
3-
PORTREVISION?= 0
3+
PORTREVISION?= 1
44
CATEGORIES= lang
55
MASTER_SITES= https://static.rust-lang.org/dist/:src \
66
https://dev-static.rust-lang.org/dist/:src \
@@ -48,12 +48,17 @@ TMPDIR?= ${WRKDIR}
4848

4949
OPTIONS_DEFINE= DOCS GDB LTO PORT_LLVM SOURCES WASM
5050
OPTIONS_DEFAULT= SOURCES WASM
51+
OPTIONS_DEFINE_i386= SSE2
52+
OPTIONS_DEFAULT_i386= SSE2
5153

5254
GDB_DESC= Install ports gdb (necessary for debugging rust programs)
5355
PORT_LLVM_DESC= Build against devel/llvm instead of bundled copy (experimental)
56+
SSE2_DESC= Enable SSE2 instructions
5457
SOURCES_DESC= Install source files
5558
WASM_DESC= Build the WebAssembly target (wasm32-unknown-unknown)
5659

60+
SSE2_EXTRA_PATCHES_OFF+= ${FILESDIR}/extra-patch-compiler_rustc__target_src_spec_targets_i686__unknown__freebsd.rs
61+
5762
DOCS_VARS= _RUST_BUILD_DOCS=true \
5863
_COMPONENTS+="rust-docs-${_PACKAGE_VERS}-${_RUST_TARGET} rust-docs-json-${_PACKAGE_VERS}-${_RUST_TARGET}" \
5964
_RUST_TOOLS+=rustdoc

lang/rust/files/patch-compiler_rustc__target_src_spec_targets_i686__unknown__freebsd.rs renamed to lang/rust/files/extra-patch-compiler_rustc__target_src_spec_targets_i686__unknown__freebsd.rs

File renamed without changes.

0 commit comments

Comments
 (0)