FS#13002 - Fails to build from source under long build path with "execvp: /bin/sh: Argument list too long".

Attached to Project: Rockbox
Opened by Oid Maps (oid_maps) - Monday, 22 September 2014, 15:21 GMT
Task Type Bugs
Category Build environment
Status Unconfirmed
Assigned To No-one
Operating System Sansa AMSv2
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


When I try to build rockbox, I get the following error:

make: execvp: /bin/sh: Argument list too long

My build path is a fairly long path. Building it at a location with shorter path it works. Details:

Steps to reproduce:

* Create a location where you want to have the sources; use a fairly long path name, e.g.

mkdir -p /home/myuser/download/mediaplayer_hardware/SanDisk/Sansa_Fuze_v2/rockbox/firmware/source/

* Change to that directory:

cd /home/myuser/download/mediaplayer_hardware/SanDisk/Sansa_Fuze_v2/rockbox/firmware/source/

* Download git sources (Tried with version from 2014-09-22, 10:55:11 GMT+1, Commit by "Marcin Bukat <>", Change-Id: "Ie3aa9b208e3f4f17d4d02f11f69839e9b381217d") to a long path:

git clone git://

* Make a build directory and change into it:

mkdir -p /home/myuser/download/mediaplayer_hardware/SanDisk/Sansa_Fuze_v2/rockbox/firmware/source/build_FuzeV2
cd /home/myuser/download/mediaplayer_hardware/SanDisk/Sansa_Fuze_v2/rockbox/firmware/source/build_FuzeV2

* Configure the build:

../rockbox/tools/configure --target=63 --type=N

prodces the output

Using temporary directory /tmp
Platform set to sansafuzev2
Normal build selected
Using source code root directory: /home/myuser/download/mediaplayer_hardware/SanDisk/Sansa_Fuze_v2/rockbox/firmware/source/rockbox
Using arm-elf-eabi-gcc 4.4.4 (404)
Using arm-elf-eabi-ld
Found and uses ccache (/sbin/ccache)
Automatically selected arch: arm (ver 5)
Created Makefile

* Running "make":


produces the output

Generating dependencies
make: execvp: /bin/sh: Argument list too long
make: *** No rule to make target '/home/myuser/download/mediaplayer_hardware/SanDisk/Sansa_Fuze_v2/rockbox/firmware/source/build_FuzeV2/make.dep', needed by 'all'. Stop.

and returns with exit code 2.


Building it in a directory with shorter path, e.g. doing everything in "/tmp", works.

But that is only a workaround; it should not fail when building in arbitrary locations, and especially not with a message not making it clear _what_ the underlying problem ist. (I had to do a long internet search to get to the idea that the build place can be the problem).
This task depends upon

Comment by MichaelGiacomelli (saratoga) - Monday, 22 September 2014, 21:33 GMT
"/bin/sh: Argument list too long"

It looks like your OS can't handle arguments long enough to generate the dependencies with such long paths. You could try updating, although I have no idea if that will fix it. I'm guessing that line is something like a full path list of all dependencies, which will be quite huge if the base path is very long.
Comment by Oid Maps (oid_maps) - Tuesday, 23 September 2014, 08:21 GMT
I am using Arch Linux, bash version 4.3.24(1)-release, 64bit system; everything up to date ("bleeding edge", what Arch Linux' policy is) ca. mid of September 2014.

So I doubt that my OS is especially vulnerable to long paths.

But yes, the dependency list got very long.