aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2012-10-24 14:50:46 -0700
committerRoland McGrath <roland@hack.frob.com>2012-10-24 14:50:46 -0700
commit6e6249d0b461b952d0f544792372663feb6d792a (patch)
tree555d1ac3a5e2ca9030d15f2e1760aea1a2e69ba7
parent0cae3f4b033e441d820f4521fa5736e4e6e4d713 (diff)
downloadglibc-6e6249d0b461b952d0f544792372663feb6d792a.tar.xz
glibc-6e6249d0b461b952d0f544792372663feb6d792a.zip
BZ#14743: Move clock_* symbols from librt to libc.
-rw-r--r--ChangeLog58
-rw-r--r--NEWS12
-rw-r--r--config.h.in3
-rwxr-xr-xconfigure7
-rw-r--r--configure.in6
-rw-r--r--include/time.h6
-rw-r--r--nptl/ChangeLog7
-rw-r--r--nptl/Makefile27
-rw-r--r--nscd/Makefile6
-rw-r--r--ports/ChangeLog.alpha5
-rw-r--r--ports/ChangeLog.arm5
-rw-r--r--ports/ChangeLog.ia648
-rw-r--r--ports/ChangeLog.m68k6
-rw-r--r--ports/ChangeLog.mips6
-rw-r--r--ports/ChangeLog.powerpc7
-rw-r--r--ports/ChangeLog.tile9
-rw-r--r--ports/sysdeps/unix/sysv/linux/alpha/nptl/libc.abilist5
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/nptl/libc.abilist5
-rw-r--r--ports/sysdeps/unix/sysv/linux/ia64/get_clockfreq.c8
-rw-r--r--ports/sysdeps/unix/sysv/linux/ia64/nptl/libc.abilist5
-rw-r--r--ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libc.abilist5
-rw-r--r--ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libc.abilist5
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libc.abilist5
-rw-r--r--ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libc.abilist5
-rw-r--r--ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libc.abilist5
-rw-r--r--ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libc.abilist5
-rw-r--r--ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libc.abilist5
-rw-r--r--ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libc.abilist5
-rw-r--r--posix/Makefile8
-rw-r--r--rt/Makefile7
-rw-r--r--rt/Versions14
-rw-r--r--rt/clock-compat.c65
-rw-r--r--rt/clock_getcpuclockid.c4
-rw-r--r--rt/clock_getres.c4
-rw-r--r--rt/clock_gettime.c5
-rw-r--r--rt/clock_nanosleep.c1
-rw-r--r--rt/clock_settime.c4
-rw-r--r--sysdeps/posix/clock_getres.c3
-rw-r--r--sysdeps/unix/clock_gettime.c4
-rw-r--r--sysdeps/unix/clock_nanosleep.c3
-rw-r--r--sysdeps/unix/clock_settime.c3
-rw-r--r--sysdeps/unix/sysv/linux/clock_getcpuclockid.c1
-rw-r--r--sysdeps/unix/sysv/linux/clock_nanosleep.c1
-rw-r--r--sysdeps/unix/sysv/linux/i386/get_clockfreq.c8
-rw-r--r--sysdeps/unix/sysv/linux/i386/nptl/libc.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/Makefile2
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/sh/nptl/libc.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c30
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist5
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist5
56 files changed, 385 insertions, 73 deletions
diff --git a/ChangeLog b/ChangeLog
index 3c9a31e2eb..28f485a06a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,61 @@
+2012-10-24 Roland McGrath <roland@hack.frob.com>
+
+ * nscd/Makefile ($(objpfx)nscd): Remove librt dependency.
+ * posix/Makefile ($(objpfx)tst-regex, $(objpfx)tst-regex2):
+ Targets removed.
+
+ [BZ #14743]
+ * include/time.h: Remove librt_hidden_proto (clock_gettime).
+ Declare __clock_getres, __clock_gettime, __clock_settime,
+ __clock_nanosleep, and __clock_getcpuclockid.
+ * rt/clock_gettime.c: Define __clock_gettime as an alias.
+ Remove librt_hidden_def (clock_gettime).
+ * sysdeps/unix/clock_gettime.c: Likewise.
+ * rt/clock_getcpuclockid.c: Define __clock_getcpuclockid as an alias.
+ * sysdeps/unix/sysv/linux/clock_getcpuclockid.c: Likewise.
+ * rt/clock_getres.c: Define __clock_getres as an alias.
+ * sysdeps/posix/clock_getres.c: Likewise.
+ * rt/clock_settime.c: Define __clock_settime as an alias.
+ * sysdeps/unix/clock_settime.c: Likewise.
+ * rt/clock_nanosleep.c: Define __clock_nanosleep as an alias.
+ * sysdeps/unix/clock_nanosleep.c: Likewise.
+ * sysdeps/unix/sysv/linux/clock_nanosleep.c: Likewise.
+ * rt/clock-compat.c: New file.
+ * rt/Makefile (librt-routines): Add clock-compat and move
+ $(clock-routines) to ...
+ (routines): ... here, new variable.
+ * sysdeps/unix/sysv/linux/powerpc/Makefile (sysdep_routines):
+ Don't add get_clockfreq here.
+ * rt/Versions (libc: GLIBC_2.17): New version set.
+ Add clock_* symbols here.
+ (libc: GLIBC_PRIVATE): New version set. Add __clock_* symbols here.
+ * sysdeps/unix/sysv/linux/i386/nptl/libc.abilist
+ (GLIBC_2.17): Add clock_* symbols.
+ * sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sh/nptl/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libc.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libc.abilist:
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/64/nptl/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/nptl/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-64/nptl/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-32/nptl/libc.abilist: Likewise.
+ * NEWS: Mention the move.
+
+ * sysdeps/unix/sysv/linux/i386/get_clockfreq.c (__get_clockfreq):
+ Use __open, __read, __close rather than their public counterparts.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c
+ (__get_clockfreq_via_cpuinfo): Likewise.
+ (__get_clockfreq_via_proc_openprom): Likewise, and __getdirentries.
+ (__get_clockfreq_via_dev_openprom): Likewise, and __ioctl.
+
+ * config.h.in (HAVE_IFUNC): New #undef.
+ * configure.in: Define it if libc_cv_ld_gnu_indirect_function
+ was successful.
+ * configure: Regenerated.
+
2012-10-24 Mike Frysinger <vapier@gentoo.org>
* configure.in: Move READELF check to start of file.
diff --git a/NEWS b/NEWS
index 0e10112a35..a1cc1287fd 100644
--- a/NEWS
+++ b/NEWS
@@ -16,7 +16,8 @@ Version 2.17
14328, 14331, 14336, 14337, 14347, 14349, 14376, 14417, 14459, 14476,
14477, 14505, 14510, 14516, 14518, 14519, 14530, 14532, 14538, 14543,
14544, 14545, 14557, 14562, 14568, 14576, 14579, 14583, 14587, 14602,
- 14621, 14638, 14645, 14648, 14652, 14660, 14661, 14683, 14694, 14716.
+ 14621, 14638, 14645, 14648, 14652, 14660, 14661, 14683, 14694, 14716,
+ 14743.
* Support for STT_GNU_IFUNC symbols added for s390 and s390x.
Optimized versions of memcpy, memset, and memcmp added for System z10 and
@@ -54,6 +55,13 @@ Version 2.17
enabled, and fail on encrypted strings using the MD5 or DES algorithm
when the mode is enabled.
+* The `clock_*' suite of functions (declared in <time.h>) is now available
+ directly in the main C library. Previously it was necessary to link with
+ -lrt to use these functions. This change has the effect that a
+ single-threaded program that uses a function such as `clock_gettime' (and
+ is not linked with -lrt) will no longer implicitly load the pthreads
+ library at runtime and so will not suffer the overheads associated with
+ multi-thread support in other code such as the C++ runtime library.
Version 2.16
@@ -81,7 +89,7 @@ Version 2.16
14043, 14044, 14048, 14049, 14050, 14053, 14055, 14059, 14064, 14075,
14080, 14083, 14103, 14104, 14109, 14112, 14117, 14122, 14123, 14134,
14153, 14183, 14188, 14199, 14210, 14218, 14229, 14241, 14273, 14277,
- 14278,
+ 14278.
* Support for the x32 ABI on x86-64 added. The x32 target is selected by
configuring glibc with:
diff --git a/config.h.in b/config.h.in
index 5f9f3c39d5..653df54e56 100644
--- a/config.h.in
+++ b/config.h.in
@@ -180,6 +180,9 @@
/* Define if the dynamic linker should consult an ld.so.cache file. */
#undef USE_LDCONFIG
+/* Define if STT_GNU_IFUNC support actually works. */
+#undef HAVE_IFUNC
+
/*
*/
diff --git a/configure b/configure
index 8cd403bf4e..35b06c1473 100755
--- a/configure
+++ b/configure
@@ -7456,6 +7456,13 @@ if test x$libc_cv_gcc_unwind_find_fde = xyes; then
fi
+# A sysdeps configure fragment can reset this if IFUNC is not actually
+# usable even though the assembler knows how to generate the symbol type.
+if test x"$libc_cv_ld_gnu_indirect_function" = xyes; then
+ $as_echo "#define HAVE_IFUNC 1" >>confdefs.h
+
+fi
+
# This is far from the AC_ARG_ENABLE that sets it so that a sysdeps
# configure fragment can override the value to prevent this AC_DEFINE.
diff --git a/configure.in b/configure.in
index 4f7bc09842..928b7b62a9 100644
--- a/configure.in
+++ b/configure.in
@@ -2123,6 +2123,12 @@ if test x$libc_cv_gcc_unwind_find_fde = xyes; then
fi
AC_SUBST(libc_cv_gcc_unwind_find_fde)
+# A sysdeps configure fragment can reset this if IFUNC is not actually
+# usable even though the assembler knows how to generate the symbol type.
+if test x"$libc_cv_ld_gnu_indirect_function" = xyes; then
+ AC_DEFINE(HAVE_IFUNC)
+fi
+
# This is far from the AC_ARG_ENABLE that sets it so that a sysdeps
# configure fragment can override the value to prevent this AC_DEFINE.
AC_SUBST(use_nscd)
diff --git a/include/time.h b/include/time.h
index f056542a10..9be15b9739 100644
--- a/include/time.h
+++ b/include/time.h
@@ -19,7 +19,11 @@ libc_hidden_proto (localtime)
libc_hidden_proto (strftime)
libc_hidden_proto (strptime)
-librt_hidden_proto (clock_gettime)
+extern __typeof (clock_getres) __clock_getres;
+extern __typeof (clock_gettime) __clock_gettime;
+extern __typeof (clock_settime) __clock_settime;
+extern __typeof (clock_nanosleep) __clock_nanosleep;
+extern __typeof (clock_getcpuclockid) __clock_getcpuclockid;
/* Now define the internal interfaces. */
struct tm;
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 5a3ab06604..d0b5d6c7b8 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,10 @@
+2012-10-24 Roland McGrath <roland@hack.frob.com>
+
+ * Makefile ($(objpfx)tst-cond11, $(objpfx)tst-cond19): Targets removed.
+ ($(objpfx)tst-sem5, $(objpfx)tst-cancel18): Likewise.
+ ((objpfx)tst-cancelx18, $(objpfx)tst-clock2): Likewise.
+ ($(objpfx)tst-rwlock14): Likewise.
+
2012-10-24 Joseph Myers <joseph@codesourcery.com>
* Makefile (tests): Remove tst-oddstacklimit.
diff --git a/nptl/Makefile b/nptl/Makefile
index 21a876652e..7387a640b9 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -484,31 +484,18 @@ $(objpfx)tst-dlsym1: $(libdl) $(shared-thread-library)
$(objpfx)tst-fini1: $(shared-thread-library) $(objpfx)tst-fini1mod.so
ifeq (yes,$(build-shared))
-$(objpfx)tst-cond11: $(common-objpfx)rt/librt.so
-$(objpfx)tst-cond19: $(common-objpfx)rt/librt.so
-$(objpfx)tst-sem5: $(common-objpfx)rt/librt.so
-$(objpfx)tst-cancel17: $(common-objpfx)rt/librt.so
-$(objpfx)tst-cancelx17: $(common-objpfx)rt/librt.so
-$(objpfx)tst-cancel18: $(common-objpfx)rt/librt.so
-$(objpfx)tst-cancelx18: $(common-objpfx)rt/librt.so
-$(objpfx)tst-clock2: $(common-objpfx)rt/librt.so
-$(objpfx)tst-rwlock14: $(common-objpfx)rt/librt.so
+librt = $(