All of lore.kernel.org
 help / color / mirror / Atom feed
* Kbuild: Ignore GREP_OPTIONS env variable
@ 2013-10-30 16:06 Borislav Petkov
  2013-11-06 21:42 ` Michal Marek
  0 siblings, 1 reply; 6+ messages in thread
From: Borislav Petkov @ 2013-10-30 16:06 UTC (permalink / raw)
  To: linux-kbuild, lkml; +Cc: x86-ml

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 <bp@suse.de>
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(^[[01;31m^[[K0^[[m^[[K, sys_read, sys_read)
__SYSCALL_COMMON(^[[01;31m^[[K1^[[m^[[K, sys_write, sys_write)
__SYSCALL_COMMON(^[[01;31m^[[K1^[[m^[[K0, 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 <bp@suse.de>
---
 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
-- 
1.8.4

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-11-11 20:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-30 16:06 Kbuild: Ignore GREP_OPTIONS env variable Borislav Petkov
2013-11-06 21:42 ` Michal Marek
2013-11-11 14:27   ` [PATCH -v1.1] " Borislav Petkov
2013-11-11 17:00     ` Michal Marek
2013-11-11 20:43       ` Ingo Molnar
2013-11-11 20:58         ` Borislav Petkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.