[Buildroot] cyrus-sasl in buildroot: makemd5 is wrongly cross-compiled

Luca Ceresoli luca at lucaceresoli.net
Fri Jun 24 12:52:03 UTC 2011

after having worked around the "apparent CFLAGS mismatch" problem, I hit
another cross-compilation error while trying to build cyrus-sasl in 

   $ make cyrus-sasl-dirclean
   $ make cyrus-sasl 2>&1 | tee cyrus-sasl.log
/home/murray/devel/buildroot/output/host/usr/bin/arm-linux-gcc -Wall -W 
-D_FILE_OFFSET_BITS=64 -o makemd5 makemd5.o -lresolv
   rm -f md5global.h
   ./makemd5 md5global.h
   /bin/bash: ./makemd5: cannot execute binary file
   make[3]: *** [md5global.h] Error 126

The problem here is pretty clear: makemd5, which is meant to run on the 
has been cross-compiled instead:

   $ file output/build/cyrus-sasl-2.1.24rc1/include/makemd5
   output/build/cyrus-sasl-2.1.24rc1/include/makemd5: ELF 32-bit LSB 
executable, ARM, version 1 (SYSV), dynamically linked (uses shared 
libs), for GNU/Linux 2.6.31, not stripped

Attached is my patch to allow makemd5 to correctly (non-cross) compiled.
Basically, it consists in replacing $(CC) with $(HOSTCC) in cyrus-sasl's
Note that I'm not the first that faced this problem. My patch has been
inspired by:

The build log is attached too.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: cyrus-sasl-makemd5.log.gz
Type: application/x-gzip
Size: 3477 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20110624/6e781892/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cyrus-sasl-hostcc.patch
Type: text/x-patch
Size: 1317 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20110624/6e781892/attachment-0005.bin>

More information about the buildroot mailing list