Skip to content

Commit

Permalink
git: Force use -O2 when lto enabled
Browse files Browse the repository at this point in the history
Git doen't support lto with gcc flag -O3 and -Ofast.
This is discussed in #24366.
If CONFIG_USE_LTO=y, filter -O% from CPPFLAGS and set to -O2.

Signed-off-by: Ryan Keane <[email protected]>
  • Loading branch information
Ra2-IFV committed Jun 27, 2024
1 parent a029f01 commit f6b68a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions net/git/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ define Package/git-gitweb/conffiles
/etc/gitweb.conf
endef

ifeq ($(CONFIG_USE_LTO),y)
TARGET_CPPFLAGS := $(filter-out -O%,$(TARGET_CFLAGS)) -O2
endif

MAKE_FLAGS := \
CC="$(TARGET_CC)" \
CFLAGS="$(TARGET_CFLAGS)" \
Expand Down

0 comments on commit f6b68a9

Please sign in to comment.