Re: [Mono-dev] Building mono with android ndk standalone toolchain (android ndk r8e)

2013-05-10 Thread Jonathan Pryor
On May 8, 2013, at 4:29 PM, Jeremy Bell bell.jer...@gmail.com wrote:
 So, it looks like HAVE_SGEN_GC is not defined, but should be? Have I missed a 
 step somewhere?

Yes, it should be. From the commit message you mention:

 The Android NDK/bionic is interesting, in that it's lacking header files and
 macros normally present on Linux which otherwise break the build (e.g. no
 link.h which breaks Boehm support).

breaks Boehm support means only sgen works. You need to disable Boehm, and 
enable sgen.

 - Jon

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Building mono with android ndk standalone toolchain (android ndk r8e)

2013-05-10 Thread Jeremy Bell
Thanks Jonathan.
I was aware that Boehm was broken, and so I added --with-sgen=yes and
--disable-boehm as noted (though it looks like the configure line in my
email was missing the options - sorry for the confusion).

I've also tried adding --with-gc=none instead of --disable-boehm, and in
addition to --disable-boehm, and a few combinations of the three options.
I've even thrown in --with-moon-gc=sgen:

note the following differences between these attempts and my earlier email:
- replaced --host and --target with armv7-a-linux-androideabi. Previously I
was using armv5-linux-androideabi
- Changed CFLAGS and CXXFLAGS to -DARM_FPU_VFP. Previously I was using
-DARM_FPU_NONE=1
- hard coded i686-pc-linux-gnu for --build. Previously I was using
--build=`config.guess` which gave a command config.guess not found error.
I ran ./config.guess manually and inserted the value into the options.


-- Original, successful build config for mono branch mono-2-10-8:
./autogen.sh --build=i686-pc-linux-gnu --host=armv7-a-linux-androideabi
--target=armv7-a-linux-androideabi --enable-nls=no --with-mcs-docs=no
--with-mcs-build=no --with-moonlight=no --with-gc=none
CFLAGS=-DARM_FPU_VFP=1 CXXFLAGS=-DARM_FPU_VFP

This builds successfully. Next, I tried with mono branch master:

-- first attempt with branch master, with options --with-sgen=yes
--disable-boehm --with-gc=none

config options:
./autogen.sh --build=i686-pc-linux-gnu --host=armv7-a-linux-androideabi
--target=armv7-a-linux-androideabi --enable-nls=no --with-mcs-docs=no
--with-mcs-build=no --with-moonlight=no --with-gc=none
CFLAGS=-DARM_FPU_VFP=1 CXXFLAGS=-DARM_FPU_VFP
--prefix=/home/jeremybell/desktop/monodevsrc/mono_arm_install
--with-sgen=yes --disable-boehm --with-gc=none

config report:
mcs source:mcs

   Engine:
GC:   sgen and included Boehm
TLS:   pthread
SIGALTSTACK:   no
Engine:Building and using the JIT
oprofile:  no
BigArrays: no
DTrace:no
LLVM Back End: no (dynamically loaded: no)

   Libraries:
.NET 2.0/3.5:  no
.NET 4.0:  no
.NET 4.5:  no
MonoDroid: no
MonoTouch: no
JNI support:   IKVM Native
libgdiplus:assumed to be installed
zlib:  system zlib
configure: WARNING: Turning off static Mono is a risk

build error:
  CC mono_sgen-main.o
main.c:7:22: fatal error: buildver.h: No such file or directory
compilation terminated.


-- second attempt, adding --with-moon-gc=sgen

config options:
./autogen.sh --build=i686-pc-linux-gnu --host=armv7-a-linux-androideabi
--target=armv7-a-linux-androideabi --enable-nls=no --with-mcs-docs=no
--with-mcs-build=no --with-moonlight=no --with-gc=none
CFLAGS=-DARM_FPU_VFP=1 CXXFLAGS=-DARM_FPU_VFP
--prefix=/home/jeremybell/desktop/monodevsrc/mono_arm_install
--with-sgen=yes --disable-boehm --with-gc=none --with-moon-gc=sgen

config output: same as first attempt above
build error: same as first attempt above

-- third attempt, removing --with-gc=none and --with-moon-gc=sgen options

config options:
./autogen.sh --build=i686-pc-linux-gnu --host=armv7-a-linux-androideabi
--target=armv7-a-linux-androideabi --enable-nls=no --with-mcs-docs=no
--with-mcs-build=no --with-moonlight=no --with-gc=none
CFLAGS=-DARM_FPU_VFP=1 CXXFLAGS=-DARM_FPU_VFP
--prefix=/home/jeremybell/desktop/monodevsrc/mono_arm_install
--with-sgen=yes --disable-boehm

config output: same as first attempt above
build error: same as first attempt above

-- fourth attempt, removing --disable-boehm and adding back --with-gc=none
config options:
./autogen.sh --build=i686-pc-linux-gnu --host=armv7-a-linux-androideabi
--target=armv7-a-linux-androideabi --enable-nls=no --with-mcs-docs=no
--with-mcs-build=no --with-moonlight=no --with-gc=none
CFLAGS=-DARM_FPU_VFP=1 CXXFLAGS=-DARM_FPU_VFP
--prefix=/home/jeremybell/desktop/monodevsrc/mono_arm_install
--with-sgen=yes --with-gc=none

config output: same as first attempt above
build error: same as first attempt above

--fifth attempt, leaving just --with-gc=none as in successful mono-2-10-8
branch build:
config options:
./autogen.sh --build=i686-pc-linux-gnu --host=armv7-a-linux-androideabi
--target=armv7-a-linux-androideabi --enable-nls=no --with-mcs-docs=no
--with-mcs-build=no --with-moonlight=no --with-gc=none
CFLAGS=-DARM_FPU_VFP=1 CXXFLAGS=-DARM_FPU_VFP
--prefix=/home/jeremybell/desktop/monodevsrc/mono_arm_install --with-gc=none
config output: same as first attempt above
build error: same as first attempt above


-- sixth attempt, adding HAVE_SGEN_GC=1 to the CFLAGS, and using
--with-sgen=yes --disable-boehm
config options:
./autogen.sh --build=i686-pc-linux-gnu --host=armv7-a-linux-androideabi
--target=armv7-a-linux-androideabi --enable-nls=no --with-mcs-docs=no
--with-mcs-build=no --with-moonlight=no --with-gc=none
CFLAGS=-DARM_FPU_VFP=1 -DHAVE_SGEN_GC=1 CXXFLAGS=-DARM_FPU_VFP
-DHAVE_SGEN_GC=1
--prefix=/home/jeremybell/desktop/monodevsrc/mono_arm_install
--with-sgen=yes --disable-boehm


[Mono-dev] Building mono with android ndk standalone toolchain (android ndk r8e)

2013-05-08 Thread Jeremy Bell
I'm attempting to build mono using the ndk standalone toolchain from the
android ndk (version r8e), but I am unable to complete the build.

I setup my standalone environment like so:
export
SYSROOT=/home/jeremybell/Desktop/android-ndk-r8e/platforms/android-14/arch-arm
/home/jeremybell/Desktop/android-ndk-r8e/build/tools/make-standalone-toolchain.sh
--platform=android-14 --install-dir=./android-14-toolchain

Next, I configure mono. I'm using something similar to the example shown
here:
http://permalink.gmane.org/gmane.comp.gnome.mono.patches/181374

Except for a few differences. First, I export each of the variables (AR,
AS, CC, etc..) including SYSROOT (the configure script no longer takes a
--sysroot=/path/to/sysroot option) prior to running configure. Second, I
added --with-sgen=yes --disable-boehm

Here's my environment and my autogen.sh command:
export NDK=/home/jeremybell/Desktop/android-ndk-r8e
export SYSROOT=$NDK/platforms/android-14/arch-arm
export NDK_STANDALONE=/home/jeremybell/Desktop/monodevsrc/ndk_standalone
export PATH=$NDK_STANDALONE/bin:$PATH
export CC=arm-linux-androideabi-gcc
export CXX=arm-linux-androideabi-g++
export AR=arm-linux-androideabi-ar
export AS=arm-linux-androideabi-as
export CPP=arm-linux-androideabi-cpp
export LD=arm-linux-androideabi-ld
export RANLIB=arm-linux-androideabi-ranlib
export STRIP=arm-linux-androideabi-strip
./autogen.sh --build=`./config.guess` --host=armv5-linux-androideabi
--target=armv5-linux-androideabi --enable-nls=no --with-mcs-docs=no
--enable-mcs-build=no --with-glib=embedded --with-monodroid=yes
CFLAGS=-DARM_FPU_NONE=1 CXXFLAGS=-DARM_FPU_NONE=1

Configure appears to run fine, but make fails while building
mono_sgen-main.o:

  CC libmini_static_la-tramp-arm.lo
  CC libmini_static_la-mini-posix.lo
  CXXLD  libmini-static.la
  CC mono_sgen-main.o
main.c:7:22: fatal error: buildver.h: No such file or directory
compilation terminated.
make[4]: *** [mono_sgen-main.o] Error 1
make[4]: Leaving directory
`/home/jeremybell/Desktop/monodevsrc/mono/mono/mini'
make[3]: *** [all] Error 2
make[3]: Leaving directory
`/home/jeremybell/Desktop/monodevsrc/mono/mono/mini'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/jeremybell/Desktop/monodevsrc/mono/mono'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/jeremybell/Desktop/monodevsrc/mono'
make: *** [all] Error 2


The offending line:
#include config.h
#include mini.h
#ifndef HOST_WIN32
#ifdef HAVE_SGEN_GC
#include buildver-sgen.h
#else
#include buildver.h
#endif
#endif

So, it looks like HAVE_SGEN_GC is not defined, but should be? Have I missed
a step somewhere?

Thanks!
Jeremy
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list