How to have an equivalent to gcc-multilib

Hello,

A project I work on needs a nix flake. It’s a compiler and the outputs binaries are in ia32 or llvm-intermediate code, therefore we would need gcc and clang able to be used with -m32 flag.

I tried to build with glibc_multi and other 'multi' as stdenv and the link for theses binaries fail : -lgcc is not found.

I don’t know if this comes from the nix linker-wrapper not including multilib or anything.

What should I do to be able to build the compiler and its outputs, and if it is possible to have a devshell with this environnement ?

This flake worked for me:

{
  outputs = {nixpkgs, ...}: let
    system = "x86_64-linux";
    np = import nixpkgs {
      localSystem = "x86_64-linux";
    };
    pkgs = np.pkgsi686Linux;
  in {
    devShells.${system}.default = pkgs.mkShell {
      packages = with pkgs; [
        gcc
      ];
    };
  };
}