From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4990 Path: news.gmane.org!not-for-mail From: "writeonce@midipix.org" Newsgroups: gmane.linux.lib.musl.general Subject: Re: static musl-based gdb and -fPIC Date: Tue, 29 Apr 2014 17:40:06 -0400 Message-ID: <53601C36.7050601@midipix.org> References: <5353FDD0.6090903@midipix.org> <20140420203140.GA26358@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1398807642 27224 80.91.229.3 (29 Apr 2014 21:40:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Apr 2014 21:40:42 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4994-gllmg-musl=m.gmane.org@lists.openwall.com Tue Apr 29 23:40:37 2014 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 1WfFlV-0003CK-IW for gllmg-musl@plane.gmane.org; Tue, 29 Apr 2014 23:40:37 +0200 Original-Received: (qmail 9820 invoked by uid 550); 29 Apr 2014 21:40:35 -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 9809 invoked from network); 29 Apr 2014 21:40:35 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: <20140420203140.GA26358@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:4990 Archived-At: On 04/20/2014 04:31 PM, Rich Felker wrote: > On Sun, Apr 20, 2014 at 01:03:12PM -0400,writeonce@midipix.org wrote: >> Greetings, >> >> While building a statically linked musl-based gdb, ld asked that >> libc.a be recompiled with -fPIC. > This is a bug in the gdb build process. Despite your request for a > static gdb, it's trying to build a shared library for something. > There's a way to disable it (IIRC --disable-gdbserver is a big hammer > that can do it, and there might be a more fine-grained approach) but > the real issue is that the build process is broken and doing something > that can't work. > Rich > > I built a static gdb (v7.7, passing --disable-gdbserver to configure) and _thought_ that everything was fine. Then I checked the build logs and saw that gdb refused to use the present libexpat, libncurses/tinfo, and libpython. In the case of expat, at least, the "solution" was easy, albeit unacceptable: temporarily break my local system by renaming libexpat.so (so that gdb cannot find it). But for ncurses and python that didn't work. It appears that expat is passed to the linker as a full path (/full/path/to/libexpat.so) rather than normally (-lexpat), which makes the whole thing break since there is no way to request a static expat instead. Note, however, that this problem is not musl-specific (https://sourceware.org/ml/crossgcc/2013-06/msg00003.html). At this point I am no longer seeking a solution (unless you have one ready), but thought I should share this for the record. As an aside, it looks like the static python interpreter is missing some modules as well (see, for instance, https://trac.torproject.org/projects/tor/ticket/7557). zg