Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kconfig: let 'shell' return enough output for deep path names

The 'shell' built-in only returns the first 256 bytes of the command's
output. In some cases, 'shell' is used to return a path; by bumping up
the buffer size to 4096 this lets us capture up to PATH_MAX.

The specific case where I ran into this was due to commit 1e860048c53e
("gcc-plugins: simplify GCC plugin-dev capability test"). After this
change, we now use `$(shell,$(CC) -print-file-name=plugin)` to return
a path; if the gcc path is particularly long, then the path ends up
truncated at the 256 byte mark, which makes the HAVE_GCC_PLUGINS
depends test always fail.

Signed-off-by: Brenda Streiff <brenda.streiff@ni.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

authored by

Brenda Streiff and committed by
Masahiro Yamada
8a4c5b2a dfd42fac

+1 -1
+1 -1
scripts/kconfig/preprocess.c
··· 141 141 static char *do_shell(int argc, char *argv[]) 142 142 { 143 143 FILE *p; 144 - char buf[256]; 144 + char buf[4096]; 145 145 char *cmd; 146 146 size_t nread; 147 147 int i;