summaryrefslogtreecommitdiffstats
path: root/recipes-append/busybox
diff options
context:
space:
mode:
authorZhenhua Luo <b19537@freescale.com>2012-02-24 09:48:05 +0000
committerMatthew McClintock <msm@freescale.com>2012-02-23 22:03:23 -0600
commitf6454c34f366ffcb869ad9ee239470034a9cc4a5 (patch)
tree8468e62e7194b272ef7f104fa43343015505f62d /recipes-append/busybox
parent08a980d854fb9b3b91e13b79ade7a8ce14b40e3a (diff)
downloadmeta-fsl-ppc-f6454c34f366ffcb869ad9ee239470034a9cc4a5.tar.gz
busybox: fix the build error when enable CONFIG_TCPSVD
These patches were pulled from upstream busybox Signed-off-by: Zhenhua Luo <b19537@freescale.com>
Diffstat (limited to 'recipes-append/busybox')
-rw-r--r--recipes-append/busybox/busybox-1.18.5/0001-libbb.h-do-not-use-homegrown-struct-sysinfo.patch54
-rw-r--r--recipes-append/busybox/busybox-1.18.5/0002-work-around-sysinfo.h-versus-linux-.h-problems.patch95
-rw-r--r--recipes-append/busybox/busybox_1.18.5.bbappend5
3 files changed, 154 insertions, 0 deletions
diff --git a/recipes-append/busybox/busybox-1.18.5/0001-libbb.h-do-not-use-homegrown-struct-sysinfo.patch b/recipes-append/busybox/busybox-1.18.5/0001-libbb.h-do-not-use-homegrown-struct-sysinfo.patch
new file mode 100644
index 0000000..ab0c48f
--- /dev/null
+++ b/recipes-append/busybox/busybox-1.18.5/0001-libbb.h-do-not-use-homegrown-struct-sysinfo.patch
@@ -0,0 +1,54 @@
1From b87113587ed488ee10f621bde099766e13088923 Mon Sep 17 00:00:00 2001
2From: Denys Vlasenko <vda.linux@googlemail.com>
3Date: Mon, 25 Jul 2011 09:05:43 +0000
4Subject: [PATCH 1/2] libbb.h: do not use homegrown struct sysinfo.
5
6Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
7---
8 include/libbb.h | 23 ++++-------------------
9 1 files changed, 4 insertions(+), 19 deletions(-)
10
11diff --git a/include/libbb.h b/include/libbb.h
12index 7c1db3f..afe3b61 100644
13--- a/include/libbb.h
14+++ b/include/libbb.h
15@@ -44,6 +44,10 @@
16 #ifdef HAVE_SYS_STATFS_H
17 # include <sys/statfs.h>
18 #endif
19+/* struct sysinfo is linux-specific */
20+#ifdef __linux__
21+# include <sys/sysinfo.h>
22+#endif
23 #if ENABLE_SELINUX
24 # include <selinux/selinux.h>
25 # include <selinux/context.h>
26@@ -100,25 +104,6 @@ int klogctl(int type, char *b, int len);
27 #if !defined __FreeBSD__
28 char *dirname(char *path);
29 #endif
30-/* Include our own copy of struct sysinfo to avoid binary compatibility
31- * problems with Linux 2.4, which changed things. Grumble, grumble. */
32-struct sysinfo {
33- long uptime; /* Seconds since boot */
34- unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
35- unsigned long totalram; /* Total usable main memory size */
36- unsigned long freeram; /* Available memory size */
37- unsigned long sharedram; /* Amount of shared memory */
38- unsigned long bufferram; /* Memory used by buffers */
39- unsigned long totalswap; /* Total swap space size */
40- unsigned long freeswap; /* swap space still available */
41- unsigned short procs; /* Number of current processes */
42- unsigned short pad; /* Padding needed for m68k */
43- unsigned long totalhigh; /* Total high memory size */
44- unsigned long freehigh; /* Available high memory size */
45- unsigned int mem_unit; /* Memory unit size in bytes */
46- char _f[20 - 2 * sizeof(long) - sizeof(int)]; /* Padding: libc5 uses this.. */
47-};
48-int sysinfo(struct sysinfo* info);
49 #ifndef PATH_MAX
50 # define PATH_MAX 256
51 #endif
52--
531.7.5
54
diff --git a/recipes-append/busybox/busybox-1.18.5/0002-work-around-sysinfo.h-versus-linux-.h-problems.patch b/recipes-append/busybox/busybox-1.18.5/0002-work-around-sysinfo.h-versus-linux-.h-problems.patch
new file mode 100644
index 0000000..4d4d175
--- /dev/null
+++ b/recipes-append/busybox/busybox-1.18.5/0002-work-around-sysinfo.h-versus-linux-.h-problems.patch
@@ -0,0 +1,95 @@
1From f0256fb16d37061e04ca966da9d51d8eb205bc89 Mon Sep 17 00:00:00 2001
2From: Denys Vlasenko <vda.linux@googlemail.com>
3Date: Tue, 26 Jul 2011 11:42:12 +0000
4Subject: *: work around sysinfo.h versus linux/*.h problems
5
6Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
7---
8 include/libbb.h | 10 ++++++----
9 init/init.c | 3 ++-
10 procps/free.c | 3 +++
11 procps/ps.c | 3 +++
12 procps/uptime.c | 4 ++++
13 5 files changed, 18 insertions(+), 5 deletions(-)
14
15diff --git a/include/libbb.h b/include/libbb.h
16index afe3b61..9fcd770 100644
17--- a/include/libbb.h
18+++ b/include/libbb.h
19@@ -44,10 +44,12 @@
20 #ifdef HAVE_SYS_STATFS_H
21 # include <sys/statfs.h>
22 #endif
23-/* struct sysinfo is linux-specific */
24-#ifdef __linux__
25-# include <sys/sysinfo.h>
26-#endif
27+/* Don't do this here:
28+ * #include <sys/sysinfo.h>
29+ * Some linux/ includes pull in conflicting definition
30+ * of struct sysinfo (only in some toolchanins), which breaks build.
31+ * Include sys/sysinfo.h only in those files which need it.
32+ */
33 #if ENABLE_SELINUX
34 # include <selinux/selinux.h>
35 # include <selinux/context.h>
36diff --git a/init/init.c b/init/init.c
37index 0a0d503..5121b94 100644
38--- a/init/init.c
39+++ b/init/init.c
40@@ -113,7 +113,8 @@
41 #include <paths.h>
42 #include <sys/resource.h>
43 #ifdef __linux__
44-#include <linux/vt.h>
45+# include <linux/vt.h>
46+# include <sys/sysinfo.h>
47 #endif
48 #if ENABLE_FEATURE_UTMP
49 # include <utmp.h> /* DEAD_PROCESS */
50diff --git a/procps/free.c b/procps/free.c
51index efbac5b..706be1b 100644
52--- a/procps/free.c
53+++ b/procps/free.c
54@@ -10,6 +10,9 @@
55 /* getopt not needed */
56
57 #include "libbb.h"
58+#ifdef __linux__
59+# include <sys/sysinfo.h>
60+#endif
61
62 struct globals {
63 unsigned mem_unit;
64diff --git a/procps/ps.c b/procps/ps.c
65index 48b55a7..e9e6ca9 100644
66--- a/procps/ps.c
67+++ b/procps/ps.c
68@@ -16,6 +16,9 @@ enum { MAX_WIDTH = 2*1024 };
69
70 #if ENABLE_DESKTOP
71
72+#ifdef __linux__
73+# include <sys/sysinfo.h>
74+#endif
75 #include <sys/times.h> /* for times() */
76 #ifndef AT_CLKTCK
77 #define AT_CLKTCK 17
78diff --git a/procps/uptime.c b/procps/uptime.c
79index 5c48795..eda782c 100644
80--- a/procps/uptime.c
81+++ b/procps/uptime.c
82@@ -16,6 +16,10 @@
83 /* getopt not needed */
84
85 #include "libbb.h"
86+#ifdef __linux__
87+# include <sys/sysinfo.h>
88+#endif
89+
90
91 #ifndef FSHIFT
92 # define FSHIFT 16 /* nr of bits of precision */
93--
941.7.5
95
diff --git a/recipes-append/busybox/busybox_1.18.5.bbappend b/recipes-append/busybox/busybox_1.18.5.bbappend
new file mode 100644
index 0000000..b285c16
--- /dev/null
+++ b/recipes-append/busybox/busybox_1.18.5.bbappend
@@ -0,0 +1,5 @@
1FILESEXTRAPATHS_prepend := "${THISDIR}/busybox-1.18.5:"
2
3SRC_URI += "file://0001-libbb.h-do-not-use-homegrown-struct-sysinfo.patch \
4 file://0002-work-around-sysinfo.h-versus-linux-.h-problems.patch \
5"