All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Ashfield <bruce.ashfield@windriver.com>
To: nicolas.dichtel@6wind.com
Cc: Sam Ravnborg <sam@ravnborg.org>, Michal Marek <mmarek@suse.cz>,
	linux-kbuild@vger.kernel.org
Subject: Re: make headers_install fail when path is too long
Date: Wed, 6 Mar 2013 11:50:08 -0500	[thread overview]
Message-ID: <513773C0.5010309@windriver.com> (raw)
In-Reply-To: <51376E6C.4040903@6wind.com>

On 13-03-06 11:27 AM, Nicolas Dichtel wrote:
> Le 06/03/2013 17:10, Sam Ravnborg a écrit :
>> On Wed, Mar 06, 2013 at 12:16:33PM +0100, Nicolas Dichtel wrote:
>>> This problem has probably already been reported, but I don't find the
>>> fix
>>> in a kernel.org tree and I don't understand why.
>>
>> First time I see this bug described - but I may missed it here at kbuild.
> It's probably why I didn't find this on a linux kernel mailing list ;-)

And it's been on my TODO list to float this as a RFC to the kbuild lists
before 3.9 arrived .. a goal that I managed to miss (again).

The patch in question has us up and installing headers on Yocto kernel/
kernel header packages greater than 3.7, so it has received a decent
amount of testing.

As for it being the perfect approach, I only claim that it works in
the environment that I've been using and it is functional.

If this change turns out to be acceptable, that's great. I can also
spend time re-working as appropriate .. or someone else's solution
can be adopted.

In the end it's a win and a fix, and the thread has prompted me to
get the change floated :)

Cheers,

Bruce

>
>> If a patch exists then please include the patch in your mail so we can
>> see it and comment on it.
>>
>> And make sure to have the attribution correct if you consider it to
>> be applied.
> I'm not the author of the patch, I've found it on the web. Here it is:
>
>  From cb9c811b8f23277de95dc687e87c6859308e68e6 Mon Sep 17 00:00:00 2001
> From: Bruce Ashfield <bruce.ashfield@windriver.com>
> Date: Wed, 6 Mar 2013 17:23:51 +0100
> Subject: [PATCH] scripts/Makefile.headersinst: install headers from scratch
>   file
>
> If headers_install is executed from a deep/long directory structure, the
> shell's maximum argument length can be execeeded, which breaks the
> operation
> with:
>
> | make[2]: execvp: /bin/sh: Argument list too long
> | make[2]: ***
>
> By dumping the input files to a scratch file and using xargs to read the
> input list from the scratch file, we can avoid blowing out the maximum
> argument size and install headers in a long path name environment.
>
> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
> ---
>   scripts/Makefile.headersinst | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst
> index 25f216a..c481986 100644
> --- a/scripts/Makefile.headersinst
> +++ b/scripts/Makefile.headersinst
> @@ -71,7 +71,7 @@ printdir = $(patsubst $(INSTALL_HDR_PATH)/%/,%,$(dir $@))
>   quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\
>                               file$(if $(word 2, $(all-files)),s))
>         cmd_install = \
> -        $(PERL) $< $(installdir) $(SRCARCH) $(input-files); \
> +        xargs $(PERL) $< $(installdir) $(SRCARCH) <
> $(INSTALL_HDR_PATH)/.input-files; \
>           for F in $(wrapper-files); do                                   \
>                   echo "\#include <asm-generic/$$F>" >
> $(installdir)/$$F;    \
>           done;                                                           \
> @@ -100,7 +100,9 @@ targets += $(install-file)
>   $(install-file): scripts/headers_install.pl $(input-files) FORCE
>       $(if $(unwanted),$(call cmd,remove),)
>       $(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@)))
> +    @echo $(input-files) > $(INSTALL_HDR_PATH)/.input-files
>       $(call if_changed,install)
> +    @rm $(INSTALL_HDR_PATH)/.input-files
>
>   else
>   __headerscheck: $(subdirs) $(check-file)


  reply	other threads:[~2013-03-06 16:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-06 11:16 make headers_install fail when path is too long Nicolas Dichtel
2013-03-06 16:10 ` Sam Ravnborg
2013-03-06 16:24   ` Michal Marek
2013-03-06 16:27   ` Nicolas Dichtel
2013-03-06 16:50     ` Bruce Ashfield [this message]
2013-03-07  8:26     ` Michal Marek
2013-03-07 13:28       ` Bruce Ashfield
2013-04-26 16:36         ` [PATCH] fix make headers_install " Nicolas Dichtel
2013-04-26 18:14           ` Bruce Ashfield
2013-04-26 18:57           ` Sam Ravnborg
2013-04-29 12:13             ` Michal Marek
2013-04-29 12:17               ` Nicolas Dichtel
2013-04-29 12:15             ` [PATCH linux-next v2] " Nicolas Dichtel
2013-04-29 12:34               ` Bruce Ashfield
2013-05-06  8:19                 ` Nicolas Dichtel
2013-05-17  9:12                   ` Nicolas Dichtel
2013-05-17 20:08                     ` Michal Marek

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=513773C0.5010309@windriver.com \
    --to=bruce.ashfield@windriver.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=mmarek@suse.cz \
    --cc=nicolas.dichtel@6wind.com \
    --cc=sam@ravnborg.org \
    /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 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.