diff --git a/net/git/Makefile b/net/git/Makefile index e79b400f5916b8..6be3a8a90f44ef 100644 --- a/net/git/Makefile +++ b/net/git/Makefile @@ -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)" \