[openwrt/openwrt] rules_mk: use gcc versions for external toolchain

LEDE Commits lede-commits at lists.infradead.org
Mon Oct 3 15:13:26 PDT 2022


hauke pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/29927e347a1b1c256ca39076f23dfc7bbeae798d

commit 29927e347a1b1c256ca39076f23dfc7bbeae798d
Author: Vincent Wiemann <vincent.wiemann at ironai.com>
AuthorDate: Mon Dec 28 16:00:13 2020 +0100

    rules_mk: use gcc versions for external toolchain
    
    When using the OpenWrt toolchain as an external toolchain the build
    failed due to missing LTO support. By choosing the GCC wrappers of
    the tools this commit makes sure that the LTO-enabled executables
    are being used.
    
    Signed-off-by: Vincent Wiemann <vincent.wiemann at ironai.com>
    [ wrap the commit description to 72 char ]
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
    (cherry picked from commit 2555ffb4536e2727465e9a0d426ad3c4f1ef003a)
---
 rules.mk | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/rules.mk b/rules.mk
index 1d63d61ee1..5bc63e34d2 100644
--- a/rules.mk
+++ b/rules.mk
@@ -243,20 +243,13 @@ HOST_CXXFLAGS:=
 HOST_CFLAGS:=-O2 $(HOST_CPPFLAGS)
 HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib $(if $(IS_PACKAGE_BUILD),-L$(STAGING_DIR_HOSTPKG)/lib -L$(STAGING_DIR)/host/lib)
 
-ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
-  TARGET_AR:=$(TARGET_CROSS)gcc-ar
-  TARGET_RANLIB:=$(TARGET_CROSS)gcc-ranlib
-  TARGET_NM:=$(TARGET_CROSS)gcc-nm
-else
-  TARGET_AR:=$(TARGET_CROSS)ar
-  TARGET_RANLIB:=$(TARGET_CROSS)ranlib
-  TARGET_NM:=$(TARGET_CROSS)nm
-endif
-
 BUILD_KEY=$(TOPDIR)/key-build
 
 FAKEROOT:=$(STAGING_DIR_HOST)/bin/fakeroot
 
+TARGET_AR:=$(TARGET_CROSS)gcc-ar
+TARGET_RANLIB:=$(TARGET_CROSS)gcc-ranlib
+TARGET_NM:=$(TARGET_CROSS)gcc-nm
 TARGET_CC:=$(TARGET_CROSS)gcc
 TARGET_CXX:=$(TARGET_CROSS)g++
 KPATCH:=$(SCRIPT_DIR)/patch-kernel.sh




More information about the lede-commits mailing list