Tru64 and Irix have RPATH issues for test suite
authorTom Yu <tlyu@mit.edu>
Thu, 12 Feb 2004 18:28:01 +0000 (18:28 +0000)
committerTom Yu <tlyu@mit.edu>
Thu, 12 Feb 2004 18:28:01 +0000 (18:28 +0000)
Implement hack for faking up _RLD_ROOT with a shadow of the directory
tree up to the installed "lib" directory.  This helps with running
tests on Tru64 and Irix.

ticket: 1793

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16066 dc483132-0cff-0310-8789-dd5450dbe970

src/config/ChangeLog
src/config/pre.in
src/config/shlib.conf
src/kadmin/testing/scripts/ChangeLog
src/kadmin/testing/scripts/env-setup.shin
src/util/ChangeLog
src/util/Makefile.in

index 37d34aa45c4e745afe4ede893f379e88d3e04f91..16c1fa9cbc4ad88f6ea723082bd0434dece05fde 100644 (file)
@@ -1,3 +1,15 @@
+2004-02-12  Tom Yu  <tlyu@mit.edu>
+
+       * pre.in (FAKEDEST, FAKEPREFIX, FAKELIBDIR): Support variables for
+       the _RLD_ROOT hack.
+
+       * shlib.conf: For alpha/Tru64 and Irix, construct _RLD_ROOT values
+       pointing to a fake destdir, as well as to the real root directory.
+       Previously, pointing _RLD_ROOT at a non-existent directory and
+       putting everything in LD_LIBRARY_PATH caused other installed
+       utilities with RPATHs which were run by the test suite to fail to
+       run.
+
 2004-02-09  Tom Yu  <tlyu@mit.edu>
 
        * config.guess: Update from autoconf-2.59.
index f89a9da406c620b51ab6a253069598e4ad55ba94..34f91b7e09e0fb27f17c63d2bed882c942d4fec0 100644 (file)
@@ -123,6 +123,10 @@ SRCTOP = @srcdir@/$(BUILDTOP)
 VPATH = @srcdir@
 CONFIG_RELTOPDIR = @CONFIG_RELTOPDIR@
 
+FAKEDEST=$(BUILDTOP)/util/fakedest
+FAKEPREFIX=$(FAKEDEST)/$(prefix)
+FAKELIBDIR=$(FAKEPREFIX)/lib
+
 # DEFS         set by configure
 # DEFINES      set by local Makefile.in
 # LOCALINCLUDES        set by local Makefile.in
index f37a747338a8f074701becbcf305d716df1a16ed..8442ab8346b590157ed23f69062c7c5114046032 100644 (file)
@@ -30,13 +30,20 @@ alpha*-dec-osf*)
        PROFFLAGS=-pg
        RPATH_FLAG='-Wl,-rpath -Wl,'
        CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) $(RPATH_FLAG)$(PROG_RPATH) $(CFLAGS) $(LDFLAGS)'
-       # Need -oldstyle_liblookup to avoid picking up shared libs from
-       # other builds.  OSF/1 / Tru64 ld programs look through the entire
-       # library path for shared libs prior to looking through the
-       # entire library path for static libs.
-       CC_LINK_STATIC='$(CC) $(PROG_LIBPATH) -Wl,-oldstyle_liblookup $(CFLAGS) $(LDFLAGS)'
-       # $(PROG_RPATH) is here to handle things like a shared tcl library
-       RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`:$(PROG_RPATH):/usr/shlib:/usr/ccs/lib:/usr/lib/cmplrs/cc:/usr/lib:/usr/local/lib; export LD_LIBRARY_PATH; _RLD_ROOT=/dev/dummy/d; export _RLD_ROOT;'
+       if test "$krb5_cv_prog_gcc" = yes; then
+               # Really should check for gnu ld vs system ld, too.
+               CC_LINK_STATIC='$(CC) $(PROG_LIBPATH) $(CFLAGS) $(LDFLAGS)'
+       else
+               # Need -oldstyle_liblookup to avoid picking up shared libs from
+               # other builds.  OSF/1 / Tru64 ld programs look through the entire
+               # library path for shared libs prior to looking through the
+               # entire library path for static libs.
+               CC_LINK_STATIC='$(CC) $(PROG_LIBPATH) -Wl,-oldstyle_liblookup $(CFLAGS) $(LDFLAGS)'
+       fi
+       # _RLD_ROOT hack needed to repoint "root" directory for purposes
+       # of searching for shared libs, since RPATHs take precedence over
+       # LD_LIBRARY_PATH.
+       RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`$${LD_LIBRARY_PATH+:$$LD_LIBRARY_PATH}; export LD_LIBRARY_PATH; _RLD_ROOT=$(FAKEDEST):$${_RLD_ROOT+$$_RLD_ROOT}$${_RLD_ROOT-/}; export _RLD_ROOT;'
        ;;
 
 # HPUX *seems* to work under 10.20.
@@ -93,11 +100,17 @@ mips-sgi-irix6.3)  # This is a Kludge; see below
        # supported ABIs on Irix, and the precedence of the rpath over
        # LD_LIBRARY*_PATH.  Like OSF/1, _RLD*_ROOT needs to be set to
        # work around this lossage.
-       add='`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`'
-       dummy=/dev/dummmy/d
+       #
        # Set the N32 and 64 variables first because the unqualified
        # variables affect all three and can cause the sed command to fail.
-       RUN_ENV="LD_LIBRARYN32_PATH=$add:/usr/lib32:/usr/lib32/internal:/lib32:/opt/lib32; export LD_LIBRARYN32_PATH; _RLDN32_ROOT=$dummy; export _RLDN32_ROOT; LD_LIBRARY64_PATH=$add:/usr/lib64:/usr/lib64/internal:/lib64:/opt/lib64; export LD_LIBRARY64_PATH; _RLD64_ROOT=$dummy; export _RLD64_ROOT; LD_LIBRARY_PATH=$add:/usr/lib:/usr/lib/internal:/lib:/lib/cmplrs/cc:/usr/lib/cmplrs/cc:/opt/lib; export LD_LIBRARY_PATH; _RLD_ROOT=$dummy; export _RLD_ROOT;"
+       #
+       # This loop is to reduce the clutter a slight bit.
+       add='`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`'
+       RUN_ENV=
+       for i in N32 64 ''; do
+               RUN_ENV="${RUN_ENV+ $RUN_ENV}LD_LIBRARY${i}_PATH=$add\$\${LD_LIBRARY${i}_PATH+:\$\$LD_LIBRARY${i}_PATH}; export LD_LIBRARY${i}_PATH;"
+               RUN_ENV="${RUN_ENV} _RLD${i}_ROOT=\$(FAKEDEST):\$\${_RLD${i}_ROOT+\$\${_RLD${i}_ROOT}}\$\${_RLD${i}_ROOT-/}; export _RLD${i}_ROOT;"
+       done
        ;;
 
 mips-sgi-irix*)
@@ -116,11 +129,17 @@ mips-sgi-irix*)
        # supported ABIs on Irix, and the precedence of the rpath over
        # LD_LIBRARY*_PATH.  Like OSF/1, _RLD*_ROOT needs to be set to
        # work around this lossage.
-       add='`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`'
-       dummy=/dev/dummmy/d
+       #
        # Set the N32 and 64 variables first because the unqualified
        # variables affect all three and can cause the sed command to fail.
-       RUN_ENV="LD_LIBRARYN32_PATH=$add:/usr/lib32:/usr/lib32/internal:/lib32:/opt/lib32; export LD_LIBRARYN32_PATH; _RLDN32_ROOT=$dummy; export _RLDN32_ROOT; LD_LIBRARY64_PATH=$add:/usr/lib64:/usr/lib64/internal:/lib64:/opt/lib64; export LD_LIBRARY64_PATH; _RLD64_ROOT=$dummy; export _RLD64_ROOT; LD_LIBRARY_PATH=$add:/usr/lib:/usr/lib/internal:/lib:/lib/cmplrs/cc:/usr/lib/cmplrs/cc:/opt/lib; export LD_LIBRARY_PATH; _RLD_ROOT=$dummy; export _RLD_ROOT;"
+       #
+       # This loop is to reduce the clutter a slight bit.
+       add='`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`'
+       RUN_ENV=
+       for i in N32 64 ''; do
+               RUN_ENV="${RUN_ENV+ $RUN_ENV}LD_LIBRARY${i}_PATH=$add\$\${LD_LIBRARY${i}_PATH+:\$\$LD_LIBRARY${i}_PATH}; export LD_LIBRARY${i}_PATH;"
+               RUN_ENV="${RUN_ENV} _RLD${i}_ROOT=\$(FAKEDEST):\$\${_RLD${i}_ROOT+\$\${_RLD${i}_ROOT}}\$\${_RLD${i}_ROOT-/}; export _RLD${i}_ROOT;"
+       done
        ;;
 
 # untested...
index 4b49a023cdc49cb6a3bf6bfb135524a138fd535d..1ec2b42a36805205c284711a2a780088d5b4edc2 100644 (file)
@@ -1,3 +1,7 @@
+2004-02-12  Tom Yu  <tlyu@mit.edu>
+
+       * env-setup.shin: Substitute FAKEDEST.  Substitue "$" for "$$".
+
 2003-12-05  Tom Yu  <tlyu@mit.edu>
 
        * env-setup.shin: Allow BUILDTOP substitution.
index e4a8c7e1b50fa7c13db56a36516f8f82039efa09..0f790ac1c291150989fe8dd6dc4ddc2e7d91ef75 100644 (file)
@@ -22,12 +22,14 @@ PROG_LIBPATH=-L@RBUILD@/lib
 BUILDTOP=@RBUILD@
 # XXX kludge!
 PROG_RPATH=@RBUILD@/lib
+# XXX more kludge!
+FAKEDEST=@RBUILD@/util/fakedest
 # This converts $(TOPLIBD) to $TOPLIBD
 cat > /tmp/env_setup$$ <<\EOF
 @KRB5_RUN_ENV@
 EOF
 
-foo=`sed -e 's/(//g' -e 's/)//g' /tmp/env_setup$$`
+foo=`sed -e 's/(//g' -e 's/)//g' -e 's/\\\$\\\$/\$/g' /tmp/env_setup$$`
 eval $foo
 
 # This will get put in setup.csh for convenience
index 7b833a1e1dc02fcef24cd73872bebbefa6cb62a0..54b9cdbbd321e4bd472e87729a3a0c7271b95510 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-12  Tom Yu  <tlyu@mit.edu>
+
+       * Makefile.in (all-unix, clean-unix): Add new rule to build fake
+       root directory for _RLD_ROOT hacks.
+
 2003-12-05  Tom Yu  <tlyu@mit.edu>
 
        * Makefile.in (DL_COMPILE, DL_COMPILE_TAIL): New variables to
index bb04ff73d6fc44ba5b73b1df7a8cabca6eb53a5a..dd106bbc289c8a4dc690df84e6b442dc0101503a 100644 (file)
@@ -29,8 +29,15 @@ DL_COMPILE=@DL_COMPILE@
 DL_COMPILE_TAIL=@DL_COMPILE_TAIL@
 
 all-recurse: libupdate makeshlib @EXITSLEEP_TARG@
+all-unix:: $(FAKEPREFIX)/lib
 all-mac::
 
+$(FAKEPREFIX)/lib:
+       $(SRCTOP)/config/mkinstalldirs $(FAKEPREFIX) && ln -s `pwd`/../lib $(FAKEPREFIX)
+
+clean-unix::
+       $(RM) -r $(FAKEPREFIX)
+
 NO_OUTDIR=1
 all-windows::
        @echo Making in util\windows