win32 build with gcc 4.7.2

win32 build with gcc 4.7.2

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

Moderator: Moderators

Post Reply
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

win32 build with gcc 4.7.2

Post by abma »

i've set up a buildslave with a new gcc.

http://springrts.com/dl/buildbot/defaul ... -g3ae96e7/

can someone please test?

only difference i currently see is that spring.exe is slightly smaller in comparinson to the old gcc (if i remember right gcc 4.4)
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: win32 build with gcc 4.7.2

Post by jK »

OMP?

PS: it's very complicated to get OMP working in cross-compiling. With a win32-native buildslave & gcc-TDM it's just an additional checkbox :)
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: win32 build with gcc 4.7.2

Post by abma »

jK wrote:OMP?
not sure, its just a gentoo buildslave created with your instructions.

for me the build crashes on load
(gdb) run
Starting program: d:\temp\spring\spring.exe
[New Thread 3628.0x828]

Program received signal SIGSEGV, Segmentation fault.
0x0119e019 in _tls_start ()
(gdb) bt
#0 0x0119e019 in _tls_start ()
#1 0x00823bde in __dyn_tls_init@12 ()
#2 0x00000000 in ?? ()
(gdb) break __mingw_CRTStartup
seems to be this problem:
http://old.nabble.com/Re%3A--Mingw-user ... 89555.html
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: win32 build with gcc 4.7.2

Post by abma »

doesn't look like openmp is working:

http://buildbot.springrts.com/builders/ ... logs/stdio
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: win32 build with gcc 4.7.2

Post by jK »

Yeah, I thought you would work on a windows native build.
As already said it is nearly impossible to setup OpenMP in a cross-build env. Cause the official Windows OpenMP source code is incomplete and only TDM-gcc has a working one (don't ask me why their changes aren't merged into the main-trunk).
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: win32 build with gcc 4.7.2

Post by abma »

hmm:

did this on the buildslave:

Code: Select all

emerge layman mercurial
layman -a ohnobinki
echo "source /var/lib/layman/make.conf" >> /etc/portage/make.conf
CHOST=i686-mingw32 ROOT=/usr/i686-mingw32 emerge -va pthreads-win32
USE="openmp cxx -fortran" crossdev i686-mingw32 --env 'EXTRA_ECONF="--disable-sjlj-exceptions --with-dwarf"'
now i get:
Performing Test OpenMP_FLAG_DETECTED - Success
Could NOT find OpenMP (missing: OpenMP_C_FLAGS OpenMP_CXX_FLAGS)


hu?

http://buildbot.springrts.com/builders/ ... logs/stdio

my next try: "cross" compile with wine... :)
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: win32 build with gcc 4.7.2

Post by jK »

Code: Select all

spring_buildbot k # CHOST="i686-mingw32" ROOT=/usr/i686-mingw32/ cmake  /home/jk1/buildslave/latest-boost/build  -DCMAKE_TOOLCHAIN_FILE:STRING="/home/jk1/buildslave/latest-boost/build/buildbot/slave/win32_test.cmake" -DMINGWLIBS=/home/jk1/buildslave/mingwlibs/
...
-- Found Windres: /usr/bin/i686-mingw32-windres
...
-- Building Spring for 32bit environment
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp  
-- using march=i686
-- Enable IMAGE_FILE_LARGE_ADDRESS_AWARE (>2GB memory limit)
very promising
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: win32 build with gcc 4.7.2

Post by abma »

uhh, its close to working.

i only get a static init error:

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
0x6fc899b6 in libstdc++-6!_ZNSsC1EPKcRKSaIcE () from D:\MinGW32\bin\libstdc++-6.dll
(gdb) bt
#0  0x6fc899b6 in libstdc++-6!_ZNSsC1EPKcRKSaIcE () from D:\MinGW32\bin\libstdc++-6.dll
#1  0x00d0b0fb in __static_initialization_and_destruction_0 (__initialize_p=<optimized out>, __priority=<optimized out>)
    at /home/buildbot/slave/full-windows-test/build/rts/lib/assimp/code/ObjFileParser.cpp:57
#2  _GLOBAL__sub_I__ZN6Assimp13ObjFileParser16DEFAULT_MATERIALE ()
    at /home/buildbot/slave/full-windows-test/build/rts/lib/assimp/code/ObjFileParser.cpp:683
#3  0x4016cbe4 in ?? ()
#4  0x0028ff94 in ?? ()
#5  0x77ae9ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
#6  0xfffde000 in ?? ()
#7  0x77ae9ec5 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll
#8  0x004012a0 in mainCRTStartup ()
#9  0xfffde000 in ?? ()
#10 0x00000000 in ?? ()
https://github.com/spring/spring/blob/d ... er.cpp#L57


thats not fixed upstream... jk, can you fix that? (should be the same error as for the weapondefs...)


also pthreadGC2.dll is missing. static link to it or add it to mingwlibs? can do both do that, but not sure what... i guess static linking is fine in this case?!

note: i've disabled automatic builds on the "old" win32 buildslave and switched over to the new one as the buildsetup should be fine now...

about the startup-error: its fixed in mingw-rt but not in gentoo. hopefully they use soon the updated version, see https://bugs.gentoo.org/show_bug.cgi?id=445284
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: win32 build with gcc 4.7.2

Post by abma »

did you compiled gcc with the patch already?
yep! the mingw runtime patch is applied... i just used mingwrt... -2 which contains the patch(es).
also any idea why there is still a desync?
i guess you mean that?
[f=0018810] Error: [DESYNC_WARNING] checksum 310b7cf8 from player 1 (TestMonkey) does not match our checksum c5916539 for frame-number 18810

afaik thats no desync... desync is "sync error... blabla

http://springrts.com/mantis/view.php?id=2838
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: win32 build with gcc 4.7.2

Post by abma »

first working build:

http://springrts.com/dl/buildbot/defaul ... -gcefd4b5/

Spring 91.0.1-554-gcefd4b5 develop (OMP)

but for some reason, omp seems to not work? is there a config setting to enable it?

i tried /cheat /give 1000 armfleas and got at max 1 core to 100%...?!
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: win32 build with gcc 4.7.2

Post by abma »

hmm, applied the patch, but i still don't get more than 100% cpu... any ideas?

" * Applying gomp.patch ..." (<- seems to have worked...)

edit:

my test was wrong, everything seems to work! :-)
Post Reply

Return to “Engine”