I586 cross compiling, ambiguous "i686" use

I ambitiously set out today to start adding i586 support and immediately ran into the issue of the loose use of “i686”. Sometimes it is interpreted as “32 bit x86” and other times specifically as the i686 cpu (ie c build flag -march=i686). Has anybody given thought about how to address this?

I am working with Vortex86 CPUs which are a few instructions short of i686.

I have a branch that should let you cross compile to i586:


Thanks. Is the systems/parse and binutils commits the crux of it, or is there other stuff driving i586 support?
Is this likely to be merged to master?

Just trying to get the lay of the land here. I’m happy to work on i586 support and vet it on actual i586 hardware. My inclination is to run my own branch with the intention of eventually merging it to master.

The “ambiguity” is due to originally not counting on supporting any x86 not compatible with i686.

These changes probably won’t be controversial (I just looked quickly), but by itself it won’t help you to get binaries from cache.nixos.org anyway.

I’ve sketched an RFC for this. Initial thoughts?


I’ve read it. It LGTM.

See also some discussion in https://github.com/NixOS/nixpkgs/pull/50562. I think most, if not all, of us interested in cross-compilation here would agree with the change RFC proposes.

I’m more worried about the vendor and kernel parts of the target string. :slight_smile:

1 Like

LGTM! Thanks for doing this—and providing the real-world use-case.

I tested this by building an i586 kernel and running it on actual i586 hardware. It worked!