#16 Port to SunPro CC 5.7 compiler

closed-accepted
None
5
2005-11-17
2005-11-17
Gail Baker
No

Here a patch to the current 5.0 CVS Branch (not the
HEAD) adding support for the SunPro CC compiler version
5.7 (Sun Studio 10).

The patch consist of 2 files. The patch file for the
existing STLport files and a new file for the unit test
build build/test/unit/CC.mak

The port required changes to three areas:

1) Build files:

1.1) Simple porting of the compiler options in CC.mak
files.

1.2) I also changed the depend target by adding a
compiler specific target. This target allows the
STLport include files to be linked correctly to allow
the SunPro compiler to find them.

2) STLport include files changes:

2.1) stlport/cstdlib: Updated to allow the compiler to
find abs() and div().

2.2) stlport/config/stl_sunpro.h: Disabled
_STLP_LINK_TIME_INSTANTIATION since this nolonger works
with current files. The issue here is that a number of
defines that are required in the c versions of the
files use defines that are undefed at the end of the
include. So, when the compiler finally compiles the c
version at link time the defines are lost and the files
don't compile. Also added a minor change to allow files
that are compiled with cc to include stl_sunpro.h
without bailing out.

2.3) stlport/stl/_bvector.h: Added stl/_range_errors.h
required by an exception that can be called.

2.4) stlport/stl/_cmath.h: Changed to pull all math
functions from std namespace for SunPro compiles only.

2.5) stlport/stl/_rope.c: Removed extra semi-colons.

2.6) stlport/stl/_rope.h: Sunpro compiler had a problem
with the __ROPE_DEPTH_SIZE macro doing an addition.
Changed to a fixed value instead.

3) Unit test file changes:

3.1) test/unit/fstream_test.cpp: Added SunPro compile
to the list of compilers that don't use the
DO_CUSTOM_FACET_TEST.

3.2) test/unit/string_test.cpp: Added Sun UI Threads to
the list of supported thread types in the test.

3.3) test/unit/valarray_test.cpp: The compiler was
having trouble finding abs(). Added a "using std::abs"
for the SunPro compiler which solved the problem.

3.4) test/unit/cppunit/cppunit_mini.h: Added additional
using statements for the str* commands.

3.5) test/unit/cppunit/test_main.cpp: Added "using
namespace std;" for the SunPro compiler.

I've built STLport with these changes on Sun Solaris
using the SunPro CC 5.7 compiler, Linux using gcc 3.2.2
, and Win2K using VC++ 7.1. All compiled succesfully.

If you have any questions just let me know.

Gail

Discussion

  • Gail Baker
    Gail Baker
    2005-11-17

    Patch file based off the current STLPORT_5_0 branch

     
  • Gail Baker
    Gail Baker
    2005-11-17

    New build/test/unit/CC.mak file

     
    Attachments
    • assigned_to: nobody --> complement
     
    • status: open --> closed
     
  • Logged In: YES
    user_id=615813

    Done. Thanks.

    What about unit tests status with SunPro 5.7 (Solaris? what
    version?)?

     
    • status: closed --> closed-accepted
     
  • Gail Baker
    Gail Baker
    2005-11-17

    Logged In: YES
    user_id=1339151

    Sun Solaris 2.8:
    Sun Studio 10:
    CC 5.7:

    --------------------------------------------
    CC/shared/stl_unit_test:

    ../../../test/unit/mvctor_test.cpp(839) :
    CPPUNIT_ASSERT(MovableStruct::nb_destruct_call == 7);

    In this test case the destructor is called 3 time instead of
    7 so I'm not sure if this is a problem with the test or an
    error in the code?
    --------------------------------------------
    CC/shared-g/stl_unit_test:

    ../../../test/unit/mvctor_test.cpp(839) :
    CPPUNIT_ASSERT(MovableStruct::nb_destruct_call == 7);

    Same issue as in the previous test.
    --------------------------------------------
    CC/shared-stlg/stl_unit_test:

    ../../stlport/stl/debug/_debug.c(518): STL assertion failure
    : __next && __next->_Owner() == __l

    Abort(coredump)

    I haven't traces this problem back to see what's going on here.

    Should I submit a patch for the STATUS file?

    Thanks,
    Gail