From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4931 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: Sun, 20 Apr 2014 16:29:49 -0400 Message-ID: <53542E3D.5020600@midipix.org> References: <5353FDD0.6090903@midipix.org> 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 1398025810 18996 80.91.229.3 (20 Apr 2014 20:30:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Apr 2014 20:30:10 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4935-gllmg-musl=m.gmane.org@lists.openwall.com Sun Apr 20 22:30:04 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 1WbyNG-0001w1-2Y for gllmg-musl@plane.gmane.org; Sun, 20 Apr 2014 22:30:02 +0200 Original-Received: (qmail 9876 invoked by uid 550); 20 Apr 2014 20:30:00 -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 9862 invoked from network); 20 Apr 2014 20:29:59 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: <5353FDD0.6090903@midipix.org> Xref: news.gmane.org gmane.linux.lib.musl.general:4931 Archived-At: On 04/20/2014 01:03 PM, writeonce@midipix.org wrote: > Greetings, > > While building a statically linked musl-based gdb, ld asked that > libc.a be recompiled with -fPIC. After recompiling musl with the > above flag, gdb built successfully. The reason I wanted to have a > static gdb (other than the trivial ones) was to be able to debug a > musl-based python. The distribution's gdb has a dynamic dependency on > a glibc-based libpython, and the two friends don't play well together. > > Now that the static gdb is up and running, my questions are: > > 1) is there any reason not to "always" compile musl with -fPIC, at > least on x86_64? > > 2) is there any reason to revert to the old build of libc.so? Although > I rebuilt musl because of libc.a, it turns out that the -fPIC flag > also helped libc.so become much smaller: 699299 bytes, instead of > 2767910 bytes (musl v1.0.0, binutils v2.24). Any other factors to > consider? Pardon! Of the two files above, only the larger one had debug information. With -fPIC and debug information, the current size of libc.so is 2379780 bytes. > > Thanks for looking at this, > zg > > >