diff --git a/.ci/before_build_wheel.sh b/.ci/before_build_wheel.sh
new file mode 100644
index 0000000000000000000000000000000000000000..4356dbc7e7111731f2bba21d574e610688691e08
--- /dev/null
+++ b/.ci/before_build_wheel.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+set -eu
+
+# On 32-bit Linux platforms, we need libatomic1 to use rustup
+if command -v apt-get &> /dev/null; then
+    apt-get update
+    apt-get install libatomic1
+fi
+
+# Install a Rust toolchain
+curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.82.0 -y --profile minimal
diff --git a/changelog.d/18212.misc b/changelog.d/18212.misc
new file mode 100644
index 0000000000000000000000000000000000000000..0e8516a3236d7a5ff7abc482ac13ecaa7e48fb34
--- /dev/null
+++ b/changelog.d/18212.misc
@@ -0,0 +1 @@
+Fix wheel building configuration in CI by installing libatomic1.
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 5f18bd07681822c17c6fba48a4ab3d6b50cc3f88..80482f469a665859a95dfb09f7d0e04f260a6c3f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -390,7 +390,7 @@ skip = "cp36* cp37* cp38* pp37* pp38* *-musllinux_i686 pp*aarch64 *-musllinux_aa
 #
 # We temporarily pin Rust to 1.82.0 to work around
 # https://github.com/element-hq/synapse/issues/17988
-before-all =  "curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.82.0 -y --profile minimal"
+before-all =  "sh .ci/before_build_wheel.sh"
 environment= { PATH = "$PATH:$HOME/.cargo/bin" }
 
 # For some reason if we don't manually clean the build directory we