summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjimb <jimb@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2007-04-14 00:33:20 +0000
committerjimb <jimb@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2007-04-14 00:33:20 +0000
commit1590e6cad283b71a34158d9a8f928d1719440d41 (patch)
treec19a536d248c6b4a4def6ba85c84a9284914f002
parent664d6e49d327205c02bf16da8e4285ad2c6944da (diff)
downloadeglibc2-1590e6cad283b71a34158d9a8f928d1719440d41.tar.gz
* 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. git-svn-id: svn://svn.eglibc.org/branches/eglibc-2_5@1971 7b3dc134-2b1b-0410-93df-9e9f96275f8d
-rw-r--r--libc/ChangeLog.eglibc8
-rw-r--r--libc/elf/Makefile10
-rw-r--r--libc/nptl/Makefile2
-rwxr-xr-xlibc/nptl/tst-tls6.sh4
-rwxr-xr-xlibc/scripts/run-with-env.sh20
-rwxr-xr-xlibc/scripts/run-with-preload.sh20
6 files changed, 37 insertions, 27 deletions
diff --git a/libc/ChangeLog.eglibc b/libc/ChangeLog.eglibc
index 03617e74c..20192e06e 100644
--- a/libc/ChangeLog.eglibc
+++ b/libc/ChangeLog.eglibc
@@ -1,5 +1,13 @@
2007-04-13 Jim Blandy <jimb@codesourcery.com>
+ * 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.
2007-04-11 Jim Blandy <jimb@codesourcery.com>
diff --git a/libc/elf/Makefile b/libc/elf/Makefile
index 31d1d7433..4930b078f 100644
--- a/libc/elf/Makefile
+++ b/libc/elf/Makefile
@@ -542,7 +542,7 @@ LDFLAGS-preloadtest = -rdynamic
$(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)order.out: $(objpfx)order
$(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: $(libdl)
$(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
diff --git a/libc/nptl/Makefile b/libc/nptl/Makefile
index 6e241c17f..e64a2aaa5 100644
--- a/libc/nptl/Makefile
+++ b/libc/nptl/Makefile
@@ -471,7 +471,7 @@ $(objpfx)tst-tls6.out: tst-tls6.sh $(objpfx)tst-tls5 \
$(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)
diff --git a/libc/nptl/tst-tls6.sh b/libc/nptl/tst-tls6.sh
index f58e8270a..73bf538b7 100755
--- a/libc/nptl/tst-tls6.sh
+++ b/libc/nptl/tst-tls6.sh
@@ -4,14 +4,14 @@ common_objpfx=$1; shift
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
diff --git a/libc/scripts/run-with-env.sh b/libc/scripts/run-with-env.sh
new file mode 100755
index 000000000..0fc0d7ea5
--- /dev/null
+++ b/libc/scripts/run-with-env.sh
@@ -0,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 "$@"
diff --git a/libc/scripts/run-with-preload.sh b/libc/scripts/run-with-preload.sh
deleted file mode 100755
index da129bd9e..000000000
--- a/libc/scripts/run-with-preload.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-# Usage: run-with-preload.sh CMD ...
-#
-# Set the LD_PRELOAD environment variable to the value of the
-# $EGLIBC_TEST_LD_PRELOAD environment variable, and run CMD ... .
-#
-# The EGLIBC test suite uses this to set LD_PRELOAD for test programs.
-# If we simply say:
-# LD_PRELOAD=smootz \
-# $(cross-test-wrapper) \
-# tst-foo arg1 arg2
-# then the LD_PRELOAD setting inteferes with the execution of
-# $(cross-test-wrapper). If we instead say:
-# EGLIBC_TEST_LD_PRELOAD=smootz \
-# $(cross-test-wrapper) \
-# run-with-preload.sh \
-# tst-foo arg1 arg2
-# then things work fine.
-
-LD_PRELOAD="$EGLIBC_TEST_LD_PRELOAD" exec "$@"