mk/spdk.common: Use -flto=auto for the LTO builds

This tells lto-wrapper to either use make's jobserver or fallback to
auto guessing number of cpu threads used for the build. Mainly, this
should silence the following warning:

lto-wrapper: warning: using serial compilation of N LTRANS jobs
lto-wrapper: note: see the ‘-flto’ option documentation for more
information

Change-Id: Ib848319c858f4371b94f9264d22449535d25d6da
Signed-off-by: Michal Berger <michal.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17491
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Michal Berger 2023-04-07 02:02:26 +02:00 committed by David Ko
parent 6585c782e5
commit 2994a06067

View File

@ -97,8 +97,8 @@ COMMON_CFLAGS += -Werror
endif
ifeq ($(CONFIG_LTO),y)
COMMON_CFLAGS += -flto
LDFLAGS += -flto
COMMON_CFLAGS += -flto=auto
LDFLAGS += -flto=auto
endif
ifeq ($(CONFIG_PGO_CAPTURE),y)