aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2012-10-24 09:10:52 +0200
committerAndreas Jaeger <aj@suse.de>2012-10-24 09:10:52 +0200
commitaec22f45f4b7ec2d5d6bf2abcd696788bd17eba2 (patch)
tree503b3da15cbdb76448aeedbfd0707dbcafa755ff
parent1b0eb3e0a50411a48717b3e3412bd7ccbca284ee (diff)
parent3a8db22f07e2ab5373d4a366672a7a7b158ada96 (diff)
downloadglibc-aec22f45f4b7ec2d5d6bf2abcd696788bd17eba2.tar
glibc-aec22f45f4b7ec2d5d6bf2abcd696788bd17eba2.tar.gz
glibc-aec22f45f4b7ec2d5d6bf2abcd696788bd17eba2.tar.bz2
glibc-aec22f45f4b7ec2d5d6bf2abcd696788bd17eba2.zip
Merge branch 'master' into aj/shared-linux-fcntl
-rw-r--r--ChangeLog75
-rw-r--r--Makeconfig47
-rw-r--r--Rules2
-rw-r--r--catgets/Makefile2
-rw-r--r--elf/Makefile8
-rw-r--r--grp/Makefile2
-rw-r--r--iconv/Makefile2
-rw-r--r--iconvdata/Makefile2
-rw-r--r--intl/Makefile2
-rw-r--r--io/Makefile2
-rw-r--r--io/fcntl.h52
-rw-r--r--libio/Makefile2
-rw-r--r--localedata/ChangeLog5
-rw-r--r--localedata/Makefile4
-rw-r--r--malloc/Makefile2
-rw-r--r--misc/Makefile2
-rw-r--r--nptl/ChangeLog12
-rw-r--r--nptl/Makefile12
-rw-r--r--posix/Makefile11
-rwxr-xr-xposix/globtest.sh102
-rw-r--r--resolv/Makefile4
-rw-r--r--rt/Makefile2
-rw-r--r--stdio-common/Makefile2
-rw-r--r--stdlib/Makefile2
-rw-r--r--string/Makefile2
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/fcntl.h22
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/fcntl.h8
-rw-r--r--sysdeps/unix/sysv/linux/x86/bits/fcntl.h16
28 files changed, 239 insertions, 167 deletions
diff --git a/ChangeLog b/ChangeLog
index def4ac39b4..06676a3feb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,78 @@
+2012-10-24 Andreas Jaeger <aj@suse.de>
+
+ * io/fcntl.h: Always define mode_t, off_t, pid_t and use these
+ types for creat, creat64, lockf, posix_fadvise, posix_fallocate.
+ [__USE_LARGEFILE64 && !__off64_t_defined]: Define off64_t.
+ [__USE_LARGEFILE64]: Use off64_t in declaration of lock64,
+ posix_fadvise64, posix_fallocate64.
+
+ * sysdeps/unix/sysv/linux/x86/bits/fcntl.h (F_GETLK, F_SETLK)
+ (F_SETLKW) [__x86_64]: Remove, provided by <bits/fcntl-linux.h>.
+ (F_GETLK, F_SETLK, F_SETLKW) [!__USE_FILE_OFFSET64 && !__x86_64__]:
+ Likewise.
+ (F_GETLK, F_SETLK, F_SETLKW) [__USE_FILE_OFFSET64 && ! __x86_64__]:
+ Likewise.
+ (F_GETLK64, F_SETLK64, F_SETLKW64) [!__x86_64__]: Likewise.
+
+ * sysdeps/unix/sysv/linux/sparc/bits/fcntl.h (F_GETLK, F_SETLK)
+ (F_SETLKW) [__USE_FILE_OFFSET64]: Remove, provided by
+ <bits/fcntl-linux.h>.
+ (F_GETLK64, F_SETLK64, F_SETLKW64) [__WORDSIZE == 64]: Likewise.
+
+ * sysdeps/unix/sysv/linux/s390/bits/fcntl.h (F_DUPFD, F_GETFD)
+ (F_SETFD, F_GETFL, F_SETFL): Remove, provided by <bits/fcntl-linux.h>.
+ (F_GETLK, F_SETLK, F_SETLKW) [__WORDSIZE == 64]: Likewise.
+ (F_GETLK, F_SETLK, F_SETLKW, F_GETLK64, F_SETLK64, F_SETLKW64)
+ [__WORDSIZE != 64]: Likewise.
+
+2012-10-23 Joseph Myers <joseph@codesourcery.com>
+
+ * Makeconfig (run-built-tests): New variable.
+ * Rules [$(cross-compiling) = yes]: Change condition to
+ [$(run-built-tests) = no].
+ * catgets/Makefile [$(cross-compiling) != yes]: Change condition
+ to [$(run-built-tests) = yes].
+ * elf/Makefile [$(cross-compiling) = no]: Likewise
+ * grp/Makefile [$(cross-compiling) = no]: Likewise.
+ * iconv/Makefile [$(cross-compiling) != yes]: Likewise.
+ * iconvdata/Makefile [$(cross-compiling) = no]: Likewise.
+ * intl/Makefile [$(cross-compiling) = no]: Likewise.
+ * io/Makefile [$(cross-compiling) = no]: Likewise.
+ * libio/Makefile [$(cross-compiling) = no]: Likewise.
+ * malloc/Makefile [$(cross-compiling) = no]: Likewise.
+ * misc/Makefile [$(cross-compiling) = no]: Likewise.
+ * posix/Makefile [$(cross-compiling) = no]: Likewise.
+ * resolv/Makefile [$(cross-compiling) = no]: Likewise.
+ * stdio-common/Makefile [$(cross-compiling) = no]: Likewise.
+ * stdlib/Makefile [$(cross-compiling) = no]: Likewise.
+ * string/Makefile [$(cross-compiling) = no]: Likewise.
+
+ * posix/Makefile ($(objpfx)globtest.out): Pass
+ $(run-program-prefix) to globtest.sh, not $(elf-objpfx) and
+ $(rtld-installed-name).
+ * posix/globtest.sh (elf_objpfx): Remove variable.
+ (rtld_installed_name): Likewise.
+ (library_path): Likewise.
+ (run_program_prefix): New variable. Use for running globtest
+ binary.
+
+2012-10-23 Jim Blandy <jimb@codesourcery.com>
+ Joseph Myers <joseph@codesourcery.com>
+
+ * Makeconfig (host-built-program-cmd): New variable.
+ * elf/Makefile (tst-stackguard1-ARGS): Use
+ $(host-built-program-cmd).
+ * posix/Makefile (tst-exec-ARGS): Use $(host-built-program-cmd).
+ (tst-spawn-ARGS): Likewise.
+ * rt/Makefile (tst-mqueue7-ARGS): Use $(host-built-program-cmd).
+
+2012-10-23 Joseph Myers <joseph@codesourcery.com>
+ Jim Blandy <jimb@codesourcery.com>
+
+ * Makeconfig (run-via-rtld-prefix): New variable.
+ (run-program-prefix): Define in terms of $(run-via-rtld-prefix).
+ (built-program-cmd): Likewise.
+
2012-10-23 Andreas Jaeger <aj@suse.de>
* sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Remove all
diff --git a/Makeconfig b/Makeconfig
index 9dadc3f177..1b1604af56 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -564,6 +564,15 @@ endif
csu-objpfx = $(common-objpfx)csu/
elf-objpfx = $(common-objpfx)elf/
+# Whether to run test programs built for the library's host system.
+ifndef run-built-tests
+ifeq (yes,$(cross-compiling))
+run-built-tests = no
+else
+run-built-tests = yes
+endif
+endif
+
# How to run a program we just linked with our library.
# The program binary is assumed to be $(word 2,$^).
built-program-file = $(dir $(word 2,$^))$(notdir $(word 2,$^))
@@ -573,17 +582,35 @@ sysdep-library-path = \
$(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
$(filter -Wl$(comma)-rpath-link=%,\
$(sysdep-LDFLAGS)))))
-run-program-prefix = $(if $(filter $(notdir $(built-program-file)),\
- $(tests-static) $(xtests-static)),, \
- $(elf-objpfx)$(rtld-installed-name) \
- --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)))
+# $(run-via-rtld-prefix) is a command that, when prepended to the name
+# of a program built with the newly built library, produces a command
+# that, executed on the host for which the library is built, runs that
+# program. For the statically-linked %-bp test programs, and for
+# tests listed in tests-static or xtests-static, it is empty.
+run-via-rtld-prefix = \
+ $(if $(strip $(filter $(notdir $(built-program-file)), \
+ $(tests-static) $(xtests-static)) \
+ $(filter %-bp,$(built-program-file))),, \
+ $(elf-objpfx)$(rtld-installed-name) \
+ --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)))
else
-run-program-prefix =
-endif
-# Never use $(run-program-prefix) for the statically-linked %-bp test programs
-built-program-cmd = $(patsubst %,$(run-program-prefix),\
- $(filter-out %-bp,$(built-program-file))) \
- $(built-program-file)
+run-via-rtld-prefix =
+endif
+# $(run-via-rtld-prefix) is a command that, when prepended to the name
+# 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)
+# $(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)
+# $(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
+# $(host-built-program-cmd) is used.
+host-built-program-cmd = $(run-via-rtld-prefix) $(built-program-file)
ifndef LD
LD := ld -X
diff --git a/Rules b/Rules
index 5e33610e0c..db5bad0c85 100644
--- a/Rules
+++ b/Rules
@@ -94,7 +94,7 @@ others: $(addprefix $(objpfx),$(others) $(sysdep-others) $(extra-objs))
else
others: $(addprefix $(objpfx),$(extra-objs))
endif
-ifeq ($(cross-compiling),yes)
+ifeq ($(run-built-tests),no)
tests: $(addprefix $(objpfx),$(tests) $(test-srcs))
xtests: tests
else
diff --git a/catgets/Makefile b/catgets/Makefile
index ec8fe1e0bc..bbd438a27c 100644
--- a/catgets/Makefile
+++ b/catgets/Makefile
@@ -50,7 +50,7 @@ generated-dirs = de
tst-catgets-ENV = NLSPATH="$(objpfx)%l/%N.cat" LANG=de
-ifneq ($(cross-compiling),yes)
+ifeq ($(run-built-tests),yes)
tests: $(objpfx)de/libc.cat $(objpfx)test1.cat $(objpfx)test2.cat \
$(objpfx)test-gencat.out
# This test just checks whether the program produces any error or not.
diff --git a/elf/Makefile b/elf/Makefile
index dde94091c7..4f092ab2af 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -161,7 +161,7 @@ tests += tst-audit6 tst-audit7
endif
endif
endif
-ifeq ($(cross-compiling),no)
+ifeq ($(run-built-tests),yes)
tests: $(objpfx)tst-leaks1-mem $(objpfx)tst-leaks1-static-mem \
$(objpfx)noload-mem
endif
@@ -438,7 +438,7 @@ test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
generated += $(addsuffix .so,$(strip $(modules-names)))
ifeq (yes,$(build-shared))
-ifeq ($(cross-compiling),no)
+ifeq ($(run-built-tests),yes)
tests: $(objpfx)tst-pathopt.out $(objpfx)tst-rtld-load-self.out
endif
endif
@@ -1046,7 +1046,7 @@ order2mod2.so-no-z-defs = yes
LDFLAGS-order2mod1.so = $(no-as-needed)
LDFLAGS-order2mod2.so = $(no-as-needed)
-tst-stackguard1-ARGS = --command "$(built-program-cmd) --child"
+tst-stackguard1-ARGS = --command "$(host-built-program-cmd) --child"
tst-stackguard1-static-ARGS = --command "$(objpfx)tst-stackguard1-static --child"
$(objpfx)tst-leaks1: $(libdl)
@@ -1174,7 +1174,7 @@ $(objpfx)tst-relsort1mod2.so: $(libm)
$(objpfx)tst-relsort1.out: $(objpfx)tst-relsort1mod1.so \
$(objpfx)tst-relsort1mod2.so
-ifeq ($(cross-compiling),no)
+ifeq ($(run-built-tests),yes)
tests: $(objpfx)tst-unused-dep.out
endif
diff --git a/grp/Makefile b/grp/Makefile
index 1988cbf10f..99ea3a2e68 100644
--- a/grp/Makefile
+++ b/grp/Makefile
@@ -50,7 +50,7 @@ CFLAGS-getgrgid.c = -fexceptions
endif
-ifeq (no,$(cross-compiling))
+ifeq ($(run-built-tests),yes)
# tst_fgetgrent currently only works with shared libraries
ifeq (yes,$(build-shared))
tests: $(objpfx)tst_fgetgrent.out
diff --git a/iconv/Makefile b/iconv/Makefile
index 6d7791103f..4724d4f9ac 100644
--- a/iconv/Makefile
+++ b/iconv/Makefile
@@ -69,7 +69,7 @@ $(inst_bindir)/iconv: $(objpfx)iconv_prog $(+force)
$(objpfx)iconv_prog: $(iconv_prog-modules:%=$(objpfx)%.o)
$(objpfx)iconvconfig: $(iconvconfig-modules:%=$(objpfx)%.o)
-ifneq ($(cross-compiling),yes)
+ifeq ($(run-built-tests),yes)
xtests: test-iconvconfig
endif
diff --git a/iconvdata/Makefile b/iconvdata/Makefile
index cf6cf707fe..89f0dcd9c3 100644
--- a/iconvdata/Makefile
+++ b/iconvdata/Makefile
@@ -267,7 +267,7 @@ endif # build-shared = yes
include ../Rules
-ifeq (no,$(cross-compiling))
+ifeq ($(run-built-tests),yes)
ifeq (yes,$(build-shared))
tests: $(objpfx)iconv-test.out $(objpfx)tst-tables.out
ifneq (no,$(PERL))
diff --git a/intl/Makefile b/intl/Makefile
index 5bf66065da..c2a169807d 100644
--- a/intl/Makefile
+++ b/intl/Makefile
@@ -48,7 +48,7 @@ $(objpfx)plural.o: plural.c
include ../Rules
-ifeq (no,$(cross-compiling))
+ifeq ($(run-built-tests),yes)
ifeq (yes,$(build-shared))
ifneq ($(strip $(MSGFMT)),:)
tests: $(objpfx)tst-translit.out $(objpfx)tst-gettext2.out \
diff --git a/io/Makefile b/io/Makefile
index 9601a6ff6c..b076e4d863 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -98,7 +98,7 @@ test-stat2-ARGS = Makefile . $(objpfx)test-stat2
tst-statvfs-ARGS = $(objpfx)tst-statvfs tst-statvfs.c /tmp
-ifeq ($(cross-compiling),no)
+ifeq ($(run-built-tests),yes)
tests: $(objpfx)ftwtest.out
$(objpfx)ftwtest.out: ftwtest-sh $(objpfx)ftwtest
diff --git a/io/fcntl.h b/io/fcntl.h
index 81f34bfbd7..cc978f7c7b 100644
--- a/io/fcntl.h
+++ b/io/fcntl.h
@@ -34,28 +34,32 @@ __BEGIN_DECLS
numbers and flag bits for `open', `fcntl', et al. */
#include <bits/fcntl.h>
-#if defined __USE_XOPEN || defined __USE_XOPEN2K
-/* The Single Unix specification says that some more types are
- available here. */
-# ifndef __mode_t_defined
+/* POSIX.1-2001 specifies that these types are defined by <fcntl.h>.
+ Earlier POSIX standards permitted any type ending in `_t' to be defined
+ by any POSIX header, so we don't conditionalize the definitions here. */
+#ifndef __mode_t_defined
typedef __mode_t mode_t;
-# define __mode_t_defined
-# endif
+# define __mode_t_defined
+#endif
-# ifndef __off_t_defined
-# ifndef __USE_FILE_OFFSET64
+#ifndef __off_t_defined
+# ifndef __USE_FILE_OFFSET64
typedef __off_t off_t;
-# else
+# else
typedef __off64_t off_t;
-# endif
-# define __off_t_defined
# endif
+# define __off_t_defined
+#endif
+
+#if defined __USE_LARGEFILE64 && !defined __off64_t_defined
+typedef __off64_t off64_t;
+# define __off64_t_defined
+#endif
-# ifndef __pid_t_defined
+#ifndef __pid_t_defined
typedef __pid_t pid_t;
-# define __pid_t_defined
-# endif
-#endif /* X/Open */
+# define __pid_t_defined
+#endif
/* For XPG all symbols from <sys/stat.h> should also be available. */
#if defined __USE_XOPEN || defined __USE_XOPEN2K8
@@ -202,17 +206,17 @@ extern int openat64 (int __fd, const char *__file, int __oflag, ...)
This function is a cancellation point and therefore not marked with
__THROW. */
#ifndef __USE_FILE_OFFSET64
-extern int creat (const char *__file, __mode_t __mode) __nonnull ((1));
+extern int creat (const char *__file, mode_t __mode) __nonnull ((1));
#else
# ifdef __REDIRECT
-extern int __REDIRECT (creat, (const char *__file, __mode_t __mode),
+extern int __REDIRECT (creat, (const char *__file, mode_t __mode),
creat64) __nonnull ((1));
# else
# define creat creat64
# endif
#endif
#ifdef __USE_LARGEFILE64
-extern int creat64 (const char *__file, __mode_t __mode) __nonnull ((1));
+extern int creat64 (const char *__file, mode_t __mode) __nonnull ((1));
#endif
#if !defined F_LOCK && (defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \
@@ -231,7 +235,7 @@ extern int creat64 (const char *__file, __mode_t __mode) __nonnull ((1));
# define F_TEST 3 /* Test a region for other processes locks. */
# ifndef __USE_FILE_OFFSET64
-extern int lockf (int __fd, int __cmd, __off_t __len);
+extern int lockf (int __fd, int __cmd, off_t __len);
# else
# ifdef __REDIRECT
extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len), lockf64);
@@ -240,7 +244,7 @@ extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len), lockf64);
# endif
# endif
# ifdef __USE_LARGEFILE64
-extern int lockf64 (int __fd, int __cmd, __off64_t __len);
+extern int lockf64 (int __fd, int __cmd, off64_t __len);
# endif
#endif
@@ -248,7 +252,7 @@ extern int lockf64 (int __fd, int __cmd, __off64_t __len);
/* Advice the system about the expected behaviour of the application with
respect to the file associated with FD. */
# ifndef __USE_FILE_OFFSET64
-extern int posix_fadvise (int __fd, __off_t __offset, __off_t __len,
+extern int posix_fadvise (int __fd, off_t __offset, off_t __len,
int __advise) __THROW;
# else
# ifdef __REDIRECT_NTH
@@ -260,7 +264,7 @@ extern int __REDIRECT_NTH (posix_fadvise, (int __fd, __off64_t __offset,
# endif
# endif
# ifdef __USE_LARGEFILE64
-extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len,
+extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len,
int __advise) __THROW;
# endif
@@ -270,7 +274,7 @@ extern int posix_fadvise64 (int __fd, __off64_t __offset, __off64_t __len,
This function is a possible cancellation point and therefore not
marked with __THROW. */
# ifndef __USE_FILE_OFFSET64
-extern int posix_fallocate (int __fd, __off_t __offset, __off_t __len);
+extern int posix_fallocate (int __fd, off_t __offset, off_t __len);
# else
# ifdef __REDIRECT
extern int __REDIRECT (posix_fallocate, (int __fd, __off64_t __offset,
@@ -281,7 +285,7 @@ extern int __REDIRECT (posix_fallocate, (int __fd, __off64_t __offset,
# endif
# endif
# ifdef __USE_LARGEFILE64
-extern int posix_fallocate64 (int __fd, __off64_t __offset, __off64_t __len);
+extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len);
# endif
#endif
diff --git a/libio/Makefile b/libio/Makefile
index 0d28cea59c..9ccd6a0c38 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -175,7 +175,7 @@ shared-only-routines = oldiofopen oldiofdopen oldiofclose oldfileops \
include ../Rules
-ifeq (no,$(cross-compiling))
+ifeq ($(run-built-tests),yes)
tests: $(objpfx)test-freopen.out
ifeq (yes,$(build-shared))
# Run tst-fopenloc.check only if shared library is enabled since it
diff --git a/localedata/ChangeLog b/localedata/ChangeLog
index 7ae362c157..3e775ed446 100644
--- a/localedata/ChangeLog
+++ b/localedata/ChangeLog
@@ -1,3 +1,8 @@
+2012-10-23 Joseph Myers <joseph@codesourcery.com>
+
+ * Makefile [$(cross-compiling) = no]: Change condition to
+ [$(run-built-tests) = yes].
+
2012-10-22 Jim Blandy <jimb@codesourcery.com>
Joseph Myers <joseph@codesourcery.com>
diff --git a/localedata/Makefile b/localedata/Makefile
index 5be2413d3c..d1b277ef31 100644
--- a/localedata/Makefile
+++ b/localedata/Makefile
@@ -59,7 +59,7 @@ generated-dirs := $(ld-test-names) tt_TT de_DE.437 \
# Get $(inst_i18ndir) defined.
include ../Makeconfig
-ifeq (no,$(cross-compiling))
+ifeq ($(run-built-tests),yes)
locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl \
tst_iswctype tst_iswdigit tst_iswgraph \
tst_iswlower tst_iswprint tst_iswpunct \
@@ -113,7 +113,7 @@ CFLAGS-tst-mbswcs5.c = -Wno-format
CFLAGS-tst-trans.c = -Wno-format
-ifeq (no,$(cross-compiling))
+ifeq ($(run-built-tests),yes)
# We have to generate locales
LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 \
en_US.ISO-8859-1 ja_JP.EUC-JP da_DK.ISO-8859-1 \
diff --git a/malloc/Makefile b/malloc/Makefile
index 9dd0336d9e..1e0281f9fa 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -104,7 +104,7 @@ $(objpfx)libmcheck.a: $(objpfx)mcheck-init.o
lib: $(objpfx)libmcheck.a
-ifeq (no,$(cross-compiling))
+ifeq ($(run-built-tests),yes)
ifeq (yes,$(build-shared))
ifneq ($(PERL),no)
tests: $(objpfx)tst-mtrace.out
diff --git a/misc/Makefile b/misc/Makefile
index ea68d26a3e..4cb7f24e6c 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -77,7 +77,7 @@ gpl2lgpl := error.c error.h
tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch \
tst-error1 tst-pselect tst-insremque tst-mntent2 bug-hsearch1
-ifeq (no,$(cross-compiling))
+ifeq ($(run-built-tests),yes)
tests: $(objpfx)tst-error1-mem
endif
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 6154e61c67..2743631da4 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,15 @@
+2012-10-23 Joseph Myers <joseph@codesourcery.com>
+
+ * Makefile [$(cross-compiling) = no]: Change condition to
+ [$(run-built-tests) = yes].
+
+2012-10-23 Jim Blandy <jimb@codesourcery.com>
+ Joseph Myers <joseph@codesourcery.com>
+
+ * Makefile (tst-cancel7-ARGS): Use $(host-built-program-cmd).
+ (tst-exec4-ARGS): Likewise.
+ (tst-stackguard1-ARGS): Likewise.
+
2012-10-21 Jim Blandy <jimb@codesourcery.com>
Joseph Myers <joseph@codesourcery.com>
diff --git a/nptl/Makefile b/nptl/Makefile
index bc563f8969..02db930b6c 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -439,7 +439,7 @@ CFLAGS-tst-initializers1-c99.c = $(CFLAGS-tst-initializers1-<)
CFLAGS-tst-initializers1-gnu89.c = $(CFLAGS-tst-initializers1-<)
CFLAGS-tst-initializers1-gnu99.c = $(CFLAGS-tst-initializers1-<)
-tst-cancel7-ARGS = --command "$(built-program-cmd)"
+tst-cancel7-ARGS = --command "$(host-built-program-cmd)"
tst-cancelx7-ARGS = $(tst-cancel7-ARGS)
tst-umask1-ARGS = $(objpfx)tst-umask1.temp
@@ -448,7 +448,7 @@ LDFLAGS-tst-atfork2 = -rdynamic
tst-atfork2-ENV = MALLOC_TRACE=$(objpfx)tst-atfork2.mtrace
$(objpfx)tst-atfork2mod.so: $(shared-thread-library)
-ifeq ($(cross-compiling),no)
+ifeq ($(run-built-tests),yes)
tests: $(objpfx)tst-stack3-mem
endif
tst-stack3-ENV = MALLOC_TRACE=$(objpfx)tst-stack3.mtrace
@@ -472,7 +472,7 @@ LDFLAGS-tst-tls5 = $(no-as-needed)
LDFLAGS-tst-tls5mod.so = -Wl,-soname,tst-tls5mod.so
ifeq ($(build-shared),yes)
-ifeq ($(cross-compiling),no)
+ifeq ($(run-built-tests),yes)
tests: $(objpfx)tst-tls6.out
endif
$(objpfx)tst-tls6.out: tst-tls6.sh $(objpfx)tst-tls5 \
@@ -583,7 +583,7 @@ generated += banner.h
LDFLAGS-pthread.so += -e __nptl_main
endif
-ifeq (no,$(cross-compiling))
+ifeq ($(run-built-tests),yes)
ifeq (yes,$(build-shared))
tests: $(objpfx)tst-cancel-wrappers.out
$(objpfx)tst-cancel-wrappers.out: tst-cancel-wrappers.sh
@@ -595,7 +595,7 @@ $(objpfx)tst-cancel-wrappers.out: tst-cancel-wrappers.sh
endif
endif
-tst-exec4-ARGS = $(built-program-cmd)
+tst-exec4-ARGS = $(host-built-program-cmd)
$(objpfx)tst-execstack: $(libdl)
$(objpfx)tst-execstack.out: $(objpfx)tst-execstack-mod.so
@@ -603,7 +603,7 @@ LDFLAGS-tst-execstack = -Wl,-z,noexecstack
$(objpfx)tst-fini1mod.so: $(shared-thread-library)
-tst-stackguard1-ARGS = --command "$(built-program-cmd) --child"
+tst-stackguard1-ARGS = --command "$(host-built-program-cmd) --child"
tst-stackguard1-static-ARGS = --command "$(objpfx)tst-stackguard1-static --child"
# The tests here better do not run in parallel
diff --git a/posix/Makefile b/posix/Makefile
index 6e3d0bb3fd..86e6c6bede 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -112,13 +112,12 @@ generated := $(addprefix wordexp-test-result, 1 2 3 4 5 6 7 8 9 10) \
include ../Rules
-ifeq (no,$(cross-compiling))
+ifeq ($(run-built-tests),yes)
# globtest and wordexp-test currently only works with shared libraries
ifeq (yes,$(build-shared))
tests: $(objpfx)globtest.out $(objpfx)wordexp-tst.out
$(objpfx)globtest.out: globtest.sh $(objpfx)globtest
- $(SHELL) $< $(common-objpfx) $(elf-objpfx) \
- $(rtld-installed-name)
+ $(SHELL) $< $(common-objpfx) '$(run-program-prefix)'
$(objpfx)wordexp-tst.out: wordexp-tst.sh $(objpfx)wordexp-test
$(SHELL) $< $(common-objpfx) '$(run-program-prefix)'
endif
@@ -170,8 +169,8 @@ CFLAGS-execlp.os = -fomit-frame-pointer
tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \
--none random --col --color --colour
-tst-exec-ARGS = -- $(built-program-cmd)
-tst-spawn-ARGS = -- $(built-program-cmd)
+tst-exec-ARGS = -- $(host-built-program-cmd)
+tst-spawn-ARGS = -- $(host-built-program-cmd)
tst-dir-ARGS = `pwd` `cd $(common-objdir)/$(subdir); pwd` `cd $(common-objdir); pwd` $(objpfx)tst-dir
tst-chmod-ARGS = $(objdir)
tst-vfork3-ARGS = --test-dir=$(objpfx)
@@ -212,7 +211,7 @@ ptestcases.h: PTESTS PTESTS2C.sed
# Run a test on the header files we use.
# XXX Please note that for now we ignore the result of this test.
tests: $(objpfx)annexc.out
-ifeq (no,$(cross-compiling))
+ifeq ($(run-built-tests),yes)
tests: $(objpfx)bug-regex2-mem $(objpfx)bug-regex14-mem \
$(objpfx)bug-regex21-mem $(objpfx)bug-regex31-mem $(objpfx)tst-rxspencer-mem\
$(objpfx)tst-pcre-mem $(objpfx)tst-boost-mem $(objpfx)tst-getconf.out \
diff --git a/posix/globtest.sh b/posix/globtest.sh
index 286b1b4912..29277a44c9 100755
--- a/posix/globtest.sh
+++ b/posix/globtest.sh
@@ -20,8 +20,7 @@
set -e
common_objpfx=$1; shift
-elf_objpfx=$1; shift
-rtld_installed_name=$1; shift
+run_program_prefix=$1; shift
logfile=$common_objpfx/posix/globtest.out
#CMP=cmp
@@ -36,9 +35,6 @@ case "$common_objpfx" in
;;
esac
-# We have to find the libc and the NSS modules.
-library_path=${common_objpfx}:${common_objpfx}nss:${common_objpfx}nis:${common_objpfx}db2:${common_objpfx}hesiod
-
# Since we use `sort' we must make sure to use the same locale everywhere.
LC_ALL=C
export LC_ALL
@@ -78,7 +74,7 @@ rm -f $logfile
# Normal test
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest "$testdir" "*" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -105,7 +101,7 @@ fi
# Don't let glob sort it
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -s "$testdir" "*" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -132,7 +128,7 @@ fi
# Mark directories
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -m "$testdir" "*" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -159,7 +155,7 @@ fi
# Find files starting with .
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -p "$testdir" "*" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -189,7 +185,7 @@ fi
# Test braces
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -b "$testdir" "file{1,2}" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -202,7 +198,7 @@ if test $failed -ne 0; then
fi
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -b "$testdir" "{file{1,2},-file3}" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -216,7 +212,7 @@ if test $failed -ne 0; then
fi
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -b "$testdir" "{" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -229,7 +225,7 @@ fi
# Test NOCHECK
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -c "$testdir" "abc" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -242,7 +238,7 @@ fi
# Test NOMAGIC without magic characters
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -g "$testdir" "abc" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -255,7 +251,7 @@ fi
# Test NOMAGIC with magic characters
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -g "$testdir" "abc*" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -268,7 +264,7 @@ fi
# Test NOMAGIC for subdirs
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -g "$testdir" "*/does-not-exist" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -281,7 +277,7 @@ fi
# Test subdirs correctly
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest "$testdir" "*/*" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -297,7 +293,7 @@ fi
# Test subdirs for invalid names
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest "$testdir" "*/1" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -310,7 +306,7 @@ fi
# Test subdirs with wildcard
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest "$testdir" "*/*1_1" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -324,7 +320,7 @@ fi
# Test subdirs with ?
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest "$testdir" "*/*?_?" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -339,7 +335,7 @@ if test $failed -ne 0; then
fi
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest "$testdir" "*/file1_1" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -352,7 +348,7 @@ if test $failed -ne 0; then
fi
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest "$testdir" "*-/*" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -364,7 +360,7 @@ if test $failed -ne 0; then
fi
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest "$testdir" "*-" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -377,7 +373,7 @@ fi
# Test subdirs with ?
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest "$testdir" "*/*?_?" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -393,7 +389,7 @@ fi
# Test subdirs with [ .. ]
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest "$testdir" "*/file1_[12]" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -409,7 +405,7 @@ fi
# Test ']' inside bracket expression
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest "$testdir" "dir1/file1_[]12]" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -423,7 +419,7 @@ fi
# Test tilde expansion
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -q -t "$testdir" "~" |
sort >$testout
echo ~ | $CMP - $testout >> $logfile || failed=1
@@ -438,7 +434,7 @@ fi
# Test tilde expansion with trailing slash
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -q -t "$testdir" "~/" |
sort > $testout
# Some shell incorrectly(?) convert ~/ into // if ~ expands to /.
@@ -458,7 +454,7 @@ fi
# Test tilde expansion with username
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -q -t "$testdir" "~"$USER |
sort > $testout
eval echo ~$USER | $CMP - $testout >> $logfile || failed=1
@@ -473,7 +469,7 @@ fi
# Tilde expansion shouldn't match a file
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -T "$testdir" "~file4" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -486,7 +482,7 @@ fi
# Matching \** should only find *file6
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest "$testdir" "\**" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -500,7 +496,7 @@ fi
# ... unless NOESCAPE is used, in which case it should entries with a
# leading \.
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -e "$testdir" "\**" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -515,7 +511,7 @@ fi
# Matching \*file6 should find *file6
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest "$testdir" "\*file6" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -528,7 +524,7 @@ fi
# GLOB_BRACE alone
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -b "$testdir" '\{file7\,\}' |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -541,7 +537,7 @@ fi
# GLOB_BRACE and GLOB_NOESCAPE
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -b -e "$testdir" '\{file9\,file9b\}' |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -554,7 +550,7 @@ fi
# Escaped comma
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -b "$testdir" '{filea\,}' |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -567,7 +563,7 @@ fi
# Escaped closing brace
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -b "$testdir" '{fileb\}c}' |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -580,7 +576,7 @@ fi
# Try a recursive failed search
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -e "$testdir" "a*/*" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -593,7 +589,7 @@ fi
# ... with GLOB_ERR
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -E "$testdir" "a*/*" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -606,7 +602,7 @@ fi
# Try a recursive search in unreadable directory
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest "$testdir" "noread/*" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -618,7 +614,7 @@ if test $failed -ne 0; then
fi
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest "$testdir" "noread*/*" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -636,14 +632,14 @@ if test -z "$user"; then
fi
if test "$user" != root; then
# ... with GLOB_ERR
- ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+ ${run_program_prefix} \
${common_objpfx}posix/globtest -E "$testdir" "noread/*" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
GLOB_ABORTED
EOF
- ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+ ${run_program_prefix} \
${common_objpfx}posix/globtest -E "$testdir" "noread*/*" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -657,7 +653,7 @@ fi # not run as root
# Try multiple patterns (GLOB_APPEND)
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest "$testdir" "file1" "*/*" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -674,7 +670,7 @@ fi
# Try multiple patterns (GLOB_APPEND) with offset (GLOB_DOOFFS)
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -o "$testdir" "file1" "*/*" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -692,7 +688,7 @@ fi
# Test NOCHECK with non-existing file in subdir.
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -c "$testdir" "*/blahblah" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -705,7 +701,7 @@ fi
# Test [[:punct:]] not matching leading period.
failed=0
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -c "$testdir" "[[:punct:]]*" |
sort > $testout
cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
@@ -734,10 +730,10 @@ mkdir $testdir/dir6
echo 6 > $testdir/dir6/'file1[a'
echo 7 > $testdir/dir6/'file1[ab]'
failed=0
-v=`${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+v=`${run_program_prefix} \
${common_objpfx}posix/globtest "$testdir" 'dir3\*/file2'`
test "$v" != 'GLOB_NOMATCH' && echo "$v" >> $logfile && failed=1
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -c "$testdir" \
'dir3\*/file1' 'dir3\*/file2' 'dir1/file\1_1' 'dir1/file\1_9' \
'dir2\/' 'nondir\/' 'dir4[a/fil*1' 'di*r4[a/file2' 'dir5[ab]/file[12]' \
@@ -762,7 +758,7 @@ cat <<"EOF" | $CMP - $testout >> $logfile || failed=1
`nondir\/'
EOF
HOME="$testdir" \
-${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${run_program_prefix} \
${common_objpfx}posix/globtest -ct "$testdir" \
'~/dir1/file1_1' '~/dir1/file1_9' '~/dir3\*/file1' '~/dir3\*/file2' \
'~\/dir1/file1_2' |
@@ -777,15 +773,15 @@ EOF
if eval test -d ~"$USER"/; then
user=`echo "$USER" | sed -n -e 's/^\([^\\]\)\([^\\][^\\]*\)$/~\1\\\\\2/p'`
if test -n "$user"; then
- ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+ ${run_program_prefix} \
${common_objpfx}posix/globtest -ctq "$testdir" "$user/" |
sort > $testout
eval echo ~$USER/ | $CMP - $testout >> $logfile || failed=1
- ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+ ${run_program_prefix} \
${common_objpfx}posix/globtest -ctq "$testdir" "$user\\/" |
sort > $testout
eval echo ~$USER/ | $CMP - $testout >> $logfile || failed=1
- ${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+ ${run_program_prefix} \
${common_objpfx}posix/globtest -ctq "$testdir" "$user" |
sort > $testout
eval echo ~$USER | $CMP - $testout >> $logfile || failed=1
diff --git a/resolv/Makefile b/resolv/Makefile
index 4777317b17..a398694772 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -108,7 +108,7 @@ $(objpfx)tst-leaks: $(objpfx)libresolv.so
tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace
$(objpfx)mtrace-tst-leaks: $(objpfx)tst-leaks.out
$(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@
-ifeq (no,$(cross-compiling))
+ifeq ($(run-built-tests),yes)
ifneq (no,$(PERL))
tests: $(objpfx)mtrace-tst-leaks
endif
@@ -117,7 +117,7 @@ endif
tst-leaks2-ENV = MALLOC_TRACE=$(objpfx)tst-leaks2.mtrace
$(objpfx)mtrace-tst-leaks2: $(objpfx)tst-leaks2.out
$(common-objpfx)malloc/mtrace $(objpfx)tst-leaks2.mtrace > $@
-ifeq (no,$(cross-compiling))
+ifeq ($(run-built-tests),yes)
ifneq (no,$(PERL))
xtests: $(objpfx)mtrace-tst-leaks2
endif
diff --git a/rt/Makefile b/rt/Makefile
index 941c471688..26d4ffaaf6 100644
--- a/rt/Makefile
+++ b/rt/Makefile
@@ -77,4 +77,4 @@ ifeq (yes,$(build-bounded))
$(tests:%=$(objpfx)%-bp): $(objpfx)librt_b.a $(bounded-thread-library)
endif
-tst-mqueue7-ARGS = -- $(built-program-cmd)
+tst-mqueue7-ARGS = -- $(host-built-program-cmd)
diff --git a/stdio-common/Makefile b/stdio-common/Makefile
index 5e2e48dfc2..f7f152c2d7 100644
--- a/stdio-common/Makefile
+++ b/stdio-common/Makefile
@@ -63,7 +63,7 @@ test-srcs = tst-unbputc tst-printf
include ../Rules
-ifeq ($(cross-compiling),no)
+ifeq ($(run-built-tests),yes)
.PHONY: do-tst-unbputc do-tst-printf
tests: do-tst-unbputc do-tst-printf
diff --git a/stdlib/Makefile b/stdlib/Makefile
index a5318ee00b..682a70c998 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -122,7 +122,7 @@ bug-fmtmsg1-ENV = SEV_LEVEL=foo,11,newsev
# Run a test on the header files we use.
tests: $(objpfx)isomac.out
-ifeq (no,$(cross-compiling))
+ifeq ($(run-built-tests),yes)
tests: $(objpfx)tst-fmtmsg.out
endif
diff --git a/string/Makefile b/string/Makefile
index 54eae7072f..740006e56b 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -78,7 +78,7 @@ CFLAGS-tst-inlcall.c = -fno-builtin
CFLAGS-bug-strstr1.c = -fno-builtin
CFLAGS-bug-strcasestr1.c = -fno-builtin
-ifeq ($(cross-compiling),no)
+ifeq ($(run-built-tests),yes)
tests: $(objpfx)tst-svc.out
$(objpfx)tst-svc.out: tst-svc.input $(objpfx)tst-svc
GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
diff --git a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
index ecf1baf8b9..43eee7a37a 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/fcntl.h
@@ -29,33 +29,11 @@
# define __O_LARGEFILE 0100000
#endif
-/* Values for the second argument to `fcntl'. */
-#define F_DUPFD 0 /* Duplicate file descriptor. */
-#define F_GETFD 1 /* Get file descriptor flags. */
-#define F_SETFD 2 /* Set file descriptor flags. */
-#define F_GETFL 3 /* Get file status flags. */
-#define F_SETFL 4 /* Set file status flags. */
#if __WORDSIZE == 64
-# define F_GETLK 5 /* Get record locking info. */
-# define F_SETLK 6 /* Set record locking info (non-blocking). */
-# define F_SETLKW 7 /* Set record locking info (blocking). */
/* Not necessary, we always have 64-bit offsets. */
# define F_GETLK64 5 /* Get record locking info. */
# define F_SETLK64 6 /* Set record locking info (non-blocking). */
# define F_SETLKW64 7 /* Set record locking info (blocking). */
-#else
-# ifndef __USE_FILE_OFFSET64
-# define F_GETLK 5 /* Get record locking info. */
-# define F_SETLK 6 /* Set record locking info (non-blocking). */
-# define F_SETLKW 7 /* Set record locking info (blocking). */
-# else
-# define F_GETLK F_GETLK64 /* Get record locking info. */
-# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/
-# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */
-# endif
-# define F_GETLK64 12 /* Get record locking info. */
-# define F_SETLK64 13 /* Set record locking info (non-blocking). */
-# define F_SETLKW64 14 /* Set record locking info (blocking). */
#endif
struct flock
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
index 0f4bf76490..22e71fcd7e 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
@@ -56,20 +56,12 @@
# define F_GETLK 7 /* Get record locking info. */
# define F_SETLK 8 /* Set record locking info (non-blocking). */
# define F_SETLKW 9 /* Set record locking info (blocking). */
-#else
-# define F_GETLK F_GETLK64 /* Get record locking info. */
-# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/
-# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */
#endif
#if __WORDSIZE == 64
# define F_GETLK64 7 /* Get record locking info. */
# define F_SETLK64 8 /* Set record locking info (non-blocking). */
# define F_SETLKW64 9 /* Set record locking info (blocking). */
-#else
-# define F_GETLK64 12 /* Get record locking info. */
-# define F_SETLK64 13 /* Set record locking info (non-blocking). */
-# define F_SETLKW64 14 /* Set record locking info (blocking). */
#endif
/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
diff --git a/sysdeps/unix/sysv/linux/x86/bits/fcntl.h b/sysdeps/unix/sysv/linux/x86/bits/fcntl.h
index dcf4fc01af..9251e750ed 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/fcntl.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/fcntl.h
@@ -27,26 +27,10 @@
#endif
#ifdef __x86_64__
-# define F_GETLK 5 /* Get record locking info. */
-# define F_SETLK 6 /* Set record locking info (non-blocking). */
-# define F_SETLKW 7 /* Set record locking info (blocking). */
/* Not necessary, we always have 64-bit offsets. */
# define F_GETLK64 5 /* Get record locking info. */
# define F_SETLK64 6 /* Set record locking info (non-blocking). */
# define F_SETLKW64 7 /* Set record locking info (blocking). */
-#else
-# ifndef __USE_FILE_OFFSET64
-# define F_GETLK 5 /* Get record locking info. */
-# define F_SETLK 6 /* Set record locking info (non-blocking). */
-# define F_SETLKW 7 /* Set record locking info (blocking). */
-# else
-# define F_GETLK F_GETLK64 /* Get record locking info. */
-# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/
-# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */
-# endif
-# define F_GETLK64 12 /* Get record locking info. */
-# define F_SETLK64 13 /* Set record locking info (non-blocking). */
-# define F_SETLKW64 14 /* Set record locking info (blocking). */
#endif