support building gdb on ppc64le host
authorSadoon Albader <sadoon@soulserv.xyz>
Sun, 27 Aug 2023 13:24:31 +0000 (16:24 +0300)
committerSadoon Albader <sadoon@soulserv.xyz>
Sun, 27 Aug 2023 13:24:31 +0000 (16:24 +0300)
ppc64-gdb-gcc

index 5f2ca95c9fff4f1752242935f2393272c03141d8..66d6c6e8c309f2ddcff27c6ab76f0d5945d08265 100755 (executable)
@@ -4,10 +4,14 @@ if [ "$EUID" -ne 0 ]
   exit
 fi
 
-# first install powerpc64 gcc-8 cross-compiler
-apt-get -y install gcc-8-powerpc64-linux-gnu \
-                gcc-powerpc64-linux-gnu \
-                wget texinfo
+# first install powerpc64 gcc-8 cross-compiler if not on ppc64le
+if $(uname -m) != "ppc64le"; then
+       apt-get -y install gcc-8-powerpc64-linux-gnu \
+                     gcc-powerpc64-linux-gnu \
+                   wget texinfo
+else
+       apt-get -y install gcc-8 gcc wget texinfo
+fi
 
 # it your responsibility to check that the archive downloaded below is
 # uncompromised!
@@ -21,7 +25,10 @@ tar -xvzf gdb-8.3.tar.gz
 cd gdb-8.3
 mkdir -p build
 cd build
-../configure --srcdir=.. --host=x86_64-linux --target=powerpc64-linux-gnu
+if $(uname -m) != "ppc64le; then
+       ../configure --srcdir=.. --host=x86_64-linux --target=powerpc64-linux-gnu
+else
+       ../configure --srcdir=.. --target=powerpc64-linux-gnu
 make
 '
 cd /home/$SUDO_USER/src/gdb-8.3/build