···
12
+
stdenv.mkDerivation rec {
13
+
pname = "gcc-arm-embedded";
14
+
version = "14.2.rel1";
18
+
aarch64-darwin = "darwin-arm64";
19
+
aarch64-linux = "aarch64";
20
+
x86_64-darwin = "darwin-x86_64";
21
+
x86_64-linux = "x86_64";
23
+
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
26
+
url = "https://developer.arm.com/-/media/Files/downloads/gnu/${version}/binrel/arm-gnu-toolchain-${version}-${platform}-arm-none-eabi.tar.xz";
27
+
# hashes obtained from location ${url}.sha256asc
30
+
aarch64-darwin = "c7c78ffab9bebfce91d99d3c24da6bf4b81c01e16cf551eb2ff9f25b9e0a3818";
31
+
aarch64-linux = "87330bab085dd8749d4ed0ad633674b9dc48b237b61069e3b481abd364d0a684";
32
+
x86_64-darwin = "2d9e717dd4f7751d18936ae1365d25916534105ebcb7583039eff1092b824505";
33
+
x86_64-linux = "62a63b981fe391a9cbad7ef51b17e49aeaa3e7b0d029b36ca1e9c3b2a9b78823";
35
+
.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
38
+
dontConfigure = true;
40
+
dontPatchELF = true;
46
+
# these binaries require ancient Python 3.8 not available in Nixpkgs
47
+
rm $out/bin/{arm-none-eabi-gdb-py,arm-none-eabi-gdb-add-index-py} || :
50
+
preFixup = lib.optionalString stdenv.isLinux ''
51
+
find $out -type f | while read f; do
52
+
patchelf "$f" > /dev/null 2>&1 || continue
53
+
patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
54
+
patchelf --set-rpath ${
55
+
lib.makeLibraryPath [
68
+
description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
69
+
homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";
70
+
license = with licenses; [
78
+
maintainers = with maintainers; [
88
+
sourceProvenance = with sourceTypes; [ binaryNativeCode ];