Open
Description
Code
It appears that rust versions newer than 1.82.0 fail to build recent firefox versions on NetBSD's "i386" port (which covers i486, i586 and i686, but since we provide rust only for i586 or above, that's the sub-parts which are affected). All these are "ILP32" ports, and provide a maximum per-process data segment size somewhere around 3GB.
The testing scoreboard I've created looks like this:
firefox version | rust version | result |
---|---|---|
138.0.4 | 1.82.0 | OK |
138.0.4 | 1.83.0 | failed: Cannot allocate memory (os error 12) |
138.0.4 | 1.85.0 | failed: Cannot allocate memory (os error 12) |
138.0.4 | 1.86.0 | failed: error: could not compile style (lib) |
135.0.1 | 1.87.0 | failed: Cannot allocate memory (os error 12) |
136.0.2 | 1.87.0 | failed: memory allocation of 71061296 bytes failed |
137.0.2 | 1.87.0 | failed: rustc-LLVM ERROR: out of memory |
138.0.4 | 1.88.0 | failed: rustc-LLVM ERROR: out of memory |
A typical build error looks like this:
Compiling mls-platform-api v0.1.0 (https://github.com/beurdouche/mls-platform-api?rev=19c3f18b747d13354370ba84440bb0b963932634#19c3f18b)
Compiling neqo-http3 v0.11.0 (https://github.com/mozilla/neqo?tag=v0.11.0#c6d5502f)
Compiling socket2 v0.4.999 (/usr/pkgsrc/www/firefox/work/firefox-135.0.1/build/rust/socket2)
Compiling storage v0.1.0 (/usr/pkgsrc/www/firefox/work/firefox-135.0.1/storage/rust)
Compiling dogear v0.5.0
error: failed to build archive at `/usr/pkgsrc/www/firefox/work/build/i586-unknown-netbsd/release/deps/libstyle-5354116ed6cc56c6.rlib`: failed to map object file: Cannot allocate memory (os error 12)
error: could not compile `style` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
and it goes downhill from there.
Version it worked on
It most recently worked on: version 1.82.0.
Version with regression
rustc --version --verbose
:
$ rustc --version --verbose
rustc 1.88.0 (6b00bc388 2025-06-23) (built from a source tarball)
binary: rustc
commit-hash: 6b00bc3880198600130e1cf62b8f8a93494488cc
commit-date: 2025-06-23
host: i586-unknown-netbsd
release: 1.88.0
LLVM version: 19.1.7
$
This is with an externally built LLVM. The same problem occurs with the internal LLVM.
Metadata
Metadata
Assignees
Labels
Category: This is a bug.Issue: Problems and improvements with respect to memory usage during compilation.Target: x86 processors, 32 bit (like i686-*) (also known as IA-32, i386, i586, i686)Relevant to the compiler team, which will review and decide on the PR/issue.Performance or correctness regression from one stable version to another.