205-fix-headers_install.patch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From e60cc1b011bf0f1acdb7e5168b7bed4ebb78c91f Mon Sep 17 00:00:00 2001
  2. From: Bruce Ashfield <[email protected]>
  3. Date: Wed, 9 Jan 2013 16:24:39 -0500
  4. Subject: [PATCH] scripts/Makefile.headersinst: install headers from scratch file
  5. If headers_install is executed from a deep/long directory structure, the
  6. shell's maximum argument length can be execeeded, which breaks the operation
  7. with:
  8. | make[2]: execvp: /bin/sh: Argument list too long
  9. | make[2]: ***
  10. By dumping the input files to a scratch file and using xargs to read the
  11. input list from the scratch file, we can avoid blowing out the maximum
  12. argument size and install headers in a long path name environment.
  13. Signed-off-by: Bruce Ashfield <[email protected]>
  14. [[email protected]: adapt to Linux 3.10]
  15. Signed-off-by: Jo-Philipp Wich <[email protected]>
  16. ---
  17. scripts/Makefile.headersinst | 4 +++-
  18. 1 files changed, 3 insertions(+), 1 deletions(-)
  19. --- a/scripts/Makefile.headersinst
  20. +++ b/scripts/Makefile.headersinst
  21. @@ -72,7 +72,7 @@ printdir = $(patsubst $(INSTALL_HDR_PATH
  22. quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\
  23. file$(if $(word 2, $(all-files)),s))
  24. cmd_install = \
  25. - $(CONFIG_SHELL) $< $(installdir) $(input-files); \
  26. + xargs $(CONFIG_SHELL) $< $(installdir) < $(INSTALL_HDR_PATH)/.input-files; \
  27. for F in $(wrapper-files); do \
  28. echo "\#include <asm-generic/$$F>" > $(installdir)/$$F; \
  29. done; \
  30. @@ -101,7 +101,9 @@ targets += $(install-file)
  31. $(install-file): scripts/headers_install.sh $(input-files) FORCE
  32. $(if $(unwanted),$(call cmd,remove),)
  33. $(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@)))
  34. + @echo $(input-files) > $(INSTALL_HDR_PATH)/.input-files
  35. $(call if_changed,install)
  36. + @rm $(INSTALL_HDR_PATH)/.input-files
  37. else
  38. __headerscheck: $(subdirs) $(check-file)