Skip to content

Instantly share code, notes, and snippets.

@mikesart
Created October 24, 2013 19:37
Show Gist options
  • Save mikesart/7143615 to your computer and use it in GitHub Desktop.
Save mikesart/7143615 to your computer and use it in GitHub Desktop.
diff to get busybox 1.13 stable building on my Ubuntu 64-bit 12.04 machine with gcc 4.8.
diff --git a/include/libbb.h b/include/libbb.h
index 08fed90..ee166c2 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -89,6 +89,7 @@ int klogctl(int type, char *b, int len);
char *dirname(char *path);
/* Include our own copy of struct sysinfo to avoid binary compatibility
* problems with Linux 2.4, which changed things. Grumble, grumble. */
+#if 0
struct sysinfo {
long uptime; /* Seconds since boot */
unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
@@ -105,6 +106,10 @@ struct sysinfo {
unsigned int mem_unit; /* Memory unit size in bytes */
char _f[20 - 2 * sizeof(long) - sizeof(int)]; /* Padding: libc5 uses this.. */
};
+#else
+struct sysinfo;
+#endif
+
int sysinfo(struct sysinfo* info);
diff --git a/init/init.c b/init/init.c
index 5536504..7f6beb2 100644
--- a/init/init.c
+++ b/init/init.c
@@ -13,6 +13,7 @@
#include <syslog.h>
#include <paths.h>
#include <sys/reboot.h>
+#include <sys/sysinfo.h>
/* Was a CONFIG_xxx option. A lot of people were building
* not fully functional init by switching it on! */
diff --git a/procps/free.c b/procps/free.c
index e76dd21..d67244c 100644
--- a/procps/free.c
+++ b/procps/free.c
@@ -10,6 +10,7 @@
/* getopt not needed */
#include "libbb.h"
+#include <sys/sysinfo.h>
int free_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int free_main(int argc, char **argv)
diff --git a/procps/uptime.c b/procps/uptime.c
index d9aa1d0..3e29c0c 100644
--- a/procps/uptime.c
+++ b/procps/uptime.c
@@ -16,6 +16,7 @@
/* getopt not needed */
#include "libbb.h"
+#include <sys/sysinfo.h>
#ifndef FSHIFT
# define FSHIFT 16 /* nr of bits of precision */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment