From patchwork Wed Oct 30 16:06:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 3115401 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0A44B9F3E2 for ; Wed, 30 Oct 2013 16:07:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5353D203E9 for ; Wed, 30 Oct 2013 16:07:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 306F620125 for ; Wed, 30 Oct 2013 16:07:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752299Ab3J3QGo (ORCPT ); Wed, 30 Oct 2013 12:06:44 -0400 Received: from mail.skyhub.de ([78.46.96.112]:39044 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751371Ab3J3QGo convert rfc822-to-8bit (ORCPT ); Wed, 30 Oct 2013 12:06:44 -0400 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1383149202; bh=kMjCCoVQnXO5qgrQ2f8YaBumbXuMQcTCffWkVO57l14=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding; b=BZCS/YQ8K/teicWN3DehxUvJLgqBNgfVBoWwe eA7gifQgcOT1Nncg5W1RuxC4ZpkjHgCWIRa3cpTNUMsZpdhUuiA8GuXCIWx9LxLLqG0 Vh/AejsFJWzpRS6jpq5yET0ulGfzsuOCyxtpKJp4HxvVwV3PL5W2FuF/Lvs+SEWeSMY = Received: from mail.skyhub.de ([127.0.0.1]) by localhost (door.skyhub.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Hmm1htJs6ls8; Wed, 30 Oct 2013 17:06:41 +0100 (CET) Received: from liondog.tnic (p54B7EB73.dip0.t-ipconnect.de [84.183.235.115]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 99C151DA255; Wed, 30 Oct 2013 17:06:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1383149201; bh=kMjCCoVQnXO5qgrQ2f8YaBumbXuMQcTCffWkVO57l14=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding; b=HR1pHtrr4gQJB3M8JanSvAPijfLxlIHWodFXE bjcXt3HijzpPnfyniL7PqX9T1E9pvIX9gBN+nYhiIBhaiLp/8k9SYTErlengMsl2S/f KoIbHMVVGhLIrdmvUatWLOrB+rYKZk1wa17y1u8/HEvIIxJIxuRKM0TcUnwo3htbTM0 = Received: by liondog.tnic (Postfix, from userid 1000) id CF923102469; Wed, 30 Oct 2013 17:06:35 +0100 (CET) Date: Wed, 30 Oct 2013 17:06:35 +0100 From: Borislav Petkov To: linux-kbuild@vger.kernel.org, lkml Cc: x86-ml Subject: Kbuild: Ignore GREP_OPTIONS env variable Message-ID: <20131030160635.GE13290@pd.tnic> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, this is just a general poll of what people think about the issue here, just so that at least we've talked about it. So I had defined GREP_OPTIONS=--color=always on one of my boxes and had forgotten about it and the kernel build started failing because we use grep quite a while in the tree and it started issuing shell color markup which generated garbage files, like the syscall headers on x86, for example. I have a fix below which seems to take care of it but what is the general opinion: Do we want to be more robust against the environment we find on a machine before building the kernel or let the user figure it out himself that he should be using GREP_OPTIONS=--color=auto in the first place and it is his own moronic fault if he does 'always'? Opinions, comments? Thanks. --- From: Borislav Petkov Subject: [PATCH] Kbuild: Ignore GREP_OPTIONS env variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building the kernel in a shell which defines GREP_OPTIONS so that grep behavior is modified, we can break the generation of the syscalls table like so: __SYSCALL_COMMON(0, sys_read, sys_read) __SYSCALL_COMMON(1, sys_write, sys_write) __SYSCALL_COMMON(10, sys_mprotect, sys_mprotect) ... This is just the initial breakage, later we barf when generating modules. In this case, GREP_OPTIONS contains "--color=always" which adds the shell colors markup and completely fudges the headers under ...generated/asm/. Fix that by ignoring the GREP_OPTIONS variable for the whole kernel build as we tend to use grep at a bunch of places. Signed-off-by: Borislav Petkov --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 868c0eb67b08..7a2acd9a5d1c 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,9 @@ NAME = One Giant Leap for Frogkind # o print "Entering directory ..."; MAKEFLAGS += -rR --no-print-directory +GREP_OPTIONS= +export GREP_OPTIONS + # Avoid funny character set dependencies unexport LC_ALL LC_COLLATE=C