glibc/glibc-2.16.0-i586-hptiming.patch
2012-07-10 14:20:40 +04:00

37 lines
1 KiB
Diff

--- glibc-2.16.0/elf/rtld.c.orig 2012-07-03 14:45:24.564837876 +0400
+++ glibc-2.16.0/elf/rtld.c 2012-07-03 14:50:58.156918323 +0400
@@ -16,6 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+/* Early statistics require high-precision timing. */
+#define NEED_HP_TIMING_HWCAP_AVAIL 1
+
#include <errno.h>
#include <dlfcn.h>
#include <fcntl.h>
@@ -190,6 +193,12 @@
static struct libname_list _dl_rtld_libname;
static struct libname_list _dl_rtld_libname2;
+/* Run-time detect availability of high-precision timer? */
+#ifdef HP_TIMING_HWCAP_AVAIL
+# undef HP_TIMING_AVAIL
+# define HP_TIMING_AVAIL HP_TIMING_HWCAP_AVAIL
+#endif
+
/* We expect less than a second for relocation. */
#ifdef HP_SMALL_TIMING_AVAIL
# undef HP_TIMING_AVAIL
@@ -321,9 +330,8 @@
#endif
-#if HP_TIMING_AVAIL
- HP_TIMING_NOW (GL(dl_cpuclock_offset));
-#endif
+ if (HP_TIMING_AVAIL)
+ HP_TIMING_NOW (GL(dl_cpuclock_offset));
/* Initialize the stack end variable. */
__libc_stack_end = __builtin_frame_address (0);