GCC and Sun Studio 12 compatibility ?

What is the level of compatibility between g++ for SPARC systems and the Sun Studio C++ compilers for SPARC ?
If I build a shared library using g++ for SPARC is it safe for objects built with the Sun C++ compilers to use these shared libraries ?

They are completely incompatible, there is no way you can mix them.

Similar Messages

  • Confused between Netbeans and Sun Studio Enterprise

    Hi all,
    Acually I am very confused between Netbeans and Sun Studio Enterprise/Creator.
    Why sun did not concentrate on one IDE as Microsoft is doing with Visual Studio?
    Now, I do not know what to learn....Netbeans or Sun Studio !!!
    What make me more confused is that both are supported oficially by Sun. And both are free for SDN members!!!!!
    So, what is the difference???!!!
    regards

    I tried it back when it was called Forte, and it seamed pretty
    identical to netbeans. the only difference was that Forte could
    only be used for personal use without a license.

  • BOOST and Sun Studio 10

    C++ 5.7 in Sun Studio 10 now compiles most of BOOST 1.32.0, when the compiler is updated with the current patches from
    http://developers.sun.com/prodtech/cc/downloads/patches/ss10_patches.html
    Two known bugs remain, and should be fixed in a future patch.
    Some of the BOOST compilation failures are due to errors in the BOOST configuration for Sun C++. We have submitted corrections to the BOOST site, and we hope all of them will be included in version 1.33.0.
    In the mean time, you can apply the following corrections to version 1.32.0:
    1. Get this correction from the BOOST bug tracker:
    http://sourceforge.net/tracker/index.php?func=detail&aid=1155439&group_id=7586&atid=107586
    2. Also get this correction from the BOOST bug tracker:
    http://sourceforge.net/tracker/index.php?func=detail&aid=1165980&group_id=7586&atid=107586
    3. Edit build.sh according to these diffs: *** build.sh.orig     Fri Mar 18 06:09:44 2005
    --- build.sh     Fri Mar 18 06:41:07 2005
    *** 150,160 ****
          sunpro)
    !     if test -r /opt/SUNWspro/bin/cc ; then
              BOOST_JAM_TOOLSET_ROOT=/opt/SUNWspro/
          fi
    !     if test -r $BOOST_JAM_TOOLSET_ROOTbin/cc ; then
    !         export PATH=$BOOST_JAM_TOOLSET_ROOTbin:$PATH
          fi
          BOOST_JAM_CC=cc
    --- 150,161 ----
          sunpro)
    !     if test -z "${BOOST_JAM_TOOLSET_ROOT}" -r /opt/SUNWspro/bin/cc ; then
              BOOST_JAM_TOOLSET_ROOT=/opt/SUNWspro/
          fi
    !     if test -r ${BOOST_JAM_TOOLSET_ROOT}bin/cc ; then
    !         PATH=${BOOST_JAM_TOOLSET_ROOT}bin:${PATH}
    !         export PATH
          fi
          BOOST_JAM_CC=cc
          ;;

    Here is a small but complete test program, together with the command line of the compiler. This is the patch level of the compiler we use here:
    CC: Sun C++ 5.7 Patch 117830-02 2005/03/30Test program (graph_test.cpp):
    #include <iostream>                  // for std::cout
    #include <utility>                   // for std::pair
    #include <algorithm>                 // for std::for_each
    #include <boost/graph/graph_traits.hpp>
    #include <boost/graph/adjacency_list.hpp>
    #include <boost/graph/dijkstra_shortest_paths.hpp>
    using namespace boost;
    int main(int,char*[])
      enum { A, B, C, D, E, N };
      const int num_vertices = N;
      const char* name = "ABCDE";
      typedef adjacency_list<vecS, vecS, bidirectionalS> Graph;
      Graph g(num_vertices);
      typedef graph_traits<Graph>::vertex_iterator vertex_iter;
      std::pair<vertex_iter, vertex_iter> vp;
      vp = vertices(g); /** Error **/
      return 0;
    }Command line:
    CC -I./include/boost -v graph_test.cpp
    ###     command line files and options (expanded):
    ### -I/export/rpms/401/tools/inst/include/boost -v graph_test.cpp
    ### CC: Note: NLSPATH = /export/home2/SUNs10/SUNWspro/prod/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/export/home2/SUNs10/SUNWspro/prod/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
    /export/home2/SUNs10/SUNWspro/prod/bin/ccfe -y-o -ygraph_test.o -I/export/rpms/401/tools/inst/include/boost -y-fbe -y/export/home2/SUNs10/SUNWspro/prod/bin/fbe -y-xarch=generic -y-verbose -O0 -ptf /tmp/00299%1.%2 -ptx /export/home2/SUNs10/SUNWspro/prod/bin/CC -ptk "-I/export/rpms/401/tools/inst/include/boost -v  -xs " -D__SunOS_5_8 -D__SUNPRO_CC=0x570 -Dunix -Dsun -Dsparc -D__sparc -D__sparcv8plus -D__unix -D__sun -D__BUILTIN_VA_ARG_INCR -D__SVR4 -D__SUNPRO_CC_COMPAT=5 -D__SUN_PREFETCH -xdbggen=no%dwarf2+stabs -y-s -xdbggen=incl -y-xmemalign=8i -I-xbuiltin -xldscope=global -instlib=/export/home2/SUNs10/SUNWspro/prod/lib/libCstd.a -I/export/home2/SUNs10/SUNWspro/prod/include/CC/Cstd -I/export/home2/SUNs10/SUNWspro/prod/include/CC -I/export/home2/SUNs10/SUNWspro/prod/include/CC/rw7 -I/export/home2/SUNs10/SUNWspro/prod/include/cc -y-comdat graph_test.cpp -s /tmp/ccfe.00299.0.s >&/tmp/ccfe.00299.1.err
    rm /tmp/ccfe.00299.0.s
    /export/home2/SUNs10/SUNWspro/prod/bin/stdlibfilt -stderr </tmp/ccfe.00299.1.err
    "graph_test.cpp", line 22: Error: Could not find a match for boost::vertices<boost::T>(boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS, boost::no_property, boost::no_property, boost::no_property, boost::listS>) needed in main(int, char**).
    1 Error(s) detected.
    rm /tmp/ccfe.00299.1.err
    rm graph_test.oAny help would be greatly appreciated! If you need any more information, please let me know.
    Thanks in advance,
    Andreas

  • Error building using Coverity Prevent and Sun Studio 11

    We recently started using a static code-checking tool called Coverity Prevent. When we first started using it, we were on a very old verison of the Forte Compiler (Forte 6 update 2). Builds completed fine through Prevent. In the last month, we've upgraded to Sun Studio 11 (can't go to 12 because we're using Solaris 8). Now I can't get a build to run completely through Prevent. Prevent has a preprocessor that's a bit more strict than most compilers. I'm getting the following errors in a lot of places.
    "/vobs1/cots/ForteDeveloper/SUNWspro/prod/include/CC/rw7/rw/defs.h", line 316: error #101:
    "istream" has already been declared in the current scope
    class _RWCLASSTYPE istream;
    ^
    "/vobs1/cots/ForteDeveloper/SUNWspro/prod/include/CC/rw7/rw/defs.h", line 317: error #101:
    "ostream" has already been declared in the current scope
    class _RWCLASSTYPE ostream;
    ^
    "/vobs1/cots/ForteDeveloper/SUNWspro/prod/include/CC/rw7/rw/defs.h", line 318: error #101:
    "ios" has already been declared in the current scope
    class _RWCLASSTYPE ios;
    ^
    "/vobs1/cots/ForteDeveloper/SUNWspro/prod/include/CC/Cstd/iostream.h", line 4: error #101:
    "istream" has already been declared in the current scope
    using std::istream;
    ^
    "/vobs1/cots/ForteDeveloper/SUNWspro/prod/include/CC/Cstd/iostream.h", line 9: error #101:
    "ostream" has already been declared in the current scope
    using std::ostream;
    ^
    I've googled a bit, and most of the solutions involve someone mistakenly putting "using namespace std" in a header file. I can't find any case where we do this in our code. One specific file that is failing includes one local header, and that header only includes <fstream.h> and <rw/cstring.h>. It seems like RW and std are conflicting with each other somewhere, but I can't figure out where. The compiler command looks like:
    /vobs1/cots/ForteDeveloper/SUNWspro/bin/CC -xildoff -instances=static -mt -g -fsimple
    -xlibmil -xO3 -xtarget=ultra -DUSE_VFU_LL_C -DXRT -KPIC -library=rwtools7_std -x
    libmopt -DRW_MULTI_THREAD -I/vobs1/cots/rogue/workspaces/SOLARIS7/SUNPRO50/12d -c c4i_file_stream.cpp
    We're still pointing at an older version of RW for the DBTools libraries (rebuilt using the compiler's internal Tools++), but we're using the compiler's internal Tools++ headers and libraries for everything else.

    It sounds like Prevent is not processing the #include directives, or possibly some other preprocessing directives, the same way as the Sun C++ compiler.
    The C++ Users Guide documents how #include directives are processed, and in particular the order in which directories are searched.
    [http://docs.sun.com/app/docs/doc/819-5267/bkaso?a=view]
    If Prevent provides similar documentation, you can compare the docs. If you see a difference, maybe Prevent has some options to control the behavior to make it work like the Sun compiler.
    Note: The CC driver passes some -I directives to the C++ compiler proper (ccfe) that do not appear on the CC command line that you write. The exact -I options depend on other options on the command line. Possibly Prevent is not using the same set of implicit -I directives.
    If you can't resolve the #include directive issue, you might need to talk to Coventry tech support.
    We at Sun are happy to work with 3rd-party vendors to help them get their products working correctly on Sun.

  • Difference between Sun Studio 12u1 and Sun Studio Express...

    Hi,
    on my open solaris:
    SunOS opensolaris 5.11 snv_111b i86pc i386 i86pc
    I've installed Sun Studio Express to get the C/C++ compilers. What is the difference with the Sun Studio 12 suite (which is about 200 MB larger than the Express one)? Also I saw there are patches for Sun Studio 12 (last one Jul 20 2009) that might have a fix for a problem I just reported. How can I install such patches?
    Patch: http://sunsolve.sun.co.jp/search/document.do?assetkey=1-21-126498-14-1
    Cheers, Fons.

    Studio Express is a pre-release or beta release. Some features may be missing or not functional. It cannot be patched. It can be replaced by a later release.
    Sun Studio 12 update 1 is an actual, supported release, later than the most recent (as of this date) Studio Express. If you install SS12u1 from packages (using the installer GUI for example), you can download and install patches for it as they become available. (Installations from a tar file cannot be patched; they can be replaced.)

  • Bundled Tomcat File Structure and Sun Studio Enterprise 8

    I am having trouble using form authorization with Enterprise 8,
    the bundled Tomcat and MySql.
    Request clarification on what tomcat-users.xml is used by Ent 8.
    I see the following in my configuration:
    1) apache-tomcat-5.5.15-embed/conf/tomcat-users.xml
    2) apache-tomcat-5.5.15/conf/tomcat-users.xml
    3) C:\Program Files\Sun\jstudio_ent8\ide\enterprise1\jakarta-tomcat-5.5.7\conf\tomcat-users.xml
    4) C:\Document and Settings\motel\.jstudio\Ent8\jakarta-tomcat-5.5.7_base\conf\tomcat-users.xml
    I assume the first two are some type of windows cached.
    Further, #3 I assume is initial or default tomcat-user file.
    So is #4 the file that I want to edit so that my IDE can work with Tomcat?
    Thank you for any help and guidance,
    Craig

    I assume the first two are some type of windows cached.
    Further, #3 I assume is initial or default tomcat-user file.I would agree with you; regarding the first two files, it is not clear how they came about since they don't seem to be in either the ide directory or ide-user directory; and also because the directories seem to point to a different version of tomcat, namely 5.15 instead of the ide-bundled 5.7... It is even possible that the first two are not related to JSE ide at all...
    Regarding 3 and 4, your guess is right; 3 is the initial installation directory. This directory is not used by the ide at all for actually working with the tomcat server; this is because the ide-userdir is customizable via the command-line. You can have several user directories at the same time and switch between them by running './runide.exe -userdir <this-sessions-user-dir>'. Naturally the different sessions cannot use the same tomcat server since that would lead to conflicts. So the ide first copies the server installation to the current user directory and then runs the tomcat from there.

  • INFORMIX 9 and SUN Studio Enterprise Configuration

    Attention all informix to java programmers
    Architecture regulations obliges the use of the J2EE platform. Sun ONE
    Application server 7 is the appserver to use and Informix Dynamic Server
    9.22 the database. This is not the most mainstream combination.
    Especially since Sun ONE doesn't support the Informix database.
    It turned out that you can use this combination, but you need to apply
    some workarounds.
    First you need to know which properties to set for the datasource. This
    is the list:
    IfxIFXHOST=foo.bar.com
    PortNumber=1527
    User=Krusty
    Password=L3k4N1%j
    ServerName=foobarifx_ol
    DatabaseName=testdb
    The values are examples. Be careful of the syntax. The first letter
    should be a capital!
    The second adjustment is a little harder. Because Informix syntax isn't
    fully ANSI92 compliant (it doesn't support right joins),
    the persistence manager of Sun ONE generates illegal SQL when
    fulfilling it's CMP responsabilities.
    To solve this problem you need to add a property file to the
    appserv-cmp.jar.
    This lib is part of the Sun ONE server libraries and you can find it at
    {Sun ONE INSTALLDIR}/lib.
    The file name should be "INFORMIX DYNAMIC SERVER.properties" and it
    should go under the folder
    com/sun/jdo/spi/persistence/support/sqlstore/database.
    This is the content of the file:
    FOR_UPDATE=for update
    LEFT_JOIN=LEFT OUTER JOIN
    RIGHT_JOIN=,
    RIGHT_JOIN_PRE=outer
    IS_NULL=IS NULL
    IS_NOT_NULL=IS NOT NULL
    RTRIM=trim (trailing \" \" from
    RTRIM_POST=)
    QUOTE_CHAR_START=
    QUOTE_CHAR_END=
    Having this information up front would have saved me many hours of frustration. I hope anyone else using Informix 9 and J2EE finds this helpful.

    i follow this steps , but i still have problems now i got this exception
    [19/Jul/2005:20:17:53] INFO ( 3812): CORE3282: stdout: java.sql.SQLException: com.informix.asf.IfxASFException: Attempt to connect to database server (srvr_cannes_tcp) failed.
    i think is the ServerName variable did you know which is the problem; i'm still frustrated

  • Fedora 7 and Sun Studio 12

    Not work Analyzer(Running "/opt/sun/sunstudio12/prod/bin/collect -d /usr/local/sunworkspace/Fractal_1/nbproject/private/experiments -o test.3.er -A on -r race,deadlock /usr/local/sunworkspace/Fractal_1/dist/Debug/fractal" in /usr/local/sunworkspace/Fractal_1
    WARNING: Target `/usr/local/sunworkspace/Fractal_1/dist/Debug/fractal' is not instrumented for datarace detection;
    reported datarace data may be misleading
    Unknown Redhat Linux version
    Fedora release 7 (Moonshine)
    WARNING: Linux-32-bit, 2 CPUs, RH_UNK system localhost is not supported by the Performance tools.
    WARNING: Data collection may fail: system is not properly configured or is unsupported.
    Creating experiment database /usr/local/sunworkspace/Fractal_1/nbproject/private/experiments/test.3.er ...
    Run failed. Exit value 139. )
    , not correct termination example program
    int counter=0;
    void pancake(void arg) {
    counter++;
    printf("Thread %u is number %d\n",
    pthread_self(),counter);
    } main() { int i; pthread_t tid;
    for (i=0;i<10;i++)
    pthread_create(&tid,NULL,pancake,NULL);
    Output - 4 pthread!!!
    What i do not correct??? I think, that Fedora is like RedHat - and this tools (SunStudio12) - must work
    Thank's

    &#1057;&#1087;&#1072;&#1089;&#1080;&#1073;&#1086; &#1052;&#1072;&#1082;&#1089;&#1080;&#1084;! - &#1079;&#1085;&#1072;&#1095;&#1080;&#1090;&#1100; &#1085;&#1077; free SunStudio 12, &#1078;&#1072;&#1083;&#1082;&#1086; - &#1093;&#1086;&#1088;&#1086;&#1096;&#1080;&#1081; &#1087;&#1088;&#1086;&#1076;&#1091;&#1082;&#1090; - &#1101;&#1090;&#1086; &#1080; &#1087;&#1086;&#1085;&#1103;&#1090;&#1085;&#1086; - &#1079;&#1072; &#1073;&#1077;&#1089;&#1087;&#1083;&#1072;&#1090;&#1085;&#1086; &#1086;&#1085;&#1080; &#1076;&#1077;&#1083;&#1072;&#1090;&#1100; &#1085;&#1080;&#1095;&#1077;&#1075;&#1086; &#1085;&#1077; &#1073;&#1091;&#1076;&#1091;&#1090; - &#1082;&#1072;&#1087;&#1080;&#1090;&#1072;&#1083;&#1080;&#1089;&#1090;&#1099; &#1078;&#1077;...... - &#1089;&#1087;&#1072;&#1089;&#1080;&#1073;&#1086; &#1095;&#1090;&#1086; &#1074;&#1085;&#1077;&#1089;&#1083;&#1080; &#1103;&#1089;&#1085;&#1086;&#1089;&#1090;&#1100; - &#1086;&#1085;&#1080; &#1074;&#1089;&#1077; &#1088;&#1072;&#1074;&#1085;&#1086; &#1089; &#1087;&#1088;&#1086;&#1080;&#1075;&#1088;&#1072;&#1083;&#1080; &#1089; Linux - &#1085;&#1077;&#1090; &#1072;&#1085;&#1072;&#1083;&#1080;&#1090;&#1080;&#1095;&#1077;&#1089;&#1082;&#1086;&#1075;&#1086; &#1084;&#1099;&#1096;&#1083;&#1077;&#1085;&#1080;&#1103; - &#1073;&#1086;&#1083;&#1100;&#1096;&#1080;&#1085;&#1089;&#1090;&#1074;&#1086; &#1084;&#1072;&#1096;&#1080;&#1085; - &#1101;&#1090;&#1086; x86(&#1091;&#1078;&#1072;&#1089; ! &#1090;&#1072;&#1082; &#1084;&#1077;&#1076;&#1083;&#1077;&#1085;&#1085;&#1086; &#1088;&#1072;&#1073;&#1086;&#1090;&#1072;&#1077;&#1090; &#1085;&#1072; 2 &#1103;&#1076;&#1077;&#1088;&#1085;&#1086;&#1084; &#1087;&#1088;&#1086;&#1094;&#1077;&#1089;&#1089;&#1086;&#1088;&#1077;- &#1085;&#1080;&#1085;&#1082;&#1091;&#1076;&#1072; &#1085;&#1077; &#1075;&#1086;&#1076;&#1080;&#1090;&#1100;&#1089;&#1103;!!!) &#1072; &#1085;&#1080;&#1082;&#1072;&#1082; &#1085;&#1077; SPARC - &#1083;&#1091;&#1095;&#1096;&#1077; &#1087;&#1091;&#1089;&#1090;&#1100; &#1076;&#1077;&#1083;&#1072;&#1102;&#1090; &#1090;&#1086; &#1095;&#1090;&#1086; &#1093;&#1086;&#1088;&#1086;&#1096;&#1086; &#1076;&#1077;&#1083;&#1072;&#1102;&#1090; - &#1080;&#1093; &#1084;&#1072;&#1083;&#1086;, &#1072; &#1089;&#1074;&#1086;&#1073;&#1086;&#1076;&#1085;&#1099;&#1093; &#1087;&#1088;&#1086;&#1075;&#1088;&#1072;&#1084;&#1084;&#1080;&#1089;&#1090;&#1086;&#1074; - &#1084;&#1085;&#1086;&#1075;&#1086;, &#1087;&#1086; &#1083;&#1086;&#1075;&#1080;&#1082;&#1077; - &#1074;&#1089;&#1077; &#1088;&#1072;&#1074;&#1085;&#1086; &#1087;&#1077;&#1088;&#1077;&#1080;&#1075;&#1088;&#1072;&#1102;&#1090;...
    &#1057; &#1091;&#1074;&#1072;&#1078;&#1077;&#1085;&#1080;&#1077;&#1084;!

  • Sun Studio cc includes unused static inline functions in object file

    While trying to compile some code originally compiled with GCC I run into a linking problem. My problem seems to be caused by that GCC does not include unused static inline functions in the object files while cc does. The following simple example can be used for illustrating this:
    void foo();
    static inline void bar()
      foo();
    int main()
    }This program compiles and links without any problems using GCC and Sun Studio 12 CC (the C++ compiler) but fails to link using Sun Studio 12 cc:
    khepri%> cc staticinline.c
    Undefined first referenced
    symbol in file
    foo staticinline.o
    ld: fatal: Symbol referencing errors. No output written to a.out
    It is probably fine of cc to include foo() in the object file (although not necessary?). My questions are:
    1. Are there any reasons for why cc includes unused static inline functions in the object file while CC does not?
    2. Are there any ways or options to tell cc to not include unused static inline functions in the object file?
    In the example above this is easy to fix by just removing or #ifdef away the code but the original code where I have this problem is not maintained by me and the static inline functions are in header files that get included in multiple C files and in some of these the functions are used.
    Thanks,
    Olav

    olavsa wrote:
    1. Are there any reasons for why cc includes unused static inline functions in the object file while CC does not?
    2. Are there any ways or options to tell cc to not include unused static inline functions in the object file?Removing dead code is an optimization, so you need at least -xO1 for that.

  • Sun Studio 11- Now Available (and FREE)

    Howdy,
    Today, Sun announced the availability of Sun Studio 11, the latest release of our venerable set of optimizing compilers and tools. We are very excited about this release for many reasons, including:
    * Record-setting optimizing C,C++,Fortran compilers
    App performance =� Platform + OS + Compilers/Tools
    Using the latest SPARC/x64/x86-systems and Solaris/OpenSolaris versions is great. But to get maximum performance for your app, you need to upgrade to Sun Studio 11.
    http://www.sun.com/software/products/studio/benchmarks.xml
    * Exploits multicore (CMT) systems for maximum throughput performance
    - Multicore optimizations (UltraSPARC, x64)
    - OpenMP 2.5 support with autoscoping across all compilers
    - Support for OpenMP/Solaris/Posix threads in debugger & performance analyzer
    - Dataspace profiling provides hardware and program views into the performance costs associated with application memory references
    * Providing Platform Choice: Solaris 8,9,10 (SPARC, x64, x86) and RHEL 4/SLES 9
    - Optimizing compilers with Solaris versions only
    - Linux version has debugger, performance analyzer, IDE, etc.
    - Technology preview of Linux compilers:
    http://developer.sun.com/sunstudio/linux
    * FREE, unrestricted license (no gotchas)
    Sun Studio has been a good and growing business for Sun, but our intent is very transparent with this pricing model change- we want to accelerate the adoption of Solaris and Sun Studio.
    Download Sun Studio 11 today:
    http://developers.sun.com/sunstudio/download
    Thanks!
    /kso
    PS. See what these 2 guys think of Sun Studio 11:
    (apologies to those who are unable to view real streams)
    http://webcast-east.sun.com/ramgen/archives/VIP-2199/VIP-2199_01_300.rm

    In reading the click-thru license, I came across the following in section 5(i):
    "Software may contain programs that perform automated collection of system data and/or automated software updating services. System data collected through such programs may be used by Sun, its subcontractors, and its service delivery partners for the purpose of providing you with remote system services and/or improving Sun's software and systems."
    Does this mean that the software will phone home to the 'mother ship' and report on my utilization? It seems to be worded in such a way as to be able to send my hardware configuration and other things that I may not want to share with Sun.

  • Sun studio and VCS integration?

    Hi,
    I can't find any information about what VCS, Sun studio can work with, I know netbeans provide CVS, SVN and Mercurial support, is it the same for Sun studio? Is there a documentation page about that, is there plugins, will netbeans plugins work with sun studio ?
    Thanx

    Yes, you are right, Netbeans provides CVS, SVN and Mercurial support (and probably
    some other VCS, like ClearCase), and Sun Studio IDE provides the same support.
    The Netbeans plugins will work with Sun Studio IDE.
    Thanks,
    Nik

  • Poor performance of string::append on Solaris 10 with Sun Studio 10

    I found string::append(size_type num, char ch) of libCstd consumes too much cpu time comparing with stlport. Anybody knows if this is a known issue on Solaris 10 and Sun Studio 10? Or if I need to use special build options to build with libCstd?
    For example: a.c
    #include <iostream>
    #include <time.h>
    using namespace std;
    int main()
      string ss;
      for ( i=0; i<60000; i++)
        ss.append(1, 'A');
      cout << clock();
      cout << endl;
      return 0;
    }Build with libCstd:
    CC a.c -o a1
    Build with stlport:
    CC -library=%none -library=stlport4 a.c -o a2
    a1 outputs: 10000
    a2 outputs: 1900000
    You can see how big different they have. I am sure their running environment is same.

    I suspect this is due to a bug in libCstd that manifests itself by reallocating the string for each append. Compile and run the program below:
    #include <string>
    #include <new>
    #include <stdlib.h>
    int in_main;
    void* operator new (size_t nbytes) throw (std::bad_alloc) {
    if (in_main) printf ("operator new (%zu)\n", nbytes);
    return malloc (nbytes);
    void operator delete (void *p) throw () {
    if (in_main) printf ("operator delete (%p)\n", p);
    free (p);
    int main () {
    in_main = 1;
    std::string ss;
    for (int i = 0; i < 256; i++) {
    printf ("append(1, 'A')\n");
    ss.append (1, 'A');
    in_main = 0;
    }

  • Gcc and gdb integration in Sun Developer 11

    Is it possible (and how easy) to integrate gcc and gdb into Sun Developer Studio 11. Also, if yes, would one be able to use any of the visual debugging functionality (setting breakpoints etc..) in the Studio.

    Are you running a remote X server from your PC? If so, thats probably
    the problem. I suggest trying vnc instead. Its better at passing all
    chararcters than remote X servers. There is a white paper on using
    vnc at http://developers.sun.com/prodtech/cc/articles/vnc.html.
    The type of problem you're seeing is fairly typical of many Motif or
    X11 applications run via a remote X server.
    If that doesn't work then I don't have an immediate alternative. My
    group (the Sun Studio IDE team) is working with several NetBeans
    groups and are considering adding gdb support to the NetBeans
    C/C++ Native Development Module, but that effort is just getting
    started and nothing would be available very soon (the gdb effort
    probably won't even get scheduled in the near future). But we're
    likely to do it eventually.

  • Sun Studio code hangs at fork, GCC code runs fine

    I am encountering a strange problem where code complied with GCC runs fine, but the same code compiled with Sun Studio 12 compiler hangs at a fork call after an initial set of fork calls.
    I'd appreciate your help in solving this.
    The code was originally written for GCC, I started using the Sun Studio with a view to using Sun's thread analyzer. I made a couple of changes which I think are inoccuous:
    (a) added #ifdef __SUNPRO_CC char * __FUNCTION__ = "name"; #endif
    (b) one more #ifdef around one call to ctime_r because the g++ include expects 2 parameters while Sun Studio 12 expects 3 parameters.
    The g++ is compiled on a Solaris 9 (1 x sparcv9) using GCC 3.3.3
    while the Sun Studio 12 is on a Solaris 10 ( 4 x sparcv9).
    Both runs were on the same Solaris 10 machine which has the compiler.
    The program is a multi instance socket listener, the main program binds to a socket, then forks off a set of processes which accept connections, those children later fork off other client applications based on the connection data; after those clients exit, the children continue accepting etc. The main program only monitors the child processes, records their status and starts if any of those die.
    This is working as expected when compiled with g++.
    The exact same code (note the two sets of #ifdefs above) when compiled with Sun PRO CC alway hangs at the second set of fork. That is, it goes through the first set of forks fine, then when a connection is established, it reads the data but hangs right at the fork call.
    The application code at this point is:
    char * p = pathfind( getenv("PATH"), progname );
    if ( !p ) {  printError(); return false; }
    pid = fork();
    The truss for the Sun Studio code shows
    23914: access("/usr/bin/progname", X_OK) = Err#2 ENOENT
    23914: access("/usr/you/bin/progname", X_OK) = 0
    23914: lwp_park(0x0000000, 0) (sleeping)
    while the truss for the g++ code shows
    23986: access("/usr/bin/progname", X_OK) = Err#2 ENOENT
    23986: access("/usr/you/bin/progname", X_OK) = 0
    23996: fork1() = 24005
    What am I doing wrong?
    Thanks and best regards

    If I understand correctly, you are compiling with gcc on Solaris 9, and with Sun Studio on Solaris 10. Since the OS is different, you might be running into OS issues and not compiler issues. What happens if you build with the same gcc version on the Solaris 10 system where you see the problem?
    By "OS issues", I mean
    1. The program uses unstable or undocumented OS interfaces, or
    2. A bug that is new in Solaris 10.
    A bug was identified in Solaris 10 that could cause forks to hang. It showed up in the libpkcs11 library as used by the JVM. I don't know whether it showed up elsewhere.
    This bug was fixed in Solaris 10u2. If you are using an earlier version of Solaris 10, you could try upgrading.

  • Sun Studio 11 and ifc

    As long as there is no Sun compiler available for linux I would like to use the intel fortran compiler since the gnu fortran compiler does not support all the language features used in our codes, yet.
    My problem is that the Sun Studio debugger is not able to read the debugging information generated by the intel compiler. Is there a way to overcome this problem or do I have to wait for the sun fortran compiler?

    dbx can read dwarf information from gcc and g++ as well as the Sun compilers, so it should be possible to read basic dwarf information
    from the Intel compiler (assuming it generates a fairly normal version
    of dwarf output).
    I can't think of any workarounds that will make Sun Studio 11
    read debug information from a compiler, if it's not properly
    supported by dbx.
    Out of curiosity, what happens when you try to load such
    a program?
    --chris                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for

  • Installation problem in Pentium IV

    Hi , Today I got one problem or bug whatever it can be said while I was trying to install Personel Oracle 8.1.7 for windowsNT/2000 in a Dell P IV computer with windows 2000 operating system.but it is not giving any response it just display a window l

  • Why is yosemite so slow compared to previous OS?

    why has yosemite made my macbook so much slower than it was before? how can I revert to an earlier version such as mountain lion?

  • Proper way to close the scene

    In my application i am using multiple scenes for multiple windows. when the function is completed, I close the scene using stage stage.close() function. Its written in javadoc that close() function is same as setVisible(false). hence even if i close

  • After reset ipad, could not use imessage any more!why?

    why could not I to use imessage any more after I reset my ipad?

  • Depicting Shark sensors with Plugins/Compositing?

    heya currently i am working on a project that involves depicting Shark sensory abilities. the task i have been set is representing a sharks electro, thermal and scent sensors both from a POV of the shark(recieving signal) and the prey(transmitting si