From 405caf01e9b234bc512ec93ac055d57336ce18d9 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 31 May 2021 14:28:46 +0200 Subject: 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 Signed-off-by: Jason A. Donenfeld --- src/Kbuild | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Kbuild b/src/Kbuild index a0d433f..2f7b634 100644 --- a/src/Kbuild +++ b/src/Kbuild @@ -2,10 +2,9 @@ # # Copyright (C) 2015-2019 Jason A. Donenfeld . All Rights Reserved. -ccflags-y := -O3 -ccflags-$(CONFIG_WIREGUARD_DEBUG) += -DDEBUG -g -ccflags-y += -D'pr_fmt(fmt)=KBUILD_MODNAME ": " fmt' +ccflags-y := -D'pr_fmt(fmt)=KBUILD_MODNAME ": " fmt' ccflags-y += -Wframe-larger-than=2048 +ccflags-$(CONFIG_WIREGUARD_DEBUG) += -DDEBUG -g ccflags-$(if $(WIREGUARD_VERSION),y,) += -D'WIREGUARD_VERSION="$(WIREGUARD_VERSION)"' 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 -- cgit v1.2.3