[Mono-dev] Windows build

Robert Jordan robertj at gmx.net
Wed Jul 16 15:38:58 EDT 2008


Hi Kornél,

__ImageBase was probably added sometime after this message:

http://sourceware.org/ml/binutils/2007-11/msg00017.html

It seems that the proper symbol on x86 (32bit) is indeed
"__image_base__", but it must be declared w/out the underscore:

#include <windows.h>
#include <stdio.h>

extern IMAGE_DOS_HEADER _image_base__;

int main (void)
{
	printf ("%x\n", _image_base__.e_magic);
	return 0;
}

Robert


Kornél Pál wrote:
> Hi,
> 
> Because even __ImageBase works for me on my cygwin installation, I'm 
> unsure about older cygwin versions, so I would like to ask you or 
> someone else to test __image_base__ (with the previous version that was 
> using __ImageBase):
> 
>  >     modify coree.h:
>  >     /* Defined by the linker. */
>  >     #ifndef _MSC_VER
>  >     #define __ImageBase __image_base__
>  >     #endif
>  >     extern IMAGE_DOS_HEADER __ImageBase MONO_INTERNAL;
> 
> If this works, I would prefer this solution because it's only a three 
> line patch and image base will be updated uisng relocation rather than 
> by the entrypoint that makes mono.dll able to function before the entry 
> point is called.
> 
> Kornél
> 
> Jonathan Chambers wrote:
>> Kornel,
>>      I reverted your changes related to __ImageBase yesterday in hopes 
>> of getting something working. The build machine has historically had a 
>> (very) old version of cygwin, as upgrading cygwin in the past has cause 
>> problems. However, it would be nice to upgrade the cygwin on the build 
>> machine at some point; I am not sure who is responsible for that in Novell.
>>
>>     In any case, my changes seem to have fixed the build. See: 
>> http://mono.ximian.com/monobuild/python/monobuild.py/packagestatus?platform=win-4-i386&package=mono&HEAD_or_RELEASE=HEAD 
>> <http://mono.ximian.com/monobuild/python/monobuild.py/packagestatus?platform=win-4-i386&package=mono&HEAD_or_RELEASE=HEAD>
>>
>>      If you wish to try something else to fix the issue, please respond 
>> soon. If not I'll backport my change to the 2.0 branch so the win32 
>> version of the release can move forward.
>>
>> Thanks,
>> Jonathan
>>
>> On Wed, Jul 16, 2008 at 4:34 AM, Kornél Pál <kornelpal at gmail.com 
>> <mailto:kornelpal at gmail.com>> wrote:
>>
>>     Hi,
>>
>>     __ImageBase works for me on cygwin as well. Aren't you using some
>>     old ld version?
>>
>>     Could you please try if __image_base__ works?
>>
>>     modify coree.h:
>>     /* Defined by the linker. */
>>     #ifndef _MSC_VER
>>     #define __ImageBase __image_base__
>>     #endif
>>     extern IMAGE_DOS_HEADER __ImageBase MONO_INTERNAL;
>>
>>     Thanks.
>>
>>     Kornél
>>
>>
>>     Andreas Nahr wrote:
>>
>>         Has already been fixed yesterday after my posting.
>>
>>         Greetings
>>         Andreas
>>
>>             -----Ursprüngliche Nachricht-----
>>             Von: mono-devel-list-bounces at lists.ximian.com
>>             <mailto:mono-devel-list-bounces at lists.ximian.com>
>>             [mailto:mono-devel-list- <mailto:mono-devel-list->
>>             bounces at lists.ximian.com <mailto:bounces at lists.ximian.com>]
>>             Im Auftrag von Miha Vrhovnik
>>             Gesendet: Mittwoch, 16. Juli 2008 07:15
>>             An: mono-devel-list at lists.ximian.com
>>             <mailto:mono-devel-list at lists.ximian.com>
>>             Betreff: Re: [Mono-dev] Windows build
>>
>>
>>             "Andreas Nahr" <classdevelopment at a-softtech.com
>>             <mailto:classdevelopment at a-softtech.com>> wrote on 15.07.2008
>>             22:34:00:
>>
>>                 Could somebody please fix the windows build? It has been
>>                 broken for
>>
>>             ages now...
>>
>>                 Happy Hacking
>>                 Andreas
>>
>>             Hi Andreas,
>>
>>             What exactly is broken in Windows build? I built Mono
>>             successfully in
>>             both Cygwin environment and using VS 2005.
>>
>>             Although if I remember correctly I had to tweak include
>>             paths a little
>>             bit.
>>
>>             Regards,
>>             Miha
>>
>>
>>             --
>>             It's time to get rid of your current e-mail client ...
>>             ... and start using si.Mail.
>>
>>             It's small & free. ( http://www.simail.si/ )
>>             _______________________________________________
>>             Mono-devel-list mailing list
>>             Mono-devel-list at lists.ximian.com
>>             <mailto:Mono-devel-list at lists.ximian.com>
>>             http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>
>>
>>         _______________________________________________
>>         Mono-devel-list mailing list
>>         Mono-devel-list at lists.ximian.com
>>         <mailto:Mono-devel-list at lists.ximian.com>
>>         http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>



More information about the Mono-devel-list mailing list