Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 733192 - net-vpn/wireguard-modules-1.0.20200712 build error with sys-kernel/gentoo-sources-5.4.52
Summary: net-vpn/wireguard-modules-1.0.20200712 build error with sys-kernel/gentoo-sou...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-19 06:26 UTC by Joakim Tjernlund
Modified: 2020-07-22 11:02 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joakim Tjernlund 2020-07-19 06:26:00 UTC
>>> Compiling source in /var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712 ...
 * Preparing wireguard module
make -j8 -s HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' KERNELDIR=/usr/src/linux module 
In file included from <command-line>:
/var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/compat/compat.h: In function ‘ip_tunnel_parse_protocol’:
/var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/compat/compat.h:1051:40: error: invalid application of ‘sizeof’ to incomplete type ‘struct iphdr’
 1051 |      (skb_network_header(skb) + sizeof(struct iphdr)) <= skb_tail_pointer(skb) &&
      |                                        ^~~~~~
/var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/compat/compat.h:1052:6: error: implicit declaration of function ‘ip_hdr’ [-Werror=implicit-function-declaration]
 1052 |      ip_hdr(skb)->version == 4)
      |      ^~~~~~
/var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/compat/compat.h:1052:17: error: invalid type argument of ‘->’ (have ‘int’)
 1052 |      ip_hdr(skb)->version == 4)
      |                 ^~
/var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/compat/compat.h:1055:40: error: invalid application of ‘sizeof’ to incomplete type ‘struct ipv6hdr’
 1055 |      (skb_network_header(skb) + sizeof(struct ipv6hdr)) <= skb_tail_pointer(skb) &&
      |                                        ^~~~~~
/var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/compat/compat.h:1056:6: error: implicit declaration of function ‘ipv6_hdr’ [-Werror=implicit-function-declaration]
 1056 |      ipv6_hdr(skb)->version == 6)
      |      ^~~~~~~~
/var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/compat/compat.h:1056:19: error: invalid type argument of ‘->’ (have ‘int’)
 1056 |      ipv6_hdr(skb)->version == 6)
      |                   ^~
/var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/compat/compat.h: At top level:
/var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/compat/compat.h:1061:21: error: variable ‘ip_tunnel_header_ops’ has initializer but incomplete type
 1061 | static const struct header_ops ip_tunnel_header_ops = { .parse_protocol = ip_tunnel_parse_protocol };
      |                     ^~~~~~~~~~
/var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/compat/compat.h:1061:58: error: ‘const struct header_ops’ has no member named ‘parse_protocol’
 1061 | static const struct header_ops ip_tunnel_header_ops = { .parse_protocol = ip_tunnel_parse_protocol };
      |                                                          ^~~~~~~~~~~~~~
/var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/compat/compat.h:1061:75: warning: excess elements in struct initializer
 1061 | static const struct header_ops ip_tunnel_header_ops = { .parse_protocol = ip_tunnel_parse_protocol };
      |                                                                           ^~~~~~~~~~~~~~~~~~~~~~~~
/var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/compat/compat.h:1061:75: note: (near initialization for ‘ip_tunnel_header_ops’)
In file included from <command-line>:
/var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/compat/compat.h: In function ‘ip_tunnel_parse_protocol’:
/var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/compat/compat.h:1051:40: error: invalid application of ‘sizeof’ to incomplete type ‘struct iphdr’
 1051 |      (skb_network_header(skb) + sizeof(struct iphdr)) <= skb_tail_pointer(skb) &&
      |                                        ^~~~~~
In file included from /var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/allowedips.h:10,
                 from /var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/device.h:10,
                 from /var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/peer.h:9,
                 from /var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/queueing.h:9,
                 from /var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/device.c:6:
./include/linux/ip.h:19:29: error: conflicting types for ‘ip_hdr’
   19 | static inline struct iphdr *ip_hdr(const struct sk_buff *skb)
      |                             ^~~~~~
In file included from <command-line>:
/var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/compat/compat.h:1052:6: note: previous implicit declaration of ‘ip_hdr’ was here
 1052 |      ip_hdr(skb)->version == 4)
      |      ^~~~~~
/var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/compat/compat.h:1052:6: error: implicit declaration of function ‘ip_hdr’ [-Werror=implicit-function-declaration]
 1052 |      ip_hdr(skb)->version == 4)
      |      ^~~~~~
/var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/compat/compat.h:1052:17: error: invalid type argument of ‘->’ (have ‘int’)
 1052 |      ip_hdr(skb)->version == 4)
      |                 ^~
/var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/compat/compat.h:1055:40: error: invalid application of ‘sizeof’ to incomplete type ‘struct ipv6hdr’
 1055 |      (skb_network_header(skb) + sizeof(struct ipv6hdr)) <= skb_tail_pointer(skb) &&
      |                                        ^~~~~~
/var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/compat/compat.h:1056:6: error: implicit declaration of function ‘ipv6_hdr’ [-Werror=implicit-function-declaration]
 1056 |      ipv6_hdr(skb)->version == 6)
      |      ^~~~~~~~
/var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/compat/compat.h:1056:19: error: invalid type argument of ‘->’ (have ‘int’)
 1056 |      ipv6_hdr(skb)->version == 6)
.....
Comment 1 Joakim Tjernlund 2020-07-19 10:17:25 UTC
in compat.h you have:
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)
#if IS_ENABLED(CONFIG_NF_NAT)
#include <linux/ip.h>
#include <linux/icmpv6.h>
#include <net/ipv6.h>
#include <net/icmp.h>
#include <net/netfilter/nf_conntrack.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
#include <net/netfilter/nf_nat_core.h>
#endif
static inline void __compat_icmp_ndo_send(struct sk_buff *skb_in, int type, int code, __be32 info)
{
....

I don't have CONFIG_NF_NAT set so the includes are not seen and
that causes the build error.
if I just replace
 #if IS_ENABLED(CONFIG_NF_NAT)
with
 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)
I can build again

Do you really need CONFIG_NF_NAT for WG to work?
Comment 2 Progenyx 2020-07-19 18:20:34 UTC
on my system it fails with this instead:

cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/structleak_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/structleak_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/structleak_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/latent_entropy_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/latent_entropy_plugin.so
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/latent_entropy_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/structleak_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/latent_entropy_plugin.so
cc1: error: incompatible gcc/plugin versions
cc1: error: incompatible gcc/plugin versions
cc1: error: incompatible gcc/plugin versions
cc1: error: incompatible gcc/plugin versions
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/randomize_layout_plugin.so
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/randomize_layout_plugin.so
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/randomize_layout_plugin.so
cc1: error: fail to initialize plugin ./scripts/gcc-plugins/randomize_layout_plugin.so
make[2]: *** [scripts/Makefile.build:265: /var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/main.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [scripts/Makefile.build:265: /var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/device.o] Error 1
make[2]: *** [scripts/Makefile.build:265: /var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/peer.o] Error 1
make[2]: *** [scripts/Makefile.build:265: /var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src/noise.o] Error 1
make[1]: *** [Makefile:1706: /var/tmp/portage/net-vpn/wireguard-modules-1.0.20200712/work/wireguard-linux-compat-1.0.20200712/src] Error 2
make: *** [Makefile:25: module] Error 2
Comment 3 Jonas Stein gentoo-dev 2020-07-19 18:39:28 UTC
Thank you for the report. We need to have all information at hand before ticket assignment. That is why I ask you to 
* attach the kernel config
* attach the logs and 
* paste the emerge info 
as described on https://wiki.gentoo.org/wiki/Attach_the_logs_to_the_bug_ticket
Please reopen this ticket (Status:UNCONFIRMED) afterwards.
Comment 4 Joakim Tjernlund 2020-07-19 21:24:28 UTC
(In reply to Jonas Stein from comment #3)
> Thank you for the report. We need to have all information at hand before
> ticket assignment. That is why I ask you to 
> * attach the kernel config
> * attach the logs and 
> * paste the emerge info 
> as described on
> https://wiki.gentoo.org/wiki/Attach_the_logs_to_the_bug_ticket
> Please reopen this ticket (Status:UNCONFIRMED) afterwards.

That was a bit harsh I think, I did pinpoint the exact problem I think.
Comment 5 Michele Santullo 2020-07-22 11:02:56 UTC
I'm also affected by this bug, can you please not close valid outstanding bugs as "resolved"? It creates confusion and doesn't help us users affected by the issue.