1

Using xerces-c-3.1.1 and SolarisStudio12.5Beta-solaris-x86-bin (on Solaris 10).

./configure CXX=CC CC=cc CXXFLAGS="-std=c++11"
gmake
gmake check
results in 37 core dumps and the error messages
terminate called after throwing an instance of 'xercesc_3_1::EndOfEntityException'

a pstack on 1 of the core files show
core 'core_gs580w_XSerializerTest_132_10_1462965423_23542' of 23542:  /usr/local/src/xerces-c-3.1.3/tests/.libs/XSerializerTest -v=always pe
fdb5c925 _lwp_kill (1, 6) + 15
fdb03783 raise    (6) + 1f
fdae29f5 abort    (fdc725cc, 107, 8118140, fdbc3cd8, fedb04d0, fdc725cc) + cd
fdd71eb5 _ZN9__gnu_cxx27__verbose_terminate_handlerEv (1, 0, fdd6eb0b, fddb3468, 8114df0, 8045f00) + 175
fdd6eb17 ???????? (fdd71d40, 0, fdd6eb75, fdd6eba7, fdd6eb99, fddb3468)
fdd6ebb0 ???????? (8114df0, fedb04d0, fdd6eb75, fdd6ee0f, fecfa708, 807b0c0)
fdd6ee3e ???????? (8114e10, fed7d848, feb24d00, feb24aec, 8114db8, fe8f3468)
feb24bff _ZN11xercesc_3_19ReaderMgr9popReaderEv (80df840, 8045b14, 0, feb21a2c) + 11f
feb21a60 _ZN11xercesc_3_19ReaderMgr14skipPastSpacesEv (80df840, 0, 0, febf3911) + 40
febf3d4e _ZN11xercesc_3_110DTDScanner17scanExtSubsetDeclEbb (8045f00, 0, 1, 64) + 44e
feb09db0 _ZN11xercesc_3_112IGXMLScanner15scanDocTypeDeclEv (80df7b8, fec9dec8, fef90c18, feb512f1) + 1610
feb5154f _ZN11xercesc_3_110XMLScanner10scanPrologEv (80df7b8, 80e5c38, feb24700, 0) + 26f
feb0483f _ZN11xercesc_3_112IGXMLScanner12scanDocumentERKNS_11InputSourceE (80df7b8, 80e5c38, 807b0c0, feb4cb51) + 9f
feb4d0ad _ZN11xercesc_3_110XMLScanner12scanDocumentEPKt (80df7b8, 80e5c08, 807b0c0, feb4d96e) + 56d
feb4d9c4 _ZN11xercesc_3_110XMLScanner12scanDocumentEPKc (80df7b8, 8046d5c, feb98f00, 0) + 64
feb9500f _ZN11xercesc_3_117SAX2XMLReaderImpl5parseEPKc (80df500, 8046d5c, 1, 8046ca8) + af
0805e1d2 _Z8parseOnePN11xercesc_3_115BinOutputStreamEPKc (80dd6c0, 8046d5c, 807adf0, fdd2305c) + 112
0805dd70 _Z9parseCasePKc (8046d5c, 0, 3e8, 0) + b0
0805d8a6 main     (3, 8046bb0, 8046bc0) + be6
0805a932 _start   (3, 8046d18, 8046d52, 8046d5c, 0, 8046d69) + 72

removing CXXFLAGS="-std=c++11" from the configure results in a successful "gmake check"

Any tips on making xerces-c work with sun studio 12.5 and c++11?

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
didiz
  • 1,069
  • 13
  • 26

1 Answers1

1

Assuming the build process for Xerces 3.1.1 is the same as Xerces 3.1.4, Xerces is explicitly linking in the standard Solaris C++ run-time libraries. That's a problem because specifying -std=c++11 causes Solaris Studio to use the g++ ABI and runtime.

This is ldd output on one of the test executables from compiling Xerces 3.1.4, admittedly on Solaris 11:

bash-4.1$ ldd XSValueTest
    libxerces-c-3.1.so =>    /home/achenle/xerces/xerces-c-3.1.4/src/.libs/libxerces-c-3.1.so
    libpthread.so.1 =>   /lib/libpthread.so.1
    libcurl.so.3 =>  /usr/lib/libcurl.so.3
    libidn.so.11 =>  /usr/lib/libidn.so.11
    libsldap.so.1 =>     /usr/lib/libsldap.so.1
    libldap.so.5 =>  /usr/lib/libldap.so.5
    libsocket.so.1 =>    /lib/libsocket.so.1
    libnsl.so.1 =>   /lib/libnsl.so.1
    libgss.so.1 =>   /usr/lib/libgss.so.1
    libssl.so.1.0.0 =>   /lib/libssl.so.1.0.0
    libcrypto.so.1.0.0 =>    /lib/libcrypto.so.1.0.0
    libz.so.1 =>     /lib/libz.so.1
    libstdc++.so.6 =>    /opt/SUNWspro/lib/compilers/CC-gcc/lib/libstdc++.so.6
    libgcc_s.so.1 =>     /opt/SUNWspro/lib/compilers/CC-gcc/lib/libgcc_s.so.1
    librt.so.1 =>    /lib/librt.so.1
    libm.so.2 =>     /lib/libm.so.2
    libc.so.1 =>     /lib/libc.so.1
    libstatomic.so.1 =>  /opt/SUNWspro/lib/compilers/atomic/libstatomic.so.1
    libCstd.so.1 =>  /usr/lib/libCstd.so.1
    libCrun.so.1 =>  /usr/lib/libCrun.so.1
    libscf.so.1 =>   /lib/libscf.so.1
    libsasl.so.1 =>  /usr/lib/libsasl.so.1
    libmd.so.1 =>    /lib/libmd.so.1
    libnspr4.so =>   /usr/lib/mps/libnspr4.so
    libplc4.so =>    /usr/lib/mps/libplc4.so
    libnss3.so =>    /usr/lib/mps/libnss3.so
    libssl3.so =>    /usr/lib/mps/libssl3.so
    libmp.so.2 =>    /lib/libmp.so.2
    libuutil.so.1 =>     /lib/libuutil.so.1
    libgen.so.1 =>   /lib/libgen.so.1
    libnvpair.so.1 =>    /lib/libnvpair.so.1
    libsmbios.so.1 =>    /usr/lib/libsmbios.so.1
    libsoftcrypto.so.1 =>    /lib/libsoftcrypto.so.1
    libelf.so.1 =>   /lib/libelf.so.1
    libdl.so.1 =>    /lib/libdl.so.1
    libnssutil3.so =>    /usr/lib/mps/libnssutil3.so
    libplds4.so =>   /usr/lib/mps/libplds4.so
    libthread.so.1 =>    /lib/libthread.so.1
    libcryptoutil.so.1 =>    /lib/libcryptoutil.so.1

Note the presence of libstdc++.so.6 (the g++ runtime) and libCstd.so.1 and libCrun.so.1 (the standard Solaris C++ runtime).

This is from the "What's New" documentation on Solaris Studio 12.4:

Using C++11 Features

In Oracle Solaris Studio 12.4, the C++ compiler supports C++11, a new language and ABI (Application Binary Interface).

In C++ 11 mode, the CC compiler uses the g++ ABI and a version of the g++ runtime library that is supplied with Oracle Solaris Studio. For this release, version 4.8.2 of the g++ runtime library is used.

The C++11 implying the use of the g++ ABI and runtime also applies to Solaris Studio 12.5:

A.2.88 –std=v

...

c++11

Selects C++ 11 dialect and g++ binary compatibility. It sets the __SUNPRO_CC_COMPAT preprocessor macro to 'G'.

But the Xerces build explicitly links in the standard Solaris C++ runtime in addition to the implicitly-linked g++ runtime.

Andrew Henle
  • 32,625
  • 3
  • 24
  • 56
  • What if I just remove both libraries, (editing the makefiles myself) will it find what it needs by itself? – didiz Apr 22 '17 at 13:25
  • 1
    @drolmal - In theory it should work, but there's only one way to find out. The problem is that the build doesn't work, which means it hasn't been tested at all. So there could be other issues. – Andrew Henle Apr 22 '17 at 14:13
  • The other option is replacing it, which is expensive for us as we rely on in pretty heavily :( thanks for the answer, once we decide on a solution / workaround I will update the topic – didiz Apr 22 '17 at 14:16
  • 1
    @drolmal I did get 3.1.4 to compile successfully and pass `gmake check` with the default Solaris 11 GCC v4.8.2, so that might be an option too, since `-std=c++11` uses the 4.8.2 g++ runtime anyway. I am tempted to try Studio 12.5 and add in "-m64 -xport64 +w2" to CXXFLAGS just to see what else might be broken... – Andrew Henle Apr 22 '17 at 14:47
  • Thanks, if you get around to trying it please share! Found this on the documentation, will try: When you need to list libraries to be linked, such as when you are creating a shared library, use the following options in this order when using the `–compat=g or –std=x` options: `-lstdc++ -lgcc_s -lCrunG3` https://docs.oracle.com/cd/E37069_01/html/E37071/gndfg.html – didiz Apr 22 '17 at 17:41
  • 1
    Just adding that I was able to use it after all. It did require a few code changes for compatibility with the new standard. – didiz Dec 28 '17 at 18:06