From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2180 Path: news.gmane.org!not-for-mail From: Brian Wang Newsgroups: gmane.linux.lib.musl.general Subject: Re: Problem Compiling gdbserver with musl Date: Sun, 21 Oct 2012 17:19:37 +0800 Message-ID: References: <50815B8A.3070109@barfooze.de> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1350811190 718 80.91.229.3 (21 Oct 2012 09:19:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Oct 2012 09:19:50 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2181-gllmg-musl=m.gmane.org@lists.openwall.com Sun Oct 21 11:19:58 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1TPrhM-00031O-Pd for gllmg-musl@plane.gmane.org; Sun, 21 Oct 2012 11:19:56 +0200 Original-Received: (qmail 28036 invoked by uid 550); 21 Oct 2012 09:19:49 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 28026 invoked from network); 21 Oct 2012 09:19:49 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=gUKsIXz/y8VRkPKfa3jRRvOvq3wiTejIhR5m80XzpQE=; b=x4tctCvfyCsVBhOx2snrOYUjUkMWlWhSUPK7dnljVU6g8nKw3wBweSSOUSCRNNiIz2 fDDIJsYFo9g9iU2xIpm1LK2OueG4h3Kr+inZ8k+CaUNGHk0USy2euepccFNTqGmg8yFy lKdvRaYdGYvzYc6CbTThmXytAOmD1NqH8sP809XtKL4Oqeqwr5NZoqVJWLWZ3WP39k// 7QIol/O72ruKj4de/58EP9U5+zbLjrfb0Zdz37jHs7TkqTexeYbLD9TFM7p8MOFTeAUf azYV8z0ZxkIOE3vhpvKz6rf/gF3vlv/hTktgy9tlVVLZYHLlrqFlTVOYmdlvdm2s7nM6 gKxQ== In-Reply-To: <50815B8A.3070109@barfooze.de> Xref: news.gmane.org gmane.linux.lib.musl.general:2180 Archived-At: On Fri, Oct 19, 2012 at 9:54 PM, John Spencer w= rote: > 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 =E2=80=98find_one_thread=E2=80=99: >> thread-db.c:292:7: error: format =E2=80=98%ld=E2=80=99 expects argument = of type =E2=80=98long >> int=E2=80=99, but argument 3 has type =E2=80=98thread_t=E2=80=99 [-Werro= r=3Dformat] >> thread-db.c:315:6: error: =E2=80=98struct lwp_info=E2=80=99 has no membe= r named =E2=80=98th=E2=80=99 >> thread-db.c: In function =E2=80=98attach_thread=E2=80=99: >> thread-db.c:329:7: error: format =E2=80=98%ld=E2=80=99 expects argument = of type =E2=80=98long >> int=E2=80=99, but argument 3 has type =E2=80=98thread_t=E2=80=99 [-Werro= r=3Dformat] >> thread-db.c:335:9: error: format =E2=80=98%ld=E2=80=99 expects argument = of type =E2=80=98long >> int=E2=80=99, but argument 2 has type =E2=80=98thread_t=E2=80=99 [-Werro= r=3Dformat] >> thread-db.c:340:6: error: =E2=80=98struct lwp_info=E2=80=99 has no membe= r named =E2=80=98th=E2=80=99 >> thread-db.c: In function =E2=80=98thread_db_get_tls_address=E2=80=99: >> thread-db.c:513:47: error: =E2=80=98struct lwp_info=E2=80=99 has no memb= er named =E2=80=98th=E2=80=99 >> thread-db.c: In function =E2=80=98dladdr_to_soname=E2=80=99: >> thread-db.c:652:3: error: passing argument 1 of =E2=80=98dladdr=E2=80=99= discards >> =E2=80=98const=E2=80=99 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 =E2=80=98void *=E2=80=99 but argument is of type =E2=80= =98const void *=E2=80=99 >> thread-db.c: In function =E2=80=98try_thread_db_load_from_sdir=E2=80=99: >> thread-db.c:708:30: error: =E2=80=98LIBTHREAD_DB_SO=E2=80=99 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 =E2=80=98try_thread_db_load_from_dir=E2=80=99: >> thread-db.c:719:29: error: =E2=80=98LIBTHREAD_DB_SO=E2=80=99 undeclared = (first use in >> this function) >> thread-db.c: In function =E2=80=98thread_db_load_search=E2=80=99: >> thread-db.c:748:41: error: =E2=80=98LIBTHREAD_DB_SEARCH_PATH=E2=80=99 un= declared >> (first use in this function) >> thread-db.c: In function =E2=80=98thread_db_handle_monitor_command=E2=80= =99: >> thread-db.c:971:7: error: =E2=80=98LIBTHREAD_DB_SEARCH_PATH=E2=80=99 und= eclared (first >> use in this function) >> thread-db.c: In function =E2=80=98try_thread_db_load_from_sdir=E2=80=99: >> thread-db.c:709:1: error: control reaches end of non-void function >> [-Werror=3Dreturn-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 us= ing > 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=3D13011 > > > 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/02202d48d5062c62a3fa62deaf3bdc0= 1d5b4423d > > 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 progr= am. Brian --=20 brian ------------------ Cool-Karaoke - The smallest recording studio, in your palm, open-sourced http://cool-idea.com.tw/ iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe