From: jow Date: Sun, 26 Dec 2010 00:53:40 +0000 (+0000) Subject: [packages] procps: the recently added "HZ fix" introduces constructor priorities... X-Git-Url: http://207.154.207.93/?a=commitdiff_plain;h=016c0374b9635c9db2d3444337653a7bac894de2;p=packages.git [packages] procps: the recently added "HZ fix" introduces constructor priorities which GCC < 4.0 does not support, protect those with a gcc version check git-svn-id: svn://svn.openwrt.org/openwrt/packages@24828 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- diff --git a/utils/procps/patches/020_hz_fix.patch b/utils/procps/patches/020_hz_fix.patch index 7b185c95b..1a4e48264 100644 --- a/utils/procps/patches/020_hz_fix.patch +++ b/utils/procps/patches/020_hz_fix.patch @@ -1,22 +1,30 @@ --- a/proc/sysinfo.c +++ b/proc/sysinfo.c -@@ -209,7 +209,7 @@ static int check_for_privs(void){ +@@ -209,7 +209,12 @@ static int check_for_privs(void){ return !!rc; } --static void init_libproc(void) __attribute__((constructor)); ++#if __GNUC__ < 4 + static void init_libproc(void) __attribute__((constructor)); ++#else +static void init_libproc(void) __attribute__((constructor(200))); ++#endif ++ 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) { +@@ -33,7 +33,12 @@ void display_version(void) { int linux_version_code; --static void init_Linux_version(void) __attribute__((constructor)); ++#if __GNUC__ < 4 + static void init_Linux_version(void) __attribute__((constructor)); ++#else +static void init_Linux_version(void) __attribute__((constructor(100))); ++#endif ++ static void init_Linux_version(void) { static struct utsname uts; int x = 0, y = 0, z = 0; /* cleared in case sscanf() < 3 */