WIP: spring 64 bit for windows.

WIP: spring 64 bit for windows.

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

WIP: spring 64 bit for windows.

Post by Super Mario »

Compiles the majority of code with spring-legacy until, I got this error

Code: Select all

spring\rts\System\Platform\Win\CrashHandler.cpp|246|error: cannot convert 'DWORD* {aka long unsigned int*}' to 'PDWORD64 {aka long long unsigned int*}' for argument '3' to 'WINBOOL SymGetSymFromAddr64(HANDLE, DWORD64, PDWORD64, PIMAGEHLP_SYMBOL64)'|
Figuring out how to do this correctly.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: WIP: spring 64 bit for windows.

Post by smoth »

goes under development
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: WIP: spring 64 bit for windows.

Post by Super Mario »

ok I remove the error by editing the following code to

Code: Select all

#if _WIN64
	DWORD64 dwModBase, Disp, dwModAddrToPrint;
	#else
	DWORD dwModBase, Disp, dwModAddrToPrint;
	#endif // _WIN64
Now I got another error

Code: Select all

spring\rts\System\Platform\Win\CrashHandler.cpp|353|error: cast from 'PVOID {aka void*}' to 'long unsigned int' loses precision [-fpermissive]|
after passing -fpermissive flag, I got another error

Code: Select all

FAILED: cmd.exe /C "cd . && C:\TDM-GCC-64\bin\c++.exe  -fpermissive -mwindows
          -std=gnu++11 -mtune=generic -msse -mfpmath=sse -mno-sse2 -mno-sse3 -mn
o-ssse3 -mno-sse4.1 -mno-sse4.2 -mno-sse4 -mno-sse4a -mno-avx -mno-fma -mno-fma4
 -mno-xop -mno-lwp -mno-avx2 -fsingle-precision-constant -frounding-math -mieee-
fp -pipe -fno-strict-aliasing   -mthreads  -O2      -Wno-unknown-pragmas -DNDEBU
G -g  -Wl,--enable-auto-import @CMakeFiles/engine-legacy.rsp  -o spring.exe -Wl,
--out-implib,rts\builds\legacy\libspring.dll.a -Wl,--major-image-version,0,--min
or-image-version,0  && cd ."
collect2.exe: error: ld returned 5 exit status
ninja: build stopped: subcommand failed.
Can't find any information about this particular exist status.
Going to check somethings

Edit: Ah, silly mistake, was using the old 32 bit libaries.
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: WIP: spring 64 bit for windows.

Post by Super Mario »

gah, I am having a hard time finding the 64 bit dll version for freetype(2), zlib, ogg, vorbis and vorbisfile.
Any assistance would be much appreciated.
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: WIP: spring 64 bit for windows.

Post by Silentwings »

What is the benefit of 64 bit Spring for windows? Afaics all you'd gain is more RAM, but tbh I think that won't be much use because
(1) The bottleneck will be cpu, which will naturally kick in way sooner.
(2) If you did manage to have *so* much stuff in RAM that you needed 64bit, you'll quickly discover that old systems can no longer handle your game - there are still quite a few PCs areound with only 2Gb RAM.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: WIP: spring 64 bit for windows.

Post by smoth »

Because he cannot figure out how to compile it for 32 bit windows.
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: WIP: spring 64 bit for windows.

Post by Silentwings »

Just use -m32 iirc, that's what I've always done when I wanted to compile Spring (I only have 64 bit compilers installed for reasons unrelated to RAM).
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: WIP: spring 64 bit for windows.

Post by Super Mario »

smoth wrote:Because he cannot figure out how to compile it for 32 bit windows.
I already had compile for 32 bit windows.
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: WIP: spring 64 bit for windows.

Post by Super Mario »

Silentwings wrote:What is the benefit of 64 bit Spring for windows? Afaics all you'd gain is more RAM, but tbh I think that won't be much use because
(1) The bottleneck will be cpu, which will naturally kick in way sooner.
(2) If you did manage to have *so* much stuff in RAM that you needed 64bit, you'll quickly discover that old systems can no longer handle your game - there are still quite a few PCs areound with only 2Gb RAM.
Why is there a 64 bit version for linux if you think there is no benefit of having a 64 bit version of spring?
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: WIP: spring 64 bit for windows.

Post by abma »

Super Mario wrote:gah, I am having a hard time finding the 64 bit dll version for freetype(2), zlib, ogg, vorbis and vorbisfile.
Any assistance would be much appreciated.
very likely you have to compile these libs yourself or compile it on linux with mxe as it should be a lot easier: https://github.com/mxe/mxe

not sure if compiling mxe works on windows, i don't think so

FYI: some of the "official" mingwlibs are compiled with mxe. if i remember right, not all libs were compiled because at the point where i did it, some libs couldn't be compiled as shared lib or sth. like that.
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: WIP: spring 64 bit for windows.

Post by Super Mario »

I manged to find the necessarily dll, succesfully linked spring with the boost lib that I compile, now the problem it that it won't start.

Code: Select all

Process returned -1073741701 (0xC000007B)   execution time : 2.820 s
sigh, now I have no clue on what to do.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: WIP: spring 64 bit for windows.

Post by abma »

i can only guess that mingw / msvc compiled dll's are mixed. this often leads to such weird problems as they have differend stdlibc++.

does infolog.txt appear? anything useful in gdb?
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: WIP: spring 64 bit for windows.

Post by Super Mario »

abma wrote:i can only guess that mingw / msvc compiled dll's are mixed. this often leads to such weird problems as they have differend stdlibc++.

does infolog.txt appear? anything useful in gdb?
I'm pretty sure that I downloaded the dlls that are mingw base, nothing useful appear in the gdb nor does the infolog.txt appear.

Do you want me to upload the lib, dll that I am using? I can do that.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: WIP: spring 64 bit for windows.

Post by abma »

Super Mario wrote:Do you want me to upload the lib, dll that I am using? I can do that.
no, this won't help. try with gdb and set a breakpoint at main/winmain (not sure what you have to set, too)

then you should hopefully see whats wrong, either libs/dlls are totally broken or its a weird init error.

on osx for example you can't mix shared which are compiled with clang and gcc. the same applies if you use the same compiler but for example use different versions of boost compiled in.

thats which makes mxe so good: everything is compiled with the same toolchain.
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: WIP: spring 64 bit for windows.

Post by Silentwings »

Silentwings wrote:What is the benefit of 64 bit Spring for windows?
Super Mario wrote:Why is there a 64 bit version for linux if you think there is no benefit of having a 64 bit version of spring?
Well - before I answer, first thing your reply says to me is that you are apparently not able to provide a reason why 64 bit Spring would give any advantage on Windows. I've no wish to demotivate you (maybe you are just doing this for fun) but I asked for a reason and, if you have one, I'm sure that I and others would be interested to hear it.

Afaik the answers to your question are:
(1) 64 bit Windows (these days, at least) has seemless automatic 32 bit compatibility, but not all 64 bit linux distributions do.
(2) Since mingwlibs needs to be recompiled for 64 bit windows, there is much more work in producing a 64 bit Windows compile that a 64 bit linux compile - so in view of (1), and the fact that afaics there is no clear reason to do so, no one has bothered, to set up a 64 bit windows compile.
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: WIP: spring 64 bit for windows.

Post by Super Mario »

abma wrote:
Super Mario wrote:Do you want me to upload the lib, dll that I am using? I can do that.
no, this won't help. try with gdb and set a breakpoint at main/winmain (not sure what you have to set, too)

then you should hopefully see whats wrong, either libs/dlls are totally broken or its a weird init error.

on osx for example you can't mix shared which are compiled with clang and gcc. the same applies if you use the same compiler but for example use different versions of boost compiled in.

thats which makes mxe so good: everything is compiled with the same toolchain.
I had try setting breakpoints, but that doesn't work either, because it crashes the moment that it attempts to start the program.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: WIP: spring 64 bit for windows.

Post by abma »

then you very likely hit incompatibilities of the used dll's.
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: WIP: spring 64 bit for windows.

Post by Super Mario »

abma wrote:then you very likely hit incompatibilities of the used dll's.
Any suggestion on figuring out which one are incompatible?

Edit: Rather then find out which ones are incompatible, is any way for me to use the mxe to test the changes that I make to spring rts to make sure that it runs?
Last edited by Super Mario on 17 Jan 2015, 17:00, edited 1 time in total.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: WIP: spring 64 bit for windows.

Post by abma »

Super Mario wrote:Any suggestion on figuring out which one are incompatible?
sorry, no clue. i fixed it by compile it myself by using mxe.
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: WIP: spring 64 bit for windows.

Post by Super Mario »

Anyways, the code change for spring to run 64 bit is minimal for windows. The necessarily libraries though, are difficult to obtain currently.
Post Reply

Return to “Engine”