1 From e60cc1b011bf0f1acdb7e5168b7bed4ebb78c91f Mon Sep 17 00:00:00 2001
2 From: Bruce Ashfield <bruce.ashfield@windriver.com>
3 Date: Wed, 9 Jan 2013 16:24:39 -0500
4 Subject: [PATCH] scripts/Makefile.headersinst: install headers from scratch file
6 If headers_install is executed from a deep/long directory structure, the
7 shell's maximum argument length can be execeeded, which breaks the operation
10 | make[2]: execvp: /bin/sh: Argument list too long
13 By dumping the input files to a scratch file and using xargs to read the
14 input list from the scratch file, we can avoid blowing out the maximum
15 argument size and install headers in a long path name environment.
17 Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
19 scripts/Makefile.headersinst | 4 +++-
20 1 files changed, 3 insertions(+), 1 deletions(-)
22 diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst
23 index 06ba4a7..536d722 100644
24 --- a/scripts/Makefile.headersinst
25 +++ b/scripts/Makefile.headersinst
26 @@ -71,7 +71,7 @@ printdir = $(patsubst $(INSTALL_HDR_PATH)/%/,%,$(dir $@))
27 quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\
28 file$(if $(word 2, $(all-files)),s))
30 - $(PERL) $< $(installdir) $(SRCARCH) $(input-files); \
31 + xargs $(PERL) $< $(installdir) $(SRCARCH) < $(INSTALL_HDR_PATH)/.input-files; \
32 for F in $(wrapper-files); do \
33 echo "\#include <asm-generic/$$F>" > $(installdir)/$$F; \
35 @@ -100,7 +100,9 @@ targets += $(install-file)
36 $(install-file): scripts/headers_install.pl $(input-files) FORCE
37 $(if $(unwanted),$(call cmd,remove),)
38 $(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@)))
39 + @echo $(input-files) > $(INSTALL_HDR_PATH)/.input-files
40 $(call if_changed,install)
41 + @rm $(INSTALL_HDR_PATH)/.input-files
44 __headerscheck: $(subdirs) $(check-file)