Skip to content

Instantly share code, notes, and snippets.

@boomshroom
Last active January 28, 2018 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boomshroom/93b524ab8786299de76eca89ea156d50 to your computer and use it in GitHub Desktop.
Save boomshroom/93b524ab8786299de76eca89ea156d50 to your computer and use it in GitHub Desktop.
bintuils working, nothing else
self: super:
let target-gcc = arch:
let target = {
config = arch;
libc = null;
isDarwin = false;
};
#binutils = self.pkgs.binutils.override {
# targetPlatform = target;
#};
binutils = self.pkgs.wrapBintoolsWith {
libc = null;
bintools =
self.pkgs.binutils-unwrapped.overrideAttrs (old: rec {
configurePlatforms = ["build" "host"];
targetPrefix = "${arch}-";
name = targetPrefix + "binutils-${old.passthru.version}";
passthru = old.passthru // {
inherit targetPrefix;
};
configureFlags = old.configureFlags ++ ["--target=${arch}"];
});
};
in self.pkgs.wrapCCWith {
name = "gcc-" + arch;
cc = self.pkgs.gcc7.cc.override {
targetPlatform = target;
crossStageStatic = true;
langCC = false;
langC = true;
libcCross = null;
enableShared = false;
targetPackages.stdenv.cc.bintools = binutils;
};
bintools = binutils;
libc = null;
};
in
{
gcc-cross = {
i686 = target-gcc "i686-elf";
#riscv = target-gcc "riscv64-elf";
arm = target-gcc "arm-none-eabi";
#redox = target-gcc "x86_64-elf-redox";
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment