[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#574717: mingw32-ocaml: Supported arches

Le samedi 20 mars 2010 08:21:53, Kurt Roeckx a écrit :
> Hi,


> It seems you currently restrict the arch list to:
> i386 amd64 kfreebsd-amd64 kfreebsd-i386
> Is there a reason for this?  Both mingw32 and ocaml seem to be
> supported on all arches (except for mingw32 on hurd-i386).
> I also don't get why you need to build-depend on gcc-multilib.

This is needed to get a working build environment for gcc -m32

> You have this in your rules file:
>         # Note that we must build a 32 bit compiler, even on 64 bit build
>         # architectures, because this compiler will try to do strength
>         # reduction optimizations using its internal int type, and that
>  must # match Windows' int type.  (That's what -cc and -host are for).
> But the size of an int doesn't change for 32 and 64 targets.  Only the size
> of a long and a pointer do.
> The description even says:
>  This compiler runs quickly,
>  generates compact code with moderate memory requirements, and is
>  portable to essentially any 32 or 64 bit Unix platform.
> I currently see no reason not to set the arch list to any.

The cross-compilation process is a bit more complicated than that. In 
particular, the ocamlopt compiler emits temporary assembly files that are 
compiled later by the compiler. When switching to gcc instead of gcc -m32, I 
get a lot of messages like this:

/tmp/camlasmf9e413.s: Assembler messages:                                                                                                                                           
/tmp/camlasmf9e413.s:431: Warning: value 0x3cb0000000000000 truncated to 0x0                                                                                                        
/tmp/camlasmf9e413.s:437: Warning: value 0x10000000000000 truncated to 0x0                                                                                                          
/tmp/camlasmf9e413.s:443: Warning: value 0x7fefffffffffffff truncated to 0xffffffff                                                                                                 
/tmp/camlasmf9e413.s:449: Warning: value 0x7ff0000000000001 truncated to 0x1                                                                                                        
/tmp/camlasmf9e413.s:455: Warning: value 0xfff0000000000000 truncated to 0x0                                                                                                        
/tmp/camlasmf9e413.s:461: Warning: value 0x7ff0000000000000 truncated to 0x0      

Hence, I assume it is not safe to compile it using (64 bits) gcc.

However, I'm open to any suggestion, in particular when tested and if possible 
with a patch...


Reply to: