On Tue, Jul 26, 2011 at 12:18 AM, Douglas Mencken <[email protected]> wrote:
> Denys, no! It doesn't work too.
>
> CC networking/tcpudp.o
> In file included from /usr/include/linux/sysctl.h:25:0,
> from /usr/include/linux/netfilter.h:6,
> from /usr/include/linux/netfilter_ipv4.h:8,
> from networking/tcpudp.c:74:
> /usr/include/linux/kernel.h:12:8: error: redefinition of 'struct sysinfo'
> /usr/include/sys/sysinfo.h:28:8: note: originally defined here
> make[1]: *** [networking/tcpudp.o] Error 1
> make: *** [networking] Error 2
I'm committing the attached patch.
Please try current git and let me know if the problem is still there.
--
vda
diff -d -urpN busybox.2/include/libbb.h busybox.3/include/libbb.h
--- busybox.2/include/libbb.h 2011-07-25 11:05:18.000000000 +0200
+++ busybox.3/include/libbb.h 2011-07-26 13:38:04.967443220 +0200
@@ -52,10 +52,12 @@
#ifdef HAVE_SYS_STATFS_H
# include <sys/statfs.h>
#endif
-/* struct sysinfo is linux-specific */
-#ifdef __linux__
-# include <sys/sysinfo.h>
-#endif
+/* Don't do this here:
+ * #include <sys/sysinfo.h>
+ * Some linux/ includes pull in conflicting definition
+ * of struct sysinfo (only in some toolchanins), which breaks build.
+ * Include sys/sysinfo.h only in those files which need it.
+ */
#if ENABLE_SELINUX
# include <selinux/selinux.h>
# include <selinux/context.h>
diff -d -urpN busybox.2/init/init.c busybox.3/init/init.c
--- busybox.2/init/init.c 2011-06-02 17:41:47.000000000 +0200
+++ busybox.3/init/init.c 2011-07-26 13:38:49.287571142 +0200
@@ -113,7 +113,8 @@
#include <paths.h>
#include <sys/resource.h>
#ifdef __linux__
-#include <linux/vt.h>
+# include <linux/vt.h>
+# include <sys/sysinfo.h>
#endif
#include "reboot.h" /* reboot() constants */
diff -d -urpN busybox.2/procps/free.c busybox.3/procps/free.c
--- busybox.2/procps/free.c 2011-06-02 17:41:47.000000000 +0200
+++ busybox.3/procps/free.c 2011-07-26 13:32:55.837096172 +0200
@@ -22,6 +22,9 @@
//usage: "Total: 386144 257128 129016\n"
#include "libbb.h"
+#ifdef __linux__
+# include <sys/sysinfo.h>
+#endif
struct globals {
unsigned mem_unit;
diff -d -urpN busybox.2/procps/ps.c busybox.3/procps/ps.c
--- busybox.2/procps/ps.c 2011-06-20 11:48:49.000000000 +0200
+++ busybox.3/procps/ps.c 2011-07-26 13:32:25.065439926 +0200
@@ -62,6 +62,9 @@ enum { MAX_WIDTH = 2*1024 };
#if ENABLE_DESKTOP
+#ifdef __linux__
+# include <sys/sysinfo.h>
+#endif
#include <sys/times.h> /* for times() */
#ifndef AT_CLKTCK
# define AT_CLKTCK 17
diff -d -urpN busybox.2/procps/uptime.c busybox.3/procps/uptime.c
--- busybox.2/procps/uptime.c 2011-06-02 17:41:47.000000000 +0200
+++ busybox.3/procps/uptime.c 2011-07-26 13:33:03.965010472 +0200
@@ -25,6 +25,10 @@
//usage: " 1:55pm up 2:30, load average: 0.09, 0.04, 0.00\n"
#include "libbb.h"
+#ifdef __linux__
+# include <sys/sysinfo.h>
+#endif
+
#ifndef FSHIFT
# define FSHIFT 16 /* nr of bits of precision */
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox