PKG_NAME:=busybox
PKG_VERSION:=1.28.4
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_FLAGS:=essential
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_BUILD_DEPENDS:=BUSYBOX_USE_LIBRPC:librpc BUSYBOX_CONFIG_PAM:libpam
PKG_BUILD_PARALLEL:=1
PKG_CHECK_FORMAT_SECURITY:=0
-PKG_INSTALL:=1
#Busybox use it's own PIE config flag and LDFLAGS are used with ld, not gcc.
PKG_ASLR_PIE:=0
export KCONFIG_NOTIMESTAMP=1
+ifndef CONFIG_USE_MUSL
LDLIBS:=m crypt
+endif
+
LDLIBS += $(call BUSYBOX_IF_ENABLED,PAM,pam pam_misc pthread)
ifdef CONFIG_BUSYBOX_USE_LIBRPC
LDLIBS += rpc
LDLIBS += $(call BUSYBOX_IF_ENABLED,NSLOOKUP_OPENWRT,resolv)
endif
+TARGET_CFLAGS += -flto
+TARGET_LDFLAGS += -flto=jobserver -fuse-linker-plugin
+
MAKE_VARS :=
MAKE_FLAGS += \
EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
LDLIBS="$(LDLIBS)" \
+ LD="$(TARGET_CC)" \
SKIP_STRIP=y
ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
MAKE_FLAGS += V=1
endif
-MAKE_INSTALL_FLAGS += CONFIG_PREFIX="$(PKG_INSTALL_DIR)"
-
-
define Build/Configure
grep 'CONFIG_BUSYBOX_$(BUSYBOX_SYM)' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_$(BUSYBOX_SYM)_\\(.*\\),\\1CONFIG_\\2,g" > $(PKG_BUILD_DIR)/.config
yes 'n' | $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) oldconfig
endef
+define Build/Compile
+ $(call Build/Compile/Default, \
+ CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
+ all install \
+ )
+endef
+
define Package/busybox/install
$(INSTALL_DIR) $(1)/etc/init.d
$(CP) $(PKG_INSTALL_DIR)/* $(1)/
--- /dev/null
+--- a/scripts/Kbuild.include
++++ b/scripts/Kbuild.include
+@@ -130,7 +130,7 @@ make-cmd = $(subst \#,\\\#,$(subst $$,$$
+ #
+ if_changed = $(if $(strip $(filter-out $(PHONY),$?) \
+ $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \
+- @set -e; \
++ +@set -e; \
+ $(echo-cmd) $(cmd_$(1)); \
+ echo 'cmd_$@ := $(make-cmd)' > $(@D)/.$(@F).cmd)
+
+@@ -139,7 +139,7 @@ if_changed = $(if $(strip $(filter-out $
+ if_changed_dep = $(if $(strip $(filter-out $(PHONY),$?) \
+ $(filter-out FORCE $(wildcard $^),$^) \
+ $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ), \
+- @set -e; \
++ +@set -e; \
+ $(echo-cmd) $(cmd_$(1)); \
+ scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(@D)/.$(@F).tmp; \
+ rm -f $(depfile); \
+@@ -150,5 +150,5 @@ if_changed_dep = $(if $(strip $(filter-o
+ # and if so will execute $(rule_foo)
+ if_changed_rule = $(if $(strip $(filter-out $(PHONY),$?) \
+ $(call arg-check, $(cmd_$(1)), $(cmd_$@)) ),\
+- @set -e; \
++ +@set -e; \
+ $(rule_$(1)))