Mipsel Cross-Compile Failure

Quantum Scientific Info at quantum-sci.com
Mon May 16 00:03:52 WST 2005


Hello List,

Trying to cross-compile Dropbear to the WRT54G, but it's dumping out for not 
finding utmpx.h .  This email seems long, but my comments are short.

-----------------------------------------------------------------------
# ./configure --disable-lastlog --build=i686-pc-linux-gnu --host=mipsel-linux
	--disable-zlib
...
checking for mipsel-linux-install... no
...
checking whether __UCLIBC__ is declared... no
...
checking for struct utmpx.ut_host... yes
checking for struct utmpx.ut_syslen... no
checking for struct utmpx.ut_type... yes
checking for struct utmpx.ut_id... yes
checking for struct utmpx.ut_addr... no
checking for struct utmpx.ut_addr_v6... yes
checking for struct utmpx.ut_time... no
checking for struct utmpx.ut_tv... yes
...
checking if your system defines UTMP_FILE... yes
checking if your system defines WTMP_FILE... yes
checking if your system defines UTMPX_FILE... no
checking if your system defines WTMPX_FILE... no
...
# make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" MULTI=1
	STATIC=1
mipsel-uclibc-gcc -I. -I./libtomcrypt -I./zlibincludes -I../zlibincludes -Os
	-W -Wall -DDROPBEAR_SERVER -DDROPBEAR_CLIENT -DDBMULTI_dropbear
	-DDBMULTI_dbclient -DDBMULTI_dropbearkey -DDBMULTI_dropbearconvert
	-DDBMULTI_scp -DDROPBEAR_MULTI   -c -o dbmulti.o dbmulti.c
In file included from dbmulti.c:25:
includes.h:67:19: utmpx.h: No such file or directory
dbmulti.c: In function `main':
dbmulti.c:49: warning: implicit declaration of function `cli_main'
make: *** [dbmulti.o] Error 1
#
-----------------------------------------------------------------------

Now, utmpx.h is in /opt/brcm/hndtools-mipsel-uclibc/include/bits .  It is 
finding utmp.h, but which one it's finding is a mystery.

So I included the header path in the Makefile:

-----------------------------------------------------------------------
# make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" MULTI=1 
STATIC=1
mipsel-uclibc-gcc -I. -l/opt/brcm/hndtools-mipsel-uclibc/include/bits
	-I./libtomcrypt -I./zlibincludes -I../zlibincludes -Os -W -Wall
	-DDROPBEAR_SERVER -DDROPBEAR_CLIENT -DDBMULTI_dropbear
	-DDBMULTI_dbclient -DDBMULTI_dropbearkey -DDBMULTI_dropbearconvert
	-DDBMULTI_scp -DDROPBEAR_MULTI -c -o dbmulti.o dbmulti.c
In file included from dbmulti.c:25:
includes.h:67:19: utmpx.h: No such file or directory
dbmulti.c: In function `main':
dbmulti.c:49: warning: implicit declaration of function `cli_main'
make: *** [dbmulti.o] Error 1
#
-----------------------------------------------------------------------

It still can't find it.

Below are the modifications I made to the Makefile.  Beyond options.h I've 
made no other modifications.

-----------------------------------------------------------------------
#**********************************************************
DESTDIR=/usr
#**********************************************************

ifndef PROGRAMS
...

sbindir=${exec_prefix}/sbin

#*************************************************************
# Build platform
export BUILD := i686-pc-linux-gnu
export HOSTCC := gcc
export PLATFORM := mipsel-uclibc

# uClibc wrapper
export CROSS_COMPILE := mipsel-uclibc-
export CONFIGURE := ./configure mipsel-linux --build=$(BUILD)
export TOOLCHAIN := $(shell cd $(dir $(shell which $(CROSS_COMPILE)gcc))/.. && 
pwd -P)

export CC := $(CROSS_COMPILE)gcc
export AR := $(CROSS_COMPILE)ar
export AS := $(CROSS_COMPILE)as
export LD := $(CROSS_COMPILE)ld
export NM := $(CROSS_COMPILE)nm
export RANLIB := $(CROSS_COMPILE)ranlib
export STRIP := $(CROSS_COMPILE)strip
export SIZE := $(CROSS_COMPILE)size

CFLAGS=-I. -l/opt/brcm/hndtools-mipsel-uclibc/include/bits 
-I$(srcdir)/libtomcrypt -I$(srcdir)/zlibincludes -I../zlibincludes @CFLAGS@
LDFLAGS=$(srcdir)/zlibincludes/libz.a @LDFLAGS@

#CC=@gcc@
#LD=@LD@
#AR=@AR@
#RANLIB=@RANLIB@
#STRIP=@STRIP@
INSTALL=@INSTALL@
#CFLAGS=-I. -I$(srcdir)/libtomcrypt @CFLAGS@
LIBS=$(LTC) $(LTM) @LIBS@
#LDFLAGS=@LDFLAGS@
#**********************************************************
-----------------------------------------------------------------------

One other issue.  When I try to include zlib, it can't find it.  I've put 
zconf.h and zlib.h under zlibincludes.

-----------------------------------------------------------------------
./configure --disable-lastlog --build=i686-pc-linux-gnu --host=mipsel-linux
	-with-zlib=/dl/Skymesh2/MIMO_GPL_1.00.06/src/router/dropbear/zlibincludes
...
checking for deflate in -lz... no
configure: error: *** zlib missing - install first or check config.log ***
#
-----------------------------------------------------------------------

In config.log is:

-----------------------------------------------------------------------
configure:3623: checking for deflate in -lz
configure:3653: mipsel-linux-gcc -o conftest -Os -W -Wall   conftest.c -lz   
-lcrypt >&5
/opt/brcm/hndtools-mipsel-linux/bin/../lib/gcc-lib/mipsel-linux/3.2.3/../../../../mipsel-linux/bin/ld: 
cannot find -lz
-----------------------------------------------------------------------

Now, mipsel-linux-ld is there, but not ld.

Can you advise?

Best,

Carl Cook








More information about the Dropbear mailing list