Skip to contentSkip to conversation

RHEL-8.1 compile problem

PATCH In review Sergey Ivanov 2 participants 5 messages Dec 8, 2019 – Dec 9, 2019

lore
Share & tools
lore
#0 lore raw

Hi,
I have used wireguard version 0.0.20191012 on RHEL-8.0, but after upgrade to RHEL-8.1 with kernel 4.18.0-147.el8.x86_64 dkms failed to install to the new kernel. I am trying now to reinstall manually compiling from tag 4.18.0-147.el8.x86_64:
===
sh-4.4$ git clone https://git.zx2c4.com/WireGuard
Cloning into 'WireGuard'...
...
Resolving deltas: 100% (8471/8471), done.
sh-4.4$ cd WireGuard/
sh-4.4$ git checkout 0.0.20191127
Note: checking out '0.0.20191127'.
...

HEAD is now at 7fc30dd version: bump snapshot sh-4.4$ git checkout -b b_0.0.20191127
Switched to a new branch 'b_0.0.20191127'
sh-4.4$ cd src/
sh-4.4$ make
CC [M] /var/home/seriv/work/git/WireGuard/src/main.o
In file included from <command-line>:
/var/home/seriv/work/git/WireGuard/src/compat/compat.h:342:20:
error: static declaration of ‘rng_is_initialized’ follows non-static declaration
static inline bool rng_is_initialized(void)

                    ^~~~~~~~~~~~~~~~~~

In file included from /var/home/seriv/work/git/WireGuard/src/compat/compat.h:330,
from <command-line>:
./include/linux/random.h:40:13: note: previous declaration of ‘rng_is_initialized’ was here

 extern bool rng_is_initialized(void);
             ^~~~~~~~~~~~~~~~~~
In file included from <command-line>:
/var/home/seriv/work/git/WireGuard/src/compat/compat.h:835:23:
error: redeclaration of enumerator ‘NLA_UNSPEC’
 #define NLA_EXACT_LEN NLA_UNSPEC
                       ^~~~~~~~~~

./include/net/netlink.h:184:2: note: in expansion of macro ‘NLA_EXACT_LEN’
NLA_EXACT_LEN,
^~~~~~~~~~~~~
In file included from ./include/net/rtnetlink.h:6,

                 from ./include/net/sch_generic.h:17,
                 from ./include/linux/filter.h:24,
                 from ./include/net/sock.h:64,
                 from ./include/linux/tcp.h:23,
                 from ./include/linux/ipv6.h:106,
                 from ./include/net/ipv6.h:16,
                 from 

/var/home/seriv/work/git/WireGuard/src/compat/compat.h:874,
from <command-line>:
./include/net/netlink.h:166:2: note: previous definition of ‘NLA_UNSPEC’ was here
NLA_UNSPEC,
^~~~~~~~~~
make[2]: *** [scripts/Makefile.build:313:
/var/home/seriv/work/git/WireGuard/src/main.o] Error 1 make[1]:
*** [Makefile:1547:
_module_/var/home/seriv/work/git/WireGuard/src] Error 2 make: *** [Makefile:38: module] Error 2

Signature · 2 lines
  Regards,
  Sergey Ivanov

_______________________________________________
WireGuard mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/wireguard

#1 lore raw

RHEL-8.1 backported a couple features breaking wireguard compilation.

Hi,

on kernel 4.18.0-147.el8.x86_64 I am not able to compile https://git.zx2c4.com/WireGuard sources, tried tags 0.0.20191127 and  0.0.20191205 and master at 5eb87fb649.

To compile it I did the following workaround:

===

$ git diff
src/compat/compat.h +0 -0
index ab22fa4..6e034b5 100644
@@ -326,7 +326,7 @@ static inline int wait_for_random_bytes(void)

 }
 #endif

-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) && defined(ISRHEL8) && RHEL_MINOR < 1 && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) #include <linux/random.h>
 #include <linux/slab.h>
 struct rng_is_initialized_callback {
@@ -831,7 +831,7 @@ static inline void skb_mark_not_on_list(struct sk_buff *skb)
 }
 #endif

-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) && (!defined(ISRHEL8) || RHEL_MINOR < 1) #define NLA_EXACT_LEN NLA_UNSPEC
 #endif
 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
===

Signature · 8 lines
  Regards,

  Sergey Ivanov

_______________________________________________
WireGuard mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/wireguard
#2 lore raw

Re: RHEL-8.1 backported a couple features breaking wireguard compilation.

Thanks. The rhel backporting policy has generally been to not support older point releases once new ones exist. So we'll move to supporting rhel 8.1 and drop 8.0. If you submit a properly formatted git patch with a sign off line, I can apply it.

Quoted 42 lines · On Sun, Dec 8, 2019, 11:41 Sergey Ivanov <[email protected]> wrote:

Hi,

on kernel 4.18.0-147.el8.x86_64 I am not able to compile
https://git.zx2c4.com/WireGuard sources, tried tags 0.0.20191127 and 0.0.20191205 and master at 5eb87fb649.

To compile it I did the following workaround:

===

$ git diff
src/compat/compat.h +1 -1
index ab22fa4..6e034b5 100644
@@ -326,7 +326,7 @@ static inline int wait_for_random_bytes(void)
  }
  #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) && LINUX_VERSION_CODE
 >= KERNEL_VERSION(4, 2, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) && defined(ISRHEL8)
 && RHEL_MINOR < 1 && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
  #include <linux/random.h>
  #include <linux/slab.h>
  struct rng_is_initialized_callback {
src/compat/compat.h +1 -1
@@ -831,7 +831,7 @@ static inline void skb_mark_not_on_list(struct
 sk_buff *skb)
  }
  #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) && (!defined(ISRHEL8)
 || RHEL_MINOR < 1)
  #define NLA_EXACT_LEN NLA_UNSPEC

#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
===

--

Quoted 9 lines

Regards,

Sergey Ivanov

_______________________________________________
WireGuard mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/wireguard

_______________________________________________
WireGuard mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/wireguard

#3 lore raw

PATCH 1/1 Support building for RHEL-8.1 instead of RHEL-8.0

RedHat backported to their kernel 4.18.0-147.el8 a couple features. This patch enables compiling for this kernel.

---
 src/compat/compat.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/compat/compat.h +2 -2
index b4a8f8b..6808259 100644
@@ -326,7 +326,7 @@ static inline int wait_for_random_bytes(void)
 }
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) && !defined(ISRHEL8) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
 #include <linux/random.h>
 #include <linux/slab.h>
 struct rng_is_initialized_callback {
@@ -831,7 +831,7 @@ static inline void skb_mark_not_on_list(struct sk_buff *skb)
 }
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) && !defined(ISRHEL8)
 #define NLA_EXACT_LEN NLA_UNSPEC
 #endif
 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
Signature · 6 lines
2.18.1

_______________________________________________
WireGuard mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/wireguard