From 7fae5a802b4aac751c41a404c44c9f550e8bfe5c Mon Sep 17 00:00:00 2001 From: prtzl Date: Wed, 5 Apr 2023 13:07:27 +0200 Subject: [PATCH] gcc-arm-embedded: fix arm-none-eabi-gdb error --- .../compilers/gcc-arm-embedded/11/default.nix | 15 ++++++++++++++- .../compilers/gcc-arm-embedded/12/default.nix | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/gcc-arm-embedded/11/default.nix b/pkgs/development/compilers/gcc-arm-embedded/11/default.nix index d36bd66aa3cb..1fb9f611a066 100644 --- a/pkgs/development/compilers/gcc-arm-embedded/11/default.nix +++ b/pkgs/development/compilers/gcc-arm-embedded/11/default.nix @@ -3,6 +3,8 @@ , fetchurl , ncurses5 , python38 +, libxcrypt-legacy +, runtimeShell }: stdenv.mkDerivation rec { @@ -38,10 +40,21 @@ stdenv.mkDerivation rec { 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 ${lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python38 ]} "$f" || true + patchelf --set-rpath ${lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python38 libxcrypt-legacy ]} "$f" || true done ''; + postFixup = '' + mv $out/bin/arm-none-eabi-gdb $out/bin/arm-none-eabi-gdb-unwrapped + cat < $out/bin/arm-none-eabi-gdb + #!${runtimeShell} + export PYTHONPATH=${python38}/lib/python3.8 + export PYTHONHOME=${python38}/bin/python3.8 + $out/bin/arm-none-eabi-gdb-unwrapped + EOF + chmod +x $out/bin/arm-none-eabi-gdb + ''; + meta = with lib; { description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors"; homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm"; diff --git a/pkgs/development/compilers/gcc-arm-embedded/12/default.nix b/pkgs/development/compilers/gcc-arm-embedded/12/default.nix index 1fac31680fb5..fd7306689ab9 100644 --- a/pkgs/development/compilers/gcc-arm-embedded/12/default.nix +++ b/pkgs/development/compilers/gcc-arm-embedded/12/default.nix @@ -3,6 +3,8 @@ , fetchurl , ncurses5 , python38 +, libxcrypt-legacy +, runtimeShell }: stdenv.mkDerivation rec { @@ -40,10 +42,21 @@ stdenv.mkDerivation rec { 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 ${lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python38 ]} "$f" || true + patchelf --set-rpath ${lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python38 libxcrypt-legacy ]} "$f" || true done ''; + postFixup = '' + mv $out/bin/arm-none-eabi-gdb $out/bin/arm-none-eabi-gdb-unwrapped + cat < $out/bin/arm-none-eabi-gdb + #!${runtimeShell} + export PYTHONPATH=${python38}/lib/python3.8 + export PYTHONHOME=${python38}/bin/python3.8 + $out/bin/arm-none-eabi-gdb-unwrapped + EOF + chmod +x $out/bin/arm-none-eabi-gdb + ''; + meta = with lib; { description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors"; homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";