[Nix-dev] RTEMS cross compiler

Benjamin Franksen benjamin.franksen at helmholtz-berlin.de
Fri Jul 4 15:01:38 CEST 2014


I want to package the tool chain for RTEMS 4.9. The sources are at 
ftp://www.rtems.org/pub/rtems/SOURCES/4.9. The gcc version is 4.3.2 plus a 
few RTEMS specific patches. I successfully packaged the corresponding 
binutils. I can also build and install the cross gcc. However, when using 
the resulting gcc as a "driver" e.g. to compile a single .c file to an 
executable, I get errors that suggest that it tries to call the 'as' 
(assembler, part of binutils) for the host system, not the cross version. 
Specifically,

franksen at tiber: ~/tmp > powerpc-rtems4.9-gcc -mcpu=603e -Dmpc603e -Dppc603e 
-O2 -g -mmultiple -mstring -mstrict-align conftest.c
as: unrecognized option '-mppc'

I have been banging my head against this problem with no success, so now I 
am asking for help here, hoping that you guys have more experience with 
building gcc with nix and can give me a hint how to get this to work.

I attached my default.nix, on the top-level I have this definition of 
config.nix:

{
  packageOverrides = pkgs: with pkgs; rec {
    binutils_powerpc_rtems49 = callPackage rtems/4.9/binutils {
      targetArch = "powerpc";
    };

    gcc_powerpc_rtems49 = callPackage rtems/4.9/gcc {
      targetArch = "powerpc";
      targetArchBinutils = binutils_powerpc_rtems49;
    };
  };
}

Cheers
Ben
-- 
"Make it so they have to reboot after every typo." ? Scott Adams
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: default.nix
Url: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20140704/0cc02a8a/attachment.pl 


More information about the nix-dev mailing list