mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Zvi Gilboa <zg7s@eservices.virginia.edu>
To: <musl@lists.openwall.com>
Subject: Re: static musl-based gdb and -fPIC
Date: Wed, 30 Apr 2014 00:29:36 -0400	[thread overview]
Message-ID: <53607C30.4010207@eservices.virginia.edu> (raw)
In-Reply-To: <20140430040758.GG26358@brightrain.aerifal.cx>

On 04/30/2014 12:07 AM, Rich Felker wrote:
> On Tue, Apr 29, 2014 at 11:26:56PM -0400, writeonce@midipix.org wrote:
>> On 04/29/2014 10:57 PM, Rich Felker wrote:
>>> On Tue, Apr 29, 2014 at 05:40:06PM -0400, writeonce@midipix.org wrote:
>>>> 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).
>>> It's not clear at all to me from your email or from the linked thread
>>> who the passer in "is passed" might be. Is this something broken in
>>> gdb's build script, or expat's pkg-config or similar, or ct-ng, or
>>> something else?
>> Pardon.  The expat pkg-config file (expat.pc) is fine.  It is the
>> gdb script that passes /full/path/to/libexpat.so to the linker,
>> which then complains about an attempt to statically link a dynamic
>> library.  As far as I can tell the problem is somewhere in the
>> configure script under the gdb sub-directory.
> You might should check the patches used by sabotage or one of the
> other dists using musl. They probably have dealt with the gdb bugs and
> probably already have a good fix or workaround.
Sabotage has several gdb patches, but none of them addresses this. From 
the [deps] section, it looks like sabotage does not aim to have the 
python functionality in its static gdb, and from --disable-tui it looks 
like they encountered a similar problem with ncurses.  The version of 
gdb that I built is a bit newer than sabotage's (7.7 vs. 7.6/7.5), but I 
don't believe that matters.

>
>>>> 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).
>>> Static python is not very useful since most important python
>>> extensions are partly implemented as C code, which necessarily must be
>>> dynamically loaded.
>>>
>> The purpose of building a static python was to make a static
>> libpython.a available for gdb.  Given the loss of functionality on
>> both the python and gdb ends, it might be better to leave the two
>> dynamically linked as they were meant to be...
> I always just build gdb without python (I'm not much of a python fan).
> The ideal solution would be separating python out to run as a separate
> process communicating with gdb rather than actually embedding python
> in gdb. I really doubt python is anything remotely clean for embedding
> into other programs.
>
> Rich
Thanks for the tip.  My knowledge of python is actually rather limited; 
I just need it to work since many tests in llvm/clang depend on it...

zg


  reply	other threads:[~2014-04-30  4:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-20 17:03 writeonce
2014-04-20 20:29 ` writeonce
2014-04-20 20:31 ` Rich Felker
2014-04-20 21:39   ` writeonce
2014-04-21  7:33     ` Szabolcs Nagy
2014-04-21  8:21       ` Szabolcs Nagy
2014-04-21 11:16         ` writeonce
2014-04-21 11:16       ` writeonce
2014-04-29 21:40   ` writeonce
2014-04-30  2:57     ` Rich Felker
2014-04-30  3:26       ` writeonce
2014-04-30  4:07         ` Rich Felker
2014-04-30  4:29           ` Zvi Gilboa [this message]
2014-05-22 20:14             ` John Spencer

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=53607C30.4010207@eservices.virginia.edu \
    --to=zg7s@eservices.virginia.edu \
    --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).