The demo/bug1 test program fails on this platform (or at least the one I'm using). the bug seems to be related to the way the shared library is generated, as the test succeed when all .o are statically linked together. In the first case, the _mainthread object defined in thread.cpp is not initialized, and is (obviously) required whenever a thread dies [ call to _parent->Notify(..) line 361 in function execHandler(...) - file thread.cpp last CVS version ]. When statically linked, _mainthread is initialized and the call to Notify(...) succeeds.
I'd like to know if anyone allready had this problem (ie the bug1 error with the same reason) and if there is a solution ? Is this a system configuration issue, or a wrong libtool use ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I gather that your platform perhaps does not create shared libraries which include the "init" segment for loading and initializing constructed objects prior to calling "main()". I actually use that feature extensivily in a number of my projects and for initializing DSO modules, so I am not sure how bad this problem is in your case but it would produce many difficulties beyond just _mainthread in Common C++ programming. Do you use the sun linker or the gnu linker in your toolchain?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I use the sun linker. It seems that the configure script doesn't correctly set the linker options :
I was able to compile successfully the libraries by hand by replacing the 'ld -G' with a simple 'g++ -shared'. OTOH, I still don't know what are the linker options used by g++.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The demo/bug1 test program fails on this platform (or at least the one I'm using). the bug seems to be related to the way the shared library is generated, as the test succeed when all .o are statically linked together. In the first case, the _mainthread object defined in thread.cpp is not initialized, and is (obviously) required whenever a thread dies [ call to _parent->Notify(..) line 361 in function execHandler(...) - file thread.cpp last CVS version ]. When statically linked, _mainthread is initialized and the call to Notify(...) succeeds.
I'd like to know if anyone allready had this problem (ie the bug1 error with the same reason) and if there is a solution ? Is this a system configuration issue, or a wrong libtool use ?
I gather that your platform perhaps does not create shared libraries which include the "init" segment for loading and initializing constructed objects prior to calling "main()". I actually use that feature extensivily in a number of my projects and for initializing DSO modules, so I am not sure how bad this problem is in your case but it would produce many difficulties beyond just _mainthread in Common C++ programming. Do you use the sun linker or the gnu linker in your toolchain?
I use the sun linker. It seems that the configure script doesn't correctly set the linker options :
I was able to compile successfully the libraries by hand by replacing the 'ld -G' with a simple 'g++ -shared'. OTOH, I still don't know what are the linker options used by g++.