diff mbox series

[OpenWrt-Devel,2/3] rules.mk: replace iremap when using GCC 8

Message ID 20180621150812.3477-2-wong.syrone@gmail.com
State Accepted
Headers show
Series [OpenWrt-Devel,1/3] toolchain/gcc: add GCC 8.1.0 | expand

Commit Message

Syrone Wong June 21, 2018, 3:08 p.m. UTC
From: Syrone Wong <wong.syrone@gmail.com>

The original -iremap is replaced by -fmacro-prefix-map in GCC 8

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
---
 rules.mk | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Syrone Wong June 22, 2018, 12:21 a.m. UTC | #1
HI,

I'm not sure whether it's the correct way to deal with the flag. When
we add GCC 9 in the future, we have to remember to apply this dirty
overwrite hack as well.
Please feel free to share more elegant ways.


Best Regards,
Syrone Wong


On Thu, Jun 21, 2018 at 11:08 PM,  <wong.syrone@gmail.com> wrote:
> From: Syrone Wong <wong.syrone@gmail.com>
>
> The original -iremap is replaced by -fmacro-prefix-map in GCC 8
>
> Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
> ---
>  rules.mk | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/rules.mk b/rules.mk
> index a97b2d2155..8eb8e21a7e 100644
> --- a/rules.mk
> +++ b/rules.mk
> @@ -141,6 +141,10 @@ 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)
> +    iremap = -fmacro-prefix-map=$(1)=$(2)
> +  endif
>  endif
>
>  PACKAGE_DIR:=$(BIN_DIR)/packages
> --
> 2.17.1
>
Yousong Zhou June 22, 2018, 9 a.m. UTC | #2
On Fri, 22 Jun 2018 at 08:22, Syrone Wong <wong.syrone@gmail.com> wrote:
>
> HI,
>
> I'm not sure whether it's the correct way to deal with the flag. When
> we add GCC 9 in the future, we have to remember to apply this dirty
> overwrite hack as well.
> Please feel free to share more elegant ways.

How about adding a hidden config symbol in
toolchain/gcc/Config.version that says the how to apply the argument.

                yousong
Syrone Wong June 22, 2018, 11:21 a.m. UTC | #3
Hi,

LGTM. Any documentation on the hidden config symbols?


Best Regards,
Syrone Wong


On Fri, Jun 22, 2018 at 5:00 PM, Yousong Zhou <yszhou4tech@gmail.com> wrote:
> On Fri, 22 Jun 2018 at 08:22, Syrone Wong <wong.syrone@gmail.com> wrote:
>>
>> HI,
>>
>> I'm not sure whether it's the correct way to deal with the flag. When
>> we add GCC 9 in the future, we have to remember to apply this dirty
>> overwrite hack as well.
>> Please feel free to share more elegant ways.
>
> How about adding a hidden config symbol in
> toolchain/gcc/Config.version that says the how to apply the argument.
>
>                 yousong
Yousong Zhou June 25, 2018, 3:53 a.m. UTC | #4
On Fri, 22 Jun 2018 at 19:21, Syrone Wong <wong.syrone@gmail.com> wrote:
>
> Hi,
>
> LGTM. Any documentation on the hidden config symbols?

do not top post please.  kconfig symbols will be hidden when they have
no title.  basically all symbols in Config.version are hidden.

                yousong

>
>
> Best Regards,
> Syrone Wong
>
>
> On Fri, Jun 22, 2018 at 5:00 PM, Yousong Zhou <yszhou4tech@gmail.com> wrote:
> > On Fri, 22 Jun 2018 at 08:22, Syrone Wong <wong.syrone@gmail.com> wrote:
> >>
> >> HI,
> >>
> >> I'm not sure whether it's the correct way to deal with the flag. When
> >> we add GCC 9 in the future, we have to remember to apply this dirty
> >> overwrite hack as well.
> >> Please feel free to share more elegant ways.
> >
> > How about adding a hidden config symbol in
> > toolchain/gcc/Config.version that says the how to apply the argument.
> >
> >                 yousong
diff mbox series

Patch

diff --git a/rules.mk b/rules.mk
index a97b2d2155..8eb8e21a7e 100644
--- a/rules.mk
+++ b/rules.mk
@@ -141,6 +141,10 @@  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)
+    iremap = -fmacro-prefix-map=$(1)=$(2)
+  endif
 endif
 
 PACKAGE_DIR:=$(BIN_DIR)/packages