public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: David Cullen <David.Cullen@koe-americas.com>
To: Michal Marek <mmarek@suse.cz>,
	"linux-kbuild@vger.kernel.org" <linux-kbuild@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH RFC] Fix "/usr/bin/xargs: rm: Argument list too long" during make distclean
Date: Mon, 13 Aug 2012 19:39:00 +0000	[thread overview]
Message-ID: <502957D5.1070800@koe-americas.com> (raw)

When running "make distclean" in a cross chroot environment, the
following messages are emitted:

    [user@host:/home/work/linux]: make distclean
    /usr/bin/xargs: rm: Argument list too long
    make: *** [clean] Error 126

I use the following patch to get around the problem:

diff --git a/Makefile b/Makefile
index b771af5..e2bca8e 100644
--- a/Makefile
+++ b/Makefile
@@ -1033,7 +1033,7 @@ distclean: mrproper
                -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
                -o -name '.*.rej' \
                -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
-               -type f -print | xargs rm -f
+               -type f -print | xargs -s 122880 rm -f


 # Packaging of the kernel to various formats
@@ -1242,7 +1242,7 @@ clean: $(clean-dirs)
                -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
                -o -name '*.symtypes' -o -name 'modules.order' \
                -o -name modules.builtin -o -name '.tmp_*.o.*' \
-               -o -name '*.gcno' \) -type f -print | xargs rm -f
+               -o -name '*.gcno' \) -type f -print | xargs -s 122880 rm -f

 # Generate tags for editors
 # ---------------------------------------------------------------------------


Is there another way to solve this problem that does not require
a patch to the Makefile?

             reply	other threads:[~2012-08-13 19:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-13 19:39 David Cullen [this message]
2012-08-13 20:38 ` [PATCH RFC] Fix "/usr/bin/xargs: rm: Argument list too long" during make distclean H. Peter Anvin
2012-08-13 20:56   ` David Cullen
2012-08-13 21:01     ` H. Peter Anvin
2012-08-14 12:54       ` David Cullen

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=502957D5.1070800@koe-americas.com \
    --to=david.cullen@koe-americas.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    /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