This is the mail archive of the
mailing list for the GDB project.
Re: gdbserver - manually modify Makefile
- From: Pedro Alves <palves at redhat dot com>
- To: Ran Shalit <ranshalit at gmail dot com>, gdb <gdb at sourceware dot org>
- Date: Thu, 13 Aug 2015 22:58:32 +0100
- Subject: Re: gdbserver - manually modify Makefile
- Authentication-results: sourceware.org; auth=none
- References: <CAJ2oMh+5j+Rk7s0uH=Og7jaDmtrAQp2UDCdaM4rMhQe3L5Dt5A at mail dot gmail dot com>
On 08/13/2015 09:50 PM, Ran Shalit wrote:
> I've cross compile gdbserver according to wiki in:
> ubuntu@ubuntu-laptop:~/gdb-7.9.1/gdb/gdbserver$ sudo ./configure
> --host=powerpc-buildroot-linux-gnu --disable-werror
You should not need sudo, nor --disable-werror.
> But on doing :
> I've noticed that it uses the host gcc instead of the cross-compiler gcc.
> Only after manually modifying the Makefie with
> CC = powerpc-buildroot-linux-gnu-gcc
> instead of
> CC = gcc
> It was cross compiling as expected.
Open the config.log file in the build directory, and look for something
that looks like this:
configure:2558: checking for powerpc-buildroot-linux-gnu-gcc
The following lines should look something like this:
configure:2574: found /path/to/whatever/bin/powerpc-buildroot-linux-gnu-gcc
configure:2585: result: powerpc-buildroot-linux-gnu-gcc
configure:2854: checking for C compiler version
configure:2863: powerpc-buildroot-linux-gnu-gcc --version >&5
But in your case, "result" is probably "gcc". If configure doesn't
find $host-gcc, then it'll default to "gcc". Most likely, you don't
have powerpc-buildroot-linux-gnu-gcc in the PATH. Make sure
it is in the PATH, and that you can execute it (e.g., try
$ powerpc-buildroot-linux-gnu-gcc -v), and start over.
Let me know how it went.