utils/procps: fix "Unknown HZ value!" on some machines. (closes #8161)
authorAlexandros C. Couloumbis <alex@ozo.com>
Wed, 10 Nov 2010 14:47:31 +0000 (14:47 +0000)
committerAlexandros C. Couloumbis <alex@ozo.com>
Wed, 10 Nov 2010 14:47:31 +0000 (14:47 +0000)
SVN-Revision: 23943

utils/procps/patches/020_hz_fix.patch [new file with mode: 0644]

diff --git a/utils/procps/patches/020_hz_fix.patch b/utils/procps/patches/020_hz_fix.patch
new file mode 100644 (file)
index 0000000..7b185c9
--- /dev/null
@@ -0,0 +1,33 @@
+--- a/proc/sysinfo.c
++++ b/proc/sysinfo.c
+@@ -209,7 +209,7 @@ static int check_for_privs(void){
+   return !!rc;
+ }
+-static void init_libproc(void) __attribute__((constructor));
++static void init_libproc(void) __attribute__((constructor(200)));
+ static void init_libproc(void){
+   have_privs = check_for_privs();
+   // ought to count CPUs in /proc/stat instead of relying
+--- a/proc/version.c
++++ b/proc/version.c
+@@ -33,7 +33,7 @@ void display_version(void) {
+ int linux_version_code;
+-static void init_Linux_version(void) __attribute__((constructor));
++static void init_Linux_version(void) __attribute__((constructor(100)));
+ static void init_Linux_version(void) {
+     static struct utsname uts;
+     int x = 0, y = 0, z = 0;  /* cleared in case sscanf() < 3 */
+--- a/proc/module.mk
++++ b/proc/module.mk
+@@ -76,7 +76,7 @@ proc/$(ANAME): $(LIBOBJ)
+ #proc/$(SONAME): proc/library.map
+ proc/$(SONAME): $(LIBOBJ)
+-      $(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -shared -Wl,-soname,$(SONAME) -Wl,--version-script=proc/library.map -o $@ $^ -lc
++      $(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -shared -Wl,-soname,$(SONAME) -Wl,--version-script=proc/library.map -o $@ $(sort $^) -lc
+ # AUTOMATIC DEPENDENCY GENERATION -- GCC AND GNUMAKE DEPENDENT