Skip to content

Commit 405caf0

Browse files
committed
kbuild: do not use -O3
Apparently, various versions of gcc have O3-related miscompiles. Looking at the difference between -O2 and -O3 for gcc 11 doesn't indicate miscompiles, but the difference also doesn't seem so significant for performance that it's worth risking. Link: https://lore.kernel.org/lkml/CAHk-=wjuoGyxDhAF8SsrTkN0-YfCx7E6jUN3ikC_tn2AKWTTsA@mail.gmail.com/ Link: https://lore.kernel.org/lkml/CAHmME9otB5Wwxp7H8bR_i2uH2esEMvoBMC8uEXBMH9p0q1s6Bw@mail.gmail.com/ Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
1 parent b50ef4d commit 405caf0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Kbuild

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
#
33
# Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
44

5-
ccflags-y := -O3
6-
ccflags-$(CONFIG_WIREGUARD_DEBUG) += -DDEBUG -g
7-
ccflags-y += -D'pr_fmt(fmt)=KBUILD_MODNAME ": " fmt'
5+
ccflags-y := -D'pr_fmt(fmt)=KBUILD_MODNAME ": " fmt'
86
ccflags-y += -Wframe-larger-than=2048
7+
ccflags-$(CONFIG_WIREGUARD_DEBUG) += -DDEBUG -g
98
ccflags-$(if $(WIREGUARD_VERSION),y,) += -D'WIREGUARD_VERSION="$(WIREGUARD_VERSION)"'
109

1110
wireguard-y := main.o noise.o device.o peer.o timers.o queueing.o send.o receive.o socket.o peerlookup.o allowedips.o ratelimiter.o cookie.o netlink.o

0 commit comments

Comments
 (0)