Go Down

Topic: Build Toolchain (Read 11708 times) previous topic - next topic

jjdive

Hi Everyone! :)

I'm trying to build the toolchain on an x86_64 Archlinux machine. I'm getting the error below while building toolchain/kernel-headers:

Code: [Select]
make[6]: execvp: /bin/sh: Argument list too long

After a search I found a series of patches for this problem here https://dev.openwrt.org/ticket/12907, but (please notice me if i'm wrong) these patches apply for the latest (or so) release of OpenWRT. So I have 2 questions:

1. Did you get this same error before? There is a known way to solve it? I mean a different solution from those patches.
or...
2. If this is only a problem of my machine, there is a way I can pull the latest realease of OpenWRT trunk without losing the config files for the Yún? so I can apply those patches?
Maybe a third question: Which environment (distro etc...) do you use to compile the toolchain?

Thanks a lot in advance for any hint!!! I can't wait for my pair of Yún(s) to arrive!!!!  :D

Federico Fissore

I think I miss some details: can you provide info about:

  • what toolchain are you trying to compile and from where have you downloaded it

  • the sequence of commands you've run before getting the error




jjdive

Hi Federico!

1. what toolchain are you trying to compile and from where have you downloaded it:
Well I guess the one that is used to build the image for the Yún since I cloned the linino repo https://github.com/arduino/linino.git

2. the sequence of commands you've run before getting the error:
Being at trunk directory:

Code: [Select]
$ make menuconfig // Didn't modify anything, just exit and save config
$ ./scripts/feeds update -a // I also tried without updating and installing feeds, same result
$ ./scripts/feeds install -a
$ make menuconfig // again after update feeds
$ make V=99
tools/* build without problem, reached toolchain, it failed compiling gdb but it was a matter of adding -lncurses on its makefile
$ maje V=99 // again


Then here we have the error compiling toolchain/kernel-headers, i think when building execvp:

Code: [Select]
make[4]: Entering directory `blablablabla/trunk/build_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/linux-3.8.3'
  CHK     include/generated/uapi/linux/version.h
make[6]: execvp: /bin/sh: Argument list too long
make[6]: *** [blablablabla/trunk/build_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/linux-dev//include/linux/.install] Error 127


Next thing was getting this patch https://dev.openwrt.org/attachment/ticket/12907/001-fix_kernel_build_xargs.patch into target/linux/generic/patches-3.8/

make clean ... make V=99 again but, the result is the same... The other two patches from the ticket fail because they're for a more recent revision of the trunk I guess.

I'm still working on it :), any further details are welcome!!!

Thanks!

Federico Fissore

Ah so you're trying to build the whole image. Thank you, we really appreciate having more eyes on it but I must warn you: as you have already experienced, it's a though thing, we are used to struggle a bit with it, mainly because of ever-changing feeds

Linino should build without any patch. If you need them, there is either a problem with a feed (but that means that a particular feed won't compile and it's not your case) or with the configuration of your compiling machine

We use ubuntu 12.04 x86_64 to build it

What version of archlinux are you using? Have you installed libncurses5-dev, zlib1g-dev and gawk ? (that may fix that -lncurses you've added)

Can you try compiling it with make -j 1 V=s ? This will use only one thread and the build will stop as soon as that error shows up

fibasile

If it's of any help I managed to build the image and open-wrt based toolchain on a Debian 7 VM using the steps you mention. So maybe is a distribution-related issue, as ubuntu and Debian share similar structure.

I also have a similar issue concerning the YUN config, as it was lost updating the feeds.

I agree that one should build using the -j1 flag, as the build will get stuck if you don't. Unfortunately it does even if you compile one file at a time. You must re-issue the make command several times and it will work.

If you plan to build custom packages you should consider that opkg won't install them because of different signature.
The generated toolchain works fine, and I also managed to cross-compile the avr-gcc distribution from atmel and other simple c programs., and run them, but without packaging.

A quick question: how to load the custom image on the Yun? Will this affect the standard one in the ROM?




jjdive

Well, for the sake of the post I will use only "make toolchain/install" from now on, so I can focus on the toolchain. After that we can manage the image building in a separate post :)

I think it's the configuration of my machine, Archlinux doesn't have version like ubuntu, also there is no separate installable packages for ncurses headers, it's all in one package called ncurses :P. That's why I added -lncurses, no problem with it thouhg ;). I know that the error "Argument list too long" is related with a include/linux/limits.h file, so its content is different between Ubuntu and Archlinux. If i run make with -j 1 option, the result is exactly the same.

I want to try something a bit (if it doesn't work maybe i'll install ubuntu in a little partition jajajaja):

I cloned the openwrt branch for Attitude Adjustment and I want to know which files are specific for the Yun, so maybe i can put both things together and have a nice environment buit :). If it doesn't work after a bit of effort i'll go with the ubuntu approach :P

Thanks for the help on this!!!

jjdive

Hi fibasile!

I just saw your post, then it definitely is about differences in limits.h of Debian-like/Archlinux hosts (this file sets the size for arguments + env variables).

I think its ok if I just install Ubuntu on a separate partition to work with the toolchain :). I'll notice you how things go here.

jjdive

Hi guys!

News here: I applied this patch manually https://dev.openwrt.org/attachment/ticket/12907/001-fix_kernel_build_xargs.patch and everything went fine, i hope this is the only patch required to get the build environment (cloned from linino repo) inside a non-debian-like distro.

The toolchan is still compiling, i'll notice you any progress and hopefully a complete process :)

Federico Fissore

@fibasile: we are going to post a page with instructions the next few days
@jjdive: most but not all code specific to the yun is in the "linino" folder https://github.com/arduino/linino/tree/master/trunk/package/linino
There are a few other changed files here and there, mostly related to build process and kernel params

jjdive

#9
Sep 16, 2013, 12:55 am Last Edit: Sep 16, 2013, 02:07 am by jjdive Reason: 1
Finally i got my toolchain without having to install ubuntu :), also I tried to compile the image with partial success except for some of the packages of the linino folder due to unsatisfied dependencies:

Code: [Select]
Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for avrdude:
* lm *
* satisfy_dependencies_for: Cannot satisfy the following dependencies for luci-app-arduino-webpanel:
* luci * luci-lib-json *
* satisfy_dependencies_for: Cannot satisfy the following dependencies for rng-tools:
* argp-standalone *
* satisfy_dependencies_for: Cannot satisfy the following dependencies for yun-conf:
* avahi-daemon *
* pkg_run_script: package "yun-conf" postinst script returned status 1.
* opkg_configure: yun-conf.postinst returned 1.


There were more dependencies but i managed to resolve them adding its Makefile from the OpenWRT repo, like python-mini, python-json, triggerhappy, elfutils (libelf1). The Luci stuff is special, but must resolve somehow i guess.

I don't think this is related with my machine, right? @fibasile, did you have this problem trying to compile the image?

How do I satisfy this dependencies? It would be awesome to help on some image testing and experiments :)

jjdive

I have just completed the whole process on ubuntu, same dependencies error (at the final stage creating the image i guess) :(

Code: [Select]
.......
Configuring libopenssl.
Configuring ppp-mod-pppoe.
Configuring kmod-ledtrig-netdev.
Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for avrdude:
* libelf1 * lm *
* satisfy_dependencies_for: Cannot satisfy the following dependencies for cpu-mcu-bridge:
* python-mini *
* satisfy_dependencies_for: Cannot satisfy the following dependencies for luci-app-arduino-webpanel:
* luci * luci-lib-json *
* satisfy_dependencies_for: Cannot satisfy the following dependencies for rng-tools:
* argp-standalone *
* satisfy_dependencies_for: Cannot satisfy the following dependencies for spacebrew:
* python-mini * python-json *
* satisfy_dependencies_for: Cannot satisfy the following dependencies for temboo:
* python-mini *
* satisfy_dependencies_for: Cannot satisfy the following dependencies for yun-conf:
* avahi-daemon * triggerhappy *
* pkg_run_script: package "yun-conf" postinst script returned status 1.
* opkg_configure: yun-conf.postinst returned 1.
xargs: /home/juanjo/linino/trunk/staging_dir/host/bin/opkg: exited with status 255; aborting
make[2]: *** [package/install] Error 124
......


Any suggestions? :) Thanks!

Federico Fissore

Have you updated and installed the feeds? I got that error every time I forget to update them
This is what I run
Code: [Select]

./scripts/feeds uninstall -a
rm -rf feeds
./scripts/feeds update -a
./scripts/feeds install -a
rm -f .config
git checkout .config
make oldconfig

fibasile

Just wanted to let you know that with this update commands my system compiles fine, I have built all the packages we have on the official Yun feed.

Federico Fissore


jjdive

Not so fast :P. At the end i tried to compile everything on ubuntu 12.04 as suggested, but i'm having this error and maybe you know about it too, if you don't, then don't pay attention and i will start over again, maybe i made a mistake :(

Code: [Select]
cp: cannot stat `/home/juanjo/linino/trunk/build_dir/target-mips_r2_uClibc-0.9.33.2/cmus-v2.5.0/ipkg-install/usr/lib/cmus/op/oss.so': No such file or directory
make[3]: *** [/home/juanjo/linino/trunk/bin/ar71xx/packages/cmus-plugin-oss_2.5.0-5_ar71xx.ipk] Error 1


Thanks a lot!

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy