This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch] Fix HP_SMALL_TIMING_AVAIL undef warnings


Here is my attempt to fix some of the undef warnings (those for
HP_SMALL_TIMING_AVAIL).  Does this look like the right way to
fix this?  At the risk of opening a can of worms, do we want to
change the name of this macro to match the other HP_TIMING_*
macros in this section?

I tested this on my MIPS machine and all the object files remained
the same except for nscd/nscd_stat.o (has a date stamp in it) and
rt/get_clockfreq.o (line number change in debug info due to the extra
line in sysdeps/generic/hp-timing.h).

It might be good if an alpha maintainer could check this since
that is the only target that defines HP_SMALL_TIMING_AVAIL.

OK to check in?


2014-04-25  Steve Ellcey  <sellcey@mips.com>

	* sysdeps/generic/hp-timing.h (HP_SMALL_TIMING_AVAIL):
	Set default value.
	* elf/dl-support.c: Use #if to check HP_SMALL_TIMING_AVAIL.
	* elf/rtld.c: Ditto.


diff --git a/elf/dl-support.c b/elf/dl-support.c
index e435436..e9cfa64 100644
--- a/elf/dl-support.c
+++ b/elf/dl-support.c
@@ -130,7 +130,7 @@ void *_dl_random;
 #include <dl-procinfo.c>
 
 /* We expect less than a second for relocation.  */
-#ifdef HP_SMALL_TIMING_AVAIL
+#if HP_SMALL_TIMING_AVAIL
 # undef HP_TIMING_AVAIL
 # define HP_TIMING_AVAIL HP_SMALL_TIMING_AVAIL
 #endif
diff --git a/elf/rtld.c b/elf/rtld.c
index 9d121dc..5dcb61a 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -196,7 +196,7 @@ static struct libname_list _dl_rtld_libname;
 static struct libname_list _dl_rtld_libname2;
 
 /* We expect less than a second for relocation.  */
-#ifdef HP_SMALL_TIMING_AVAIL
+#if HP_SMALL_TIMING_AVAIL
 # undef HP_TIMING_AVAIL
 # define HP_TIMING_AVAIL HP_SMALL_TIMING_AVAIL
 #endif
diff --git a/sysdeps/generic/hp-timing.h b/sysdeps/generic/hp-timing.h
index eddc971..775495d 100644
--- a/sysdeps/generic/hp-timing.h
+++ b/sysdeps/generic/hp-timing.h
@@ -30,6 +30,8 @@
 
    - HP_TIMING_AVAIL: test for availability.
 
+   - HP_SMALL_TIMING_AVAIL: test for availability.
+
    - HP_TIMING_INLINE: this macro is non-zero if the functionality is not
      implemented using function calls but instead uses some inlined code
      which might simply consist of a few assembler instructions.  We have to
@@ -66,6 +68,7 @@
 
 /* Provide dummy definitions.  */
 #define HP_TIMING_AVAIL		(0)
+#define HP_SMALL_TIMING_AVAIL   (0)
 #define HP_TIMING_INLINE	(0)
 typedef int hp_timing_t;
 #define HP_TIMING_ZERO(Var)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]