mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Brian Wang <brian.wang.0721@gmail.com>
To: musl@lists.openwall.com
Subject: Re: Problem Compiling gdbserver with musl
Date: Sun, 21 Oct 2012 17:19:37 +0800	[thread overview]
Message-ID: <CAPW=hRSk1vcvqXa0=UFuXKHMwG+JNMS1LDYxXRFpbdvmRvi_Xw@mail.gmail.com> (raw)
In-Reply-To: <50815B8A.3070109@barfooze.de>

On Fri, Oct 19, 2012 at 9:54 PM, John Spencer <maillist-musl@barfooze.de> wrote:
> On 10/19/2012 08:13 AM, Brian Wang wrote:
>>
>> Hello all,
>>
>> Is it possible to cross compile gdbserver with musl?  I tried it and
>> it failed complaining about some thread-db stuff:
>> --------------
>> thread-db.c: In function ‘find_one_thread’:
>> thread-db.c:292:7: error: format ‘%ld’ expects argument of type ‘long
>> int’, but argument 3 has type ‘thread_t’ [-Werror=format]
>> thread-db.c:315:6: error: ‘struct lwp_info’ has no member named ‘th’
>> thread-db.c: In function ‘attach_thread’:
>> thread-db.c:329:7: error: format ‘%ld’ expects argument of type ‘long
>> int’, but argument 3 has type ‘thread_t’ [-Werror=format]
>> thread-db.c:335:9: error: format ‘%ld’ expects argument of type ‘long
>> int’, but argument 2 has type ‘thread_t’ [-Werror=format]
>> thread-db.c:340:6: error: ‘struct lwp_info’ has no member named ‘th’
>> thread-db.c: In function ‘thread_db_get_tls_address’:
>> thread-db.c:513:47: error: ‘struct lwp_info’ has no member named ‘th’
>> thread-db.c: In function ‘dladdr_to_soname’:
>> thread-db.c:652:3: error: passing argument 1 of ‘dladdr’ discards
>> ‘const’ qualifier from pointer target type [-Werror]
>> In file included from thread-db.c:33:0:
>>
>> /opt/cross/arm-linux-musleabi/lib/gcc/arm-linux-musleabi/4.7.1/../../../../arm-linux-musleabi/include/dlfcn.h:30:5:
>> note: expected ‘void *’ but argument is of type ‘const void *’
>> thread-db.c: In function ‘try_thread_db_load_from_sdir’:
>> thread-db.c:708:30: error: ‘LIBTHREAD_DB_SO’ undeclared (first use in
>> this function)
>> thread-db.c:708:30: note: each undeclared identifier is reported only
>> once for each function it appears in
>> thread-db.c: In function ‘try_thread_db_load_from_dir’:
>> thread-db.c:719:29: error: ‘LIBTHREAD_DB_SO’ undeclared (first use in
>> this function)
>> thread-db.c: In function ‘thread_db_load_search’:
>> thread-db.c:748:41: error: ‘LIBTHREAD_DB_SEARCH_PATH’ undeclared
>> (first use in this function)
>> thread-db.c: In function ‘thread_db_handle_monitor_command’:
>> thread-db.c:971:7: error: ‘LIBTHREAD_DB_SEARCH_PATH’ undeclared (first
>> use in this function)
>> thread-db.c: In function ‘try_thread_db_load_from_sdir’:
>> thread-db.c:709:1: error: control reaches end of non-void function
>> [-Werror=return-type]
>> cc1: all warnings being treated as errors
>> --------------
>>
>
> hello brian, please forward your bug report to gdb mailing list.
> clearly gdb devs should check if these facilities are available before using
> them.
> we must raise awareness of such issues upstream.

I guess gdb development is somehow tightly coupled with glibc, which
supplies libthread_db.
I remember seeing similar issues reported:
http://sourceware.org/bugzilla/show_bug.cgi?id=13011

>
>
> as a temporary fix, you can either build gdb without gdbserver:
> https://github.com/rofl0r/sabotage/blob/master/pkg/gdb
>
> patches are here: https://github.com/rofl0r/sabotage/tree/master/KEEP
>
> before i ported sabotage to mips i had working patches for gdbserver to
> *compile* (did not test if it *works*) on x86 and amd64:
>
> https://github.com/rofl0r/sabotage/commit/02202d48d5062c62a3fa62deaf3bdc01d5b4423d
>
> the dlopen patch should not be necessary with current musl.

Thank you for the pointers. :-)

gdbserver+gdb now works for my ARM target, at least for single-thread program.


Brian

-- 
brian
------------------

Cool-Karaoke - The smallest recording studio, in your palm, open-sourced
http://cool-idea.com.tw/

iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe


  parent reply	other threads:[~2012-10-21  9:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-19  6:13 Brian Wang
2012-10-19 12:30 ` Rich Felker
2012-10-21  9:12   ` Brian Wang
2012-10-19 13:54 ` John Spencer
2012-10-19 14:17   ` John Spencer
2012-10-21  9:19   ` Brian Wang [this message]
2012-10-21 14:24     ` John Spencer
2012-10-21 15:50       ` Brian Wang
2012-10-21 14:32     ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPW=hRSk1vcvqXa0=UFuXKHMwG+JNMS1LDYxXRFpbdvmRvi_Xw@mail.gmail.com' \
    --to=brian.wang.0721@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).