Menu

demo/bug1 on solaris 2.7/gcc 2.95.2

Porting
2000-10-23
2000-11-11
  • Didier Cassirame

    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  ?  

     
    • David Sugar

      David Sugar - 2000-11-06

      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?

       
      • Didier Cassirame

        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++.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.