bug-gnulib
[Top][All Lists]
Advanced

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

Re: DEPENDS_ON_* preprocessor symbols


From: Bruno Haible
Subject: Re: DEPENDS_ON_* preprocessor symbols
Date: Sun, 23 May 2010 23:44:04 +0200
User-agent: KMail/1.9.9

Hi Ben,

> > I wish the list of libraries that support this mechanism was not hard-coded.
> > Do you have an idea for making it extensible?
> 
> It is not clear to me why this mechanism is here.  I guess that
> it must be to avoid the need for the caller to also call the
> individual lib<name>_set_relocation_prefix functions directly.

Yes, exactly. Assume a program links to libgettextpo. libgettextpo
may or may not be linked to libunistring. libunistring may or may
not be linked to libiconv. libgettextpo may or may not be linked
to libintl. => I cannot imagine the horrible #ifdef combinations
that result from the attempt to call the lib<name>_set_relocation_prefix
functions directly.

> But it would be much more flexible if the caller was given that
> option.  Each program could simply call the necessary functions
> for the libraries that it uses.

I think it does not scale.

Probably the best is to use dl_iterate_phdr on glibc and Solaris systems,
_dyld_get_image_name on MacOS X, loadquery on AIX, shl_get on HP-UX,
ldr_inq_module on OSF/1, VirtualQuery on Woe32.

Bruno



reply via email to

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