Open Source Development

Power Open Source Development

Explore the open source tools and capabilities for building and deploying modern applications on IBM Power platforms including AIX, IBM i, and Linux.


#Power


#Power

 View Only
  • 1.  _GLOBAL__AIXI_libgpg_error_so runtime definition of the symbol was not found.

    Posted Thu June 02, 2022 10:50 AM
    AIX 7200-05-02
    After installing and upgrading dnf, I now get the following stack trace
    # dnf
    Traceback (most recent call last):

    File "/opt/freeware/bin/dnf", line 57, in <module>
    from dnf.cli import main
    File "/opt/freeware/lib/python3.7/site-packages/dnf/__init__.py", line 32, in <module>
    import dnf.base
    File "/opt/freeware/lib/python3.7/site-packages/dnf/base.py", line 29, in <module>
    import libdnf.transaction
    File "/opt/freeware/lib/python3.7/site-packages/libdnf/__init__.py", line 3, in <module>
    from . import common_types
    File "/opt/freeware/lib/python3.7/site-packages/libdnf/common_types.py", line 13, in <module>
    from . import _common_types
    ImportError: rtld: 0712-001 Symbol _GLOBAL__AIXI_libgpg_error_so was referenced
    from module /opt/freeware/lib/python3.7/site-packages/libdnf/_common_types.so(), but a runtime definition
    of the symbol was not found.
    rtld: 0712-001 Symbol _GLOBAL__AIXD_libgpg_error_so was referenced
    from module /opt/freeware/lib/python3.7/site-packages/libdnf/_common_types.so(), but a runtime definition
    of the symbol was not found.

    The update itself did not show any problems but I had to tweak my self-compiled gnupg
    As point of interest I have my own self compiled version of libgcrypt, libgpg-error and gnupg installed.
    # rpm -q libgcrypt libgpg-error gnupg
    libgcrypt-1.9.4-2.ppc
    libgpg-error-1.45-1.ppc
    gnupg-2.2.35-1.ppc

    How do I export the required symbol from my libgpg-error?
    # ls -la /opt/freeware/lib/libgpg-erro*
    -rwxr-xr-x 1 root system 318287 Jun 2 16:26 /opt/freeware/lib/libgpg-error.a
    -rwxr-xr-x 1 root system 984 Jun 2 16:26 /opt/freeware/lib/libgpg-error.la
    # ar -tv /opt/freeware/lib/libgpg-error.a
    rwxr-xr-x 0/0 298322 Jun 2 16:25 2022 libgpg-error.so.0

    Kind regards
    Frank

    ------------------------------
    Frank Lindner
    ------------------------------

    #AIXOpenSource


  • 2.  RE: _GLOBAL__AIXI_libgpg_error_so runtime definition of the symbol was not found.

    Posted Thu June 02, 2022 11:43 AM
    Hi Frank,

    What compiler have you used to compile the ibgcrypt, libgpg-error and gnupg  ?
    Recompiling them with the Toolbox gcc should bring in the required symbols.

    ------------------------------
    SANGAMESH
    ------------------------------



  • 3.  RE: _GLOBAL__AIXI_libgpg_error_so runtime definition of the symbol was not found.

    Posted Thu June 02, 2022 12:00 PM
    Hi Sangamesh,

    gnupg-2.2.33-1.aix7.2.ppc.rpm                 xlclang++
    libassuan-2.5.5-1.aix7.2.ppc.rpm              xlclang++
    libksba-1.6.0-1.aix7.2.ppc.rpm                xlclang++
    pinentry-1.2.0-1.aix7.2.ppc.rpm               xlclang++
    npth-1.6-1.aix7.2.ppc.rpm                     xlclang++
    libgcrypt-1.9.4-1.aix7.2.ppc.rpm cc
    libgpg-error-1.43-1.aix7.2.ppc.rpm cc

    I use this .profile to prepare for compile:
    export CONFIG_SHELL=/opt/freeware/bin/bash
    export CONFIG_ENV_ARGS=/opt/freeware/bin/bash
    export CC=cc
    export CFLAGS="-qmaxmem=16384 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_AIX71 -D_AIX72 -D_ALL_SOURCE -DFUNCPROTO=15 -O2 -I/opt/freeware/include"
    export CXX=xlC
    export CXXFLAGS=$CFLAGS
    export F77=xlf
    export FFLAGS="-qmaxmem=16384 -O -I/opt/freeware/include"
    export LD=ld
    # for 32-bit applications
    export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000"
    # for 64-bit applications
    export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000"
    export PATH=/opt/freeware/bin:/opt/freeware/sbin:/usr/bin:/bin:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/vac/bin:/usr/vacpp/bin:/usr/ccs/bin:/usr/dt/bin:/usr/opt/perl5/bin:/usr/local/bin:/usr/lib/instl
    export PATH=/opt/IBM/xlC/16.1.0/bin:$PATH

    For xlclang++ I change CC and CXX.

    Kind regards
    Frank

    ------------------------------
    Frank Lindner
    ------------------------------



  • 4.  RE: _GLOBAL__AIXI_libgpg_error_so runtime definition of the symbol was not found.

    Posted Fri June 03, 2022 07:47 AM
    Hi Frank,

    The libraries compiled with xlc won't provide some of the symbols which gcc built libraries needs.
    But it can work the other way around.
    To resolve the current issue you would need to have the Toolbox dependent libraries installed or build the dependent libraries with gcc.



    ------------------------------
    SANGAMESH
    ------------------------------



  • 5.  RE: _GLOBAL__AIXI_libgpg_error_so runtime definition of the symbol was not found.

    Posted Fri June 03, 2022 08:02 AM
    Hi Sangamesh,

    at this point I do not want to change my compile environment to gcc.
    Would xlclang++ be an option?
    Currently the library refuses to be compiled with xlclang++.
    If gcc is the only option, then I will revert to non-dnf environment.

    Kind regards
    Frank

    ------------------------------
    Frank Lindner
    ------------------------------



  • 6.  RE: _GLOBAL__AIXI_libgpg_error_so runtime definition of the symbol was not found.

    Posted Fri June 03, 2022 11:52 AM
    Hi Frank,

    I don't think with xlclang++ it would also work.

    ------------------------------
    SANGAMESH
    ------------------------------



  • 7.  RE: _GLOBAL__AIXI_libgpg_error_so runtime definition of the symbol was not found.

    Posted Fri June 03, 2022 12:38 PM
    Hi Sangamesh,

    could you maybe explain to me, what exactly are these symbols, how are they generated with gcc and why?
    For example, what are the compile options used, with which version of gcc?
    Or have some special configure options been used?
    I assume there has been no code alteration, for libgpg-error or libassuan, from the original source code by IBM.

    Kind regards
    Frank

    ------------------------------
    Frank Lindner
    ------------------------------



  • 8.  RE: _GLOBAL__AIXI_libgpg_error_so runtime definition of the symbol was not found.

    Posted Mon June 06, 2022 01:49 PM
    Edited by SANKET RATHI Mon June 06, 2022 01:50 PM
    Here is the info that may help 

    /* On AIX, initialisers specified with -binitfini are called in breadth-first
       order.
       e.g. if a.out depends on lib1.so, the init function for a.out is called before
       the init function for lib1.so.
    
       To ensure global C++ constructors in linked libraries are run before global
       C++ constructors from the current module, there is additional symbol scanning
       logic in collect2.
    
       The global initialiser/finaliser functions are named __GLOBAL_AIXI_{libname}
       and __GLOBAL_AIXD_{libname} and are exported from each shared library.
    
       collect2 will detect these symbols when they exist in shared libraries that
       the current program is being linked against.  All such initiliser functions
       will be called prior to the constructors of the current program, and
       finaliser functions called after destructors.
    
       Reference counting generated by collect2 will ensure that constructors are
       only invoked once in the case of multiple dependencies on a library.
    
       -binitfini is still used in parallel to this solution.
       This handles the case where a library is loaded through dlopen(), and also
       handles the option -blazy.
    */

    ------------------------------
    SANKET RATHI
    ------------------------------