Re: Why is LD_LIBRARY_PATH unset in FC6 and not in FC5

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

 



Pelle Svensson wrote:
Hi,

Why is LD_LIBRARY_PATH not exported in following test on FC6.

Put Makefile, SubMakefile and Subscript in a directory and issue make.

Result if run as user:
[]$ make
================
In Makefile: LD_LIBRARY_PATH=/home/testing and TEST_PATH=/home/testing
make[1]: Entering directory `/home/pelle/diverse/make-fc6'
In SubMakefile: LD_LIBRARY_PATH= and TEST_PATH=/home/testing
make[1]: Leaving directory `/home/pelle/diverse/make-fc6'
In SubScript: LD_LIBRARY_PATH=/home/testing and TEST_PATH=/home/testing


Result if run as root:
[]$ sudo make
================
In Makefile: LD_LIBRARY_PATH=/home/testing and TEST_PATH=/home/testing
make[1]: Entering directory `/home/pelle/diverse/make-fc6'
In SubMakefile: LD_LIBRARY_PATH=/home/testing and TEST_PATH=/home/testing
make[1]: Leaving directory `/home/pelle/diverse/make-fc6'
In SubScript: LD_LIBRARY_PATH=/home/testing and TEST_PATH=/home/testing


On FC5 when running as user SubMakefile will have 'LD_LIBRARY_PATH=/home/testing'

/Pelle

_________________________________________________________________
Spela roliga Worms'07 i mobilen http://msn.cellus.se/?page=game_order&itemId=878908

I am no expert in compilers, but this issue has existed sin we were doing gcc on Solaris 2.1 (1992). Someone with better knowledge feel free to respond, but these are my observations:

root has special precautions about prepended library paths. That is a common trick of old security hackers.

In modern times. LD_LIBRARY_PATH simply should not be used any where.

When building an application you can set LD_RUN_PATH and that will embed the run path into the binary.

For applications that might move locations, there has been a method provided for years, by placing a simple text file with a run path in /etc/ld.so.conf.d the loader linker will use it as if LD_LIBRARY_PATH had been set.

This makes for an easily relocatable rpm, because the rpm can drop a text file in there that points to wherever the rpm has been located.

In your example above, simply change LD_LIBRARY_PATH to LD_RUN_PATH and you will get what you want, AND users will not need to set LD_LIBRARY_PATH.

Some discussion here:

http://osr507doc.sco.com/en/tools/ccs_linkedit_dynamic_dirsearch.html

LD_RUN_PATH seems to be absent here:

http://gcc.gnu.org/onlinedocs/gcc-4.2.0/gcc/Environment-Variables.html#Environment-Variables

So maybe I am just getting old, but I am sure that the principle is good, even if my failing memory is not. :)



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux