LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 04-03-2020, 01:55 AM   #16
allen_yuan
LQ Newbie
 
Registered: Mar 2020
Posts: 23

Original Poster
Rep: Reputation: Disabled

Quote:
Originally Posted by pan64 View Post
That is a bit confusing: the command you posted is not long [enough], that cannot produce the error message you posted.
Either that is not the full command line or that was another command (which produced that error) or it is about something completely different.
DEBUG: SITE files ['endian-little', 'bit-64', 'arm-common', 'arm-64', 'common-linux', 'common-glibc', 'aarch64-linux', 'common']
DEBUG: Executing shell function do_compile
NOTE: make -j 16 KERNEL_SRC=/home/feng/q/apps_proc/poky/build/tmp-glibc/work-shared/vt-64/kernel-source CONFIG_CNSS=n CONFIG_CLD_HL_SDIO_CORE=n CONFIG_CNSS_SDIO=n CONFIG_QCA_CLD_WLAN_PROFILE=default MODNAME=wlan_debug KERNEL_BUILD=y KERNEL_PATH=/home/feng/q/apps_proc/poky/build/tmp-glibc/work-shared/vt-64/kernel-source KERNEL_VERSION=4.14.117-perf CC=aarch64-oe-linux-gcc -fuse-ld=bfd -fdebug-prefix-map=/home/feng/q/apps_proc/poky/build/tmp-glibc/work/vt_64-oe-linux/qcacld32-ll-nf-debug/git-r8_qsap_perf_perf=/usr/src/debug/qcacld32-ll-nf-debug/git-r8_qsap_perf_perf -fdebug-prefix-map=/home/feng/q/apps_proc/poky/build/tmp-glibc/work/vt_64-oe-linux/qcacld32-ll-nf-debug/git-r8_qsap_perf_perf/recipe-sysroot= -fdebug-prefix-map=/home/feng/q/apps_proc/poky/build/tmp-glibc/work/vt_64-oe-linux/qcacld32-ll-nf-debug/git-r8_qsap_perf_perf/recipe-sysroot-native= -fdebug-prefix-map=/home/feng/q/apps_proc/poky/build/tmp-glibc/work-shared/vt-64/kernel-source=/usr/src/kernel LD=aarch64-oe-linux-ld.bfd AR=aarch64-oe-linux-ar O=/home/feng/q/apps_proc/poky/build/tmp-glibc/work-shared/vt-64/kernel-build-artifacts KBUILD_EXTRA_SYMBOLS=
make -C /home/feng/q/apps_proc/poky/build/tmp-glibc/work-shared/vt-64/kernel-source M=/home/feng/q/apps_proc/poky/build/tmp-glibc/work/vt_64-oe-linux/qcacld32-ll-nf-debug/git-r8_qsap_perf_perf/wlan/qcacld-3.0 modules WLAN_ROOT=/home/feng/q/apps_proc/poky/build/tmp-glibc/work/vt_64-oe-linux/qcacld32-ll-nf-debug/git-r8_qsap_perf_perf/wlan/qcacld-3.0 MODNAME?=wlan CONFIG_QCA_WIFI_ISOC=0 CONFIG_QCA_WIFI_2_0=1 CONFIG_QCA_CLD_WLAN=m
make[1]: Entering directory `/home/feng/q/apps_proc/poky/build/tmp-glibc/work-shared/vt-64/kernel-source'
make[2]: Entering directory `/home/feng/q/apps_proc/poky/build/tmp-glibc/work-shared/vt-64/kernel-build-artifacts'
/bin/sh: paste: command not found
fatal: ambiguous argument '~..HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
/bin/sh: paste: command not found
fatal: ambiguous argument '~..HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
/bin/sh: paste: command not found
fatal: ambiguous argument '~..HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
/bin/sh: paste: command not found
fatal: ambiguous argument '~..HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
/bin/sh: paste: command not found
fatal: ambiguous argument '~..HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
/bin/sh: paste: command not found
fatal: ambiguous argument '~..HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
/bin/sh: paste: command not found
fatal: ambiguous argument '~..HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
/bin/sh: paste: command not found
fatal: ambiguous argument '~..HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
CC [M] /home/feng/q/apps_proc/poky/build/tmp-glibc/work/vt_64-oe-linux/qcacld32-ll-nf-debug/git-r8_qsap_perf_perf/wlan/qcacld-3.0/core/hdd/src/wlan_hdd_main.o
make[3]: execvp: /bin/sh: Argument list too long
make[3]: *** [/home/feng/q/apps_proc/poky/build/tmp-glibc/work/vt_64-oe-linux/qcacld32-ll-nf-debug/git-r8_qsap_perf_perf/wlan/qcacld-3.0/wlan_debug.o] Error 127
make[2]: *** [_module_/home/feng/q/apps_proc/poky/build/tmp-glibc/work/vt_64-oe-linux/qcacld32-ll-nf-debug/git-r8_qsap_perf_perf/wlan/qcacld-3.0] Error 2
make[2]: Leaving directory `/home/feng/q/apps_proc/poky/build/tmp-glibc/work-shared/vt-64/kernel-build-artifacts'
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/feng/q/apps_proc/poky/build/tmp-glibc/work-shared/vt-64/kernel-source'
make: *** [all] Error 2
ERROR: oe_runmake failed
WARNING: /home/feng/q/apps_proc/poky/build/tmp-glibc/work/vt_64-oe-linux/qcacld32-ll-nf-debug/git-r8_qsap_perf_perf/temp/run.do_compile.2985:1 exit 1 from 'exit 1'
ERROR: Function failed: do_compile (log file is located at /home/feng/q/apps_proc/poky/build/tmp-glibc/work/vt_64-oe-linux/qcacld32-ll-nf-debug/git-r8_qsap_perf_perf/temp/log.do_compile.2985)





That is all build error logs.
 
Old 04-03-2020, 01:58 AM   #17
allen_yuan
LQ Newbie
 
Registered: Mar 2020
Posts: 23

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
That is a bit confusing: the command you posted is not long [enough], that cannot produce the error message you posted.
Either that is not the full command line or that was another command (which produced that error) or it is about something completely different.
And now, if I delete half of the build OBJS,the building will be complete.
That's inexplicable!
 
Old 04-03-2020, 09:43 AM   #18
eager
Member
 
Registered: Aug 2004
Location: Palo Alto, CA
Distribution: Fedora 8/9, Ubuntu
Posts: 50

Rep: Reputation: 18
Quote:
Originally Posted by allen_yuan View Post
The command caused the error is :
"make -C /home/feng/q/apps_proc/poky/build/tmp-glibc/work-shared/vt-64/kernel-source M=/home/feng/q/apps_proc/poky/build/tmp-glibc/work/vt_64-oe-linux/qcacld32-ll-nf-debug/git-r8_qsap_perf_perf/wlan/qcacld-3.0 modules WLAN_ROOT=/home/feng/q/apps_proc/poky/build/tmp-glibc/work/vt_64-oe-linux/qcacld32-ll-nf-debug/git-r8_qsap_perf_perf/wlan/qcacld-3.0 MODNAME?=wlan CONFIG_QCA_WIFI_ISOC=0 CONFIG_QCA_WIFI_2_0=1 CONFIG_QCA_CLD_WLAN=m"
This is the command you entered, but it is NOT the command which got the error.

Make executes a number of commands. One of them had a long command line and generated the error. You need to address that error. You can add the "-d" option to have make generate debugging logs which will show all commands executed. Make will generate a lot of debug info. Capture it to a file (maybe use script) and look for the command with the error.
 
Old 04-03-2020, 09:46 AM   #19
eager
Member
 
Registered: Aug 2004
Location: Palo Alto, CA
Distribution: Fedora 8/9, Ubuntu
Posts: 50

Rep: Reputation: 18
Quote:
Originally Posted by allen_yuan View Post
DEBUG: SITE files ['endian-little', 'bit-64', 'arm-common', 'arm-64', 'common-linux', 'common-glibc', 'aarch64-linux', 'common']
DEBUG: Executing shell function do_compile

make[1]: Entering directory `/home/feng/q/apps_proc/poky/build/tmp-glibc/work-shared/vt-64/kernel-source'
make[2]: Entering directory `/home/feng/q/apps_proc/poky/build/tmp-glibc/work-shared/vt-64/kernel-build-artifacts'
/bin/sh: paste: command not found
Fix this problem.
 
Old 05-13-2021, 03:56 AM   #20
hangtian
LQ Newbie
 
Registered: May 2021
Posts: 3

Rep: Reputation: Disabled
/del

Last edited by hangtian; 05-13-2021 at 10:14 PM.
 
Old 06-11-2021, 06:11 PM   #21
xyzzy42
LQ Newbie
 
Registered: Jun 2021
Posts: 2

Rep: Reputation: Disabled
I've got this same problem with the same software. No fix yet, but I do know what is going on.

Quote:
Originally Posted by eager View Post
This is the command you entered, but it is NOT the command which got the error.
Indeed this is the case. The actual problem command is buried inside the kernel's build system and is quite hard to find. But the reason it is too long is because the $(c_flags) variable is huge. This is huge because qualcomm's wifi driver has a poor design for its headers. They have 104 header directories in their source tree and they every single one of them is added to cflags with a -I option. It would have been better to put the path to a header in the #include line so they could just add a root dir. Or different design for their code that didn't involve every single file needing to search in 104 directories for headers.

Stick in 104 long absolute paths and it gets to be a big command. Then the kernel build rules, specifically rule_cc_o_c, will expand to a short script that includes the compilation flags more than once. Think something like
Code:
[ $old_c_flags != $c_flags ] && cc $c_flags
It gets to be HUGE.

Quote:
Originally Posted by eager View Post
Fix this problem.
The git and paste errors are from the build system trying to compile in version info from git when it's not building from a git repo. They are unrelated.
 
Old 06-14-2021, 09:12 PM   #22
hangtian
LQ Newbie
 
Registered: May 2021
Posts: 3

Rep: Reputation: Disabled
patch wlan/qcacld-3.0

diff --git a/Makefile b/Makefile
index fb78b03460..8fb24a3c84 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,23 @@ KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build
# variable $(M). Allowing a relative path for $(M) enables us to have the build
# system put output/object files (.o, .ko.) into a directory different from the
# module source directory.
-M ?= $(shell pwd)
+ifeq ($(M),)
+AM = $(shell pwd)
+# Create CLD link to the directory above KERNEL_SRC to shorten object file
+# paths used in LD and CLEAN stage to avoid shell command "Argument list
+# too long" issue. If the link is created successfully, set M to link path,
+# else set M to the relative path from KERNEL_SRC to CLD path.
+CLD_LINK = $(KERNEL_SRC)/../qcacld-3.0
+MKLINK_RET = $(shell ln -nsf $(AM) $(CLD_LINK); echo $$?)
+
+ifeq ($(MKLINK_RET), 0)
+M = $(shell python -c "import os.path; print(os.path.relpath('$(CLD_LINK)',\
+ '$(KERNEL_SRC)'))")
+else
+M = $(shell python -c "import os.path; print(os.path.relpath('$(AM)',\
+ '$(KERNEL_SRC)'))")
+endif
+endif

# WLAN_ROOT must contain an absolute path (i.e. not a relative path)
KBUILD_OPTIONS := WLAN_ROOT=$(shell cd $(KERNEL_SRC); readlink -e $(M))
 
Old 06-15-2021, 02:37 AM   #23
xyzzy42
LQ Newbie
 
Registered: Jun 2021
Posts: 2

Rep: Reputation: Disabled
That's clever if you can write to the directory above the kernel source. realpath has a --relative-to=DIR option if it's new enough that could avoid the python script.

I ended up modifying to Kbuild file to place all the -I options into a file, "cat $(INCS) > $(obj)/includes", then used "@$(obj)/includes" in the cflags to have gcc pull them in from the file.

Similar problem trying to link 500+ object files into a single kernel module. I split it into three objects with about 200 files each, "$(wordlist 1,200,$(OBJS))", and then linked those into wlan.ko.
 
Old 06-15-2021, 03:54 AM   #24
hangtian
LQ Newbie
 
Registered: May 2021
Posts: 3

Rep: Reputation: Disabled
"shell realpath --relative-to" works for LE compilations, but not for Android build system, it's using toybox.

The problem here is while linking ~500 objects to wlan.ko, the single argv passed to syscall "execvp()" exceed MAX_ARG_STRLEN which normally equals to 128 KB in kernel fs/exec.c

Same issue while doing CLEAN stage, which arguments for "rm" command is bigger than LD, which has *.o and *.cmd files to remove.

The final fix should be in target kernel(msm-4.14) Makefile, use nested command arguments.

Hangtian

Last edited by hangtian; 06-15-2021 at 03:56 AM.
 
Old 02-11-2022, 04:36 PM   #25
SpeedyVintageCar
LQ Newbie
 
Registered: Feb 2022
Posts: 1

Rep: Reputation: 0
I'm having the same problem when building yocto project. The patch wlan/qcacld-3.0 doesn't work, still showing the same "argument list too long" error. Any idea how to solve it?
@xyzzy42, do you have a patch? It doesn't seem have the -l option in the Kbuild.
 
Old 08-11-2022, 04:37 AM   #26
Bokrenok
LQ Newbie
 
Registered: Aug 2022
Posts: 1

Rep: Reputation: 0
Well, I've run into same error while compiling one of the projects.

make: execvp: Argument list too long

The actual make/bash command I was able to retrieve by invoking 'dry run' for make: make -n V=s

After that I've got a command with a huge list of arguments like 700+ of them.
And actually the command could be run manually without any problems from the shell.

The case is that make do run commands passing it as a single enquoted argument like this: sh -ce '$(cmd)'
and that's where it fails (!)

According to execvp man page there is a limit for a length of a single argument defined as MAX_ARG_STRLEN and having maximum size of 128 kB.

So in my case the total length of a single argument provided by make was somewhat 138k (!)

Mostly because of quite long directory path for a project repeating seven hundred times.
After an attempt to shorten the project path (like making hard-link to it right from /home dir) I was able to shorten that huge argument in a half, and finally was able to build the project.

Last edited by Bokrenok; 08-12-2022 at 07:36 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
execvp: /bin/sh: Argument list too long - Compilation Error sahil.jammu Linux - Software 7 03-31-2020 08:32 AM
Argument list too long - Compilation Error sahil.jammu Linux - Software 5 07-24-2009 01:45 AM
Kernel Specific Compilation - Argument list is too long sahil.jammu Linux - Server 1 05-02-2009 05:28 PM
Combines 16000 files into 1 single file > error tb: /bin/cat: Argument list too long guanyu Linux - General 4 02-09-2007 12:33 AM
Zip gives error "-bash: /usr/bin/zip: Argument list too long" konathamsrinu Programming 3 07-06-2006 10:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 01:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration