Printable Version of Topic

Click here to view this topic in its original format

Linuxhelp _ Programming in Linux _ Cross compilation help needed

Posted by: Derf79 Oct 3 2008, 01:54 PM


I have a cross compilation problem I'd like some help with. I've read a few guides online, and they do provide specific examples, and from that I haven't had any luck figuring this out.

I am running Ubuntu 8.04 Hardy heron on my laptop (x86), and I'd like to compile Dropbear for my NMT, a popcorn hour, which needs to be compiled for mipsel-linux.

I got the toolchain for the NMT, downloaded it to ~/popcorn/smp/, configured it with $./configure, compiled it with $make, and it created a toolchain-path.env file. I did not do $make-install. I made the .env file executable, and ran it in my terminal window, so that it would load the $PATH into my session for mipsel-linux. The output of the .env looks like this:
$ cat toolchain-path.env
# source this script to put your new compiler in the PATH.


I then want to compile dropbear, but to enable zlib, I have to compile zlib.a myself. So I got the latest zlib from openwrt.
I put it in ~/popcorn/zlib
But when I try to do
$ CC=mipsel-linux-gcc ./configure

I end up with many error messages:
Building static library libz.a version 1.2.3 with mipsel-linux-gcc.
Checking for unistd.h... No.
Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()
Checking for snprintf() in stdio.h... No.
WARNING: snprintf() not found, falling back to sprintf(). zlib
can build but will be open to possible buffer-overflow security
Checking for return value of sprintf()... No.
WARNING: apparently sprintf() does not return a value. zlib
can build but will be open to possible string-format security
Checking for errno.h... No.
Checking for mmap support... No.

I believe it is not seeing the mipsel-linux gcc, because when I just do ./configure it finds unistd.h and the other files.

How do I get zlib.a to compile using the mipsel-linux gcc I made?

Powered by Invision Power Board (
© Invision Power Services (