toolchain/gcc: add config symbol to determine how to apply path remapping
authorSyrone Wong <wong.syrone@gmail.com>
Thu, 26 Jul 2018 14:38:57 +0000 (22:38 +0800)
committerJo-Philipp Wich <jo@mein.io>
Tue, 18 Dec 2018 16:47:47 +0000 (17:47 +0100)
Added boolean symbol for GCC 8 and higher, when we add newer GCC, we don't have
to modify rules.mk to keep things consistant.

Fixes: da9d760 ("rules.mk: replace iremap when using GCC 8")
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
(backported from 713cee6463a8b654d2c72e469112130373c1336b)

rules.mk
toolchain/gcc/Config.version

index 78792d1c75363f542259bed9ab71f09653e8e947..e97b3f6491ee6b34f1b1a7dddbf933e26c154348 100644 (file)
--- a/rules.mk
+++ b/rules.mk
@@ -140,10 +140,10 @@ else
 endif
 
 ifeq ($(or $(CONFIG_EXTERNAL_TOOLCHAIN),$(CONFIG_GCC_VERSION_4_8),$(CONFIG_TARGET_uml)),)
-  iremap = -iremap$(1):$(2)
-  # just overwrite iremap for GCC 8.1 and higher to keep backward compatibility
-  ifeq ($(CONFIG_GCC_VERSION_8),y)
+  ifeq ($(CONFIG_GCC_USE_EMBEDDED_PATH_REMAP),y)
     iremap = -fmacro-prefix-map=$(1)=$(2)
+  else
+    iremap = -iremap$(1):$(2)
   endif
 endif
 
index 97c5e50dad360f7d645a16b2db696a0aec4077df..6413e852190c46cab626a79ec5fbf06c7c877b6a 100644 (file)
@@ -10,6 +10,11 @@ config GCC_VERSION_8
        default y if GCC_USE_VERSION_8
        bool
 
+config GCC_USE_EMBEDDED_PATH_REMAP
+       default y if GCC_VERSION_8
+       default n
+       bool
+
 config GCC_VERSION
        string
        default "5.5.0"         if GCC_VERSION_5