cross-compiling talloc with waf

George McCollister george.mccollister at gmail.com
Tue Apr 13 12:00:37 MDT 2010


I cross compiled talloc using waf. I build my embedded distro for
armeb-xscale (IXP425 CPU) using ptxdist on OpenSUSE 11.2 x86_64. Here
are the steps I took:

1) Install qemu OpenSUSE package and get it work.

Ultimately I would add ptxdist host rules to build a host version of
qemu since ptxdist is designed to work independently of the host distro.
It may not be possible to push these changes upstream since ptxdist also
supports building under a cygwin environment. I'm unfamiliar with the
viability of running qemu under cygwin.

When tried to run qemu as non-root on OpenSUSE 11.2 I received this error:
mmap: Permission denied

To get qemu to work as non-root I had to follow these instructions
(https://bugzilla.novell.com/show_bug.cgi?id=574654) which basically
involve updating my kernel related packages from the OpenSUSE
repository, rebooting, rebuilding nvidia and vmware kernel modules,
rebooting again and then modifying init scripts to execute the following
at startup:
echo "4096" > /proc/sys/vm/mmap_min_addr

2) clone samba-master and build talloc tar ball.
    git clone git://git.samba.org/samba.git samba-master
    cd samba-master/lib/talloc
    ../../buildtools/bin/waf dist

3) copy talloc-2.0.2.tar.gz to distro source pool.

4) Make the following modifications to my ptxdist talloc rules:

Originally:
TALLOC_AUTOCONF :=
$(CROSS_AUTOCONF_USR)                                                  

$(STATEDIR)/talloc.prepare: $(talloc_prepare_deps_default)
        @$(call targetinfo, $@)                          
        @$(call clean, $(TALLOC_DIR)/config.cache)       
        cd $(TALLOC_DIR) && \                            
                $(TALLOC_PATH) $(TALLOC_ENV) \                   
                ./configure $(TALLOC_AUTOCONF)                   
        @$(call touch, $@)

Now:
TALLOC_AUTOCONF := --prefix=/usr --sysconfdir=/etc --cross-compile
--cross-execute='/usr/bin/qemu-armeb -L
/opt/OSELAS.Toolchain-1.1.0/armeb-xscale-linux-gnueabi/gcc-4.1.1-glibc-2.5-kernel-2.6.21.4/sysroot-armeb-xscale-linux-gnueabi'                                                                                                      


$(STATEDIR)/talloc.prepare: $(talloc_prepare_deps_default)
        @$(call targetinfo, $@)                          
        @$(call clean, $(TALLOC_DIR)/config.cache)       
        cd $(TALLOC_DIR) && \                            
                $(TALLOC_PATH) $(TALLOC_ENV) ./autogen-waf.sh && \
                $(TALLOC_PATH) $(TALLOC_ENV) \                   
                ./configure $(TALLOC_AUTOCONF)                   
        @$(call touch, $@)

5) Build using ptxdist:
ptxdist go

Cheers,
George McCollister




More information about the samba-technical mailing list