[Mono-dev] /mono/mini/main.c build error: depends on HAVE_SGEN_GC define, making it impossible to compile for sgen

Jeremy Bell bell.jeremy at gmail.com
Wed May 29 16:00:21 UTC 2013


I'm not sure if this is the best way to fix the issue, but I've submitted a
pull request with a small fix:
https://github.com/mono/mono/pull/650

This is my first mono pull request, so please let me know if there are any
contrib guidelines I missed.

Regards,
Jeremy


On Thu, May 23, 2013 at 2:25 PM, Jeremy Bell <bell.jeremy at gmail.com> wrote:

>
> These:
> export SYSROOT=$NDK/platforms/android-14/arch-arm
> 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=i686-pc-linux-gnu --host=arm-linux-androideabi
> --target=arm-linux-androideabi --enable-nls=no --with-mcs-docs=no
> --with-mcs-build=no CFLAGS="-DARM_FPU_NONE=1" CXXFLAGS="-DARM_FPU_NONE=1"
> --prefix=$PREFIX
>
> Same issue with the armv7-a build:
> export SYSROOT=$NDK/platforms/android-14/arch-arm
> 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=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 CFLAGS="-DARM_FPU_VFP=1" CXXFLAGS="-DARM_FPU_VFP"
> --prefix=$INSTALL_PREFIX
>
>
> My system:
> Ubuntu 13.04
>
> Thanks,
> Jeremy
>
>
> On Thu, May 23, 2013 at 1:39 PM, Zoltan Varga <vargaz at gmail.com> wrote:
>
>> Hi,
>>
>>  buildver.h is always built unless some configure flag disables it. What
>> configure arguments are you using ?
>>
>>           Zoltan
>>
>>
>> On Thu, May 23, 2013 at 5:01 PM, Jeremy Bell <bell.jeremy at gmail.com>wrote:
>>
>>> At some point between branch mono-2-10-9 and branch master, a change was
>>> made to /mono/mini/main.c:
>>>
>>> branch mono-2-10-9:
>>>
>>> main.c:
>>> #include <config.h>
>>> #include "mini.h"
>>> #ifndef HOST_WIN32
>>> #include "buildver.h"
>>> #endif
>>>
>>>
>>> branch master:
>>> #include <config.h>
>>> #include "mini.h"
>>> #ifndef HOST_WIN32
>>> #ifdef HAVE_SGEN_GC
>>> #include "buildver-sgen.h"
>>> #else
>>> #include "buildver.h"
>>> #endif
>>> #endif
>>>
>>> This makes main.c impossible to compile when buildver-sgen.h is
>>> generated and not buildver.h. First of all, HAVE_SGEN_GC is never defined
>>> for files in /mini as far as I can tell, so main.c always attempts to
>>> include buildver.h, which does not exist when buildver-sgen.h is generated
>>> instead.
>>>
>>> However, even if you explicitly define HAVE_SGEN_GC in CFLAGS, etc...
>>> then you will still get an error, in mini.h, because it believes it is an
>>> error to have either HAVE_SGEN_GC or HAVE_BOEHM_GC defined when mini.h is
>>> included, as /mini code should not have dependencies on the GC being used,
>>> so it says:
>>>
>>> mini.h:
>>> /*
>>>  * The mini code should not have any compile time dependencies on the GC
>>> being used, so the same object file from mini/
>>>  * can be linked into both mono and mono-sgen.
>>>  */
>>> #if defined(HAVE_BOEHM_GC) || defined(HAVE_SGEN_GC)
>>> #error "The code in mini/ should not depend on these defines."
>>> #endif
>>>
>>>
>>> So, either way, main.c won't compile without modification. Is the error
>>> in /mono/mini/mini.h no longer valid? Or was the change to
>>> /mono/mini/main.c to depend on the HAVE_SGEN_GC define a regression?
>>>
>>> Thanks,
>>> Jeremy
>>>
>>> _______________________________________________
>>> Mono-devel-list mailing list
>>> Mono-devel-list at lists.ximian.com
>>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20130529/6ff00290/attachment.html>


More information about the Mono-devel-list mailing list