[Gdal-dev] Re: GDAL on 64-bit Windows?
Simon Perkins
sy at perkins.net
Thu May 18 11:43:54 EDT 2006
On Thu, 18 May 2006 10:26:20 -0400, "Frank Warmerdam"
<warmerdam at pobox.com> said:
> Simon Perkins wrote:
> > OK, fixed all my problems and now have GDAL running on 64-bit windows...
> > The main issues were:
> >
> > - Define USE_IN_GDAL in frmts/pcraster/makefile.vc
Sorry haven't checked this in yet - I'll get on it...
> > - Change all the linker INCLUDEs to use undecorated symbol names, i.e.
> > remove the leading underscore and (in the case of stdcall functions) the
> > trailing "@nn". I guess 64-bit windows decorates C symbols differently,
> > though I haven't been able to find this described directly anywhere...
> >
> > Frank: any thoughts on how you want 64-bit windows handled in nmake.opt?
> > Let me know and I'll check in my changes.
>
> Sy,
>
> I'm a bit uncertain. I wonder if it would have worked without the above
> changes if STDCALL=YES was commented out in nmake.opt. I am hesitant to
> add dramatic complications without understanding the issues better.
I don't think commenting out STDCALL=YES would work either: 32-bit cdecl
function names are still decorated with a leading underscore, which
isn't present on 64-bit windows. 32-bit stdcall function names are
decorated with both a leading underscore and a trailing "@nn" which
describes the size of the argument list in bytes. In the x64 calling
model, the function name and the symbol name are identical, with no
decoration. Just FYI, my understanding is that there's only one calling
convention in x64 and it's not stdcall or cdecl, instead, a variant of
"fastcall" is used, in which the first few arguments for a function are
passed in registers rather than on the stack.
I don't think the changes are that complicated: only one file, the top
level makefile.vc needs to be modified, and the only thing that needs
changing is the exact names of the various additional symbols that are
passed to the linker. So, we could just define a variable in nmake.opt,
e.g WIN64=YES that by default is commented out, and then modify the
INCLUDE additions using this variable - perhaps by just appropriately
defining a variable like SYM_PREFIX that is prepended onto each of the
symbol names. WIN64 would also imply STDCALL=NO.
Let me know what you think and I'll make these changes.
Cheers,
Sy
More information about the Gdal-dev
mailing list