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

[commits] r1971 - in /branches/eglibc-2_5/libc: ./ elf/ nptl/ scripts/



Author: jimb
Date: Fri Apr 13 17:33:20 2007
New Revision: 1971

Log:
* scripts/run-with-env.sh: New script.
* elf/Makefile: Use run-with-env.sh instead of
run-with-preload.sh.
* nptl/Makefile: Same.
(tst-audit1.out, tst-audit2.out): Use run-with-env.sh, and set
EGLIBC_TEST_LD_AUDIT instead of LD_AUDIT.
* scripts/run-with-preload.sh: Delete.

Added:
    branches/eglibc-2_5/libc/scripts/run-with-env.sh   (with props)
Removed:
    branches/eglibc-2_5/libc/scripts/run-with-preload.sh
Modified:
    branches/eglibc-2_5/libc/ChangeLog.eglibc
    branches/eglibc-2_5/libc/elf/Makefile
    branches/eglibc-2_5/libc/nptl/Makefile
    branches/eglibc-2_5/libc/nptl/tst-tls6.sh

Modified: branches/eglibc-2_5/libc/ChangeLog.eglibc
==============================================================================
--- branches/eglibc-2_5/libc/ChangeLog.eglibc (original)
+++ branches/eglibc-2_5/libc/ChangeLog.eglibc Fri Apr 13 17:33:20 2007
@@ -1,4 +1,12 @@
 2007-04-13  Jim Blandy  <jimb@xxxxxxxxxxxxxxxx>
+
+	* scripts/run-with-env.sh: New script.
+	* elf/Makefile: Use run-with-env.sh instead of
+	run-with-preload.sh.
+	* nptl/Makefile: Same.
+	(tst-audit1.out, tst-audit2.out): Use run-with-env.sh, and set
+	EGLIBC_TEST_LD_AUDIT instead of LD_AUDIT.
+	* scripts/run-with-preload.sh: Delete.
 
 	* EGLIBC.option-groups: Doc fixes.
 

Modified: branches/eglibc-2_5/libc/elf/Makefile
==============================================================================
--- branches/eglibc-2_5/libc/elf/Makefile (original)
+++ branches/eglibc-2_5/libc/elf/Makefile Fri Apr 13 17:33:20 2007
@@ -542,7 +542,7 @@
 $(objpfx)preloadtest.out: $(preloadtest-preloads:%=$(objpfx)%.so)
 preloadtest-ENV = \
   EGLIBC_TEST_LD_PRELOAD=$(subst $(empty) ,:,$(strip $(preloadtest-preloads:=.so)))
-preloadtest-WRAPPER = $(..)scripts/run-with-preload.sh
+preloadtest-WRAPPER = $(..)scripts/run-with-env.sh
 
 $(objpfx)loadfail: $(libdl)
 LDFLAGS-loadfail = -rdynamic
@@ -589,7 +589,7 @@
 $(objpfx)vismain: $(addprefix $(objpfx),vismod1.so vismod2.so)
 $(objpfx)vismain.out: $(addprefix $(objpfx),vismod3.so)
 vismain-ENV = EGLIBC_TEST_LD_PRELOAD=$(addprefix $(objpfx),vismod3.so)
-vismain-WRAPPER = $(..)scripts/run-with-preload.sh
+vismain-WRAPPER = $(..)scripts/run-with-env.sh
 
 $(objpfx)noload: $(objpfx)testobj1.so
 LDFLAGS-noload = -rdynamic
@@ -890,10 +890,12 @@
 $(objpfx)tst-dlmopen3.out: $(objpfx)tst-dlmopen1mod.so
 
 $(objpfx)tst-audit1.out: $(objpfx)tst-auditmod1.so
-tst-audit1-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
+tst-audit1-ENV = EGLIBC_TEST_LD_AUDIT=$(objpfx)tst-auditmod1.so
+tst-audit1-WRAPPER = $(..)scripts/run-with-env.sh
 
 $(objpfx)tst-audit2.out: $(objpfx)tst-auditmod1.so
-tst-audit2-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
+tst-audit2-ENV = EGLIBC_TEST_LD_AUDIT=$(objpfx)tst-auditmod1.so
+tst-audit2-WRAPPER = $(..)scripts/run-with-env.sh
 
 $(objpfx)tst-global1: $(libdl)
 $(objpfx)tst-global1.out: $(objpfx)testobj6.so $(objpfx)testobj2.so

Modified: branches/eglibc-2_5/libc/nptl/Makefile
==============================================================================
--- branches/eglibc-2_5/libc/nptl/Makefile (original)
+++ branches/eglibc-2_5/libc/nptl/Makefile Fri Apr 13 17:33:20 2007
@@ -471,7 +471,7 @@
 		       $(objpfx)tst-tls5mode.so $(objpfx)tst-tls5modf.so
 	$(SHELL) -e tst-tls6.sh $(common-objpfx) $(elf-objpfx) \
 		    $(rtld-installed-name) '$(cross-test-wrapper)' \
-		    $(..)scripts/run-with-preload.sh
+		    $(..)scripts/run-with-env.sh
 endif
 
 $(objpfx)tst-dlsym1: $(libdl) $(shared-thread-library)

Modified: branches/eglibc-2_5/libc/nptl/tst-tls6.sh
==============================================================================
--- branches/eglibc-2_5/libc/nptl/tst-tls6.sh (original)
+++ branches/eglibc-2_5/libc/nptl/tst-tls6.sh Fri Apr 13 17:33:20 2007
@@ -4,14 +4,14 @@
 elf_objpfx=$1; shift
 rtld_installed_name=$1; shift
 cross_test_wrapper=$1; shift
-run_with_preload=$1; shift
+run_with_env=$1; shift
 logfile=$common_objpfx/nptl/tst-tls6.out
 
 # We have to find libc and nptl
 library_path=${common_objpfx}:${common_objpfx}nptl
 tst_tls5="${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
 	  ${common_objpfx}/nptl/tst-tls5"
-tst_tls5="$cross_test_wrapper $run_with_preload $tst_tls5"
+tst_tls5="$cross_test_wrapper $run_with_env $tst_tls5"
 
 LC_ALL=C
 export LC_ALL

Added: branches/eglibc-2_5/libc/scripts/run-with-env.sh
==============================================================================
--- branches/eglibc-2_5/libc/scripts/run-with-env.sh (added)
+++ branches/eglibc-2_5/libc/scripts/run-with-env.sh Fri Apr 13 17:33:20 2007
@@ -1,0 +1,20 @@
+#!/bin/sh
+# Usage: run-with-env.sh CMD ...
+# Execute commands with environment variables set at the last minute.
+# For certain environment variable whose names are of the form
+# 'EGLIBC_TEST_foo', if they are set, we set an environment variable
+# 'foo' to their value.
+#
+# This lets us run test programs via wrappers with environment
+# variable settings that would otherwise interfere with the wrapper
+# itself, like LD_PRELOAD or LD_AUDIT.
+
+if [ "${EGLIBC_TEST_LD_PRELOAD+set}" ]; then
+    export LD_PRELOAD="${EGLIBC_TEST_LD_PRELOAD}"
+fi
+
+if [ "${EGLIBC_TEST_LD_AUDIT+set}" ]; then
+    export LD_AUDIT="${EGLIBC_TEST_LD_AUDIT}"
+fi
+
+exec "$@"

Propchange: branches/eglibc-2_5/libc/scripts/run-with-env.sh
------------------------------------------------------------------------------
    svn:executable = *