Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2] infra/ccache: avoid color diagnostics with GCC older than v4.9
Date: Sun, 12 Feb 2017 15:14:25 +0100	[thread overview]
Message-ID: <20170212141425.GE11105@free.fr> (raw)
In-Reply-To: <1486899181-8210-1-git-send-email-casantos@datacom.ind.br>

Carlos, All,

On 2017-02-12 09:33 -0200, Carlos Santos spake thusly:
> Ensure that the GCC_COLORS environment variable is empty when calling
> ccache. When GCC_COLORS is set, ccache passes '-fdiagnostics-color' to
> GCC but this flag requires GCC v4.9 or later. Older versions complain
> about the unrecognized command line option.

So, while fixing my own patch about the issue [0], I noticed that I was
not even able to make it fail in the first place...

I'm using this defconfig, which uses a gcc-4.7:

    BR2_x86_i686=y
    BR2_CCACHE=y
    BR2_TOOLCHAIN_EXTERNAL=y

and Thomas reported he was also unable to reproduce the failure with:

    BR2_sh=y
    BR2_sh4a=y
    BR2_CCACHE=y
    BR2_TOOLCHAIN_EXTERNAL=y
    BR2_INIT_NONE=y
    BR2_SYSTEM_BIN_SH_NONE=y
    # BR2_PACKAGE_BUSYBOX is not set
    BR2_PACKAGE_DEVMEM2=y
    # BR2_TARGET_ROOTFS_TAR is not set

which also uses gcc-4.7.

Can you provide a reliable way to reproduce the issue, please?

Regards,
Yann E. MORIN.

> That behavior is hard-coded in ccache; we would need a patch to either
> make it optional or disable it at all. Notice also that the problem is
> not detectable in the autobuilders because they redirect the output to
> files/pipes and ccache adds the offending flag only when stderr is a
> terminal.
> 
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
> Changes v1->v2
>   Fix indentation, use positive logic and improve the commit message,
>   acording to comments from Thomas Petazzoni and Yann E. MORIN.
> 
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
>  package/Makefile.in | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/package/Makefile.in b/package/Makefile.in
> index 4a3eb26..e5e595a 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -236,6 +236,13 @@ export PERL5LIB=$(HOST_DIR)/usr/lib/perl
>  
>  TARGET_MAKE_ENV = PATH=$(BR_PATH)
>  
> +# When GCC_COLORS is set, ccache passes '-fdiagnostics-color' to GCC but
> +# this flag requires GCC v4.9 or later. Older versions fail, complaining
> +# about unrecognized command line option.
> +ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_9),)
> +TARGET_MAKE_ENV += GCC_COLORS=""
> +endif
> +
>  TARGET_CONFIGURE_OPTS = \
>  	$(TARGET_MAKE_ENV) \
>  	AR="$(TARGET_AR)" \
> @@ -285,6 +292,11 @@ HOST_MAKE_ENV = \
>  	PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \
>  	PKG_CONFIG_LIBDIR="$(HOST_DIR)/usr/lib/pkgconfig:$(HOST_DIR)/usr/share/pkgconfig"
>  
> +# Prevent ccache from passing '-fdiagnostics-color' (see above).
> +ifeq ($(BR2_HOST_GCC_AT_LEAST_4_9),)
> +HOST_MAKE_ENV += GCC_COLORS=""
> +endif
> +
>  HOST_CONFIGURE_OPTS = \
>  	$(HOST_MAKE_ENV) \
>  	AR="$(HOSTAR)" \
> -- 
> 2.7.4
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  parent reply	other threads:[~2017-02-12 14:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-10 13:34 [Buildroot] [PATCH] infra/ccache: avoid color diagnostics with GCC older than v4.9 Carlos Santos
2017-02-11 15:38 ` Thomas Petazzoni
2017-02-12 10:08   ` Yann E. MORIN
2017-02-12 12:14     ` Thomas Petazzoni
2017-02-12 12:33       ` Yann E. MORIN
2017-02-12 12:59         ` Thomas Petazzoni
2017-02-12 13:08           ` Yann E. MORIN
2017-02-12 13:10             ` Thomas Petazzoni
2017-02-12 11:33 ` [Buildroot] [PATCH v2] " Carlos Santos
2017-02-12 12:34   ` Yann E. MORIN
2017-02-12 14:14   ` Yann E. MORIN [this message]
2017-02-12 14:55     ` Carlos Santos
2017-02-12 17:21       ` Yann E. MORIN
2017-02-12 17:22       ` Thomas Petazzoni
2017-02-12 17:28         ` Yann E. MORIN
2017-02-13 22:41     ` Carlos Santos
2017-02-14 16:48       ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170212141425.GE11105@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox