From patchwork Sun Feb 12 11:33:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 726951 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vLmlR3YjPz9s0m for ; Sun, 12 Feb 2017 22:33:22 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 41A4F87F83; Sun, 12 Feb 2017 11:33:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rlmAhMuyPmsj; Sun, 12 Feb 2017 11:33:16 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 878AE87B3A; Sun, 12 Feb 2017 11:33:16 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 9E3DC1BFB1F for ; Sun, 12 Feb 2017 11:33:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 9C2CC87862 for ; Sun, 12 Feb 2017 11:33:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NEbf8UV7LkNz for ; Sun, 12 Feb 2017 11:33:14 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.datacom.ind.br (mx.datacom.ind.br [177.66.5.10]) by whitealder.osuosl.org (Postfix) with ESMTPS id E5A11877B8 for ; Sun, 12 Feb 2017 11:33:13 +0000 (UTC) Received: from mail.datacom.ind.br (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTPS id 50FFB192716E; Sun, 12 Feb 2017 09:28:44 -0200 (BRST) Received: from localhost (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTP id 3BD0E1927167; Sun, 12 Feb 2017 09:28:44 -0200 (BRST) Received: from mail.datacom.ind.br ([127.0.0.1]) by localhost (mail.datacom.ind.br [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id VyQdOUTJhSaC; Sun, 12 Feb 2017 09:28:44 -0200 (BRST) Received: from p7-1130br.casantos.org (unknown [186.215.53.42]) by mail.datacom.ind.br (Postfix) with ESMTPSA id C154619202A9; Sun, 12 Feb 2017 09:28:43 -0200 (BRST) From: Carlos Santos To: buildroot@buildroot.org Date: Sun, 12 Feb 2017 09:33:01 -0200 Message-Id: <1486899181-8210-1-git-send-email-casantos@datacom.ind.br> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1486733648-14658-1-git-send-email-casantos@datacom.ind.br> References: <1486733648-14658-1-git-send-email-casantos@datacom.ind.br> Cc: thomas.petazzoni@free-electrons.com, yann.morin.1998@free.fr Subject: [Buildroot] [PATCH v2] infra/ccache: avoid color diagnostics with GCC older than v4.9 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" 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. 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 Reviewed-by: "Yann E. MORIN" --- 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 --- 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)" \