Menu

Need help building 32bit Perl 5.8.9 mainly libPLSTAF.so for linux with any STAF version

Srini
2016-02-01
2016-03-01
  • Srini

    Srini - 2016-02-01

    [ 3rd Feb 2016, an Update ]
    I could now build 32bit Perl5.8.9 support i.e libPLSTAF.so for STAF3.3.3 and also STAF3.4.9. I see that the all the components are built just fine. But the issue is with registering Perl STAF Service!!, I get below error when I try registering service!!,
    Please help me understand, Is 32bit perl supported on Linux or not?, Whats the work around to get this working? ( I need this to be working with Perl 5.8.9 only!, as my libraries work only with this version!)

    /usr/local/staf$STAF local SERVICE ADD SERVICE myService LIBRARY STAFEXECPROXY EXECUTE myService OPTION PROXYLIBRARY=PLSTAF OPTION USELIB=/usr/local/staf/services/myService

    20160203-01:54:03;4099935120;00000100;Caught STAFException in STAFExecProxy.STAFServiceConstruct(), Exception: STAFConnectionIOException, Location: /opt/staf4/src/staf/stafif/STAFConnectionProviderInlImpl.cpp(280), Text: STAFConnectionReadUInt: Error reading from socket: other side closed socket, Error code: 22
    Error submitting request, RC: 27
    Additional info
    ---------------
    6:Error constructing service, STAFEXECPROXY, Result:

    ----------------------------------------------
    Hi
    I'm trying to build 32bit Perl5.8.9 support (i.e libPLSTAF.so) to get my Perl STAF service working with any STAF version. I have bunch of staf library code which need to be exposed as STAF APIs to be consumed in Perl, Python & Java scripts. These Perl library code works with only 32bit perl 5.8.9!!**

    Trying with STAF 3.3.3. and Perl 5.8.9 (32bit) on CentOS 5.4 x86_64. I have g++ compiler for 64bit, unable to install 32bit toolchain and get this building!.

    The error I get is as below;
    /opt/staf2/src/staf$make
    Linking shared library libPLSTAF.so
    /usr/bin/ld: skipping incompatible /volume/perl/5.8.9/lib/5.8.9/i686-linux-thread-multi/CORE/libperl.a when searching for -lperl
    /usr/bin/ld: cannot find -lperl
    collect2: ld returned 1 exit status
    make: *** [/opt/staf2/rel/linux/staf/retail/lib/perl58/libPLSTAF.so] Error 1
    /opt/staf2/src/staf$

    I also noticed the libSTAF.so built before this step is also 64bit version and not 32bit!

    Can I force STAF build to build it only for 32bit version??
    How do you get this built with g++ 64bit on centos 5.4? Any help in this regard will greatly help me in proceeding.


    Some more update on 2nd Feb 2016:

    I'm actualy using g++ for 64bit, and trying to build targets for 32bit by setting following ENVs;
    export CFLAGS=" -m32"
    export CXXFLAGS=" -m32"
    I can see that the compiling goes fine, but linker is trying to link wrong elf class files. Looks like compiler is trying to build both 64bit and 32bit object files!
    When above ENVs are set for -m64, stafproc is built fine, but plstaf build fails. I think plstaf requires libSTAF.so to be built first hence this approach.

    ........
    Compiling STAFFileSystem.o
    Compiling STAFFileSystemInlImpl.o
    Compiling STAFFileSystemCommon.o
    Compiling STAFProcess.o
    Compiling STAFProcessInlImpl.o
    Compiling STAFDynamicLibrary.o
    Compiling STAFDynamicLibraryInlImpl.o
    Compiling STAFConnectionProviderInlImpl.o
    Compiling STAFConnectionProviderCommon.o
    Compiling STAF.o
    Compiling STAFInlImpl.o
    Compiling STAFException.o
    Linking shared library libSTAF.so
    Linking STAFProc
    /usr/bin/ld: Warning: size of symbol std::_Deque_base<STAFString, std::allocator<STAFString> >::_M_destroy_nodes(STAFString**, STAFString**)' changed from 41 in /opt/staf2/rel/linux/staf/retail/lib/libSTAF.so to 57 in /opt/staf2/obj/linux/staf/retail/stafproc/STAFProc.o /usr/bin/ld: Warning: size of symbolstd::_Deque_base<STAFString, std::allocator<STAFString=""> >::~_Deque_base()' changed from 38 in /opt/staf2/rel/linux/staf/retail/lib/libSTAF.so to 77 in /opt/staf2/obj/linux/staf/retail/stafproc/STAFProc.o
    /usr/bin/ld: Warning: size of symbol std::_Deque_base<STAFString, std::allocator<STAFString> >::_M_create_nodes(STAFString**, STAFString**)' changed from 108 in /opt/staf2/rel/linux/staf/retail/lib/libSTAF.so to 111 in /opt/staf2/obj/linux/staf/retail/stafproc/STAFProc.o /usr/bin/ld: Warning: size of symbolSTAFFSPath::~STAFFSPath()' changed from 301 in /opt/staf2/rel/linux/staf/retail/lib/libSTAF.so to 356 in /opt/staf2/obj/linux/staf/retail/stafproc/STAFProc.o
    ......
    [tsrinivas@r-web rel]$ file /opt/staf2/rel/linux/staf/retail/lib/libSTAF.so
    /opt/staf2/rel/linux/staf/retail/lib/libSTAF.so: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped
    [tsrinivas@r-web rel]$
    [tsrinivas@r-web rel]$ file /opt/staf2/obj/linux/staf/retail/stafproc/STAFProc.o
    /opt/staf2/obj/linux/staf/retail/stafproc/STAFProc.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped
    [tsrinivas@rpt-web rel]$

    How do I enforce everything to be built for 32bit only! by using 64bit compilers(g++)??

    Thanks,
    -Srinivas

     

    Last edit: Srini 2016-02-03
  • Sharon Lucas

    Sharon Lucas - 2016-02-03

    Any reason you're not installing STAF for Linux 32-bit (e.g. by downloading and running STAF3424-setup-linux.bin, the STAF installer file for STAF 32-bit) which provides support for Perl 5.8 32-bit, instead of trying to build STAF yourself?

    Note that STAF for Linux 64-bit only provides support for Perl 64-bit (not Perl 32-bit).

    If you do need to build STAF yourself for some reason, then it appears you built STAF for linux-amd64 (e.g. export OS_NAME=linux-amd64). STAF built for linux-amd64 only supports 64-bit Perl versions, not 32-bit Perl versions. You would ned to build STAF for linux (32-bit) using export OS_NAME=linux to get STAF support for Perl 32-bit.

     
  • Srini

    Srini - 2016-02-09

    Hi Sharon,

    Thanks for the suggestion. I did try STAF 3.4.24 (32bit verion) and also chose perl58 while installing. I got below error on my Centos 5.4(x86_64), I did set LD_LIBRARY_PATH and PATH as suggested in your earlier thread.
    /usr/local/staf$STAFProc
    STAFProc: /usr/lib/libstdc++.so.6: version GLIBCXX_3.4.9' not found (required by STAFProc) STAFProc: /usr/lib/libstdc++.so.6: versionGLIBCXX_3.4.11' not found (required by STAFProc)
    STAFProc: /usr/lib/libstdc++.so.6: version GLIBCXX_3.4.9' not found (required by /usr/local/staf/lib/libSTAF.so) STAFProc: /usr/lib/libstdc++.so.6: versionGLIBCXX_3.4.11' not found (required by /usr/local/staf/lib/libSTAF.so)
    /usr/local/staf$

    when I try debugging this error I noticed that my /usr/lib/libstdc++.so.6 doesn't support GLIBCXX_3.4.9 or GLIBCXX_3.4.11...

    /usr/local/staf$strings /usr/lib/libstdc++.so.6 | grep GLIBCXX_3.4
    GLIBCXX_3.4
    GLIBCXX_3.4.1
    GLIBCXX_3.4.2
    GLIBCXX_3.4.3
    GLIBCXX_3.4.4
    GLIBCXX_3.4.5
    GLIBCXX_3.4.6
    GLIBCXX_3.4.7
    GLIBCXX_3.4.8

    I have Centos5.4(x86_64) with gcc version 4.1.2, I did try building gcc-4.4.1 from source, but getting hit with lots of other issues, which I tried resolving but in vain!.
    Do you suggest any specific version of Centos with which this should work?? I would appreciate any help in this regard. My requirment is to make STAF work with Perl 5.8.9 (32bit).

    Thanks a lot again.
    -Srinivas

     
  • Srini

    Srini - 2016-02-10

    Today I got a chance to try on Ubuntu 12.04, but I seem to have some issue with my libperl.so, i.e I do not have some required symbol in my libperl.so i.e Perl_Top_ptr!!, Any workaround for this please??

    [/b/tsrinivas/staf]perl -v
    This is perl, v5.8.9 built for i686-linux-thread-multi

    Copyright 1987-2008, Larry Wall

    Perl may be copied only under the terms of either the Artistic License or the
    GNU General Public License, which may be found in the Perl 5 source kit.

    Complete documentation for Perl, including FAQ lists, should be found on
    this system using "man perl" or "perldoc perl". If you have access to the
    Internet, point your browser at http://www.perl.org/, the Perl Home Page.
    [/b/tsrinivas/staf]
    [/b/tsrinivas/staf] source STAFEnv.sh
    [/b/tsrinivas/staf]echo $PERLLIB
    /b/tsrinivas/staf/lib:/b/tsrinivas/staf/bin
    [/b/tsrinivas/staf]
    [/b/tsrinivas/staf]echo $LD_LIBRARY_PATH
    /b/tsrinivas/staf/lib:/volume/perl/5.8.8/lib/5.10.0/i686-linux-thread-multi/CORE
    /b/tsrinivas/staf]STAFProc &
    [1] 15663
    [/b/tsrinivas/staf]
    Machine : bng-lnx021.xyz.net
    Machine nickname : bng-lnx021.xyz.net
    Startup time : 20160210-06:17:21

    STAFProc version 3.4.24 initialized
    [/b/tsrinivas/staf]
    [/b/tsrinivas/staf]
    [/b/tsrinivas/staf]STAF local SERVICE ADD SERVICE myService LIBRARY STAFEXECPROXY EXECUTE myService OPTION PROXYLIBRARY=PLSTAF OPTION USELIB=/b/tsrinivas/staf/services/myService
    Error submitting request, RC: 27
    Additional info
    ---------------**
    10:Error constructing service, STAFEXECPROXY, Result: Error initializing service, myService, Result: /b/tsrinivas/staf/lib/libPLSTAF.so: undefined symbol: Perl_Top_ptr
    [/b/tsrinivas/staf]

    What I noticed is the Perl_Top_ptr does not exists in my libperl.so. Do you suggest any way out of this??

    [/b/tsrinivas/staf]strings /volume/perl/5.8.8/lib/5.10.0/i686-linux-thread-multi/CORE/libperl.so | grep Perl_Top_ptr
    [/b/tsrinivas/staf]

     
  • Srini

    Srini - 2016-03-01

    Thanks Sharon for helping on this. The issue is resolved. Yes, you were right it was to do with libperl.so !! I had set the ENV, but the libperl.so was not right one. I had to build everything from source, the reason being, I was using some Perl from our filer for which there was no corresponding libperl.so exists!!, this required me to build everything, including gcc, glibc toolchain for 32bit support and perl for 32bit version using these new tool chain, and bingo it worked!

    Thanks for all the support. Your RHEL try on the other mail thread/feature request mail actually lead me to this thinking.

     

Log in to post a comment.