···
+
stdenv.mkDerivation rec {
+
pname = "gcc-arm-embedded";
+
aarch64-darwin = "darwin-arm64";
+
aarch64-linux = "aarch64";
+
x86_64-darwin = "darwin-x86_64";
+
x86_64-linux = "x86_64";
+
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
+
url = "https://developer.arm.com/-/media/Files/downloads/gnu/${version}/binrel/arm-gnu-toolchain-${version}-${platform}-arm-none-eabi.tar.xz";
+
# hashes obtained from location ${url}.sha256asc
+
aarch64-darwin = "c7c78ffab9bebfce91d99d3c24da6bf4b81c01e16cf551eb2ff9f25b9e0a3818";
+
aarch64-linux = "87330bab085dd8749d4ed0ad633674b9dc48b237b61069e3b481abd364d0a684";
+
x86_64-darwin = "2d9e717dd4f7751d18936ae1365d25916534105ebcb7583039eff1092b824505";
+
x86_64-linux = "62a63b981fe391a9cbad7ef51b17e49aeaa3e7b0d029b36ca1e9c3b2a9b78823";
+
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
+
# these binaries require ancient Python 3.8 not available in Nixpkgs
+
rm $out/bin/{arm-none-eabi-gdb-py,arm-none-eabi-gdb-add-index-py} || :
+
preFixup = lib.optionalString stdenv.isLinux ''
+
find $out -type f | while read f; do
+
patchelf "$f" > /dev/null 2>&1 || continue
+
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
+
patchelf --set-rpath ${
+
description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
+
homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";
+
license = with licenses; [
+
maintainers = with maintainers; [
+
sourceProvenance = with sourceTypes; [ binaryNativeCode ];