[Gc] compiling gc-7.2alpha2 or a4

Marcos_David.Dione at sophia.inria.fr Marcos_David.Dione at sophia.inria.fr
Thu Dec 10 02:22:34 PST 2009

On Tue, December 8, 2009 6:51 pm, Ivan Maidanski wrote:
> For a mono link, search for "PLATFORM_ANDROID" and "mono" in google
> codesearch.

    ok, after googling around (actually code.google.com gave no results) I
end up here:


> Now, I remember I successfully compiled GC on NDK 1.5r1 (but this was
> toolkit for windows development host which doesn't define __linux__ (which
> is tested by GC)).
> Now, this is fixed and should work for any toolkit (I've tested with
> v1.6r1).

    they, just like you, seem to have being using the android NDK. I'm not
using the NDK. when I mean native I mean take the gcc they provide and
compile a final executable to run from the command line. this is what
I've been trying to do and keep failing.

> Try the latest version from BDWGC CVS (I've added some workarounds for
> Android (some of them are as you sent to me).

    I tried with CVS, yes. same result.

> 2. To build without dynamic libraries registering, use also

    is this needed for making the gc work with code that uses it and that
it's in a dynamic lib itself? we use it in bigloo's code, which ends
up in a dynlib which later we will use from another project (hop[2],
built upon bigloo).

> 3. Alternatively, to build with that support, get and include bionics clib
> linker headers.

    didn't we just added so with the #ifdef's around elf.h and link.h?

> If you would still experience linkage problems, send me the linkage
> command (that is passed to gcc).

    you need android's source code and toolchain:


    then get the droid wrapper:


    this basically makes calling the droid's toolchain easy, and with lots
of options already set (as I mentioned, a slight variation from what
you can find here[1] and augmented for linking dynamic libraries too).

    configure and compile your project with droid-gcc.

    if you don't want to do all that stuuf (cloning android's git repo can
be painful), I resume the linking option (LDFLAGS) here:

    -nostdlib -Bdynamic -Wl,--no-undefined -Wl,-T,$SDK/build/core/armelf.x
-Wl,-dynamic-linker,$(SDK)/system/bin/linker -Wl,--gc-sections
-Wl,-z,nocopyreloc -L$LIBDIR -Wl,-rpath-link=$LIBDIR

    where SDK points to android's source code and LIB to
$SDK/out/target/product/generic/obj/lib .


[2] https://hop.inria.fr/
Lic. Marcos Dione
Engineer Expert - Hop Project
INRIA Sophia Antipolis - Méditerranée
Phone: +33 (0)4 92 38 79 67

More information about the Gc mailing list