bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Relocation patch for cygwin


From: Bruno Haible
Subject: Re: Relocation patch for cygwin
Date: Wed, 5 Oct 2011 14:10:23 +0200
User-agent: KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; )

Charles Wilson wrote:
> > Only it's a pity that you gave me the advice to use Cygwin's 
> > /proc/self/maps,
> > which I did [2], and now we discover that it is much slower than the Win32
> > API calls that I had originally.
> ...
> The problem is, it can really cause issues for "the rest of cygwin" if
> an app uses the Win32 API "behind cygwin's back".  Given cygwin's
> existing code and algorithm structure, the Win32 calls that
> old-relocation was using were not (and are not) problematic AFAICT (*)
> -- but that could change in the future, in unpredictable ways.  It would
> be bad if cygwin found itself constrained in its ongoing development,
> because some important libraries were using Win32 calls in ways that
> prevented cygwin from making some optimization or other.

I understand all that. I'm only saying that
  - My need was to have the file name behind one particular address in
    the current process.
  - The Cygwin API only allows me to get _all_ file names behind all
    addresses across the entire current process, and this is slow.
  - It would be useful to have a Cygwin API that gives me the file
    file name behind one particular address in the current process.
    This should not be that slow.

> > 2011-10-03  Bruno Haible  <address@hidden>
> > 
> >     relocatable-lib[-lgpl]: Avoid expensive /proc access on Linux, Cygwin.
> >     * lib/relocatable.c (ENABLE_COSTLY_RELOCATABLE): New macro.
> >     (compute_curr_prefix, shared_library_fullname,
> >     find_shared_library_fullname, get_shared_library_fullname, relocate):
> >     Use it together with PIC && INSTALLDIR.
> >     Reported by <address@hidden>
> >     via Charles Wilson <address@hidden>.
> 
> Basically, this patch means that even if I **DO** configure with
> --enable-relocation, I won't actually get it.  That's not the right fix.
>  If I do --enable-relocatable, then by george I ought to get it, slow
> 5ms operation and all.

No, you misunderstand it. I have split the relocatable support into a
cheap part and an expensive part. The cheap part is for people who
configure one package with --enable-relocatable, or several packages
with --enable-relocatable and the same prefix. This will continue to
work.

The expensive part is support for people who combine two packages,
built with different --prefix options. This one is costly, because
every library has to parse /proc/self/maps.

On Cygwin, many packages come through Cygwin itself, therefore people
have no need to repackage and redistribute a library that they have
not built themselves.

Only on native Windows it is likely that people will redistribute
libraries that they have not built themselves. That's why I kept the
expensive part enabled by default only on native Windows.

Bruno
-- 
In memoriam Annalena Tonelli <http://en.wikipedia.org/wiki/Annalena_Tonelli>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]