aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Wiemann <vincent.wiemann@ironai.com>2020-12-28 16:00:13 +0100
committerChristian Marangi <ansuelsmth@gmail.com>2022-12-04 16:07:33 +0100
commit56fd8355b078d8c9e1eb0bc0ea20900e7b46fe93 (patch)
tree370e647776ac5e8b8a66186d66c24677d1824bb3
parent654e0242e426423409a704bfc5f72b64ebd8d283 (diff)
downloadupstream-56fd8355b078d8c9e1eb0bc0ea20900e7b46fe93.tar.gz
upstream-56fd8355b078d8c9e1eb0bc0ea20900e7b46fe93.tar.bz2
upstream-56fd8355b078d8c9e1eb0bc0ea20900e7b46fe93.zip
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@ironai.com> [ wrap the commit description to 72 char ] Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> (cherry picked from commit 2555ffb4536e2727465e9a0d426ad3c4f1ef003a)
-rw-r--r--rules.mk13
1 files changed, 3 insertions, 10 deletions
diff --git a/rules.mk b/rules.mk
index 9c694e17ce..631e07af00 100644
--- a/rules.mk
+++ b/rules.mk
@@ -245,20 +245,13 @@ HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include $(if $(IS_PACKAGE_BUILD),-I$(STAGIN
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