Commit 7211b8b9 authored by Sergei Poselenov's avatar Sergei Poselenov Committed by Sam Ravnborg
Browse files

kbuild: fix "Argument list too long" error for "make headers_check",

I'm trying to install kernel headers to build a cross-toolchain, but got
the following:

make ARCH=arm
  CHECK   include/linux/raid (2 files)
  CHECK   include/linux/spi (1 files)
  CHECK   include/linux/sunrpc (1 files)
  CHECK   include/linux/tc_act (6 files)
  CHECK   include/linux/tc_ematch (4 files)
  CHECK   include/linux/usb (8 files)
make[2]: execvp: /bin/sh: Argument list too long
make[2]: ***
Error 127
make[1]: *** [linux] Error 2
make: *** [headers_check] Error 2

Introduce use of xargs to fix this.

Signed-off-by: default avatarSergei Poselenov <>
Cc: Wolfgang Denk <>
Signed-off-by: default avatarSam Ravnborg <>
parent 35763e85
......@@ -54,8 +54,12 @@ quiet_cmd_remove = REMOVE $(unwanted)
cmd_remove = rm -f $(unwanted-file)
quiet_cmd_check = CHECK $(printdir) ($(words $(all-files)) files)
cmd_check = $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH) \
$(addprefix $(install)/, $(all-files)); \
# Headers list can be pretty long, xargs helps to avoid
# the "Argument list too long" error.
cmd_check = for f in $(all-files); do \
echo "$(install)/$${f}"; done \
| xargs \
$(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH); \
touch $@
PHONY += __headersinst __headerscheck
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment