bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bison 3.3.2 fails to build or run testsuite


From: Dennis Clarke
Subject: Re: bison 3.3.2 fails to build or run testsuite
Date: Wed, 6 Feb 2019 21:10:14 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Thunderbird/65.0

On 2/6/19 5:46 AM, Akim Demaille wrote:
#include <iostream>

struct foo
{
   foo(int v = 42)
     : val(v)
   {}
   foo& operator=(foo& rhs)
   {
     this->val = rhs.val;
     --rhs.val;
     return *this;
   }

   int val;
};

int
main()
{
   foo f(10);
   foo b(20);
   b = f;
   std::cout << f.val << ", " << b.val << '\n';
}



First thank you for the new bison release and thank you even more for
the reply wherein I hope we can not only compile but test on a really
harsh winter like environment. Think Siberia and you have a swiss army
knife for survival.

So I am looking firstly at :

Oracle® Developer Studio 12.6: C++ User's Guide
https://docs.oracle.com/cd/E77782_01/html/E77789/index.html

Section 1.5 Standards Conformance
https://docs.oracle.com/cd/E77782_01/html/E77789/bkabg.html

I am not a C++ guy but have certainly dealt with it. I tend to see C as
the lungs of Linux and UNIX whereas C++ is lung cancer. Too many strange
libraries and things like boost and stlport4 and the folks at MySQL seem
to have a real love affair with stlport4 but then they need to release
libraries with their packages and those go in weird non-standard places
along with ELF headers that need RPATH and RUNPATH data to find these
odd libs in weird places which conflict with the libs in system places...

I could go on and on but C++ just seems like a good idea that went
entirely off the rails.  We should have stopped with Fortran 77 :-)

Anyways, looking at the "Standards" section above I see :

    The C++ compiler (CC) supports the ISO International Standard for
    C++, ISO IS 14882:2014, Programming Language—C++. The 2014 standard
    replaced the 2011 standard, which in turn replaced the 2003
    standard. The compiler recognizes the new features added in
    C++11 only when the option –std=c++11 is in effect, and recognizes
    the new features added in C++14 only when the option –std=c++14 is
    in effect.

OKay so let's try C++14 in the CXXFLAGS :


c$ pwd
/usr/local/build/bison_3.3.2_tests
c$ cat -n const_to_save.cpp
     1
     2  #include <iostream>
     3
     4  struct foo
     5  {
     6      foo(int v = 42)
     7          : val(v)
     8      {}
     9      foo& operator=(foo& rhs)
    10      {
    11          this->val = rhs.val;
    12          --rhs.val;
    13          return *this;
    14      }
    15
    16      int val;
    17  };
    18
    19  int
    20  main()
    21  {
    22      foo f(10);
    23      foo b(20);
    24      b = f;
    25      std::cout << f.val << ", " << b.val << '\n';
    26  }
    27
c$
c$ echo $CXX
/opt/developerstudio12.6/bin/CC

c$ $CXX -std=c++14 -m64 -xarch=sparc -g -xlinkopt=0 -xnolibmil -xregs=no%appl -xs -H -\# -c -o const_to_save.o const_to_save.cpp ### CC: Note: NLSPATH = /opt/developerstudio12.6/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/opt/developerstudio12.6/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
### CC: Note: TMPDIR = /var/tmp/dclarke
###     command line files and options (expanded):
### -std=c++14 -m64 -xarch=sparc -xdebuginfo=line,param,variable,tagtype,codetag,decl -xglobalize=yes -xpatchpadding=fix -Qoption driver -dconditional=yes -xkeep_unref=funcs,vars -xlinkopt=0 -xnolibmil -xregs=no%appl -xs=yes -H -# -c -oconst_to_save.o const_to_save.cpp /opt/developerstudio12.6/lib/compilers/bin/ccfe -xarch=v9 -xold_eh_mechanism=no -std=c++14 -D__SunOS_5_10 -D__SunOS_RELEASE=0x051000 -D__SUNPRO_CC=0x5150 -D__MATHERR_RENAME_EXCEPTION -D__unix -D__SVR4__ -D__svr4__ -D__SVR4 -D__sun -D__sun__ -D__SunOS -D__sparcv9 -D__sparc_v9__ -D__sparc -D__sparc__ -D_LP64 -D__LP64__ -D__arch64__ -D__ORDER_LITTLE_ENDIAN__=1234 -D__ORDER_BIG_ENDIAN__=4321 -D__BYTE_ORDER__=__ORDER_BIG_ENDIAN__ -D__BUILTIN_VA_ARG_INCR -Dunix -Dsun -Dsparc -D__SUN_PREFETCH -D__SUNPRO_CC_COMPAT='G' -include /opt/developerstudio12.6/lib/compilers/include/CC/gnu/builtins.h -include /opt/developerstudio12.6/lib/compilers/include/CC/gnu/builtins-def.h -I-xbuiltin -I/opt/developerstudio12.6/lib/compilers/include/CC/gnu -I/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0 -I/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/backward -I/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/sparc-sun-solaris2.10/sparcv9/ -I/opt/developerstudio12.6/lib/compilers/include/cc -I/usr/include -I/opt/developerstudio12.6/lib/compilers/CC-gcc/lib/gcc/sparc-sun-solaris2.10/5.4.0/include/ -H -ptf /var/tmp/dclarke/ccfe.1549486059.15748.03.%1.%2 -ptx /opt/developerstudio12.6/bin/CC -ptk "-std=c++14 -m64 -xarch=sparc -xdebuginfo=line,param,decl,variable,tagtype,codetag -xglobalize=yes -xpatchpadding=fix -xkeep_unref=funcs,vars -xlinkopt=0 -xnolibmil -xregs=no%appl -xs=yes -H -# -c -Qoption driver -dconditional=yes " -compat=g -xglobalize=yes -xdebuginfo=line,param,variable,tagtype,codetag,decl +d -xdbggen=dwarf+usedonly+incl+line+param+variable+tagtype+codetag+decl -xmemalign=8s -xF=%none -xbuiltin=%none -xldscope=global -xivdep=loop -O0 -xarrayloc const_to_save.cpp -ptb const_to_save.o -o /var/tmp/dclarke/ccfe.1549486059.15748.01.ir 2> /var/tmp/dclarke/ccfe.1549486059.15748.02.err cat /var/tmp/dclarke/ccfe.1549486059.15748.01.ir >/var/tmp/dclarke/ccfe.1549486059.15748.04.ir /opt/developerstudio12.6/lib/compilers/bin/previse -Qy -O3 -xarch=sparc -m64 -xchip=generic -xcache=generic -compat=g -xdebuginfo=line,param,variable,tagtype,codetag,decl -depend -xbuiltin=%none -xprefetch=auto,explicit -xprefetch_level=1 -xprefetch_auto_type=no%indirect_array_access -o /var/tmp/dclarke/iropt.1549486059.15748.05.ir "-Astatic_err_check:previse_iropt=on:umr=on:aob=on:free=on:nulld=on:nullc=on:msg_ctl_level=0:analytics=off:stderr_output=on" /var/tmp/dclarke/ccfe.1549486059.15748.04.ir 2> /var/tmp/dclarke/previse.1549486059.15748.07.err /opt/developerstudio12.6/lib/compilers/stdlibfilt -stderr < /var/tmp/dclarke/ccfe.1549486059.15748.02.err
/opt/developerstudio12.6/lib/compilers/include/CC/gnu/builtins.h
/opt/developerstudio12.6/lib/compilers/include/CC/gnu/builtins-def.h
/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/iostream

/opt/developerstudio12.6/lib/compilers/include/CC/gnu/bits/c++config.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/sparc-sun-solaris2.10/sparcv9/bits/c++config.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/sparc-sun-solaris2.10/sparcv9/bits/os_defines.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/sparc-sun-solaris2.10/sparcv9/bits/cpu_defines.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/ostream

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/ios

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/iosfwd

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/stringfwd.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/memoryfwd.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/postypes.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/cwchar
                                                /usr/include/wchar.h

/usr/include/sys/feature_tests.h

/usr/include/sys/ccompile.h

/usr/include/sys/isa_defs.h

/usr/include/iso/wchar_iso.h

/usr/include/stdio_tag.h

/usr/include/wchar_impl.h

/usr/include/iso/time_iso.h

/usr/include/ctype.h

/usr/include/iso/ctype_iso.h

/usr/include/iso/ctype_c99.h

/opt/developerstudio12.6/lib/compilers/include/CC/gnu/stddef.h

/usr/include/stddef.h

        /usr/include/iso/stddef_iso.h

/usr/include/sys/va_list.h

/usr/include/iso/wchar_c99.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/exception

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/atomic_lockfree_defines.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/exception_ptr.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/exception_defines.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/nested_exception.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/char_traits.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/stl_algobase.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/functexcept.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/cpp_type_traits.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/ext/type_traits.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/ext/numeric_traits.h

/opt/developerstudio12.6/lib/compilers/include/CC/gnu/bits/stl_pair.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/move.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/concept_check.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/type_traits

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/cstdint

/usr/include/stdint.h

        /usr/include/sys/stdint.h

                /usr/include/sys/int_types.h

                /usr/include/sys/int_limits.h

                /usr/include/sys/int_const.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/stl_iterator_base_types.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/stl_iterator_base_funcs.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/debug/debug.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/stl_iterator.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/ptr_traits.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/predefined_ops.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/localefwd.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/sparc-sun-solaris2.10/sparcv9/bits/c++locale.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/clocale
                                                /usr/include/locale.h

/usr/include/iso/locale_iso.h

/usr/include/libintl.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/cctype

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/ios_base.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/ext/atomicity.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/sparc-sun-solaris2.10/sparcv9/bits/gthr.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/sparc-sun-solaris2.10/sparcv9/bits/gthr-default.h

/usr/include/pthread.h

/usr/include/sys/types.h

/usr/include/sys/machtypes.h

/usr/include/sys/select.h

        /usr/include/sys/time_impl.h

        /usr/include/sys/time.h

                /usr/include/sys/types.h

                /usr/include/time.h

                        /usr/include/sys/types.h

                /usr/include/sys/select.h

/usr/include/sched.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/sparc-sun-solaris2.10/sparcv9/bits/atomic_word.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/locale_classes.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/string

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/allocator.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/sparc-sun-solaris2.10/sparcv9/bits/c++allocator.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/ext/new_allocator.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/new

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/ostream_insert.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/cxxabi_forced.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/stl_function.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/backward/binders.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/range_access.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/initializer_list

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/basic_string.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/ext/alloc_traits.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/alloc_traits.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/ext/string_conversions.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/cstdlib

/opt/developerstudio12.6/lib/compilers/include/CC/gnu/stdlib.h

        /usr/include/stdlib.h

                /usr/include/iso/stdlib_iso.h

                /usr/include/iso/stdlib_c99.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/cstdio

/usr/include/stdio.h

        /usr/include/iso/stdio_iso.h

                /usr/include/stdio_impl.h

        /usr/include/iso/stdio_c99.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/cerrno

/usr/include/errno.h

        /usr/include/sys/errno.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/functional_hash.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/hash_bytes.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/basic_string.tcc

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/locale_classes.tcc

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/system_error

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/sparc-sun-solaris2.10/sparcv9/bits/error_constants.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/stdexcept

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/streambuf

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/streambuf.tcc

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/basic_ios.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/locale_facets.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/cwctype
                                                /usr/include/wctype.h

/usr/include/iso/wctype_iso.h

/usr/include/iso/wctype_c99.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/sparc-sun-solaris2.10/sparcv9/bits/ctype_base.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/streambuf_iterator.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/sparc-sun-solaris2.10/sparcv9/bits/ctype_inline.h

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/locale_facets.tcc

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/basic_ios.tcc

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/ostream.tcc

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/istream

/opt/developerstudio12.6/lib/compilers/CC-gcc/include/c++/5.4.0/bits/istream.tcc
/opt/developerstudio12.6/lib/compilers/bin/cg -Qy -fsimple=0 -compat=g -xarch=sparc -m64 -xchip=generic -xcache=generic -comdat -xpatchpadding=fix -xdebuginfo=line,param,variable,tagtype,codetag,decl -xkeep_unref=funcs,vars -s -xbuiltin=%none -xcode=abs44 -xannotate=yes -xmemalign=8s -xprefetch=auto,explicit -xprefetch_auto_type=no%indirect_array_access -xcheck=stkovf -xcheck=noreturn -xregs=no%appl -xvector=no -oo const_to_save.o -ir /var/tmp/dclarke/ccfe.1549486059.15748.01.ir
c$

That is an offensive amount of gymnastics to compile a trivial sample.

   * * * offensive * * *

However it compiles just fine and :

c$ $CXX -std=c++14 -m64 -xarch=sparc -g -xlinkopt=0 -xnolibmil -xregs=no%appl -xs -H -\# -o const_to_save const_to_save.o ### CC: Note: NLSPATH = /opt/developerstudio12.6/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/opt/developerstudio12.6/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
### CC: Note: TMPDIR = /var/tmp/dclarke
###     command line files and options (expanded):
### -std=c++14 -m64 -xarch=sparc -xdebuginfo=line,param,variable,tagtype,codetag,decl -xglobalize=yes -xpatchpadding=fix -Qoption driver -dconditional=yes -xkeep_unref=funcs,vars -xlinkopt=0 -xnolibmil -xregs=no%appl -xs=yes -H -# -oconst_to_save const_to_save.o
### CC: Note: LD_LIBRARY_PATH = (null)
### CC: Note: LD_LIBRARY_PATH_64 = (null)
### CC: Note: LD_RUN_PATH     = /usr/local/lib
### CC: Note: LD_OPTIONS      = -64 -Qy -R/usr/local/lib -L/usr/local/lib
ln -s /opt/developerstudio12.6/lib/compilers /var/tmp/dclarke/lib_link.1549486137.15757.01 /usr/ccs/bin/ld -zld32=-S/var/tmp/dclarke/lib_link.1549486137.15757.01/libldstab_ws.so -zld64=-S/var/tmp/dclarke/lib_link.1549486137.15757.01/sparcv9/libldstab_ws.so -zld32=-S/var/tmp/dclarke/lib_link.1549486137.15757.01/libld_annotate.so -zld64=-S/var/tmp/dclarke/lib_link.1549486137.15757.01/sparcv9/libld_annotate.so -zld32=-S/var/tmp/dclarke/lib_link.1549486137.15757.01/libCCexcept.so.1 -zld64=-S/var/tmp/dclarke/lib_link.1549486137.15757.01/sparcv9/libCCexcept.so.1 /opt/developerstudio12.6/lib/compilers/sparcv9/crti.o /opt/developerstudio12.6/lib/compilers/sparcv9/CCgrti.o /opt/developerstudio12.6/lib/compilers/sparcv9/crt1.o /opt/developerstudio12.6/lib/compilers/sparcv9/values-xa.o -M /opt/developerstudio12.6/lib/compilers/CC-gcc/gcc_version.map const_to_save.o -o const_to_save -Y "P,/opt/developerstudio12.6/lib/compilers/sparcv9:/opt/developerstudio12.6/lib/sparcv9:/usr/ccs/lib/sparcv9:/opt/developerstudio12.6/lib/compilers/CC-gcc/lib/sparcv9:/lib/64:/usr/lib/64" -Qy "-R/usr/local/lib:/opt/developerstudio12.6/lib/sparcv9:/opt/developerstudio12.6/lib/compilers/CC-gcc/lib/sparcv9:/opt/developerstudio12.6/lib/compilers/atomic/sparcv9" -lstdc++ -lgcc_s /opt/developerstudio12.6/lib/compilers/atomic/sparcv9/libstatomic.so.1 -lCrunG3 -lrt -lm -lc /opt/developerstudio12.6/lib/compilers/sparcv9/CCgrtn.o /opt/developerstudio12.6/lib/compilers/sparcv9/crtn.o 2> /var/tmp/dclarke/ld.1549486137.15757.02.err /opt/developerstudio12.6/bin/c++filt -filt=no%stdlib < /var/tmp/dclarke/ld.1549486137.15757.02.err > /var/tmp/dclarke/cppfilt.1549486137.15757.03.err /opt/developerstudio12.6/lib/compilers/stdlibfilt -stderr < /var/tmp/dclarke/cppfilt.1549486137.15757.03.err
ld: warning: option -Q appears more than once, first setting taken
c$

c$
c$ file const_to_save
const_to_save: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped
c$ elfdump -de const_to_save

ELF Header
  ei_magic:   { 0x7f, E, L, F }
  ei_class:   ELFCLASS64          ei_data:       ELFDATA2MSB
  ei_osabi:   ELFOSABI_SOLARIS    ei_abiversion: EAV_SUNW_CURRENT
  e_machine:  EM_SPARCV9          e_version:     EV_CURRENT
  e_type:     ET_EXEC
  e_flags:    [ EF_SPARCV9_TSO ]
  e_entry:           0x100001340  e_ehsize:     64  e_shstrndx:  31
  e_shoff:               0x245d8  e_shentsize:  64  e_shnum:     33
  e_phoff:                  0x40  e_phentsize:  56  e_phnum:     6

Dynamic Section:  .dynamic
     index  tag                value
       [0]  NEEDED            0x42b               libstdc++.so.6
       [1]  NEEDED            0x455               libgcc_s.so.1
       [2]  NEEDED            0x4a0               libstatomic.so.1
       [3]  NEEDED            0x475               libCrunG3.so.1
       [4]  NEEDED            0x4b1               librt.so.1
       [5]  NEEDED            0x4bc               libm.so.2
       [6]  NEEDED            0x48d               libc.so.1
       [7]  INIT              0x100001a28
       [8]  FINI              0x100001b58
[9] RUNPATH 0x4c6 /usr/local/lib:/usr/local/lib:/opt/developerstudio12.6/lib/sparcv9:/opt/developerstudio12.6/lib/compilers/CC-gcc/lib/sparcv9:/opt/developerstudio12.6/lib/compilers/atomic/sparcv9 [10] RPATH 0x4c6 /usr/local/lib:/usr/local/lib:/opt/developerstudio12.6/lib/sparcv9:/opt/developerstudio12.6/lib/compilers/CC-gcc/lib/sparcv9:/opt/developerstudio12.6/lib/compilers/atomic/sparcv9
      [11]  HASH              0x100000248
      [12]  STRTAB            0x100000910
      [13]  STRSZ             0x779
      [14]  SYMTAB            0x100000400
      [15]  SYMENT            0x18
      [16]  CHECKSUM          0x5ca5
      [17]  VERNEED           0x100001090
      [18]  VERNEEDNUM        0x4
      [19]  PLTRELSZ          0x150
      [20]  PLTREL            0x7
      [21]  JMPREL            0x1000011e8
      [22]  RELA              0x1000011a0
      [23]  RELASZ            0x198
      [24]  RELAENT           0x18
      [25]  DEBUG             0
      [26]  FLAGS             0                   0
      [27]  FLAGS_1           0                   0
      [28]  SUNW_STRPAD       0x200
      [29]  SUNW_LDMACH       0x2b                EM_SPARCV9
      [30]  PLTGOT            0x100101c00
   [31-41]  NULL              0
c$

Again we get an ELF file result which needs a bucket of strange things
inside the RUNPATH and RPATH data and that also includes dependencies
on things like libstdc++.so.6 and libCrunG3.so.1 and libgcc_s.so.1??

Why the libgcc_s.so.1 ??

I don't see why.

However it runs :

c$ ./const_to_save
9, 10
c$

I would like to try this on a clean room environment wherein this is
a totally fresh install machine.  Would the dependency on libgcc still
be in there?

Why is it there at all?

Regardless it does compile and it runs and I am guessing that is the
whole question.

GCC 8.2.0 can not deal with that object file at all :

c$
c$ /usr/local/gcc8/bin/g++ --version
g++ (GCC) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

c$ /usr/local/gcc8/bin/g++ -m64 -std=c++14 -g -o const_to_save const_to_save.o
Undefined                       first referenced
 symbol                             in file
__SUNW_ABIG3_cpp_personality        const_to_save.o
__cxxabiv1::register_exit_code(void (*)()) const_to_save.o
ld: fatal: symbol referencing errors. No output written to const_to_save
collect2: error: ld returned 1 exit status
c$

However gcc 8.2.0 can compile from source on another machine here :

beta $ /usr/local/gcc8/bin/g++ --version
g++ (GCC) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


beta $ /usr/local/gcc8/bin/g++ -m64 -std=c++14 -g -c -o const_to_save.o const_to_save.cpp

beta $ /usr/local/gcc8/bin/g++ -m64 -std=c++14 -g -o const_to_save const_to_save.o

beta $ file const_to_save
const_to_save: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped

beta $ elfdump -devl const_to_save

ELF Header
  ei_magic:   { 0x7f, E, L, F }
  ei_class:   ELFCLASS64          ei_data:       ELFDATA2MSB
  ei_osabi:   ELFOSABI_SOLARIS    ei_abiversion: EAV_SUNW_CURRENT
  e_machine:  EM_SPARCV9          e_version:     EV_CURRENT
  e_type:     ET_EXEC
  e_flags:    [ EF_SPARCV9_TSO ]
  e_entry:           0x100000ca0  e_ehsize:     64  e_shstrndx:  35
  e_shoff:                0x8e00  e_shentsize:  64  e_shnum:     36
  e_phoff:                  0x40  e_phentsize:  56  e_phnum:     6

Version Needed Section:  .SUNW_version
     index  file                        version
       [2]  libstdc++.so.6              GLIBCXX_3.4
       [3]  libgcc_s.so.1               GCC_3.0
       [4]  libc.so.1                   SUNW_0.7

Dynamic Section:  .dynamic
     index  tag                value
       [0]  NEEDED            0x1c6               libstdc++.so.6
       [1]  NEEDED            0x20a               libm.so.2
       [2]  NEEDED            0x214               librt.so.1
       [3]  NEEDED            0x1e1               libgcc_s.so.1
       [4]  NEEDED            0x1f7               libc.so.1
       [5]  INIT              0x1000011bc
       [6]  FINI              0x1000011d8
       [7]  RUNPATH           0x21f               /usr/local/lib
       [8]  RPATH             0x21f               /usr/local/lib
       [9]  HASH              0x100000248
      [10]  STRTAB            0x100000650
      [11]  STRSZ             0x42e
      [12]  SYMTAB            0x100000350
      [13]  SYMENT            0x18
      [14]  CHECKSUM          0xbacc
      [15]  VERNEED           0x100000a80
      [16]  VERNEEDNUM        0x3
      [17]  PLTRELSZ          0xf0
      [18]  PLTREL            0x7
      [19]  JMPREL            0x100000bb0
      [20]  RELA              0x100000b20
      [21]  RELASZ            0x180
      [22]  RELAENT           0x18
      [23]  SYMINFO           0x1000001c8
      [24]  SYMINSZ           0x80
      [25]  SYMINENT          0x4
      [26]  REGISTER          0x2
      [27]  DEBUG             0
      [28]  FLAGS             0                   0
      [29]  FLAGS_1           0                   0
      [30]  SUNW_STRPAD       0x200
      [31]  SUNW_LDMACH       0x2b                EM_SPARCV9
      [32]  PLTGOT            0x100101300
   [33-43]  NULL              0
beta $ ls -lap
total 130
drwxr-xr-x   2 dclarke  devl           5 Feb  6 21:03 ./
drwxrwxrwt  43 root     root         219 Feb  6 21:02 ../
-rwxr-xr-x   1 dclarke  devl       38656 Feb  6 21:03 const_to_save
-rw-r--r--   1 dclarke  devl         314 Feb  6 20:09 const_to_save.cpp
-rw-r--r--   1 dclarke  devl       35952 Feb  6 21:03 const_to_save.o
beta $ ./const_to_save
9, 10
beta $


So I don't know where we are here but certainly Oracle Studio 12.6 can
compile that little sample and the end result has bizarre dependencies
in the final ELF file but it runs.


--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional



ps: A short rant about C++ and stlport4. Which is released inside the
    Oracle Studio 12.6 software set.  This is all commercial closed
    source stuff but we do get piles of things in odd places like :

c$ cat  /opt/developerstudio12.6/lib/compilers/include/CC/stlport4/time.h
/*
 * Copyright (c) 1999
 * Boris Fomitchev
 *
 * This material is provided "as is", with absolutely no warranty expressed
 * or implied. Any use is at your own risk.
 *

Where is that used?

Of course I have the "official" supported MySQL releases installed
like so :


   PKGINST:  mysql
      NAME:  MySQL Community Server (GPL)
  CATEGORY:  application
      ARCH:  sparc
   VERSION:  5.6.42
   BASEDIR:  /opt/mysql
    VENDOR:  Oracle Corporation
    PSTAMP:  MySQL Release Engineering


Which needs libstlport stuff :


c$ ldd /opt/mysql/mysql/lib/libmysqlclient.so.18.1.0 | grep 'libstlport'
        libstlport.so.1 => /opt/mysql/mysql/lib/../lib/libstlport.so.1

That thing has hard coded RPATH and RUNPATH data inside the ELF headers :

c$ elfdump -devl /opt/mysql/mysql/lib/libstlport.so.1 | grep -i 'path'
[7] RUNPATH 0x3dc5c $ORIGIN/../../../lib/compilers/rtlibs/usr/lib/64 [8] RPATH 0x3dc5c $ORIGIN/../../../lib/compilers/rtlibs/usr/lib/64
c$

In filesystem paths that don't exist.

If one digs and looks at the "release" libstlport stuff with the
C++ compilers we see :

c$ ls -lapb /opt/mysql/mysql/lib/libstlport.so.1 /opt/developerstudio12.6/lib/stlport4/sparcv9/libstlport.so.1 -rwxr-xr-x 1 root sys 2004944 May 30 2017 /opt/developerstudio12.6/lib/stlport4/sparcv9/libstlport.so.1 -rw-r--r-- 1 root bin 2483248 Aug 14 2010 /opt/mysql/mysql/lib/libstlport.so.1

Try to mix one with the other and MySQL stops working.

Really .. I don't see how a production software system can be maintained
like this and .. not well to be sure.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]