Commit 30afc277 authored by Ben Walker's avatar Ben Walker Committed by Konrad Sztyber
Browse files

build: When LTO is not enabled, add -fno-lto option



If any single dependency happens to have LTO enabled, then LTO will turn
on automatically by default. Instead, only do an LTO build if the user
requested it.

This can greatly speed up compilation times for developer builds without
forcing recompilation of dependencies that are compiled for LTO.

Change-Id: I9e79a94bd4e3d701b4b189f94a09120d6a58f0bd
Signed-off-by: default avatarBen Walker <ben@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/24651


Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
parent e99c5e99
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -99,6 +99,9 @@ endif
ifeq ($(CONFIG_LTO),y)
COMMON_CFLAGS += -flto=auto
LDFLAGS += -flto=auto
else
COMMON_CFLAGS += -fno-lto
LDFLAGS += -fno-lto
endif

ifeq ($(CONFIG_PGO_CAPTURE),y)