svn commit: r255385 - in head/etc: . etc.amd64

Konstantin Belousov kostikbel at gmail.com
Sun Sep 8 14:39:03 UTC 2013


On Sun, Sep 08, 2013 at 01:48:54PM +0200, Dag-Erling Sm??rgrav wrote:
> Konstantin Belousov <kostikbel at gmail.com> writes:
> > There is no /lib32 on 64bit platforms.
> 
> It doesn't exist, but it's supported:
> 
> #ifdef COMPAT_32BIT
> #undef STANDARD_LIBRARY_PATH
> #undef _PATH_ELF_HINTS
> #define _PATH_ELF_HINTS         "/var/run/ld-elf32.so.hints"
> /* For running 32 bit binaries  */
> #define STANDARD_LIBRARY_PATH   "/lib32:/usr/lib32"
> #define LD_ "LD_32_"
> #endif
> 
> > I do not understand why these pathes are neeeded, since compat32 rtld
> > has proper default path built in
> 
> Did you read the log message?  I am perfectly aware that the two lines
> you're complaining about are a no-op; they're included mostly for
> documentation purposes.  However, if the code that uses them was made
> unconditional (it is currently #ifdef COMPAT_32BIT), these lines would
> eliminate the need to hardcode a special STANDARD_LIBRARY_PATH in
> rtld-elf.
Any line in libmap.conf cannot add to the standard search path.
It only translates existing path.

And, the standard path is specified by the ELF standard, which we try to
follow. I.e., hardcoding STD_LIB_PATH in rtld is basically an external
requirement.

I see no reason not to remove #ifdef COMPAT_32BIT from the
path_enumerate(). At least, it would make the rtld behaviour less
puzzling.

> 
> > but if anything, /lib should be translated to /usr/lib32.
> 
> Irrelevant, because while rtld-elf won't find anything there it will
> still find what it's looking for in /usr/lib32.
Not irrelevant. If the 32bit binary is linked with "-z nodefaultlib
-rpath /lib", /usr/lib32 would not be searched. This is not as silly as
it looks, since intent is to provide some private version of the library
which exists in /usr/lib.

The non-existing path in standard search path is harmless, while
translation of the existing path (in native environment) to non-existing
path (in compat32 env) has some side effects. I am trying to point out
that the line spelled as
/lib	/usr/lib32
is more reasonable.

> 
> These mappings are *not* applied to individual libraries; they are
> applied to STANDARD_LIBRARY_PATH, LD_LIBRARY_PATH and the program's or
> library's run-time search path (-rpath).
> 
> DES
> -- 
> Dag-Erling Sm??rgrav - des at des.no
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20130908/8a265613/attachment.sig>


More information about the svn-src-all mailing list