OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
pacman-aur medium occasional DISPUTE

Get a large AUR build past 'Killed signal terminated program cc1plus'

archomarchyendeavouroscachyosmanjaroauryayparulaptopdesktop
CORRECTED An auditor found the fix wrong or incomplete and rewrote it. · checked against Omarchy omarchy 4.0.4-1 on 2026-10-05
AUDIT NOTE

The kernel OOM part is right for plain Arch. The forum thread (231534) shows MAKEFLAGS=-j1 ignored by mach, with -bin and swap as the answers. /etc/makepkg.conf has lto in OPTIONS and makepkg sources the user file after it. The record misses the Omarchy 4 mechanism its own cited sources describe. Confirmed locally: omarchy-settings 4.0.4-1 owns /etc/systemd/oomd.conf.d/10-omarchy.conf (50% pressure for 20s) and /usr/lib/systemd/user/app.slice.d/10-oomd.conf (ManagedOOMMemoryPressure=kill, ManagedOOMSwap=kill), and systemd-oomd is enabled and active. A terminal launched by uwsm-app runs in app.slice, so on Omarchy the more likely outcome is that oomd kills the terminal's whole scope, taking yay or omarchy update with it. That leaves nothing in journalctl -k, so the record's symptom and verify step miss it. zram is confirmed (zram-size = ram, zstd, from 90-omarchy.conf owned by omarchy-settings). The fix also said nothing about CMake, which honours CMAKE_BUILD_PARALLEL_LEVEL for cmake --build (CMake docs, and PR #12778 uses it). Its 'add disk swap' was vague, and on a btrfs root a swapfile must sit in its own subvolume. Cause, symptom, fix and verify are corrected. Not reproduced.

The cause above was rewritten on 2026-10-05 to match this note; the fix was corrected by the audit itself.

Symptom

Building a big C++ project from the AUR (a browser, an Electron app, a game engine, a CAD tool) runs for a long time, the desktop crawls, then:


c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: <package>

and journalctl -k shows Out of memory: Killed process ... (cc1plus).

On Omarchy 4 the terminal window running the build can instead close outright, taking yay or omarchy update with it, and journalctl -k shows nothing. In that case systemd-oomd killed the terminal, and the kill is logged by systemd-oomd.

Cause

Memory ran out. Large C++ translation units can each need gigabytes of RAM, and the build runs many in parallel. Setting MAKEFLAGS=-j1 only limits builds driven by make. CMake with Ninja, Meson, Rust's cargo and Mozilla's mach pick their own job count, usually one per CPU thread, and ignore MAKEFLAGS. Link-time optimisation, which makepkg enables by default (lto in OPTIONS in /etc/makepkg.conf), raises peak memory further at the link step.

What kills the build differs. On plain Arch it is usually the kernel's OOM killer taking a compiler process. Omarchy 4 also runs systemd-oomd. omarchy-settings ships /etc/systemd/oomd.conf.d/10-omarchy.conf (act when memory pressure stays above 50% for 20 seconds) and /usr/lib/systemd/user/app.slice.d/10-oomd.conf, which makes everything in the user's app.slice a kill candidate. A terminal started from the desktop lives in app.slice, so oomd can kill the whole terminal and every build process inside it before the kernel OOM killer ever acts. Omarchy 4 also swaps to zram sized to RAM (/usr/lib/systemd/zram-generator.conf.d/90-omarchy.conf). That helps, but it cannot cover a build that needs several times the physical memory.

Fix

First check whether a prebuilt package exists. It removes the build entirely:


yay -Ss <name>-bin

If you must build, cap parallelism and LTO in your per-user makepkg config. makepkg reads it after /etc/makepkg.conf, and omarchy update builds AUR packages through the same makepkg, so it applies there too:


mkdir -p ~/.config/pacman
cat >> ~/.config/pacman/makepkg.conf <<'EOF'
MAKEFLAGS="-j2"
OPTIONS+=(!lto)
EOF

For build systems that ignore MAKEFLAGS, set their own variable in the shell you build from:


export CARGO_BUILD_JOBS=2             # Rust / cargo
export CMAKE_BUILD_PARALLEL_LEVEL=2   # CMake, when the PKGBUILD builds with cmake --build
yay -S <package>

Ninja and Meson have no environment variable for job count. For a PKGBUILD that calls ninja or meson compile directly, edit build() to pass -j2 (yay -S --editmenu <package>).

If a build still runs out of memory, add disk swap for the duration of the build.

**Omarchy 4 (btrfs root).** Put the swapfile in its own subvolume, as Omarchy's hibernation setup does with /swap, because btrfs cannot snapshot a subvolume that holds an active swapfile and snapper snapshots @:


sudo btrfs subvolume create /swap-build
sudo btrfs filesystem mkswapfile --size 16g /swap-build/swapfile
sudo swapon /swap-build/swapfile
# build, then remove it
sudo swapoff /swap-build/swapfile
sudo btrfs subvolume delete /swap-build

**Plain Arch (ext4 root):**


sudo mkswap -U clear --size 16G --file /swapfile
sudo swapon /swapfile
# build, then remove it
sudo swapoff /swapfile
sudo rm /swapfile

Otherwise build on a bigger machine.

Verify

No new kill during the rebuild: journalctl -k -b | grep -i 'out of memory' prints nothing new, and on Omarchy 4 journalctl -u systemd-oomd -b | grep -i killed prints nothing new. pacman -Q <package> shows the new version.

Sources

aur-build-killed-out-of-memory