PKG_BUILD_FLAGS+=no-mips16
endif
-__unknown_flags=$(filter-out no-iremap no-mips16 gc-sections no-gc-sections,$(PKG_BUILD_FLAGS))
+__unknown_flags=$(filter-out no-iremap no-mips16 gc-sections no-gc-sections lto no-lto,$(PKG_BUILD_FLAGS))
ifneq ($(__unknown_flags),)
$(error unknown PKG_BUILD_FLAGS: $(__unknown_flags))
endif
TARGET_CXXFLAGS+= -ffunction-sections -fdata-sections
TARGET_LDFLAGS+= -Wl,--gc-sections
endif
+ifeq ($(call pkg_build_flag,lto,0),1)
+ TARGET_CFLAGS+= -flto=auto -fno-fat-lto-objects
+ TARGET_CXXFLAGS+= -flto=auto -fno-fat-lto-objects
+ TARGET_LDFLAGS+= -flto=auto -fuse-linker-plugin
+endif
include $(INCLUDE_DIR)/hardening.mk
include $(INCLUDE_DIR)/prereq.mk
PKG_LICENSE_FILES:=LICENSE
PKG_CPE_ID:=cpe:/a:jansson_project:jansson
+PKG_BUILD_FLAGS:=lto
+
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
Jansson is a C library for encoding, decoding and manipulating JSON data
endef
-TARGET_CFLAGS += -flto
-TARGET_LDFLAGS += -flto
-
define Package/jansson/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libjansson*so.* $(1)/usr/lib/
CONFIG_PACKAGE_libevent2-pthreads \
CONFIG_PACKAGE_libevent2-mbedtls
-PKG_BUILD_FLAGS:=gc-sections
+PKG_BUILD_FLAGS:=gc-sections lto
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
threading & locking.
endef
-TARGET_CFLAGS += $(FPIC) -flto
-TARGET_LDFLAGS += -Wl,--as-needed -flto
+TARGET_CFLAGS += $(FPIC)
+TARGET_LDFLAGS += -Wl,--as-needed
CMAKE_OPTIONS += \
-DEVENT__DISABLE_BENCHMARK:BOOL=ON \
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=lto
include $(INCLUDE_DIR)/package.mk
programming interface (API) to the in-kernel nf_tables subsystem.
endef
-TARGET_CFLAGS += $(FPIC) -flto
-TARGET_LDFLAGS += -flto
+TARGET_CFLAGS += $(FPIC)
CONFIGURE_ARGS += \
--enable-static \
PKG_FIXUP:=libtool libtool-abiver
PKG_INSTALL:=1
-PKG_BUILD_FLAGS:=no-mips16
+PKG_BUILD_FLAGS:=no-mips16 lto
PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=LICENSING COPYING
TARGET_CFLAGS += \
$(FPIC) \
-fomit-frame-pointer \
- -flto \
-DFP_MAX_BITS=8192 \
$(if $(CONFIG_WOLFSSL_ALT_NAMES),-DWOLFSSL_ALT_NAMES)
-TARGET_LDFLAGS += -flto
-
# --enable-stunnel needed for OpenSSL API compatibility bits
CONFIGURE_ARGS += \
--enable-reproducible-build \
PKG_CONFIG_DEPENDS := CONFIG_IPV6
-PKG_BUILD_FLAGS:=gc-sections
+PKG_BUILD_FLAGS:=gc-sections lto
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
/etc/firewall.user
endef
-TARGET_CFLAGS += -flto
-TARGET_LDFLAGS += -flto
CMAKE_OPTIONS += $(if $(CONFIG_IPV6),,-DDISABLE_IPV6=1)
define Package/firewall/install
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=
+PKG_BUILD_FLAGS:=lto
+
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include/libnl-tiny \
- -I$(STAGING_DIR)/usr/include \
- -flto
-
-TARGET_LDFLAGS += -flto -fuse-linker-plugin
+ -I$(STAGING_DIR)/usr/include
CMAKE_OPTIONS += \
-DLIBNL_LIBS=-lnl-tiny \
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=GPL-2.0
+PKG_BUILD_FLAGS:=lto
+
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/kernel.mk
TITLE:=Switch configuration utility
endef
-TARGET_CFLAGS += -flto
-TARGET_LDFLAGS += -flto=jobserver
-
TARGET_CPPFLAGS := \
-D_GNU_SOURCE \
-I$(STAGING_DIR)/usr/include/libnl-tiny \
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=lto
PKG_ASLR_PIE_REGULAR:=1
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcp \
CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6 \
Package/dnsmasq-dhcpv6/conffiles = $(Package/dnsmasq/conffiles)
Package/dnsmasq-full/conffiles = $(Package/dnsmasq/conffiles)
-TARGET_CFLAGS += -flto
-TARGET_LDFLAGS += -flto=jobserver
-
COPTS = -DHAVE_UBUS -DHAVE_POLL_H \
$(if $(CONFIG_IPV6),,-DNO_IPV6)
PKG_BUILD_PARALLEL:=1
PKG_ASLR_PIE_REGULAR:=1
-PKG_BUILD_FLAGS:=no-mips16 gc-sections
+PKG_BUILD_FLAGS:=no-mips16 gc-sections lto
PKG_FIXUP:=autoreconf
PKG_FLAGS:=nonshared
DROPBEAR_SVR_AGENTFWD|CONFIG_DROPBEAR_AGENTFORWARD|1|0 \
-TARGET_CFLAGS += -DARGTYPE=3 -flto
-TARGET_LDFLAGS += -flto=jobserver
+TARGET_CFLAGS += -DARGTYPE=3
db_opt_add =echo '\#define $(1) $(2)' >> $(PKG_BUILD_DIR)/localoptions.h
db_opt_replace =$(ESED) 's,^(\#define $(1)) .*$$$$,\1 $(2),g' $(PKG_BUILD_DIR)/sysoptions.h
CONFIG_DRIVER_11AX_SUPPORT \
CONFIG_WPA_ENABLE_WEP
-PKG_BUILD_FLAGS:=gc-sections
+PKG_BUILD_FLAGS:=gc-sections lto
EAPOL_TEST_PROVIDERS:=eapol-test eapol-test-openssl eapol-test-wolfssl
-D_GNU_SOURCE \
$(if $(CONFIG_WPA_MSG_MIN_PRIORITY),-DCONFIG_MSG_MIN_PRIORITY=$(CONFIG_WPA_MSG_MIN_PRIORITY))
-TARGET_CFLAGS += -flto
-TARGET_LDFLAGS += -flto=jobserver -fuse-linker-plugin -lubox -lubus
+TARGET_LDFLAGS += -lubox -lubus
ifdef CONFIG_PACKAGE_kmod-cfg80211
TARGET_LDFLAGS += -lm -lnl-tiny
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=lto
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
$(if $(CONFIG_LLDPD_WITH_SNMP),--with-snmp,) \
$(if $(CONFIG_USE_GLIBC),,--without-libbsd)
-TARGET_CFLAGS += -flto
-TARGET_LDFLAGS += -flto -Wl,--gc-sections,--as-needed
+TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
$(eval $(call BuildPackage,lldpd))
PKG_BUILD_DEPENDS:=libpcap
PKG_ASLR_PIE_REGULAR:=1
-PKG_BUILD_FLAGS:=gc-sections
+PKG_BUILD_FLAGS:=gc-sections lto
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
$(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux/
endef
-TARGET_CFLAGS += -flto
-TARGET_LDFLAGS += -flto -fuse-linker-plugin
-
MAKE_FLAGS += COPTS="$(TARGET_CFLAGS)" \
PRECOMPILED_FILTER=1 \
STAGING_DIR="$(STAGING_DIR)"
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=GPL-2.0
+PKG_BUILD_FLAGS:=lto
+
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
DEPENDS:=+libubox +libubus
endef
-TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -flto
-TARGET_LDFLAGS += -flto -fuse-linker-plugin
+TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
define Package/ustp/install
$(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d
PKG_LICENSE:=GPL-2.0
PKG_CPE_ID:=cpe:/a:iproute2_project:iproute2
-PKG_BUILD_FLAGS:=gc-sections
+PKG_BUILD_FLAGS:=gc-sections lto
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
> $(PKG_BUILD_DIR)/include/SNAPSHOT.h
endef
-TARGET_CFLAGS += -flto
TARGET_LDFLAGS += -Wl,--as-needed
TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=GPL-2.0
-PKG_BUILD_FLAGS:=gc-sections
+PKG_BUILD_FLAGS:=gc-sections lto
include $(INCLUDE_DIR)/package.mk
-I$(STAGING_DIR)/usr/include/libnl-tiny \
$(TARGET_CPPFLAGS) \
-DCONFIG_LIBNL20 \
- -D_GNU_SOURCE \
- -flto
+ -D_GNU_SOURCE
ifeq ($(BUILD_VARIANT),full)
TARGET_CPPFLAGS += -DIW_FULL
MAKE_FLAGS += \
CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
- LDFLAGS="$(TARGET_LDFLAGS) -flto" \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
NL1FOUND="" NL2FOUND=Y \
NLLIBNAME="libnl-tiny" \
LIBS="-lm -lnl-tiny" \
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
+PKG_BUILD_FLAGS:=lto
+
include $(INCLUDE_DIR)/package.mk
DISABLE_NLS:=
CONFIGURE_ARGS += --with-json
endif
-TARGET_CFLAGS += -flto
-TARGET_LDFLAGS += -flto
-
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
PKG_LICENSE_FILES:=
PKG_FLAGS:=nonshared
+PKG_BUILD_FLAGS:=lto
include $(INCLUDE_DIR)/package.mk
target=$(firstword $(subst -, ,$(BOARD)))
MAKE_FLAGS += TARGET="$(target)"
-TARGET_CFLAGS += -Dtarget_$(target)=1 -Wall -flto
-TARGET_LDFLAGS += -flto=jobserver
+TARGET_CFLAGS += -Dtarget_$(target)=1 -Wall
ifdef CONFIG_MTD_REDBOOT_PARTS
MAKE_FLAGS += FIS_SUPPORT=1
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
+PKG_BUILD_FLAGS:=lto
PKG_ASLR_PIE_REGULAR:=1
PKG_CONFIG_DEPENDS:= \
CONFIG_TARGET_INIT_PATH CONFIG_KERNEL_SECCOMP CONFIG_PROCD_SHOW_BOOT \
CMAKE_OPTIONS += -DEARLY_PATH="$(TARGET_INIT_PATH)"
-TARGET_CFLAGS += -flto
-TARGET_LDFLAGS += -flto
-
define Package/procd/Default
SECTION:=base
CATEGORY:=Base system
PKG_LICENSE_FILES:=
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
+PKG_BUILD_FLAGS:=lto
PKG_ASLR_PIE_REGULAR:=1
include $(INCLUDE_DIR)/package.mk
TITLE:=Lua binding for the OpenWrt RPC client
endef
-TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -flto
-TARGET_LDFLAGS += -flto
+TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
CMAKE_OPTIONS += \
-DLUAPATH=/usr/lib/lua \
PKG_MIRROR_HASH:=3f6569a5e63fdfd032976ac0f79d736d3935101ac1b97fb370514b013c5e6bb6
CMAKE_INSTALL:=1
PKG_CHECK_FORMAT_SECURITY:=1
-PKG_BUILD_FLAGS:=no-mips16
+PKG_BUILD_FLAGS:=no-mips16 lto
PKG_LICENSE:=ISC
PKG_LICENSE_FILES:=
TITLE:=OpenWrt signature verification utility
endef
-TARGET_CFLAGS += -flto
-TARGET_LDFLAGS += -flto=jobserver
-
CMAKE_OPTIONS += \
-DUSE_LIBUBOX=on
PKG_BUILD_DEPENDS:=BUSYBOX_CONFIG_PAM:libpam
PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=lto
PKG_CHECK_FORMAT_SECURITY:=0
PKG_LICENSE:=GPL-2.0
LDLIBS += selinux sepol
endif
-TARGET_CFLAGS += -flto
-TARGET_LDFLAGS += -flto=jobserver -fuse-linker-plugin
-
MAKE_VARS :=
MAKE_FLAGS += \
EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
-PKG_BUILD_FLAGS:=gc-sections
+PKG_BUILD_FLAGS:=gc-sections lto
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
DEPENDS:= +e2fsprogs
endef
-TARGET_CFLAGS += $(FPIC) -flto
-
-TARGET_LDFLAGS += -flto
+TARGET_CFLAGS += $(FPIC)
CONFIGURE_ARGS += \
--disable-testio-debug \