build: Pass -iremap gcc option as a single argument
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 2 Feb 2017 11:13:03 +0000 (12:13 +0100)
committerJo-Philipp Wich <jo@mein.io>
Wed, 13 Dec 2017 13:24:21 +0000 (14:24 +0100)
Passing -iremap argument separately causes problems with projects that
use scons and its ParseFlags function. Consider this SConscript
example:

    env = Environment()
    d = env.ParseFlags("-iremap one:two")

ParseFlags will interpret one:two as a file name and the returned dict
d will contain only "-iremap". When the -iremap is passed to the
compiler without an argument, compilation obviously fails.

Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
(cherry picked from commit 202ae4cc6a910dec2441c45dfdf5814ac4d82518)

rules.mk

index 1ed80f11b85dfaa744c7b994e9d07058774caee7..743619ecff550b4c11afb7ea91c98bcd917bf252 100644 (file)
--- a/rules.mk
+++ b/rules.mk
@@ -130,7 +130,7 @@ else
 endif
 
 ifeq ($(or $(CONFIG_EXTERNAL_TOOLCHAIN),$(CONFIG_GCC_VERSION_4_8),$(CONFIG_TARGET_uml)),)
-  iremap = -iremap $(1):$(2)
+  iremap = -iremap$(1):$(2)
 endif
 
 PACKAGE_DIR:=$(BIN_DIR)/packages