You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

48 lines
1018 B

{ lib
, stdenv
, libelf
}:
let
version = "2.35";
target = "xtensa-esp32-elf";
xtensa-overlay-commit = "4d8c98d";
xtensa-overlay = fetchTarball {
url = "https://codeload.github.com/espressif/xtensa-overlays/tar.gz/${xtensa-overlay-commit}";
sha256 = "sha256:16z9028mxfbzy4rmhcldi9rdlhi7lmcdxjhr630m0kr447gq3820";
};
in
with lib; stdenv.mkDerivation {
src = fetchTarball {
url = "https://ftp.gnu.org/gnu/binutils/binutils-${version}.tar.bz2";
sha256 = "sha256:0jk31l6w6bd2x067hcqa8zjvx202f85kk5khkidy6pig0p3yx8a8";
};
inherit version;
name = "${target}-binutils";
buildInputs = [
libelf
];
enableParallelBuilding = true;
preConfigure = ''
cp -r ${xtensa-overlay}/xtensa_esp32/binutils/* .
'';
configureFlags = [
"--target=${target}"
"--enable-multilib"
"--enable-interwork"
"--with-gnu-as"
"--with-gnu-ld"
"--with-sysroot"
"--disable-nls"
"--enable-ld=yes"
"--enable-gold"
"--enable-plugins"
"--enable-deterministic-archives"
];
}