cross-compiling 3.5.x to ARM

Dallas Clement dallas.a.clement at gmail.com
Mon May 16 19:18:01 MDT 2011


Hello All,

I seem to be having a difficult time getting any version of samba to
cross-compile to ARM.  I was able to build it natively just fine.  I am no
newb either when it comes to building and cross-compiling open source.  I
did configure for cross-compilation, and I do see that the cross-compiler is
getting invoked correctly.

I first tried 3.5.8.  It fails right away.

dallasc at freddy:~/Downloads/samba-3.5.8$ make
Using CFLAGS     = -I /home/dallasc/Downloads/zlib-1.2.3/staging/include -I.
-I/home/dallasc/Downloads/samba-3.5.8/./source3
-I/home/dallasc/Downloads/samba-3.5.8/./source3/../lib/popt
-I/home/dallasc/Downloads/samba-3.5.8/./source3/iniparser/src -Iinclude
-I/home/dallasc/Downloads/samba-3.5.8/./source3/include -I.
-I/home/dallasc/Downloads/samba-3.5.8/./source3
-I/home/dallasc/Downloads/samba-3.5.8/./source3/../lib/replace
-I/home/dallasc/Downloads/samba-3.5.8/./source3/../lib/tevent
-I/home/dallasc/Downloads/samba-3.5.8/./source3/libaddns
-I/home/dallasc/Downloads/samba-3.5.8/./source3/librpc
-I/home/dallasc/Downloads/samba-3.5.8/./source3/.. -I./source3/../lib/talloc
-DHAVE_CONFIG_H  -Iinclude -I./source3/include -I. -I./source3
-I./source3/../lib/replace -I./source3/../lib/tevent -I./source3/libaddns
-I./source3/librpc -I./source3/.. -I./source3/../lib/popt
-I/usr/local/include  -I/home/dallasc/Downloads/samba-3.5.8/./source3/lib
-I.. -I../source4 -D_SAMBA_BUILD_=3 -D_SAMBA_BUILD_=3
      PICFLAG    = -fPIC
      LIBS       = -lresolv -lnsl -ldl
      LDFLAGS    = -pie -Wl,-z,relro -Wl,--as-needed -L
/home/dallasc/Downloads/zlib-1.2.3/staging/lib -L./bin -L/usr/local/lib
      DYNEXP     = -Wl,--export-dynamic
      LDSHFLAGS  = -fPIC -shared -Wl,-Bsymbolic -Wl,-z,relro -Wl,--as-needed
-L /home/dallasc/Downloads/zlib-1.2.3/staging/lib -L./bin -L/usr/local/lib
-lc -Wl,-z,defs
      SHLIBEXT   = so
      SONAMEFLAG = -Wl,-soname=
Linking shared library bin/libtalloc.so.2
./source3/../lib/replace/replace.o: file not recognized: File format not
recognized
collect2: ld returned 1 exit status
make: *** [bin/libtalloc.so.2] Error 1

I then tried 3.5.0.  It makes a little more progress, but has other
problems.

dallasc at freddy:~/Downloads/samba-3.5.0$ make
Using CFLAGS     = -I /home/dallasc/Downloads/zlib-1.2.3/staging/include -I.
-I/home/dallasc/Downloads/samba-3.5.0/./source3
-I/home/dallasc/Downloads/samba-3.5.0/./source3/../lib/popt
-I/home/dallasc/Downloads/samba-3.5.0/./source3/iniparser/src -Iinclude
-I/home/dallasc/Downloads/samba-3.5.0/./source3/include -I.
-I/home/dallasc/Downloads/samba-3.5.0/./source3
-I/home/dallasc/Downloads/samba-3.5.0/./source3/../lib/replace
-I/home/dallasc/Downloads/samba-3.5.0/./source3/../lib/tevent
-I/home/dallasc/Downloads/samba-3.5.0/./source3/libaddns
-I/home/dallasc/Downloads/samba-3.5.0/./source3/librpc
-I/home/dallasc/Downloads/samba-3.5.0/./source3/.. -I./source3/../lib/talloc
-DHAVE_CONFIG_H  -Iinclude -I./source3/include -I. -I./source3
-I./source3/../lib/replace -I./source3/../lib/tevent -I./source3/libaddns
-I./source3/librpc -I./source3/.. -I./source3/../lib/popt
-I/usr/local/include  -I/home/dallasc/Downloads/samba-3.5.0/./source3/lib
-I.. -I../source4 -D_SAMBA_BUILD_=3 -D_SAMBA_BUILD_=3
      PICFLAG    = -fPIC
      LIBS       = -lresolv -lnsl -ldl
      LDFLAGS    = -pie -Wl,-z,relro -Wl,--as-needed -L
/home/dallasc/Downloads/zlib-1.2.3/staging/lib -L./bin -L/usr/local/lib
      DYNEXP     = -Wl,--export-dynamic
      LDSHFLAGS  = -shared -Wl,-Bsymbolic -Wl,-z,relro -Wl,--as-needed -L
/home/dallasc/Downloads/zlib-1.2.3/staging/lib -L./bin -L/usr/local/lib -lc
-Wl,-z,defs
      SHLIBEXT   = so
      SONAMEFLAG = -Wl,-soname=
Linking shared library bin/libwbclient.so.0
../nsswitch/libwbclient/wbclient.o: In function `wbcLibraryDetails':
wbclient.c:(.text+0x228): undefined reference to `talloc_free'
../nsswitch/libwbclient/wbclient.o: In function `wbcFreeMemory':
wbclient.c:(.text+0x24c): undefined reference to `talloc_free'
../nsswitch/libwbclient/wbc_util.o: In function
`wbcLookupDomainControllerEx':
wbc_util.c:(.text+0x504): undefined reference to `talloc_free'
wbc_util.c:(.text+0x510): undefined reference to `talloc_free'
../nsswitch/libwbclient/wbc_util.o: In function `wbcLookupDomainController':
wbc_util.c:(.text+0x614): undefined reference to `talloc_free'
../nsswitch/libwbclient/wbc_util.o:wbc_util.c:(.text+0x790): more undefined
references to `talloc_free' follow
../lib/async_req/async_sock.o: In function `writev_handler':
async_sock.c:(.text+0x94c): undefined reference to `sys_writev'
../lib/async_req/async_sock.o: In function `async_connect_connected':
async_sock.c:(.text+0xcc8): undefined reference to `talloc_free'
async_sock.c:(.text+0xd4c): undefined reference to `dbghdrclass'
async_sock.c:(.text+0xd6c): undefined reference to `dbgtext'
async_sock.c:(.text+0xdd4): undefined reference to `DEBUGLEVEL_CLASS'
../lib/async_req/async_sock.o: In function `async_req_is_errno':
async_sock.c:(.text+0xeb8): undefined reference to `async_req_is_error'
collect2: ld returned 1 exit status
make: *** [bin/libwbclient.so.0] Error 1


I then decided to try 3.4.10.  It also failed with talloc linking errors:

Linking bin/smbd
../lib/replace/replace.o: In function `rep_mkstemp':
replace.c:(.text+0x8): warning: the use of `mktemp' is dangerous, better use
`mkstemp'
param/loadparm.o: In function `free_one_parameter_common':
loadparm.c:(.text+0x79c): undefined reference to `talloc_free'
param/loadparm.o: In function `init_globals':
loadparm.c:(.text+0x1ab0): undefined reference to `talloc_free'
param/loadparm.o: In function `lp_string':
loadparm.c:(.text+0x2020): undefined reference to `talloc_free'
param/loadparm.o: In function `free_param_opts':
loadparm.c:(.text+0xffd4): undefined reference to `talloc_free'
param/loadparm.o: In function `free_service_byindex':
loadparm.c:(.text+0x10388): undefined reference to `talloc_free'
...

Perhaps part of my problem is that I am building this on a X86_64 host.
Maybe that's just asking for trouble.

I'm surprised that I'm having this much trouble.  Would someone kindly give
me some basic tips on how to successfully cross-build this for ARM?  What is
the recipe?  I just need a bare bones samba.  no ldap or ads, etc.  I would
appreciate knowing what the dependencies are if any.

Thanks much,

Dallas


More information about the samba-technical mailing list