Cross compile GDB for ARM/Android/iOS on Ubuntu

0

I know there are already many suggestions on how to do cross compilation but it seems that there is more than one way and I was not able to cross compile the files trying the various methods.

Is there a standard way, generally speaking, that I can use to cross compile GDB for ARM/Android/iOS on Ubuntu 18.04?

I downloaded GDB from https://www.gnu.org/software/gdb/download/ and also referred to this site https://sourceware.org/gdb/wiki/BuildingCrossGDBandGDBserver

As an example

Generic Questions

  • What are the software packages that must already be installed before cross compilation?

  • Which GDB files should I download? The one from Android Git or other repositories?

Scenario 1

My first attempt ended in error, below is a snippet at the end of the make process

checking for library containing waddstr... no
configure: WARNING: no enhanced curses library found; disabling TUI
checking for library containing tgetent... no
checking size of unsigned long long... 8
checking size of unsigned long... 4
checking size of unsigned __int128... 0
checking for library containing dlopen... none required
checking whether to use expat... auto
checking for libexpat... no
configure: WARNING: expat is missing or unusable; some features may be unavailable.
checking whether to use MPFR... auto
checking for libmpfr... no
configure: WARNING: MPFR is missing or unusable; some features may be unavailable.
checking whether to use python... python3.7
checking for python3.7... /usr/bin/python3.7
checking for python3.7... no
configure: error: no usable python found at python3.7
Makefile:9096: recipe for target 'configure-gdb' failed
make[1]: *** [configure-gdb] Error 1
make[1]: Leaving directory '/home/user/files/gdb/gdb-8.3'
Makefile:849: recipe for target 'all' failed
make: *** [all] Error 2

I can see that it tries to look for python3.7 which it found and then it could not find it again.

checking for python3.7... python3.7

checking for python3.7... no

My configure options were

sudo ./configure --enable-targets=all --host=arm-linux-gnueabi --with-python=python3.7 prefix=/home/user/files/gdb_output

Scenario 2

I tried without the --with-python option in configure and the make process went further but I encountered a different error.

/usr/bin/ld: ../readline/libreadline.a(readline.o): Relocations in generic ELF (EM: 40)
/usr/bin/ld: ../readline/libreadline.a(readline.o): Relocations in generic ELF (EM: 40)
/usr/bin/ld: ../readline/libreadline.a(readline.o): Relocations in generic ELF (EM: 40)
/usr/bin/ld: ../readline/libreadline.a(readline.o): Relocations in generic ELF (EM: 40)
/usr/bin/ld: ../readline/libreadline.a(readline.o): Relocations in generic ELF (EM: 40)
/usr/bin/ld: ../readline/libreadline.a(readline.o): Relocations in generic ELF (EM: 40)
/usr/bin/ld: ../readline/libreadline.a(readline.o): Relocations in generic ELF (EM: 40)
../readline/libreadline.a: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
Makefile:1892: recipe for target 'gdb' failed
make[2]: *** [gdb] Error 1
make[2]: Leaving directory '/home/user/files/gdb/gdb-8.3/gdb'
Makefile:9126: recipe for target 'all-gdb' failed
make[1]: *** [all-gdb] Error 2
make[1]: Leaving directory '/home/user/files/gdb/gdb-8.3'
Makefile:849: recipe for target 'all' failed
make: *** [all] Error 2

Would someone be able to answer my Generic Questions and also the errors in both Scenarios?

localacct

Posted 2019-05-17T10:54:21.537

Reputation: 1

No answers