Skip to content

Commit

Permalink
Makefile: add support for Link Time Optimization
Browse files Browse the repository at this point in the history
Enable LTO using: LTO=1 make

Signed-off-by: Colin Ian King <[email protected]>
  • Loading branch information
ColinIanKing committed Jan 11, 2024
1 parent fc70629 commit 1744999
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ endif
# Optimization flags
#
override CFLAGS += $(foreach flag,-fipa-pta,$(cc_supports_flag))
#
# Enable Link Time Optimization
#
ifeq ($(LTO),1)
override CFLAGS += $(foreach flag,-flto=auto,$(cc_supports_flag))
endif

#
# Expected build warnings
Expand Down

0 comments on commit 1744999

Please sign in to comment.