OpenWrt Forum Archive

Topic: Compiling for openwrt bleeding edge with toolchain not working.. why??

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

Hello all,
i am trying to compile libusb-1.0 to put in the toolchain, to get a working oscam running on my wndr3700v2. But I have many troubles. First of all, i have installed a stable release (kernel 2.6), compiled oscam and all works great. Then I have installed a trunk release of openwrt (a snapshot downloaded from official page), then oscam does not works anymore. So i have download sources to compile openwrt by myself, selecting ONLY "make toolchain.." in menuconfig options, waited, then in staging_dir i have the toolchain for openwrt. The next step i have to do is put libusb-1.0 into toolchain. But, when i run the command:

./configure CC=/home/jerrino77/router/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/bin/mips-openwrt-linux-uclibc-gcc-4.6.3 --target=mips-linux --host=mips-linux --prefix=/home/jerrino77/router/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/usr --exec-prefix=/home/jerrino77/router/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/usr CC=/home/jerrino77/router/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/bin/mips-openwrt-linux-uclibc-gcc-4.6.3

that is the right command that with openwrt toolchain from backfire works great, the output is

checking for mips-linux-gcc... /home/jerrino77/router/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/bin/mips-openwrt-linux-uclibc-gcc-4.6.3
checking whether the C compiler works... no
configure: error: in `/home/jerrino77/oscam/tool/libusb-1.0.8':
configure: error: C compiler cannot create executables
See `config.log' for more details.

and this is the log

configure:3203: $? = 0
configure:3192: /home/jerrino77/router/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/bin/mips-openwrt-linux-uclibc-gcc-4.6.3 -v >&5
Reading specs from /home/jerrino77/router/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/lib/gcc/mips-openwrt-linux-uclibc/4.6.3/specs
COLLECT_GCC=/home/jerrino77/router/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/bin/mips-openwrt-linux-uclibc-gcc-4.6.3
COLLECT_LTO_WRAPPER=/home/jerrino77/router/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/libexec/gcc/mips-openwrt-linux-uclibc/4.6.3/lto-wrapper
Target: mips-openwrt-linux-uclibc
Configured with: /home/jerrino77/router/trunk/build_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/gcc-linaro-4.6-2012.02/configure --prefix=/home/jerrino77/router/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33 --build=i686-linux-gnu --host=i686-linux-gnu --target=mips-openwrt-linux-uclibc --with-gnu-ld --enable-target-optspace --disable-libgomp --disable-libmudflap --disable-multilib --disable-nls --with-host-libstdcxx=-lstdc++ --with-float=soft --with-gmp=/home/jerrino77/router/trunk/staging_dir/host --with-mpfr=/home/jerrino77/router/trunk/staging_dir/host --disable-decimal-float --with-mips-plt --with-mpc=/home/jerrino77/router/trunk/staging_dir/host --disable-libssp --disable-__cxa_atexit --with-headers=/home/jerrino77/router/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/include --enable-languages=c,c++ --enable-shared --enable-threads --with-slibdir=/home/jerrino77/router/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/lib --enable-lto --with-libelf=/home/jerrino77/router/trunk/staging_dir/host --disable-tls
Thread model: posix
gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02)
configure:3203: $? = 0
configure:3192: /home/jerrino77/router/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/bin/mips-openwrt-linux-uclibc-gcc-4.6.3 -V >&5
mips-openwrt-linux-uclibc-gcc-4.6.3: error: unrecognized option '-V'
mips-openwrt-linux-uclibc-gcc-4.6.3: fatal error: no input files
compilation terminated.
configure:3203: $? = 1
configure:3192: /home/jerrino77/router/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/bin/mips-openwrt-linux-uclibc-gcc-4.6.3 -qversion >&5
mips-openwrt-linux-uclibc-gcc-4.6.3: error: unrecognized option '-qversion'
mips-openwrt-linux-uclibc-gcc-4.6.3: fatal error: no input files
compilation terminated.
configure:3203: $? = 1
configure:3223: checking whether the C compiler works
configure:3245: /home/jerrino77/router/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/bin/mips-openwrt-linux-uclibc-gcc-4.6.3    conftest.c  >&5
mips-openwrt-linux-uclibc-gcc-4.6.3: fatal error: environment variable 'STAGING_DIR' not defined
compilation terminated.
configure:3249: $? = 1
configure:3287: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "libusb"
| #define PACKAGE_TARNAME "libusb"
| #define PACKAGE_VERSION "1.0.8"
| #define PACKAGE_STRING "libusb 1.0.8"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define PACKAGE "libusb"
| #define VERSION "1.0.8"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:3292: error: in `/home/jerrino77/oscam/tool/libusb-1.0.8':
configure:3296: error: C compiler cannot create executables
See `config.log' for more details.

Why does not works? there is some new option to give in ./configure variabiles between gcc-4.3.3 (that, i repeat, works) and gcc-4.6.3?

Thanks in advance (and sorry for my poor english!!)

You have to pass STAGING_DIR="/home/jerrino77/router/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/" to your configure command.

Thaks mate, it works!!!

i have compiled libusb 1.0.8 with suces but not oscam.can anyone help me how to use the staging_dir in compilatin fase of oscam

Hi Jerrino77,

jerrino77 wrote:

Thaks mate, it works!!!

Could you please describe how you build oscam for backfire? Do you created only the binary or a complete package? Is it necessary to build a new libusb if you choose the svn backfire? Thanks for your help.

heinb

Hello all, i'm here again with another trouble.. First of all, i have a question: during menuconfig i have select to compile libusb-1.0, libusb, openssl, pcsclite, and make do everything fine. But, in the staging_dir toolchain dir, there is no track of libusb-1.0.a, libusb.a libpcsclite.a and openssl. Why?

btw, i'm trying to put this libraries from sources by myself. No problem with openssl and libusb-1.0, but i have many troubles to put libusb-0.1.4, required by pcsc-lite. I need this to get support for PC/SC readers on Oscam (that i have  made fine). these are my steps:

./configure CC=/opt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-uclibc-gcc --target=mips-linux --host=mips-linux --prefix=/opt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2 --exec-prefix=/opt/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2 STAGING_DIR=/opt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2 LD=/opt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-uclibc-ld

and this are the last lines of the output:

checking for mips-linux-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for LIBUSB_1_0... no
configure: error: Package requirements (libusb-1.0 >= 0.9.1) were not met:

No package 'libusb-1.0' found

but libusb-1.0.a is into /opt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib

What's my fault?
Thanks

Up.. help plz

Make sure <OpenWRT root directory>/build_dir/target-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/libusb-1.0 directory exists. If not, you will need to manually execute to compile the libusb-1.0 package, i.e. make package/libusb-1.0/compile.

In the dir you told me there is a dir called libusb-1.0.9 I try your tip, it seems to compile fine, but i get the same error. Then i try a "dirty trick", creating a symlink called "libusb1.0" that points at libusb-1.0.9.. nothing
don't know.... There is another way to put these files in toolchain?

after "make package/libusb/compile" i've found files I need not in  /opt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib but in /opt/trunk/staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib i don't know why....

good, i've found all the files i need in several folders undre /trunk.. copied in toolchain folder and everything worked fine..

Some problem with OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2. I try compile tar, gzip and gawk and saw this log:

checking for mips-openwrt-linux-gcc... ccache_cc
checking for C compiler default output file name...
configure: error: in `/home/root/OpenWrt-Toolchain/OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2/build_dir/target-mips_r2_uClibc-0.9.33.2/tar-1.23':
configure: error: C compiler cannot create executables
See `config.log' for more details.
make[2]: *** [/home/root/OpenWrt-Toolchain/OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2/build_dir/target-mips_r2_uClibc-0.9.33.2/tar-1.23/.configured_] Error 77
make[2]: Leaving directory `/home/root/OpenWrt-Toolchain/OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2/package/tar'
make[1]: *** [package/tar/compile] Error 2
make[1]: Leaving directory `/home/root/OpenWrt-Toolchain/OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2'
make: *** [package/tar/compile] Ошибка 2

(Last edited by Orion33 on 24 Aug 2014, 21:06)

Solved. Just need to install ccache util.

Orion33 wrote:

Solved. Just need to install ccache util.

Yeah bingo!

Why are you reviving a four year old thread just to post an inanity??

The discussion might have continued from here.