[Nix-dev] cannot find -lgcc
    David Craven 
    david at craven.ch
       
    Wed May  4 22:58:41 CEST 2016
    
    
  
I'm getting the following error message when trying to cross compile
using a custom toolchain. Am I missing a wrapCC or something like
that? I checked that the libgcc.a has the correct file format.
libgcc file format:
/tmp/libgcc/_absvdi2.o:             ELF 32-bit LSB relocatable, UCB
RISC-V, version 1 (SYSV), not stripped
error message:
/nix/store/3da37l9f2f5jwwv8sgkhyv94qxxf08sb-riscv-toolchain/lib/gcc/riscv32-unknown-elf/5.3.0/../../../../riscv32-unknown-elf/bin/ld:
skipping incompatible
/nix/store/3da37l9f2f5jwwv8sgkhyv94qxxf08sb-riscv-toolchain/lib/gcc/riscv32-unknown-elf/5.3.0/libgcc.a
when searching for -lgcc
/nix/store/3da37l9f2f5jwwv8sgkhyv94qxxf08sb-riscv-toolchain/lib/gcc/riscv32-unknown-elf/5.3.0/../../../../riscv32-unknown-elf/bin/ld:
cannot find -lgcc
nix-expression:
riscv-toolchain = {arch, xlen}: stdenv.mkDerivation {
    name = "riscv-toolchain";
    dontPatchELF = true;
    src = fetchFromGitHub {
      owner = "riscv";
      repo = "riscv-gnu-toolchain";
      rev = "06c957aba75025d8da554fe6b6402fb631a93e77";
      sha256 = "1qqgpk542bkaxrd3x8kxpbh0gspns85q5f5frg72976f0mhd497d";
    };
    configureFlags = "--with-xlen=${toString xlen} --with-arch=${arch}
--disable-float --disable-atomic";
    buildInputs = [ gmp libmpc mpfr gawk bison flex texinfo gperf curl ];
  };
riscv32-toolchain = {arch}: riscv-toolchain { inherit arch; xlen=32; };
riscv32i-toolchain = riscv32-toolchain {arch = "I"; };
    
    
More information about the nix-dev
mailing list