OpenWrt Forum Archive

Topic: Compile errors when compiling SDK (trunk 33188)

The content of this topic has been archived on 18 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello all,

I'm struggling with the OpenWRT compilation with SDK and toolchain enabled. I've done lots of fresh compilations (~3 hours on my PC) until I've found a problem - it's a SDK compilation. I can choose it in 'make menuconfig' or do 'make target/sdk/install' I still get same errors. The error is as follows:

cat /home/darius/build/openwrt/trunk/feeds.conf.default \
        >> /home/darius/build/openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33.2/OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2/feeds.conf.default
/home/darius/build/openwrt/trunk/staging_dir/host/bin/sed -i -e 's,^# REVISION:=.*,REVISION:=r33188,g' /home/darius/build/openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33.2/OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2/include/version.mk
find /home/darius/build/openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33.2/OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2 -name .git | xargs -r rm -rf
find /home/darius/build/openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33.2/OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2 -name .svn | xargs -r rm -rf
find /home/darius/build/openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33.2/OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2 -name CVS | xargs -r rm -rf
(cd /home/darius/build/openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33.2; \
        tar cfj /home/darius/build/openwrt/trunk/bin/ar71xx/OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2.tar.bz2 OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2; \
    )
tar: OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2/staging_dir/host/share/quilt/compat/getopt: Cannot open: Permission denied
tar: OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2/staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/etc/modules-boot.d/20-nls-base: Cannot open: Permission denied
tar: OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2/staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/usr/bin/yes: Cannot open: Permission denied
tar: OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2/staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/usr/bin/cmp: Cannot open: Permission denied
tar: OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2/staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/usr/bin/expr: Cannot open: Permission denied
tar: OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2/staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/usr/bin/tr: Cannot open: Permission denied
tar: OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2/staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/usr/bin/clear: Cannot open: Permission denied
tar: OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2/staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/usr/bin/sort: Cannot open: Permission denied
tar: OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2/staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/sbin/logread: Cannot open: Permission denied
tar: OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2/staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/sbin/insmod: Cannot open: Permission denied
tar: OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2/staging_dir/target-mips_r2_uClibc-0.9.33.2/root-ar71xx/sbin/init: Cannot open: Permission denied
tar: Exiting with failure status due to previous errors
make[2]: *** [/home/darius/build/openwrt/trunk/bin/ar71xx/OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2.tar.bz2] Error 2
make[2]: Leaving directory `/home/darius/build/openwrt/trunk/target/sdk'
make[1]: *** [target/sdk/install] Error 2
make[1]: Leaving directory `/home/darius/build/openwrt/trunk'
make: *** [target/sdk/install] Error 2

The problematic line is I think this:

tar cfj /home/darius/build/openwrt/trunk/bin/ar71xx/OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2.tar.bz2 OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2;

There is no such path as /home/darius/build/openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33.2/OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.6-linaro_uClibc-0.9.33.2 so I think thats why I get permission denied error. I just can't understand how can I fix this error and successfuly compile SDK. Please help me with some advices.
By the way, despite the error, I still get firmware images produced.

(Last edited by alphalt on 15 Aug 2012, 21:53)

Ok, I've made some investigation and found line in Makefile of SDK which causes problems:

$(TAR) -cf - -C $(TOPDIR) \
        $(foreach exclude,$(EXCLUDE_DIRS),--exclude="$(exclude)") \
        --exclude="staging_dir/$(ARCH)" \
        staging_dir/host staging_dir/target-$(ARCH)$(ARCH_SUFFIX)_$(LIBC)-$(LIBCV)$(if $(CONFIG_arm),_eabi) \
        staging_dir/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)_$(LIBC)-$(LIBCV)$(if $(CONFIG_arm),_eabi) | \
        $(TAR) -xf - -C $(SDK_BUILD_DIR)

This line compress some contents on the fly and then decompress to different folder. And the problem is that after decompression some of the files are 0 bytes size with permissions set to none. I've done that command manually and surprisingly everytime different files are set to 0 size and permissions none.
Could anyone please do 'make target/sdk/install V=99' and post result here. Also its interesting what is tar version in your case. Mine is 1.26. Now I'm really lost, if this is caused by tar or by buildroot. I do not have any other problems when building. Only this one.

I've found the problem. It was TAR version 1.26 on my 64-bit machine which was causing the problems. Interesting thing is that there is no problems on 32-bit machine with TAR version 1.26. So my solution was to downgrade TAR to version 1.23 on 64-bit machine. Now everything is working fine.
Could anyone please report here the status on 64-bit system with TAR 1.26. Is anyone using that combination ?

Works for me.
64bit Ubuntu 12.04 in Virtualbox, tar 1.26
A 75 MB sized SDK file gets created with 'make target/sdk/install' without any complaints.

perus@hnvb:/Openwrt/trunk/bin/ar71xx$ uname -a
Linux hnvb 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
perus@hnvb:/Openwrt/trunk/bin/ar71xx$ tar --version
tar (GNU tar) 1.26

Thank you very much for information. Only difference I can see is linux kernel version:
darius@hp6715b:~$ uname -a
Linux hp6715b 3.2.0-3-amd64 #1 SMP Thu Jun 28 09:07:26 UTC 2012 x86_64 GNU/Linux

I have amd64 revision while yours is generic. Maybe this could be an issue ? It would be nice to hear from other users running amd64.

The discussion might have continued from here.