# Sqlite broken on i686

**URL:** https://discourse.nixos.org/t/sqlite-broken-on-i686/80111
**Category:** Help
**Created:** [September 16, 2026, 5:43pm UTC](https://discourse.nixos.org/t/sqlite-broken-on-i686/80111 "2026-09-16T17:43:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Obvious6279](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/o/e68b1a/32.png) [@Obvious6279](https://discourse.nixos.org/u/Obvious6279)
#### Post date: [September 16, 2026, 5:43pm UTC](https://discourse.nixos.org/t/sqlite-broken-on-i686/80111/1 "2026-09-16T17:43:08Z")

</div>

Hi, long-time nix user first time caller 🙂

I am trying to compile a (minimal) NixOS image for i686 hardware; I understand Nix dropped official support for i686 years ago, but I am willing to fix broken packages as they come up. However, I am still learning how to debug and fix failing derivations, so some hand-holding would be appreciated!

The sqlite package fails to cross-compile on recent nixpkgs:  
`nix build --impure --expr "(import <nixpkgs> {}).pkgsCross.gnu32.sqlite"`

It fails at the check phase, and from digging into the logs it seems to be related to linking libstdc++:  
`.../sqlite-src-3530300/testrunner_bld_all_debug_fuzzcheck-ubsan/fuzzcheck-ubsan: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory`

The [derivation](https://github.com/NixOS/nixpkgs/blob/8325a97162cbd8696480819b63189568c164295d/pkgs/development/libraries/sqlite/default.nix) seems to be a pretty bog-standard stdenv derivation, so I am hoping there is an easy fix. I fixed a couple other broken derivations by just adding `NIX_LDFLAGS = "-lgcc_s"`, though I never looked into why the flag is needed on i686 and not on x86-64.

I will look into it further in a couple hours but wanted to ask for help early. Thanks in advance!

---

<div class="post-metadata">

### Author: ![waffle8946](https://discourse.nixos.org/user_avatar/discourse.nixos.org/waffle8946/32/27221_2.png) [@waffle8946](https://discourse.nixos.org/u/waffle8946)
#### Post date: [September 16, 2026, 6:16pm UTC](https://discourse.nixos.org/t/sqlite-broken-on-i686/80111/2 "2026-09-16T18:16:22Z")

</div>

`pkgsi686Linux.sqlite` is built fine on my end on an `x86_64-linux` machine, any reason you need cross-compilation specifically?

---

<div class="post-metadata">

### Author: ![Obvious6279](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/o/e68b1a/32.png) [@Obvious6279](https://discourse.nixos.org/u/Obvious6279)
#### Post date: [September 16, 2026, 8:45pm UTC](https://discourse.nixos.org/t/sqlite-broken-on-i686/80111/3 "2026-09-16T20:45:30Z")

</div>

I think I avoided `pkgsi686Linux` because it fails on non-`x86-64-linux` build machines. Ideally, I’d like to be able to build the derivations from my friend’s MacBook, in addition to my x86-64 computer.

Would a possible solution be for my friend to enable x86-64 emulation? Also, what is the difference between `pkgsCross.gnu32` and `pkgsi686Linux`? I have read through the top-level/stage.nix file but can’t spot the meaningful differences 😵‍💫

---

<div class="post-metadata">

### Author: ![Obvious6279](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/o/e68b1a/32.png) [@Obvious6279](https://discourse.nixos.org/u/Obvious6279)
#### Post date: [September 17, 2026, 7:13am UTC](https://discourse.nixos.org/t/sqlite-broken-on-i686/80111/4 "2026-09-17T07:13:19Z")

</div>

Also, I am not sure how to use `pkgsi686Linux` without depending on broken build-time packages. For example, `rsync` fails to build on i686 after commit 1d337c3:  
`nix build github:nixos/nixpkgs/1d337c3#pkgsi686Linux.rsync`

In the relevant NixOS configuration, I have removed `rsync` from the actual system, but it is still a build dependency (used for constructing the eventual output directory, I believe). If I set `nixpkgs.pkgs = nixpkgs.legacyPackages.${system}.pkgsi686Linux;`in the configuration, then this failing rsync derivation prevents building the system, because the build-time dependencies are pulling from `pkgsi686Linux` (I think?)

Instead, if I set `nixpkgs.buildPlatform` and `nixpkgs.hostPlatform`, the rsync dependency builds fine (because it builds the native x86\_64 version), which avoids blocking the build. But then as we’ve seen, this causes other packages (sqlite) to fail to build 🫠
