"Disabling thread support in gdbserver" problem

Khem Raj raj.khem@gmail.com
Mon Feb 15 21:37:00 GMT 2010


On Mon, Feb 15, 2010 at 12:49 AM, Daniele Palmas
<Daniele.Palmas@telit.com> wrote:
> -----Original Message-----
> From: Khem Raj [mailto:raj.khem@gmail.com]
> Sent: venerdì 12 febbraio 2010 23.17
> To: Daniele Palmas
> Cc: Yann E. MORIN; crossgcc@sourceware.org
> Subject: Re: "Disabling thread support in gdbserver" problem
>
>>> Another piece of information that can be useful: configuring the gdbserver I've found the line
>>>
>>> [ALL  ]    checking for libthread_db... no
>>>
>>> I suspect this is the problem, however I have not understood why the build system doesn't find it since it exists. Should I force this check modifying the configure.ac?
>>
>>
>> Send the config.log for gdb/gdbserver most probably the test for
>> libthread_db is failing because its using the wrong libthread_db (from
>> host instead of target)
>
> Hello Khem,
>
> in attachment you can find the config.log. For your convenience I've quoted the lines that seem important to me:
>
> [SNIP]
> configure:4062: checking for libthread_db
> configure:4093: arm-unknown-linux-gnu-gcc -o conftest -g -O2  -static conftest.c  -lthread_db >&5
> /home/danielepa/x-tools/arm-unknown-linux-gnu/lib/gcc/arm-unknown-linux-gnu/4.3.2/../../../../arm-unknown-linux-gnu/bin/ld: cannot find -lthread_db
> collect2: ld returned 1 exit status
> configure:4099: $? = 1
> configure: failed program was:
> [SNIP]
> configure:4151: arm-unknown-linux-gnu-gcc -o conftest -g -O2  -static conftest.c  /lib/libthread_db.so.1 >&5
> /home/danielepa/x-tools/arm-unknown-linux-gnu/lib/gcc/arm-unknown-linux-gnu/4.3.2/../../../../arm-unknown-linux-gnu/bin/ld: attempted static link of dynamic object `/lib/libthread_db.so.1'
> collect2: ld returned 1 exit status
> configure:4157: $? = 1
> configure: failed program was:
> [SNIP]
>
> I can understand the second problem, but not the first one: should the linker not have a default path for the libraries like libthread_db?

It seems to me that you are trying to build static gdbserver with
multi-threading support.
you need to have static version of libthread_db installed for that in
your <sysroot>/usr/lib
and this should be same as the one the programs that you intend to
debug will be linked against
otherwise the multi-threaded debugging may not work well.

If there are no restrictions to use shared libs then I would suggest
that you compile gdbsever with
shared library support. If not then you have to compile the static
version of libthread_db (libthread_db.a) during libc build step.

-Khem

--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list