> Works for me to, but I'd like to write a package that depends on GCC
> i686-linux.
You mean a package that uses a compiler able to generate code for
i686-linux? In that case you can have a look to (gnu packages firmware),
where "cross-gcc" packages are used (ovmf-aarch64 package for instance).
You would have to write something like:
--8<---------------cut here---------------start------------->8---
(native-inputs
`(,@(if (not (string-prefix? "i686" (%current-system)))
`(("cross-gcc" ,(cross-gcc "i686-unknown-linux-gnu"))
("cross-binutils" ,(cross-binutils "i686-unknown-linux-gnu")))
'())))
--8<---------------cut here---------------end--------------->8---
that uses the current gcc if you're already building on an i686 system,
or define and use a cross-gcc targeting i686 systems otherwise.
Mathieu