Cross Compiling GDB for MIPS

This is a discussion on Cross Compiling GDB for MIPS within the Linux Programming forums, part of the Platform Specific Boards category; Iam trying to compile gdb-7.0 for mips. Iam giving the configure options like below. ./configure --host=mips-linux --target=mips-linux-uclibc --libdir=/home/test/CommonApp s/Software/SW/targets/DUALMOCA/rootfs/lib --includedir=/home/test/CommonApps/Software/SW/targets/DUALMOCA/rootfs/include ...

  1. #1
    Registered User
    Join Date
    Mar 2008
    Location
    India
    Posts
    111

    Cross Compiling GDB for MIPS

    Iam trying to compile gdb-7.0 for mips.

    Iam giving the configure options like below.

    ./configure --host=mips-linux --target=mips-linux-uclibc --libdir=/home/test/CommonApp s/Software/SW/targets/DUALMOCA/rootfs/lib --includedir=/home/test/CommonApps/Software/SW/targets/DUALMOCA/rootfs/include

    Compiles well and gives me executable , when i run that i get the message like below

    This GDB was configured as "x86_64-unknown-linux-gnu".

    Where as the cross compiler pacakage "uclibc-crosstools_gcc-3.4.2_uclibc-20050502" mips-linux-gdb give's me the proper results like "This GDB was configured as "--host=i386-pc-linux-gnu --target=mips-linux-uclibc"

    Can any body guide me where am i going wrong ?

    It would be more help full if i get direct mips compiled gdbserver . My basic intention is to do the remote debugging for mips target board

    Thanks

  2. #2
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    Is mips-linux-* a uClibC compiler? BUILD= can be used to force the issue (of i386-pc-linux-gnu) if that is what you so choose.

  3. #3
    Registered User
    Join Date
    Mar 2008
    Location
    India
    Posts
    111
    Kennedy thanks for your views,

    I had a confusion in my end , when ever i was trying to run the gdb , it was executing gdb which i installed on my system not the one which i compiled for .

    So once i realised that and tried to execute with ./gdb it gives me following error .

    Code:
    # ./gdb
    bash: ./gdb: cannot execute binary file
    
    # ll gdb
    -rwxr-xr-x 1 root root 13386775 2009-10-20 11:07 gdb
    I guess it compiled for mips thats the reason its not running in my environment.

    Still my i have not met my requirement as i want to get gdbserver executable which i can run on my mips target board environment and gdb which i will start in my desktop system and using target remote command i can debug it.

    Hope i am clear about my intentions .

    Even i tried to use uClibc-0.9.30.1.tar.gz to get mips compiled gdbserver and mips-linxu-gdb unable to get the end results.

    your advice / suggestiong would be highly helpfull .

    thanks and regards

  4. #4
    Registered User
    Join Date
    Oct 2009
    Location
    While(1)
    Posts
    377
    Hey dude i think the problem is when u try to configure the GDB with MIPS

    you didn't specify the location with prefix tag and it try to configure the default one which is configured with X86 linux 64 Bit

    your configuration
    ./configure --host=mips-linux --target=mips-linux-uclibc --libdir=/home/test/CommonApp s/Software/SW/targets/DUALMOCA/rootfs/lib --includedir=/home/test/CommonApps/Software/SW/targets/DUALMOCA/rootfs/include
    do it like that may be it will help you

    with prefix u can configure the path
    ./configure --prefix=/opt/gdb/MIPS --host=mips-linux --target=mips-linux-uclibc --libdir=/home/test/CommonApp s/Software/SW/targets/DUALMOCA/rootfs/lib --includedir=/home/test/CommonApps/Software/SW/targets/DUALMOCA/rootfs/include

  5. #5
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    There are (if I can recall correctly) 4 config things: HOST, TARGET, BUILD, <something>. <something> is the one that you'll set to mips-linux -- stating that you want to debug those type binaries, but your TARGET will be for you local machine (ie, you'll want to use your native compiler to build it, but it will refer to the <something> libs when attempting to debug).

    I just cannot recall what that <something> is. I'd have to download and attempt to install. Try ./configure --help for that information.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. buffered vs unbuffered question
    By Overworked_PhD in forum Linux Programming
    Replies: 6
    Last Post: 07-04-2008, 04:57 PM
  2. Contiguous Array version of Linked List
    By ampersand11 in forum C Programming
    Replies: 19
    Last Post: 10-07-2007, 03:05 AM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  4. Too much output in GDB
    By MacNilly in forum Tech Board
    Replies: 0
    Last Post: 09-13-2006, 12:45 PM
  5. does gdb lie?
    By dinjas in forum C Programming
    Replies: 8
    Last Post: 03-10-2005, 04:17 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21