mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-23 09:43:32 +08:00
Support cross-testing.
This commit is contained in:
parent
6e6249d0b4
commit
cc1290d07e
39
ChangeLog
39
ChangeLog
@ -1,3 +1,42 @@
|
||||
2012-10-24 Joseph Myers <joseph@codesourcery.com>
|
||||
Jim Blandy <jimb@codesourcery.com>
|
||||
|
||||
* Makeconfig (test-wrapper): New variable,
|
||||
(test-wrapper-env): Likewise.
|
||||
[$(cross-compiling) = yes && $(test-wrapper) != ""]
|
||||
(run-built-tests): Define to yes.
|
||||
(run-program-prefix): Use $(test-wrapper).
|
||||
(built-program-cmd): Likewise.
|
||||
* Rules (make-test-out): Use $(test-wrapper-env) and
|
||||
$(host-built-program-cmd).
|
||||
* elf/Makefile ($(objpfx)order.out): Use $(test-wrapper).
|
||||
($(objpfx)tst-pathopt.out): Pass $(test-wrapper-env) to
|
||||
tst-pathopt.sh.
|
||||
($(objpfx)tst-rtld-load-self.out): Pass $(test-wrapper) and
|
||||
$(test-wrapper-env) to tst-rtld-load-self.sh.
|
||||
($(objpfx)order2.out): Use $(test-wrapper).
|
||||
($(objpfx)tst-initorder.out): Likewise.
|
||||
($(objpfx)tst-initorder2.out): Likewise.
|
||||
($(objpfx)tst-unused-dep.out): Use $(test-wrapper-env).
|
||||
* elf/tst-pathopt.sh (run_program_prefix): Remove unused variable.
|
||||
(test_wrapper_env): New variable. Use it to run ld.so.
|
||||
* elf/tst-rtld-load-self.sh (test_wrapper): New variable.
|
||||
Use it to run ld.so.
|
||||
(test_wrapper_env): Likewise.
|
||||
* iconvdata/Makefile ($(objpfx)iconv-test.out): Pass
|
||||
$(test-wrapper) to run-iconv-test.sh.
|
||||
* iconvdata/run-iconv-test.sh (test_wrapper): New variable.
|
||||
(ICONV): Use $test_wrapper.
|
||||
* posix/Makefile ($(objpfx)globtest.out): Pass
|
||||
$(run-via-rtld-prefix), $(test-wrapper) and $(test-wrapper-env) to
|
||||
globtest.sh, not $(run-program-prefix).
|
||||
* posix/globtest.sh (run_via_rtld_prefix): New variable.
|
||||
(test_wrapper): Likewise.
|
||||
(test_wrapper_env): Likewise. Use it to run globtest with HOME
|
||||
set together with run_via_rtld_prefix.
|
||||
(run_program_prefix): Define in terms of test_wrapper and
|
||||
run_via_rtld_prefix.
|
||||
|
||||
2012-10-24 Roland McGrath <roland@hack.frob.com>
|
||||
|
||||
* nscd/Makefile ($(objpfx)nscd): Remove librt dependency.
|
||||
|
19
Makeconfig
19
Makeconfig
@ -564,9 +564,21 @@ endif
|
||||
csu-objpfx = $(common-objpfx)csu/
|
||||
elf-objpfx = $(common-objpfx)elf/
|
||||
|
||||
# A command that, prepended to the name and arguments of a program,
|
||||
# and run on the build system, causes that program with those
|
||||
# arguments to be run on the host for which the library is built.
|
||||
ifndef test-wrapper
|
||||
test-wrapper =
|
||||
endif
|
||||
# Likewise, but the name of the program is preceded by
|
||||
# <variable>=<value> assignments for environment variables.
|
||||
ifndef test-wrapper-env
|
||||
test-wrapper-env = $(test-wrapper) env
|
||||
endif
|
||||
|
||||
# Whether to run test programs built for the library's host system.
|
||||
ifndef run-built-tests
|
||||
ifeq (yes,$(cross-compiling))
|
||||
ifeq (yes|,$(cross-compiling)|$(test-wrapper))
|
||||
run-built-tests = no
|
||||
else
|
||||
run-built-tests = yes
|
||||
@ -600,12 +612,13 @@ endif
|
||||
# of a program built with the newly built library, produces a command
|
||||
# that, executed on the build system on which "make" is run, runs that
|
||||
# program.
|
||||
run-program-prefix = $(run-via-rtld-prefix)
|
||||
run-program-prefix = $(test-wrapper) $(run-via-rtld-prefix)
|
||||
# $(built-program-cmd) is a command that, executed on the build system
|
||||
# on which "make" is run, runs the newly built program that is the
|
||||
# second dependency of the makefile target in which
|
||||
# $(built-program-cmd) is used.
|
||||
built-program-cmd = $(run-via-rtld-prefix) $(built-program-file)
|
||||
built-program-cmd = $(test-wrapper) \
|
||||
$(run-via-rtld-prefix) $(built-program-file)
|
||||
# $(host-built-program-cmd) is a command that, executed on the host
|
||||
# for which the library is built, runs the newly built program that is
|
||||
# the second dependency of the makefile target in which
|
||||
|
5
Rules
5
Rules
@ -180,8 +180,9 @@ ifneq "$(strip $(tests) $(xtests) $(test-srcs))" ""
|
||||
# These are the implicit rules for making test outputs
|
||||
# from the test programs and whatever input files are present.
|
||||
|
||||
make-test-out = GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
|
||||
$($*-ENV) $(built-program-cmd) $($*-ARGS)
|
||||
make-test-out = $(test-wrapper-env) \
|
||||
GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
|
||||
$($*-ENV) $(host-built-program-cmd) $($*-ARGS)
|
||||
$(objpfx)%-bp.out: %.input $(objpfx)%-bp
|
||||
$(make-test-out) > $@ < $(word 1,$^)
|
||||
$(objpfx)%.out: %.input $(objpfx)%
|
||||
|
@ -644,6 +644,7 @@ $(objpfx)circlemod2a.so: $(objpfx)circlemod3a.so
|
||||
$(objpfx)order: $(addprefix $(objpfx),dep4.so dep3.so dep2.so dep1.so)
|
||||
|
||||
$(objpfx)order.out: $(objpfx)order
|
||||
$(test-wrapper) \
|
||||
$(elf-objpfx)$(rtld-installed-name) \
|
||||
--library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
|
||||
$(objpfx)order > $@
|
||||
@ -710,10 +711,10 @@ $(objpfx)lateglobal.out: $(objpfx)ltglobmod1.so $(objpfx)ltglobmod2.so
|
||||
$(objpfx)tst-pathopt: $(libdl)
|
||||
$(objpfx)tst-pathopt.out: tst-pathopt.sh $(objpfx)tst-pathopt \
|
||||
$(objpfx)pathoptobj.so
|
||||
$(SHELL) $< $(common-objpfx)
|
||||
$(SHELL) $< $(common-objpfx) '$(test-wrapper-env)'
|
||||
|
||||
$(objpfx)tst-rtld-load-self.out: tst-rtld-load-self.sh $(objpfx)ld.so
|
||||
$(SHELL) $^ > $@
|
||||
$(SHELL) $^ '$(test-wrapper)' '$(test-wrapper-env)' > $@
|
||||
|
||||
$(objpfx)initfirst: $(libdl)
|
||||
$(objpfx)initfirst.out: $(objpfx)firstobj.so
|
||||
@ -1035,6 +1036,7 @@ $(objpfx)tst-global1.out: $(objpfx)testobj6.so $(objpfx)testobj2.so
|
||||
$(objpfx)order2: $(libdl)
|
||||
$(objpfx)order2.out: $(objpfx)order2 $(objpfx)order2mod1.so \
|
||||
$(objpfx)order2mod2.so
|
||||
$(test-wrapper) \
|
||||
$(elf-objpfx)$(rtld-installed-name) \
|
||||
--library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
|
||||
$(objpfx)order2 > $@
|
||||
@ -1129,6 +1131,7 @@ $(objpfx)tst-unique3.out: $(objpfx)tst-unique3lib2.so
|
||||
$(objpfx)tst-unique4: $(objpfx)tst-unique4lib.so
|
||||
|
||||
$(objpfx)tst-initorder.out: $(objpfx)tst-initorder
|
||||
$(test-wrapper) \
|
||||
$(elf-objpfx)${rtld-installed-name} \
|
||||
--library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
|
||||
$< > $@
|
||||
@ -1150,6 +1153,7 @@ object-suffixes-left := a b c d
|
||||
include $(o-iterator)
|
||||
|
||||
$(objpfx)tst-initorder2.out: $(objpfx)tst-initorder2
|
||||
$(test-wrapper) \
|
||||
$(elf-objpfx)${rtld-installed-name} \
|
||||
--library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
|
||||
$< > $@
|
||||
@ -1179,6 +1183,7 @@ tests: $(objpfx)tst-unused-dep.out
|
||||
endif
|
||||
|
||||
$(objpfx)tst-unused-dep.out: $(objpfx)testobj1.so
|
||||
$(test-wrapper-env) \
|
||||
LD_TRACE_LOADED_OBJECTS=1 \
|
||||
LD_DEBUG=unused \
|
||||
LD_PRELOAD= \
|
||||
|
@ -20,7 +20,7 @@
|
||||
set -e
|
||||
|
||||
common_objpfx=$1
|
||||
run_program_prefix=$2
|
||||
test_wrapper_env=$2
|
||||
|
||||
test -e ${common_objpfx}elf/will-be-empty &&
|
||||
rm -fr ${common_objpfx}elf/will-be-empty
|
||||
@ -29,6 +29,7 @@ test -d ${common_objpfx}elf/for-renamed ||
|
||||
|
||||
cp ${common_objpfx}elf/pathoptobj.so ${common_objpfx}elf/for-renamed/renamed.so
|
||||
|
||||
${test_wrapper_env} \
|
||||
LOCPATH=${common_objpfx}localedata GCONV_PATH=${common_objpfx}iconvdata \
|
||||
LC_ALL=C LD_LIBRARY_PATH=${common_objpfx}elf/will-be-empty:${common_objpfx}elf/for-renamed:${common_objpfx}.:${common_objpfx}dlfcn \
|
||||
${common_objpfx}elf/ld.so ${common_objpfx}elf/tst-pathopt \
|
||||
|
@ -21,25 +21,28 @@
|
||||
set -e
|
||||
|
||||
rtld=$1
|
||||
test_wrapper=$2
|
||||
test_wrapper_env=$3
|
||||
result=0
|
||||
|
||||
echo '# normal mode'
|
||||
$rtld $rtld 2>&1 && rc=0 || rc=$?
|
||||
${test_wrapper} $rtld $rtld 2>&1 && rc=0 || rc=$?
|
||||
echo "# exit status $rc"
|
||||
test $rc -le 127 || result=1
|
||||
|
||||
echo '# list mode'
|
||||
$rtld --list $rtld 2>&1 && rc=0 || rc=$?
|
||||
${test_wrapper} $rtld --list $rtld 2>&1 && rc=0 || rc=$?
|
||||
echo "# exit status $rc"
|
||||
test $rc -eq 0 || result=1
|
||||
|
||||
echo '# verify mode'
|
||||
$rtld --verify $rtld 2>&1 && rc=0 || rc=$?
|
||||
${test_wrapper} $rtld --verify $rtld 2>&1 && rc=0 || rc=$?
|
||||
echo "# exit status $rc"
|
||||
test $rc -eq 2 || result=1
|
||||
|
||||
echo '# trace mode'
|
||||
LD_TRACE_LOADED_OBJECTS=1 $rtld $rtld 2>&1 && rc=0 || rc=$?
|
||||
${test_wrapper_env} LD_TRACE_LOADED_OBJECTS=1 \
|
||||
$rtld $rtld 2>&1 && rc=0 || rc=$?
|
||||
echo "# exit status $rc"
|
||||
test $rc -eq 0 || result=1
|
||||
|
||||
|
@ -299,7 +299,7 @@ $(objpfx)tst-iconv7.out: $(objpfx)gconv-modules \
|
||||
$(objpfx)iconv-test.out: run-iconv-test.sh $(objpfx)gconv-modules \
|
||||
$(addprefix $(objpfx),$(modules.so)) \
|
||||
$(common-objdir)/iconv/iconv_prog TESTS
|
||||
$(SHELL) $< $(common-objdir) > $@
|
||||
$(SHELL) $< $(common-objdir) '$(test-wrapper)' > $@
|
||||
|
||||
$(objpfx)tst-tables.out: tst-tables.sh $(objpfx)gconv-modules \
|
||||
$(addprefix $(objpfx),$(modules.so)) \
|
||||
|
@ -21,6 +21,7 @@
|
||||
set -e
|
||||
|
||||
codir=$1
|
||||
test_wrapper="$2"
|
||||
|
||||
# We use always the same temporary file.
|
||||
temp1=$codir/iconvdata/iconv-test.xxx
|
||||
@ -39,6 +40,7 @@ LIBPATH=$codir:$codir/iconvdata
|
||||
# How the start the iconv(1) program.
|
||||
ICONV='$codir/elf/ld.so --library-path $LIBPATH --inhibit-rpath ${from}.so \
|
||||
$codir/iconv/iconv_prog'
|
||||
ICONV="$test_wrapper $ICONV"
|
||||
|
||||
# Which echo?
|
||||
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
|
||||
|
@ -1,3 +1,11 @@
|
||||
2012-10-24 Joseph Myers <joseph@codesourcery.com>
|
||||
Jim Blandy <jimb@codesourcery.com>
|
||||
|
||||
* Makefile ($(objpfx)tst-tls6.out): Pass $(test-wrapper-env) to
|
||||
tst-tls6.sh.
|
||||
* tst-tls6.sh (test_wrapper_env): New variable. Use it to run
|
||||
programs with LD_PRELOAD set.
|
||||
|
||||
2012-10-24 Roland McGrath <roland@hack.frob.com>
|
||||
|
||||
* Makefile ($(objpfx)tst-cond11, $(objpfx)tst-cond19): Targets removed.
|
||||
|
@ -476,7 +476,7 @@ $(objpfx)tst-tls6.out: tst-tls6.sh $(objpfx)tst-tls5 \
|
||||
$(objpfx)tst-tls5modc.so $(objpfx)tst-tls5modd.so \
|
||||
$(objpfx)tst-tls5mode.so $(objpfx)tst-tls5modf.so
|
||||
$(SHELL) $< $(common-objpfx) $(elf-objpfx) \
|
||||
$(rtld-installed-name)
|
||||
$(rtld-installed-name) '$(test-wrapper-env)'
|
||||
endif
|
||||
|
||||
$(objpfx)tst-dlsym1: $(libdl) $(shared-thread-library)
|
||||
|
@ -22,6 +22,7 @@ set -e
|
||||
common_objpfx=$1; shift
|
||||
elf_objpfx=$1; shift
|
||||
rtld_installed_name=$1; shift
|
||||
test_wrapper_env=$1; shift
|
||||
logfile=$common_objpfx/nptl/tst-tls6.out
|
||||
|
||||
# We have to find libc and nptl
|
||||
@ -40,33 +41,38 @@ fail=0
|
||||
for aligned in a e f; do
|
||||
echo "preload tst-tls5mod{$aligned,b,c,d}.so" >> $logfile
|
||||
echo "===============" >> $logfile
|
||||
LD_PRELOAD=`echo ${common_objpfx}nptl/tst-tls5mod{$aligned,b,c,d}.so \
|
||||
| sed 's/:$//;s/: /:/g'` ${tst_tls5} >> $logfile || fail=1
|
||||
${test_wrapper_env} \
|
||||
LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{$aligned,b,c,d}.so \
|
||||
| sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1
|
||||
echo >> $logfile
|
||||
|
||||
echo "preload tst-tls5mod{b,$aligned,c,d}.so" >> $logfile
|
||||
echo "===============" >> $logfile
|
||||
LD_PRELOAD=`echo ${common_objpfx}nptl/tst-tls5mod{b,$aligned,c,d}.so \
|
||||
| sed 's/:$//;s/: /:/g'` ${tst_tls5} >> $logfile || fail=1
|
||||
${test_wrapper_env} \
|
||||
LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{b,$aligned,c,d}.so \
|
||||
| sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1
|
||||
echo >> $logfile
|
||||
|
||||
echo "preload tst-tls5mod{b,c,d,$aligned}.so" >> $logfile
|
||||
echo "===============" >> $logfile
|
||||
LD_PRELOAD=`echo ${common_objpfx}nptl/tst-tls5mod{b,c,d,$aligned}.so \
|
||||
| sed 's/:$//;s/: /:/g'` ${tst_tls5} >> $logfile || fail=1
|
||||
${test_wrapper_env} \
|
||||
LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{b,c,d,$aligned}.so \
|
||||
| sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1
|
||||
echo >> $logfile
|
||||
done
|
||||
|
||||
echo "preload tst-tls5mod{d,a,b,c,e}" >> $logfile
|
||||
echo "===============" >> $logfile
|
||||
LD_PRELOAD=`echo ${common_objpfx}nptl/tst-tls5mod{d,a,b,c,e}.so \
|
||||
| sed 's/:$//;s/: /:/g'` ${tst_tls5} >> $logfile || fail=1
|
||||
${test_wrapper_env} \
|
||||
LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{d,a,b,c,e}.so \
|
||||
| sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1
|
||||
echo >> $logfile
|
||||
|
||||
echo "preload tst-tls5mod{d,a,b,e,f}" >> $logfile
|
||||
echo "===============" >> $logfile
|
||||
LD_PRELOAD=`echo ${common_objpfx}nptl/tst-tls5mod{d,a,b,e,f}.so \
|
||||
| sed 's/:$//;s/: /:/g'` ${tst_tls5} >> $logfile || fail=1
|
||||
${test_wrapper_env} \
|
||||
LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{d,a,b,e,f}.so \
|
||||
| sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1
|
||||
echo >> $logfile
|
||||
|
||||
exit $fail
|
||||
|
@ -117,7 +117,8 @@ ifeq ($(run-built-tests),yes)
|
||||
ifeq (yes,$(build-shared))
|
||||
tests: $(objpfx)globtest.out $(objpfx)wordexp-tst.out
|
||||
$(objpfx)globtest.out: globtest.sh $(objpfx)globtest
|
||||
$(SHELL) $< $(common-objpfx) '$(run-program-prefix)'
|
||||
$(SHELL) $< $(common-objpfx) '$(run-via-rtld-prefix)' \
|
||||
'$(test-wrapper)' '$(test-wrapper-env)'
|
||||
$(objpfx)wordexp-tst.out: wordexp-tst.sh $(objpfx)wordexp-test
|
||||
$(SHELL) $< $(common-objpfx) '$(run-program-prefix)'
|
||||
endif
|
||||
|
@ -20,7 +20,10 @@
|
||||
set -e
|
||||
|
||||
common_objpfx=$1; shift
|
||||
run_program_prefix=$1; shift
|
||||
run_via_rtld_prefix=$1; shift
|
||||
test_wrapper=$1; shift
|
||||
test_wrapper_env=$1; shift
|
||||
run_program_prefix="${test_wrapper} ${run_via_rtld_prefix}"
|
||||
logfile=$common_objpfx/posix/globtest.out
|
||||
|
||||
#CMP=cmp
|
||||
@ -758,8 +761,9 @@ cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
|
||||
`dir6/file1[ab]'
|
||||
`nondir\/'
|
||||
EOF
|
||||
${test_wrapper_env} \
|
||||
HOME="$testdir" \
|
||||
${run_program_prefix} \
|
||||
${run_via_rtld_prefix} \
|
||||
${common_objpfx}posix/globtest -ct "$testdir" \
|
||||
'~/dir1/file1_1' '~/dir1/file1_9' '~/dir3\*/file1' '~/dir3\*/file2' \
|
||||
'~\/dir1/file1_2' |
|
||||
|
Loading…
Reference in New Issue
Block a user