Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Dan George <dgeor8@gmail.com>
To: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: [wireguard-linux-compat] fallthrough macro breaks pre-5.4 kernel compatibility?
Date: Tue, 8 Mar 2022 18:31:28 +1100	[thread overview]
Message-ID: <CAMTegSQfJiwcQnAzQP3hD4Bo8zcCLkUGWiUifBFaVvLPoCoUdQ@mail.gmail.com> (raw)
In-Reply-To: <CAMTegSQZ=7GQMtbKpRu8Z-+igZVdKwQHb9HPyFt3ikYS2i5GsA@mail.gmail.com>

Hi all,

I just tried compiling the latest wireguard-linux-compat kernel module
v1.0.20211208 for kernel 4.4 [1] and encountered the following error:
"net/wireguard/compat/siphash/siphash.c:112:36: error: ‘fallthrough’
undeclared (first use in this function)"
The previous version v1.0.20210606 compiles and runs fine.

Some (inexpert) digging suggests that this is because a recent patch
[2] modified siphash.c to use 'fallthrough', which is a Linux kernel
compiler macro that was only added in kernel 5.4 [3].

In which case, presumably, either 'fallthrough' needs to be removed
again, or the macro added in wireguard-linux-compat somewhere. I'm
happy to submit a patch for either (although would appreciate some
guidance if the second option), or someone with more experience can.

In my immediate case, removing all instances of 'fallthrough' from
siphash.c has fixed compilation.

Thanks,
Dan.

[1] Specifically, in case this becomes relevant, cross-compiling for
the Synology RT2600AC router (armv7l, kernel 4.4.60) from Ubuntu
20.04.4 x64 using gcc 4.9.3 according to the steps at
https://gitlab.com/Kendek/syno-router-scripts/-/issues/3
[2] https://git.zx2c4.com/wireguard-linux-compat/commit/?id=ea6b8e7be5072553b37df4b0b8ee6e0a37134738
[3] https://github.com/torvalds/linux/commit/294f69e662d1570703e9b56e95be37a9fd3afba5

           reply	other threads:[~2022-03-14 17:16 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <CAMTegSQZ=7GQMtbKpRu8Z-+igZVdKwQHb9HPyFt3ikYS2i5GsA@mail.gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMTegSQfJiwcQnAzQP3hD4Bo8zcCLkUGWiUifBFaVvLPoCoUdQ@mail.gmail.com \
    --to=dgeor8@gmail.com \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).