You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.3 KiB

  1. --- a/proc/sysinfo.c
  2. +++ b/proc/sysinfo.c
  3. @@ -209,7 +209,12 @@ static int check_for_privs(void){
  4. return !!rc;
  5. }
  6. +#if __GNUC__ < 4 || __GNUC_MINOR__ < 3
  7. static void init_libproc(void) __attribute__((constructor));
  8. +#else
  9. +static void init_libproc(void) __attribute__((constructor(200)));
  10. +#endif
  11. +
  12. static void init_libproc(void){
  13. have_privs = check_for_privs();
  14. // ought to count CPUs in /proc/stat instead of relying
  15. --- a/proc/version.c
  16. +++ b/proc/version.c
  17. @@ -33,7 +33,12 @@ void display_version(void) {
  18. int linux_version_code;
  19. +#if __GNUC__ < 4 || __GNUC_MINOR__ < 3
  20. static void init_Linux_version(void) __attribute__((constructor));
  21. +#else
  22. +static void init_Linux_version(void) __attribute__((constructor(100)));
  23. +#endif
  24. +
  25. static void init_Linux_version(void) {
  26. static struct utsname uts;
  27. int x = 0, y = 0, z = 0; /* cleared in case sscanf() < 3 */
  28. --- a/proc/module.mk
  29. +++ b/proc/module.mk
  30. @@ -76,7 +76,7 @@ proc/$(ANAME): $(LIBOBJ)
  31. #proc/$(SONAME): proc/library.map
  32. proc/$(SONAME): $(LIBOBJ)
  33. - $(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -shared -Wl,-soname,$(SONAME) -Wl,--version-script=proc/library.map -o $@ $^ -lc
  34. + $(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -shared -Wl,-soname,$(SONAME) -Wl,--version-script=proc/library.map -o $@ $(sort $^) -lc
  35. # AUTOMATIC DEPENDENCY GENERATION -- GCC AND GNUMAKE DEPENDENT