gml and thread-local storage

gml and thread-local storage

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
User avatar
ILMTitan
Spring Developer
Posts: 410
Joined: 13 Nov 2004, 08:35

gml and thread-local storage

Post by ILMTitan »

I'm on windows compiling using mingw and scons.

I'm getting the error:

Code: Select all

In file included from rts/lib/gml/gml.h:16,
                 from rts/Rendering/GL/myGL.h:11,
                 from rts\System\LoadSaveHandler.cpp:7:
rts/lib/gml/gmlcls.h: At global scope:
rts/lib/gml/gmlcls.h:70: error: thread-local storage not supported for this target
In file included from rts/lib/gml/gml.h:16,
                 from rts/Rendering/GL/myGL.h:11,
                 from rts/Game/UI/MouseCursor.h:6,
                 from rts/Game/UI/MouseHandler.h:11,
                 from rts\System\MouseInput.cpp:15:
rts/lib/gml/gmlcls.h: At global scope:
rts/lib/gml/gmlcls.h:70: error: thread-local storage not supported for this target
My gcc is version 3.4.5. I looked through the SConstruct and rts.py and still have no clue how this problem started.
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: gml and thread-local storage

Post by zerver »

You need GCC 4.3.0 or higher to compile now because the multithreading library uses thread local storage. I'd recommend 4.3.1 since 4.3.0 seems bugged.

Edit: We need to change the mingw download instructions on this website so it points to a version that works :)
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: gml and thread-local storage

Post by imbaczek »

4.3.1 is also bugged, but, what's worse, hasn't yet been released even in alpha version.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: gml and thread-local storage

Post by hoijui »

but imbaczek, you told me that you were able to compile with 4.3.0.

i also came around the lack of instructions to compile with MinGW 4. I wanted to do it and then actualize the wiki, but i also get errors still, though i seem to be close.

If anyone succeeded, pls actualize the Wiki!
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: gml and thread-local storage

Post by KDR_11k »

Compiled fine for me, I think I'm using 4.2.1
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: gml and thread-local storage

Post by hoijui »

hmm.. well if you can, could you please explain how you setup everything? i guess it is already a while back, hm? :/
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: gml and thread-local storage

Post by KDR_11k »

I don't even remember how I got this mess to work but I spliced some testing build of GCC 4.2.1 into MinGW 3.4.5 (if I remember the version numbers right).
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: gml and thread-local storage

Post by rattle »

MingW 5.4.1, GCC 4.3.0
I'm able to compile again... or not.
Interface.cpp:(.text+0x451): undefined reference to `___gxx_personality_sj0'
build\rts\System\AutohostInterface.o:AutohostInterface.cpp:(.text+0x49c): undefined reference to `__Unwind_SjLj_Register'
build\rts\System\AutohostInterface.o:AutohostInterface.cpp:(.text+0x4fd): undefined reference to `__Unwind_SjLj_Unregister'
build\rts\System\AutohostInterface.o:AutohostInterface.cpp:(.text+0x52b): undefined reference to `__Unwind_SjLj_Resume'
build\rts\System\AutohostInterface.o:AutohostInterface.cpp:(.text+0x55f): undefined reference to `___gxx_personality_sj0'
build\rts\System\AutohostInterface.o:AutohostInterface.cpp:(.text+0x572): undefined reference to `__Unwind_SjLj_Register'
build\rts\System\AutohostInterface.o:AutohostInterface.cpp:(.text+0x603): undefined reference to `__Unwind_SjLj_Unregister'
build\rts\System\AutohostInterface.o:AutohostInterface.cpp:(.text+0x651): undefined reference to `__Unwind_SjLj_Resume'
build\rts\System\AutohostInterface.o:AutohostInterface.cpp:(.text+0x73a): undefined reference to `___gxx_personality_sj0'
build\rts\System\AutohostInterface.o:AutohostInterface.cpp:(.text+0x74d): undefined reference to `__Unwind_SjLj_Register'
build\rts\System\AutohostInterface.o:AutohostInterface.cpp:(.text+0x7e3): undefined reference to `__Unwind_SjLj_Unregister'
build\rts\System\AutohostInterface.o:AutohostInterface.cpp:(.text+0x831): undefined reference to `__Unwind_SjLj_Resume'
After some googling it looks like that this is an issue with my gcc libs (*crt and some others). Though I have no clue right now :P. Any ideas?

edit: using gcc 4.2.1 seems to work
Last edited by rattle on 25 Jun 2008, 01:17, edited 2 times in total.
User avatar
ILMTitan
Spring Developer
Posts: 410
Joined: 13 Nov 2004, 08:35

Re: gml and thread-local storage

Post by ILMTitan »

Using those packages I too get those errors.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: gml and thread-local storage

Post by rattle »

build\unitsync\tools\unitsync\test\test.o:test.cpp:(.text+0x510): undefined reference to `_InitArchiveScanner@0'
...great, unitsync fails too.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: gml and thread-local storage

Post by imbaczek »

mingw g++ 4.2 and 4.3 are incompatible; that said, it links for me. I've got runtime crashes tho:

Code: Select all

(gdb) thr a a bt

Thread 2 (thread 2696.0xf08):
#0  0x7c90eb94 in ntdll!LdrAccessResource ()
   from C:\WINDOWS\system32\ntdll.dll
#1  0x7c90e9ab in ntdll!ZwWaitForMultipleObjects ()
   from C:\WINDOWS\system32\ntdll.dll
#2  0x76b3af21 in timeGetTime () from C:\WINDOWS\system32\winmm.dll
#3  0x7c80b683 in KERNEL32!GetModuleFileNameA ()
   from C:\WINDOWS\system32\kernel32.dll
#4  0x00000000 in ?? ()

Thread 1 (thread 2696.0xb54):
#0  0x00000000 in ?? ()
#1  0x006a6f1f in _fu531____glewUseProgram ()
#2  0x00000000 in ?? ()
edit: missed unitsync, fails here too.
edit2: is it me, or has InitArchiveScanner disappeared completely?
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Re: gml and thread-local storage

Post by rattle »

Is that why spring ignores everything in the mods folder?
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: gml and thread-local storage

Post by Tobi »

InitArchiveScanner has been deprecated (and a no-op) since like 0.74 or so. Don't remember whether it was actually removed later on or not, could very well be.
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: gml and thread-local storage

Post by zerver »

You should be able to use older versions of GCC again, since I have removed the TLS requirement if multithreading is disabled (which it is by default). Define _GML_ to enable multithreading.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Re: gml and thread-local storage

Post by LordMatt »

Tobi wrote:InitArchiveScanner has been deprecated (and a no-op) since like 0.74 or so. Don't remember whether it was actually removed later on or not, could very well be.
Auswaschbar on WebSVN wrote:* removed InitArchiveScanner() from unitsync
Post Reply

Return to “Engine”