Skip to content

Commit cb7def0

Browse files
committed
Fix LTO warning by enabling parallel compilation
When using make for builds, the following warning is observed: lto-wrapper: warning: using serial compilation of 2 LTRANS jobs. To address this, -flto=auto is now used. According to GCC optimization options [1], use -flto=auto to use GNU make's job server, if available, or otherwise fall back to autodetection of the number of CPU threads present in your system. While this patch does not fully suppress the warning in certain GCC versions (11.4 or later but below 12), it improves build performance by enabling parallel LTO compilation whenever possible. [1] https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
1 parent 5b90d0f commit cb7def0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ CFLAGS += -flto
4848
endif
4949
endif
5050
ifeq ("$(CC_IS_GCC)", "1")
51-
CFLAGS += -flto
51+
CFLAGS += -flto=auto
5252
endif
5353
ifeq ("$(CC_IS_CLANG)", "1")
5454
CFLAGS += -flto=thin -fsplit-lto-unit

0 commit comments

Comments
 (0)