blob: a7890a738452f940461c643dec72c9eca5af84e0 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: "Jason A. Donenfeld" <Jason@zx2c4.com>
3Date: Fri, 4 Jun 2021 17:17:32 +0200
4Subject: [PATCH] wireguard: do not use -O3
5
6commit cc5060ca0285efe2728bced399a1955a7ce808b2 upstream.
7
8Apparently, various versions of gcc have O3-related miscompiles. Looking
9at the difference between -O2 and -O3 for gcc 11 doesn't indicate
10miscompiles, but the difference also doesn't seem so significant for
11performance that it's worth risking.
12
13Link: https://lore.kernel.org/lkml/CAHk-=wjuoGyxDhAF8SsrTkN0-YfCx7E6jUN3ikC_tn2AKWTTsA@mail.gmail.com/
14Link: https://lore.kernel.org/lkml/CAHmME9otB5Wwxp7H8bR_i2uH2esEMvoBMC8uEXBMH9p0q1s6Bw@mail.gmail.com/
15Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
16Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
17Cc: stable@vger.kernel.org
18Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
19Signed-off-by: David S. Miller <davem@davemloft.net>
20Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
21---
22 drivers/net/wireguard/Makefile | 3 +--
23 1 file changed, 1 insertion(+), 2 deletions(-)
24
25--- a/drivers/net/wireguard/Makefile
26+++ b/drivers/net/wireguard/Makefile
27@@ -1,5 +1,4 @@
28-ccflags-y := -O3
29-ccflags-y += -D'pr_fmt(fmt)=KBUILD_MODNAME ": " fmt'
30+ccflags-y := -D'pr_fmt(fmt)=KBUILD_MODNAME ": " fmt'
31 ccflags-$(CONFIG_WIREGUARD_DEBUG) += -DDEBUG
32 wireguard-y := main.o
33 wireguard-y += noise.o