Patch-ID# 113817-08
Keywords: c++ 5.5 cc 5.5 s1s8cc
Synopsis: C++ 5.5: Patch for S1S8CC C++ compiler
Date: May/05/2004


Install Requirements: None                      
                      
Solaris Release: 7 8 9

SunOS Release: 5.7 5.8 5.9

Unbundled Product: Sun ONE Studio 8 Compiler Common C++

Unbundled Release: 5.5

Xref: 

Topic: 

Relevant Architectures: sparc

BugId's fixed with this patch: 4306137 4418403 4490609 4546337 4626777 4633191 4654146 4680534 4685154 4707650 4771162 4793373 4805442 4813819 4821792 4825898 4825964 4828018 4828443 4829121 4829197 4829209 4829743 4830398 4831381 4832308 4832354 4832804 4835891 4835927 4836806 4839858 4840194 4842849 4843278 4843654 4844512 4845816 4845881 4845925 4846299 4846427 4846480 4846530 4847745 4848247 4848795 4848935 4850637 4851759 4852754 4853566 4853946 4854179 4854627 4854778 4856138 4856723 4857064 4858441 4859090 4859404 4860689 4864149 4864189 4867794 4867846 4869524 4873908 4875349 4875437 4876793 4878628 4883963 4884516 4884661 4886193 4886310 4888883 4891985 4892932 4894898 4895571 4901279 4902739 4911276 4916333 4918858 4919536 4926147 4927418 4927422 4930287 4930712 4942568 4945288 4945629 4949404 4951542 4951760 4951789 4953520 4953582 4953639 4955571 4956174 4956234 4961377 4965215 4967319 4967333 4969797 4973702 4974366 4984339 4988508 4991454 4999685 5006907 5018343 5019613 5024692

Changes incorporated in this version: 5019613 5018343 5024692

Patches accumulated and obsoleted by this patch: 

Patches which conflict with this patch: 

Patches required with this patch: 112763-04 or greater

Obsoleted by: 

Files included with this patch: 

<install_dir>/SUNWspro/lib/libiostream.so
<install_dir>/SUNWspro/lib/v9/libiostream.so
<install_dir>/SUNWspro/prod/bin/CC
<install_dir>/SUNWspro/prod/bin/ccfe
<install_dir>/SUNWspro/prod/include/CC/Cstd/fstream
<install_dir>/SUNWspro/prod/include/CC/Cstd/fstream.cc
<install_dir>/SUNWspro/prod/include/CC/Cstd/iostream
<install_dir>/SUNWspro/prod/include/CC/Cstd/iostream.h
<install_dir>/SUNWspro/prod/include/CC/Cstd/istream
<install_dir>/SUNWspro/prod/include/CC/Cstd/istream.cc
<install_dir>/SUNWspro/prod/include/CC/Cstd/limits
<install_dir>/SUNWspro/prod/include/CC/Cstd/ostream
<install_dir>/SUNWspro/prod/include/CC/Cstd/ostream.cc
<install_dir>/SUNWspro/prod/include/CC/Cstd/rw/iotraits
<install_dir>/SUNWspro/prod/include/CC/Cstd/sstream
<install_dir>/SUNWspro/prod/include/CC/Cstd/sstream.cc
<install_dir>/SUNWspro/prod/include/CC/Cstd/stdcomp.h
<install_dir>/SUNWspro/prod/include/CC/Cstd/streambuf
<install_dir>/SUNWspro/prod/include/CC/Cstd/streambuf.cc
<install_dir>/SUNWspro/prod/include/CC/Cstd/string
<install_dir>/SUNWspro/prod/include/CC/Cstd/strstream
<install_dir>/SUNWspro/prod/include/CC/Cstd/vector.cc
<install_dir>/SUNWspro/prod/include/CC/rw7/rw/compiler.h
<install_dir>/SUNWspro/prod/include/CC/rw7/rw/xdrstrea.h
<install_dir>/SUNWspro/prod/include/CC/rw7/std/rw/compiler.h
<install_dir>/SUNWspro/prod/include/CC/stlport4/iostream
<install_dir>/SUNWspro/prod/include/CC/stlport4/iostream.h
<install_dir>/SUNWspro/prod/include/CC/stlport4/ostream
<install_dir>/SUNWspro/prod/include/CC/stlport4/ostream.h
<install_dir>/SUNWspro/prod/include/CC/stlport4/stl/_threads.h
<install_dir>/SUNWspro/prod/include/CC/stlport4/using/h/iostream.h
<install_dir>/SUNWspro/prod/include/CC/stlport4/using/h/ostream.h
<install_dir>/SUNWspro/prod/include/CC/stlport4/using/iostream
<install_dir>/SUNWspro/prod/include/CC/stlport4/using/ostream
<install_dir>/SUNWspro/prod/include/CC/stlport4/wrap_std/h/iostream.h
<install_dir>/SUNWspro/prod/include/CC/stlport4/wrap_std/iostream
<install_dir>/SUNWspro/prod/include/CC/stlport4/wrap_std/ostream
<install_dir>/SUNWspro/prod/include/CC4/iostream.h
<install_dir>/SUNWspro/prod/lib/libCrun.a
<install_dir>/SUNWspro/prod/lib/libCstd.a
<install_dir>/SUNWspro/prod/lib/libiostream.a
<install_dir>/SUNWspro/prod/lib/libp/libCrun.a
<install_dir>/SUNWspro/prod/lib/libp/libCstd.a
<install_dir>/SUNWspro/prod/lib/libp/libiostream.a
<install_dir>/SUNWspro/prod/lib/locale/C/LC_MESSAGES/SUNW_SPRO_SC_ccfe.error_help.html
<install_dir>/SUNWspro/prod/lib/locale/C/LC_MESSAGES/SUNW_SPRO_SC_ccfe.msg
<install_dir>/SUNWspro/prod/lib/rw7/CC4/libp/librwtool.a
<install_dir>/SUNWspro/prod/lib/rw7/CC4/librwtool.a
<install_dir>/SUNWspro/prod/lib/rw7/CC4/librwtool.so.2
<install_dir>/SUNWspro/prod/lib/rw7/CC4/librwtool_dbg.a
<install_dir>/SUNWspro/prod/lib/rw7/libp/librwtool.a
<install_dir>/SUNWspro/prod/lib/rw7/librwtool.a
<install_dir>/SUNWspro/prod/lib/rw7/librwtool.so.2
<install_dir>/SUNWspro/prod/lib/rw7/librwtool_dbg.a
<install_dir>/SUNWspro/prod/lib/rw7/std/libp/librwtool.a
<install_dir>/SUNWspro/prod/lib/rw7/std/librwtool.a
<install_dir>/SUNWspro/prod/lib/rw7/std/librwtool.so.2
<install_dir>/SUNWspro/prod/lib/rw7/std/librwtool_dbg.a
<install_dir>/SUNWspro/prod/lib/rw7/std/v9/libp/librwtool.a
<install_dir>/SUNWspro/prod/lib/rw7/std/v9/librwtool.a
<install_dir>/SUNWspro/prod/lib/rw7/std/v9/librwtool.so.2
<install_dir>/SUNWspro/prod/lib/rw7/std/v9/librwtool_dbg.a
<install_dir>/SUNWspro/prod/lib/rw7/v9/libp/librwtool.a
<install_dir>/SUNWspro/prod/lib/rw7/v9/librwtool.a
<install_dir>/SUNWspro/prod/lib/rw7/v9/librwtool.so.2
<install_dir>/SUNWspro/prod/lib/rw7/v9/librwtool_dbg.a
<install_dir>/SUNWspro/prod/lib/v8plus/libCstd.a
<install_dir>/SUNWspro/prod/lib/v8plus/libp/libCstd.a
<install_dir>/SUNWspro/prod/lib/v9/libCrun.a
<install_dir>/SUNWspro/prod/lib/v9/libCstd.a
<install_dir>/SUNWspro/prod/lib/v9/libiostream.a
<install_dir>/SUNWspro/prod/lib/v9/libp/libCrun.a
<install_dir>/SUNWspro/prod/lib/v9/libp/libCstd.a
<install_dir>/SUNWspro/prod/lib/v9/libp/libiostream.a

Problem Description:

5024692 Regression observed in compilation time with C++ 5.5 as compared to F7 & F6U2.
5019613 ostrstream writes NULL terminator into char array
5018343 pointer-to-function template parameter type not handled
 
(from 113817-07)
4878628 missing run-time type information - Undefined  __RTTI symbol
4892932 C++ preprocessor doesn't properly include files w/ same name diff direcortors
4955571 c++ compiler generates erroneous errors
4988508 app crashes at runtime w/ -features=tmplife and inlining, when unwinding stack
4991454 friend declaration not matched to template function in namespace
4999685 Problem with nested template class specialization
5006907 SUNWspro/inventory/v11n1/SPROstl4h does not exist
 
(from 113817-06)
4945288 Sdtimage crash when opening *.tif and *.gif file.
4967333 internal use of clog/__clog in -lC/-liostream should bind to its own copy
4973702 C++ 5.5: cg error (as) : location counter not on doubleword boundary
4984339 libiostream is always linked statically
 
(from 113817-05)
4918858 incorrect use of "typename" in standard headers
4919536 libCstd does not provide enough overloads of operator>() for fpos
4927422 Compilation error about local variable not being defined
4967319 RWBTreeOnDisk insertKeyAndValue function fails with SIGSEGV in strncmp
4969797 ccfe "Assertion:  (../lnk/prepexpression.cc, line 69" upon missing definition
4974366 regression of 113817-04, Error: Different types for "?:" (? and void)
 
(from 113817-04)
4828018 unexpected "could not find match" error
4843654 Template type induction failure
4927418 A "control G" character appears after preprocessing some macro.
4930287 Unable to build isvapp mico
4942568 destructor of compiler generated temp variable called twice
4945629 Symbol referencing error if no optimization, rtti and "-xldscope=symbolic"
4949404 numeric_limits doesn't understand 64 bit integers
4951542 volatile attribute lost during cast
4951760 C++ compiler cannot match overload operator template definition
4951789 incorrect value for numeric_limits::is_modulo
4953520 C++ 5.5 ccfe dumps core due to stack overflow
4953582 stringstream::seekg() does not set the current pointer at the designated positio
4953639 istream::getline reads upto n-2 characters where n is buffer size
4956174 RWBTreeOnDisk find functions fail with SIGSEGV in strncmp
4956234 missing extern C++ overloads for qsort (and bsearch ?)
4961377 illegal operation on operator== with enumeration template instance
4965215 cerr hanging if interupted by a signal
 
(from 113817-03)
4916333 C++ 5.4/5.5: Segmentation Fault in ccfe
4926147 RW Tools.h++ headers broken for Solaris 9
4911276 Incorrect offsetof() in presence of overloaded "&" operator
4930712 Assignment inside the return() seems to return incorrect value
 
(from 113817-02)
4546337 called function cannot be defined inline
4829121 BOOST: Assertion:   (../lnk/init.cc, line 999)
4842849 C++ 5.4 with patch 111715-05 and 111715-06 consumes too much memory.
4857064 Assertion:   (../lnk/v2mangler.cc, line 1172)
4859090 error on function template return type
4859404 C++ 5.3 compiler corrupts object pointer in inline destructor when goto is used.
4860689 QS: fatal runtime error with -xprofile=collect -mt after dlclose()
4864149 QS: C++ compiler fails with specializing error
4867794 QS: Numerical escapes support needed in UCS-2 characters
4867846 QS: Single macro for these USC-2 character and string literal features
4869524 C++ 5.3 and -xO2 : compiler(iropt) error:  connect_labelrefs: undefined label
4873908 explicit specialization not found for default template parameter
4875349 Assertion:  (../lnk/init.cc, line 957) or 999
4875437 C++ 5.6 regression, cannot build fortran compiler
4876793 second argument to deallocate() should be the strings capacity NOT length
4883963 cafe fails to detect ambiguous overloaded functions call
4884516 libCstd vector class does not pass correct size to deallocator
4884661 S1 Studio 8 C++ chooses wrong conversion operators
4886193 CC -xOn -g0 (n>0) does not emit N_SLINE stabs
4886310 Overloading ambiguity error with usage of template function with const vector
4888883 incorrect ambiguity error on conversion to bool
4891985 problem with Partial specialization
4894898 the fixes for bugs 4856138 and 4876793 break binary compatibility
4895571 Invalid version string for ccfe
4901279 Assertion in entrycreator.cc with virtual function in template class
4902739 assertion ../links/prepexpression.cc, line 65 due to missing constructor
 
(from 113817-01)
4840194 CC driver refuses to invoke the linker without .o or .a on link line
4844512 QS: C++ dirver doesn't pass prof_lib.o to linker. Results in unresolved symbols.
4845925 C++ driver does not pass -D_REENTRANT when passed -xopenmp
4850637 String "Forte Developer" is remaining.
4851759 -xlang=f77 problem in K2
4828443 incorrect number of characters outputed after fix of bug 4747931
4825898 C++ runtime performace standard iostream is much slower than classic iostream
4853946 static template class variable must be __global when use -xldscope=symbolic
4856138 libCstd string class does not pass correct size to deallocator
4306137 ccfe allows access to copy constructor of private base class
4680534 cafe fails to detect prohibited implicit pointer conversion
4654146 compiler fails to diagnose a const-correctness violation
4831381 assertion ../lnk/tmplmatchargs.cc in CC 5.4
4835927 OpenMP-CC: enindex_node bad tag error for correct code
4835891 static member functions in derived class collide due to using-declarations
4805442 cpp-perf: compiler should keep track address not taken static variables
4830398 test compiled with -g SF in some cases
4793373 Bug with using-declarations and virtual functions
4836806 CC OpenMP: OpenMP for loop decision variable temporaries at offset zero
4832354 problem with changing the name of template parameter
4832804 Inherited class does not seem to get the default destructor
nobugid_1 C++ OpenMP: In some cases the use of std::coutin a parallel region causes compile error.
4829209 PCH: #error directive is not allowed in viable prefix
4821792 PCH: incorrect viable prefix when declaration used in main source
4829197 PCH: problem in pragma support
4829743 OMP-CC: threadprivate within class message is somewhat inaccurate
4707650 CC -E should emit #1 directive when reading a new file
4846427 C++ OpenMP: Calling inline functions generates spurious leaves.
4813819 OMP-CC: unreference leafs in arg seg
4839858 valid conversion to base class rejected
4846480 Signal 11 with -xdumpmacros
4848247 incorrect result from extracting float type with stdargs
4848795 Assertion error in mangler in 5.3 and 5.4 C++ compiler
4832308 Need to turn off data fragementation for TLS
4633191 bogus warning with exception specification
4847745 implicitly declared operator= is not created
4845881 QS: Macro expansion interferes with STLport  headers.
4843278 PCH: C++ detects error on the valid code
4825964 PCH: a variable defined in .h file is not found by C++
4848935 PCH: string following #pragma ident should be ignored in the viable prefix
4685154 Illegal use of '<>' in primary template declaration not reported by ccfe
4845816 QS: Need to allow symbol scoping to the template class definition.
4852754 +w yields warnings in the standard library
4854627 build failure due to new template warning
4846530 QS: Need capacity to force references to have global linker scoping
4853566 Strange conditional expression (?:) bug (core at runtime)
4626777 template partial specialization missed as friend
4858441 C++ 5.6 fails to build with math library 111721-04
4856723 OMP-CC: run time segment fault using cout and -xipo
4771162 OMP-CC: invalid atomic expression gives incorrect message
4854778 111685-14: regression: CC fails to compile operator declared forward in template
4854179 modena testcase c1120403 failed when compile with Nightly and K2 patch compiler
4418403 Using address of template function must instantiate
4490609 C++ 5.1, 5.2 & 5.3 initializing problem.
nobugid_2 Assertion from libC.so when exception is thrown by old compat=4 code.
4864189 numeric_limits denorm_min incorrectly returns zero
4846299 111685-13: destructor called when there was no constructor while unwinding stack

Patch Installation Instructions:
--------------------------------
For Solaris 7-9 releases, refer to the man pages for instructions on
using 'patchadd' and 'patchrm' scripts provided with Solaris.
Any other special or non-generic installation instructions should be
described below as special instructions.  The following example
installs a patch to a standalone machine:
 
        example# patchadd /var/spool/patch/106326-01
 
The following example removes a patch from a standalone system:
 
        example# patchrm 104945-02
 
For additional examples please see the appropriate man pages.

Special Install Instructions:
-----------------------------
 
If you are compiling or linking programs or shared libraries
using -xprofile=collect, it is strongly recommended that you also
install the most recent version of the following patches for the
corresponding compiler products shown below:
 
	product	    patch
	-------	    -----
	C   5.5	    112760-02 or later
	C++ 5.5	    113817-02 or later
	F95 7.1	    112762-02 or later
 
Patch 112763-03 or later provides a new object file "prof_tsd.o" which
exports global routines required at runtime for correct execution
of MT applications that dynamically link with shared libraries
that have been compiled and linked with -xprofile=collect.
In order to pass "prof_tsd.o" to the linker when a program
is linked with -xprofile=collect, changes to the cc, CC, and
f95 drivers are required.  These driver changes are provided
in the above patches to the C, C++, and F95 products.
 
To test whether you have installed the patches correctly, use the
following test case, which consists of a C++ source file "main.cc",
two C source files "test.c" and "shared.c", and a shell script "try.sh"
which compiles and links "main.cc" and test.c" into a profiled program
"main", and also compiles and links "shared.c" into a profiled shared
library "shared.so":
 
    % cat main.cc
 
    extern "C" test_();
 
    int
    main()
    {
	test_();
	return 0;
    }
 
    % cat test.c
 
    #include <thread.h>
    #include <dlfcn.h>
    #include <link.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <errno.h>
    static void
    dlerror_message(const char *fn)
    {
	const char *msg = dlerror();
	fprintf(stderr, "%s() failed", fn);
	if (msg != NULL)
	{
	    fprintf(stderr, ": %s", msg);
	}
	fprintf(stderr, "\n");
    }
    void *
    foo(void* cookie)
    {
	void *hndl = dlopen("./shared.so", RTLD_NOW);
	if (hndl == NULL)
	{
	    dlerror_message("dlopen");
	}
	else /* hndl != NULL */
	{
	    void *f = dlsym(hndl, "function_f");
	    if (f == NULL)
	    {
		dlerror_message("dlsym");
	    }
	    else
	    {
		((void(*)(void))f)();
	    }
	    dlclose(hndl);
	}
	return NULL;
    }
    int test_()
    {
	thread_t tid;
	thr_create(NULL, 0, foo, NULL, THR_BOUND|THR_NEW_LWP, &tid);
	thr_join(tid, NULL, NULL);
	printf("end of test\n");
	return 0;
    }
 
    % cat shared.c
 
    #include <stdio.h>
    void
    function_f(void)
    {
	printf("Here's function f\n");
    }
 
To compile and execute the installation test case, use
the following shell script:
 
    % cat try.sh
    #!/bin/sh
    set -x
    cc -O -mt -xprofile=collect -KPIC shared.c -G -o shared.so \
    && cc -O -mt -xprofile=collect test.c -c \
    && CC -O -mt -xprofile=collect main.cc test.o -o main \
    && rm -rf main.profile \
    && ./main \
    && ls main.profile
 
There are four (4) installation cases to consider.
 
Case 0 (no patches installed):
------------------------------
 
If neither patch 112763-03 or later (Common Compiler S1S8CC) nor
patch 113817-02 or later (C++ 5.5) has been installed correctly,
both the program "main" and the shared library "shared.so" will
compile and link without errors, but the process will abort at
runtime with a Segmentation Fault:
 
    % sh try.sh
    + cc -O -mt -xprofile=collect -KPIC shared.c -G -o shared.so
    + cc -O -mt -xprofile=collect test.c -c
    + CC -O -mt -xprofile=collect main.cc test.o -o main
    + rm -rf main.profile
    + ./main
    Segmentation Fault - core dumped
 
Case 1 (missing C++ 5.5 patch):
-----------------------------
 
If patch 112763-03 or later (Common Compiler S1S8CC) has been installed
correctly, but patch 113817-02 or later (C++ 5.5) has not, both
the program "main" and the shared library "shared.so" will
compile and link without errors, but the shared library
"shared.so" will print a warning message at runtime and will
run with MT profile collection disabled.
 
    % sh try.sh
    + cc -O -mt -xprofile=collect -KPIC shared.c -G -o shared.so
    + cc -O -mt -xprofile=collect test.c -c
    + CC -O -mt -xprofile=collect main.cc test.o -o main
    + rm -rf main.profile
    + ./main
    profile feedback: dlsym() could not find function __new_profile_thread_list_ops()
    warning: MT profile collection disabled for object file "/home/joe/bugs/4860689/tmp/shared.o"
    Here's function f
    end of test
    + ls main.profile
    feedbin         feedbin.lock
 
Note that in this case, despite the runtime warning message, the
feedback file main.profile/feedbin was generated.   In an actual MT
application, some of the profile data in the feedback file may be
inaccurate, due to concurrent attempts to update profile counters
by multiple threads.  If multiple threads simultaneously attempt to
close the same profiled shared library by calling dlclose(3DL), the
contents of the feedback file may be corrupted or lost.
 
Case 2 (missing Common Compiler S1S8CC patch):
----------------------------------------------
 
If patch 113817-02 or later (C++ 5.5) has been installed correctly
but patch 112763-03 or later (Common Compiler S1S8CC) has not, the program
"main" will fail to link correctly.  A message from the driver (CC)
will indicate that the required object file "prof_tsd.o" is missing:
 
    % sh try.sh
    + cc -O -mt -xprofile=collect -KPIC shared.c -G -o shared.so
    + cc -O -mt -xprofile=collect test.c -c
    + CC -O -mt -xprofile=collect main.cc test.o -o main
    CC: Cannot find /opt/SUNWspro/prod/lib/prof_tsd.o
 
Case 3 (both C++ 5.5 and Common Compiler S1S8CC patch installed correctly):
---------------------------------------------------------------------------
 
If patch 112763-03 or later (Common Compiler S1S8CC) and patch 113817-02
or later (C++ 5.5) have both been installed correctly, both the
program "main" and the shared library "shared.so" will compile,
link, and execute correctly, producing a profile feedback file
"main.profile/feedbin":
 
    % sh try.sh
    + cc -O -mt -xprofile=collect -KPIC shared.c -G -o shared.so
    + cc -O -mt -xprofile=collect test.c -c
    + CC -O -mt -xprofile=collect main.cc test.o -o main
    + rm -rf main.profile
    + ./main
    Here's function f
    end of test
    + ls main.profile
    feedbin         feedbin.lock

README -- Last modified date:  Wednesday, May 5, 2004

