summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorjimb <jimb@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2007-04-14 00:47:18 +0000
committerjimb <jimb@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2007-04-14 00:47:18 +0000
commita2325eece0c9cab8b325a31c5a1ab8b9286bd613 (patch)
treeec5f394d253628369265fcfcb63855002446dce6 /libc
parent727b65f28684c57788ff81ef31ec2a02a80facbe (diff)
downloadeglibc2-a2325eece0c9cab8b325a31c5a1ab8b9286bd613.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/trunk@1972 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc')
-rw-r--r--libc/ChangeLog.eglibc10
-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, 39 insertions, 27 deletions
diff --git a/libc/ChangeLog.eglibc b/libc/ChangeLog.eglibc
index 1f257edfd..d9d78fbae 100644
--- a/libc/ChangeLog.eglibc
+++ b/libc/ChangeLog.eglibc
@@ -1,3 +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.
+
2007-04-11 Jim Blandy <jimb@codesourcery.com>
* option-groups.mak: Use '../' if $(..) is unset.
diff --git a/libc/elf/Makefile b/libc/elf/Makefile
index 85f3d7644..923851e10 100644
--- a/libc/elf/Makefile
+++ b/libc/elf/Makefile
@@ -539,7 +539,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
@@ -586,7 +586,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
@@ -887,10 +887,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 "$@"