patch for location-independence

Frank Ch. Eigler fche@redhat.com
Wed Nov 21 13:59:00 GMT 2001


Hi -

On Wed, Nov 21, 2001 at 01:33:47PM -0800, Geoffrey Keating wrote:
: The attached patch causes SID to look at argv[0] to determine its
: location, so that the installed sid tree can be moved anywhere and
: there is no need to set SID_EXEC_PREFIX (to run the sid executable,
: at least).
: 
: OK to commit?

Thank you for giving this a try, however, I have a few
reservations though about the propriety of this approach.

For one thing, global variables such as sidutil::argv0[] are
generally unwelcome in sid, among other reasons for interfering
with shared library mechanisms.  For another, it is necessary to
use systematic C++ namespace prefixing on ~all the identifiers;
testing with gcc 3.0+ helps uncover problems like that.  The code
also does too much (all) work anew for each file search.

It would be better to put this logic into sid/main/mainDynamic.cxx
itself; if getenv(SID_EXEC_PREFIX) is unset, it could endavour to
compute a plausible value and put it into the environment.  (It could
do the same to a hypothetical SID_PREFIX while at it.)  The sidutil
code could then go unchanged, or even simplified.

Does this make sense?

(I wonder too to what extent the code in question was begat by gcc;
sid is (C) Red Hat, not (C) FSF; is there a reason for concern?)

- FChE
-- 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7/CO2VZbdDOm/ZT0RAgcgAJ9Fwi8yubKZiLo1WrPfeXfd9lApQwCfeXUx
IGZUl0CSNjv4+GKD00ga0l0=
=vjpK
-----END PGP SIGNATURE-----


More information about the Sid mailing list