Hello all,
I’m trying to create an FHS User env for a program that seems to require both 64-bit and 32-bit gcc versions. The general advice to make this run on other linux distros seems to be to install gcc-multilib
, but this isn’t a Nix package and hence I’ve been looking at other approaches. There’s some information here about this:
https://nixos.wiki/wiki/Packaging/32bit_Applications
But that seems geared towards creating derivations rather than FHS environments. There also seems to be an --enable-multilib
parameter for gcc
. This sounds promising, but I’ve tried it in what I think should be a MWE:
{ pkgs ? import <nixpkgs> {}}:
let
my-pkgs = import <nixpkgs> {
overlays = [
(self: super: with self; {
my-gcc = lowPrio (wrapCC (super.gcc.cc.overrideAttrs(old: {
configureFlags = old.configureFlags ++ [
"--enable-multilib"
];
})));
})
];
};
fhs = pkgs.buildFHSUserEnv {
name = "gcc-test";
targetPkgs = pkgs: with my-pkgs; [
my-gcc
];
multiPkgs = null;
profile = "";
runScript = "echo HELLO";
};
in fhs.env
And it doesn’t work; it tells me
configure: error: in `/build/build/x86_64-unknown-linux-gnu/32/libgcc': configure: error: C preprocessor "/lib/cpp" fails sanity check
Can anyone guide me towards the correct approach here?
Thanks in advance
Chris