Skip to contentSkip to conversation

Fix build on fedora-14 (and other older systems)

PATCH In review [email protected] 3 participants 4 messages Sep 2, 2017 – Sep 3, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix build on fedora-14 (and other older systems)

From: Ben Greear <[email protected]>

Seems Fedora-20 and below fail, hopefully this fixes them.

---
 include/linux/sysinfo.h | 8 ++++++++
 ip/ipxfrm.c             | 1 +
 ip/xfrm_policy.c        | 1 +
 ip/xfrm_state.c         | 1 +
 4 files changed, 11 insertions(+)
include/linux/sysinfo.h +8 -0
index 934335a..3596b02 100644
@@ -3,6 +3,14 @@
 
 #include <linux/types.h>
 
+/* So we can compile on older OSs, hopefully this is correct. --Ben */
+#ifndef __kernel_long_t
+typedef long __kernel_long_t;
+#endif
+#ifndef __kernel_ulong_t
+typedef unsigned long __kernel_ulong_t;
+#endif
+
 #define SI_LOAD_SHIFT	16
 struct sysinfo {
 	__kernel_long_t uptime;		/* Seconds since boot */
ip/ipxfrm.c +1 -0
index 12c2f72..492a6af 100644
@@ -38,6 +38,7 @@
 #include "utils.h"
 #include "xfrm.h"
 #include "ip_common.h"
+#include "xtables.h"
 
 #define STRBUF_SIZE	(128)
 
ip/xfrm_policy.c +1 -0
index de689c4..0f957c1 100644
@@ -32,6 +32,7 @@
 #include "utils.h"
 #include "xfrm.h"
 #include "ip_common.h"
+#include "xtables.h"
 
 /* #define NLMSG_DELETEALL_BUF_SIZE (4096-512) */
 #define NLMSG_DELETEALL_BUF_SIZE 8192
ip/xfrm_state.c +1 -0
index 4483fb8..5a6a895 100644
@@ -31,6 +31,7 @@
 #include "utils.h"
 #include "xfrm.h"
 #include "ip_common.h"
+#include "xtables.h"
 
 /* #define NLMSG_DELETEALL_BUF_SIZE (4096-512) */
 #define NLMSG_DELETEALL_BUF_SIZE 8192
Signature · 1 line
2.4.11
#1 lore raw
Quoted 5 lines · On Sat, Sep 02, 2017 at 07:15:02AM -0700, [email protected] wrote:

From: Ben Greear <[email protected]>

Seems Fedora-20 and below fail, hopefully this fixes them.

Quoted 7 lines
---
 include/linux/sysinfo.h | 8 ++++++++
 ip/ipxfrm.c             | 1 +
 ip/xfrm_policy.c        | 1 +
 ip/xfrm_state.c         | 1 +
 4 files changed, 11 insertions(+)

Works for me from openSUSE Tumbleweed to SLE11 SP4 (kernel 3.0). The build on SLE11 SP2 (also 3.0 but older headers in /usr/include) fails with unknown MS_PRIVATE and MS_REC in lib/bpf.c Newer systems have these defined in <sys/mount.h>

Including <linux/fs.h> directly in lib/bpf.c fixes that but if we do that, a copy of the file would have to be included.

Quoted 9 lines
include/linux/sysinfo.h +1 -0
index 934335a..3596b02 100644
@@ -3,6 +3,14 @@
 
 #include <linux/types.h>
 
+/* So we can compile on older OSs, hopefully this is correct. --Ben */

include/linux/sysinfo.h line 16

Quoted 10 lines
include/linux/sysinfo.h +7 -0
+#ifndef __kernel_long_t
+typedef long __kernel_long_t;
+#endif
+#ifndef __kernel_ulong_t
+typedef unsigned long __kernel_ulong_t;
+#endif
+
 #define SI_LOAD_SHIFT	16
 struct sysinfo {
 	__kernel_long_t uptime;		/* Seconds since boot */

I'm not sure if it is acceptable to modify a file which is supposed to be a direct copy of kernel uapi header.

Michal Kubecek

#2 lore raw
In reply to [email protected]
Quoted 9 lines · On Sat, 2 Sep 2017 07:15:02 -0700 [email protected] wrote:
include/linux/sysinfo.h +1 -0
index 934335a..3596b02 100644
@@ -3,6 +3,14 @@
 
 #include <linux/types.h>
 
+/* So we can compile on older OSs, hopefully this is correct. --Ben */

include/linux/sysinfo.h line 16

Quoted 10 lines
include/linux/sysinfo.h +7 -0
+#ifndef __kernel_long_t
+typedef long __kernel_long_t;
+#endif
+#ifndef __kernel_ulong_t
+typedef unsigned long __kernel_ulong_t;
+#endif
+
 #define SI_LOAD_SHIFT	16
 struct sysinfo {
 	__kernel_long_t uptime;		/* Seconds since boot */

I am not accepting this patch because all files in include/linux are automatically regenerated from kernel 'make install_headers'. No exceptions. If you want to change a header in include/linux it has to go through upstream kernel inclusion.

author
#3 lore raw
Quoted 11 lines · Stephen Hemminger
Quoted 8 lines · On Sat, 2 Sep 2017 07:15:02 -0700 [email protected] wrote:
include/linux/sysinfo.h +0 -0
index 934335a..3596b02 100644
@@ -3,6 +3,14 @@
 
 #include <linux/types.h>
 
Quoted 15 lines

include/linux/sysinfo.h line 16

Quoted 11 lines
include/linux/sysinfo.h +8 -0
+/* So we can compile on older OSs, hopefully this is correct. --Ben */
+#ifndef __kernel_long_t
+typedef long __kernel_long_t;
+#endif
+#ifndef __kernel_ulong_t
+typedef unsigned long __kernel_ulong_t;
+#endif
+
 #define SI_LOAD_SHIFT	16
 struct sysinfo {
 	__kernel_long_t uptime;		/* Seconds since boot */

I am not accepting this patch because all files in include/linux are automatically regenerated from kernel 'make install_headers'. No exceptions. If you want to change a header in include/linux it has to go through upstream kernel inclusion.

It would be wrong to add this to the actual kernel header I think.

Do you have another suggestion for fixing iproute2 compile?

Thanks,
Ben

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com