netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix build on fedora-14 (and other older systems)
@ 2017-09-02 14:15 greearb
  2017-09-02 17:03 ` Michal Kubecek
  2017-09-03 15:50 ` Stephen Hemminger
  0 siblings, 2 replies; 4+ messages in thread
From: greearb @ 2017-09-02 14:15 UTC (permalink / raw)
  To: netdev; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

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

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 include/linux/sysinfo.h | 8 ++++++++
 ip/ipxfrm.c             | 1 +
 ip/xfrm_policy.c        | 1 +
 ip/xfrm_state.c         | 1 +
 4 files changed, 11 insertions(+)

diff --git a/include/linux/sysinfo.h b/include/linux/sysinfo.h
index 934335a..3596b02 100644
--- a/include/linux/sysinfo.h
+++ b/include/linux/sysinfo.h
@@ -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 */
diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
index 12c2f72..492a6af 100644
--- a/ip/ipxfrm.c
+++ b/ip/ipxfrm.c
@@ -38,6 +38,7 @@
 #include "utils.h"
 #include "xfrm.h"
 #include "ip_common.h"
+#include "xtables.h"
 
 #define STRBUF_SIZE	(128)
 
diff --git a/ip/xfrm_policy.c b/ip/xfrm_policy.c
index de689c4..0f957c1 100644
--- a/ip/xfrm_policy.c
+++ b/ip/xfrm_policy.c
@@ -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
diff --git a/ip/xfrm_state.c b/ip/xfrm_state.c
index 4483fb8..5a6a895 100644
--- a/ip/xfrm_state.c
+++ b/ip/xfrm_state.c
@@ -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
-- 
2.4.11

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix build on fedora-14 (and other older systems)
  2017-09-02 14:15 [PATCH] Fix build on fedora-14 (and other older systems) greearb
@ 2017-09-02 17:03 ` Michal Kubecek
  2017-09-03 15:50 ` Stephen Hemminger
  1 sibling, 0 replies; 4+ messages in thread
From: Michal Kubecek @ 2017-09-02 17:03 UTC (permalink / raw)
  To: greearb; +Cc: netdev

On Sat, Sep 02, 2017 at 07:15:02AM -0700, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
> 
> Seems Fedora-20 and below fail, hopefully this fixes
> them.
> 
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
>  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.

> diff --git a/include/linux/sysinfo.h b/include/linux/sysinfo.h
> index 934335a..3596b02 100644
> --- a/include/linux/sysinfo.h
> +++ b/include/linux/sysinfo.h
> @@ -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 */

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix build on fedora-14 (and other older systems)
  2017-09-02 14:15 [PATCH] Fix build on fedora-14 (and other older systems) greearb
  2017-09-02 17:03 ` Michal Kubecek
@ 2017-09-03 15:50 ` Stephen Hemminger
  2017-09-03 18:28   ` Ben Greear
  1 sibling, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2017-09-03 15:50 UTC (permalink / raw)
  To: greearb; +Cc: netdev

On Sat,  2 Sep 2017 07:15:02 -0700
greearb@candelatech.com wrote:

> diff --git a/include/linux/sysinfo.h b/include/linux/sysinfo.h
> index 934335a..3596b02 100644
> --- a/include/linux/sysinfo.h
> +++ b/include/linux/sysinfo.h
> @@ -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 */

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix build on fedora-14 (and other older systems)
  2017-09-03 15:50 ` Stephen Hemminger
@ 2017-09-03 18:28   ` Ben Greear
  0 siblings, 0 replies; 4+ messages in thread
From: Ben Greear @ 2017-09-03 18:28 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev



On 09/03/2017 08:50 AM, Stephen Hemminger wrote:
> On Sat,  2 Sep 2017 07:15:02 -0700
> greearb@candelatech.com wrote:
>
>> diff --git a/include/linux/sysinfo.h b/include/linux/sysinfo.h
>> index 934335a..3596b02 100644
>> --- a/include/linux/sysinfo.h
>> +++ b/include/linux/sysinfo.h
>> @@ -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 */
>
> 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

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-03 18:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-02 14:15 [PATCH] Fix build on fedora-14 (and other older systems) greearb
2017-09-02 17:03 ` Michal Kubecek
2017-09-03 15:50 ` Stephen Hemminger
2017-09-03 18:28   ` Ben Greear

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).