gcc-arm-embedded: fix arm-none-eabi-gdb error

This commit is contained in:
prtzl 2023-04-05 13:07:27 +02:00
parent 4116178905
commit 7fae5a802b
2 changed files with 28 additions and 2 deletions

View file

@ -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 <<EOF > $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";

View file

@ -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 <<EOF > $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";