[Mono-dev] DistCC and cross-compiling Mono

bojanr at brandeis.edu bojanr at brandeis.edu
Thu Mar 5 23:57:10 EST 2009

Today I decided that I would try to get my x86_64 box to help out with
some compilation tasks (namely, compiling Mono--it's not particularly
slow, but any little bit helps). Both the server box and my laptop (the
host machine doing the compiling) are running Ubuntu, 8.10 on the server,
9.04 on the laptop, gcc 4.3.2, multiarch libs installed on the server box,
the works. Everything went swimmingly when compiling mono and libgc and
all the other C libs and tools, provided I included -m32 in CFLAGS and
LDFLAGS, except for compiling Jay.

I asked around in #mono, and was told that Jay was kind of hacked in--the
makefile is hand-written, and doesn't take into account many outside
parameters (none really, except for $prefix and maybe one other). In
search of a way to fix this, I stumbled upon the following section in
configure.in in the root of the mono source tree, which sets up
config.make for the mcs source tree based on what configure figured out
here in the mono source tree:

if test x$cross_compiling = xno && test x$enable_mcs_build != xno; then
    echo "prefix=$prefix" > $srcdir/$mcsdir/build/config.make
    echo "exec_prefix=$exec_prefix" >> $srcdir/$mcsdir/build/config.make
    echo "sysconfdir=$sysconfdir" >> $srcdir/$mcsdir/build/config.make
    echo 'mono_libdir=${exec_prefix}/lib' >> $srcdir/$mcsdir/build

I patched this to pass on CFLAGS and LDFLAGS to the mcs makefile, so now
jay builds correctly when cross-compiling with distcc. The patch is
attached, and it's sort of a hack. It passes compilation, though it spews
out full screens of warnings because of all the warning flags that are
passed along to jay because they're passed to mono. If anyone has a better
solution to this issue, it'd be great to see it implemented.

Bojan Rajkovic
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jay-cflags-ldflags-fix.patch
Type: text/x-patch
Size: 758 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090305/cab8c526/attachment.bin 

More information about the Mono-devel-list mailing list