first revision ppc64-gdb-gcc script
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 4 Mar 2021 21:50:28 +0000 (21:50 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 4 Mar 2021 21:50:28 +0000 (21:50 +0000)
ppc64-gdb-gcc [new file with mode: 0755]

diff --git a/ppc64-gdb-gcc b/ppc64-gdb-gcc
new file mode 100755 (executable)
index 0000000..bbf4b27
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/bash
+if [ "$EUID" -ne 0 ]
+  then echo "Please run as root"
+  exit
+fi
+
+# first install powerpc64 gcc-8 cross-compiler
+apt-get install gcc-8-powerpc64-linux-gnu
+
+runuser $SUDO_USER --preserve-environment -c '
+cd /home/$SUDO_USER
+mkdir -p src
+cd src
+wget https://ftp.gnu.org/gnu/gdb/gdb-8.3.tar.gz -O gdb-8.3.tar.gz
+tar -xvzf gdb-8.3.tar.gz
+cd gdb-8.3
+mkdir build
+cd build
+./configure --srcdir=.. --host=x86_64-linux --target=powerpc64-linux-gnu
+make
+'
+cd /home/$SUDO_USER/src/gdb-8.3/build
+make -n install
+echo -e "
+\e[1;91mCross-compiled GDB 8.3 and compiler now installed.\e[0m
+"