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.  glib2: Glib headers inconsistent

    Posted Wed March 27, 2019 11:38 AM

    Originally posted by: ctremel


    while trying to build against glib2 the following error is thrown.

     

     Glib headers inconsistent with current compiler setting. You might be using 32 bit Glib with a 64 bit compiler, check PKG_CONFIG_PATH

     

    build section from spec file:

    %build

    export OBJECT_MODE=32
    export CC="/usr/bin/xlc_r"
    export CFLAGS="-O"
    export AR="/usr/bin/ar -X32"
    export RANLIB="/usr/bin/ranlib -X32"
    export NM="/usr/bin/nm -X32"
    export LD="/usr/bin/ld"

    export OPENSSL_CFLAGS="-I/usr/include/openssl"
    export OPENSSL_LIBS="-L/usr/lib -lssl"

    export LDFLAGS="-L/opt/freeware/lib -L/opt/freeware/lib64 -Wl,-blibpath:/opt/freeware/lib:/opt/freeware/lib64:/usr/lib:/lib -Wl,-bnoquiet -Wl,-berok"

    ./configure \
        --prefix=%{_prefix} \
        --sbindir=%{sbindir} \
        --datadir=%{_datadir}/%{name} \
        --mandir=%{_mandir} \
        --sysconfdir=/etc/%{name} \
        --localstatedir=/var/lib/%{name} \
        --disable-spoof-source \
        --enable-dynamic-linking
    cd lib
    gmake
    cd ..
    cd modules
    gmake LIBS="-L%{_libdir} -lglib-2.0 -levtlog ../../lib/libsyslog-ng.la"
    cd ..
    gmake

    how to proceed here?


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 2.  Re: glib2: Glib headers inconsistent

    Posted Wed March 27, 2019 12:14 PM

    Originally posted by: AyappanP


    When does the error shows up ? During configure ? 

    What is the output of " pkg-config --libs glib-2.0 "   ? 


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 3.  Re: glib2: Glib headers inconsistent

    Posted Thu March 28, 2019 04:57 AM

    Originally posted by: ctremel


    yes its an configure error...

     

    pkg-config --libs glib-2.0
    -L/opt/freeware/lib -lglib-2.0 -lintl

    strangely enough there is just one header file and no archives/shared objects in this directory. no glue if this correct.

     

    packagebuilder@aixbuildhostng: /home/packagebuilder # ls /opt/freeware/lib/glib-2.0/
    include
    packagebuilder@aixbuildhostng: /home/packagebuilder # ls /opt/freeware/lib/glib-2.0/include
    glibconfig.h

    failing configure check:

    configure:13569: checking sanity checking Glib headers
    configure:13590: /usr/bin/xlc_r -o conftest -O -D_LARGE_FILES=1 -pthread -I/opt/freeware/include/glib-2.0 -I/opt/freeware/lib/glib-2.0/include -L/opt/freeware/lib -L/opt/freeware/lib64 -Wl,-blibpath:/opt/freeware/lib:/opt/freeware/lib64:/usr/lib:/lib -Wl,-bnoquiet -Wl,-berok -Wl,-brtl conftest.c  >&5
    /opt/IBM/xlc/13.1.0/bin/.orig/xlc_r: 1501-210 (W) command option t contains an incorrect subargument
    ld: 0706-005 Cannot find or open file: /lib/mcrt0.o
            ld:open(): No such file or directory
    configure:13590: $? = 255
    configure: program exited with status 255
    configure: failed program was:
    | /* confdefs.h */
    | #define PACKAGE_NAME ""
    | #define PACKAGE_TARNAME ""
    | #define PACKAGE_VERSION ""
    | #define PACKAGE_STRING ""
    | #define PACKAGE_BUGREPORT ""
    | #define PACKAGE_URL ""
    | #define YYTEXT_POINTER 1
    | #define STDC_HEADERS 1
    | #define HAVE_SYS_TYPES_H 1
    | #define HAVE_SYS_STAT_H 1
    | #define HAVE_STDLIB_H 1
    | #define HAVE_STRING_H 1
    | #define HAVE_MEMORY_H 1
    | #define HAVE_STRINGS_H 1
    | #define HAVE_INTTYPES_H 1
    | #define HAVE_STDINT_H 1
    | #define HAVE_UNISTD_H 1
    | #define HAVE_DLFCN_H 1
    | #define LT_OBJDIR ".libs/"
    | #define _LARGE_FILES 1
    | #define STDC_HEADERS 1
    | #define HAVE_STRINGS_H 1
    | #define HAVE_STROPTS_H 1
    | #define HAVE_SYS_STRLOG_H 1
    | #define HAVE_O_LARGEFILE 1
    | #define HAVE_STRUCT_SOCKADDR_STORAGE 1
    | #define HAVE_ENVIRON 1
    | #define HAVE_STRDUP 1
    | #define HAVE_STRTOL 1
    | #define HAVE_STRTOLL 1
    | #define HAVE_STRTOIMAX 1
    | #define HAVE_INET_ATON 1
    | #define HAVE_INET_NTOA 1
    | #define HAVE_GETOPT_LONG 1
    | #define HAVE_GETADDRINFO 1
    | #define HAVE_GETUTENT 1
    | #define HAVE_PREAD 1
    | #define HAVE_PWRITE 1
    | #define HAVE_STRCASESTR 1
    | #define HAVE_MEMRCHR 1
    | /* end confdefs.h.  */
    |
    | #include <glib.h>
    |
    | int main()
    | {
    |   if (sizeof(long) != GLIB_SIZEOF_LONG)
    |     return 1;
    |   return 0;
    | }
    |
    configure:13600: result: no
    configure:13605: error: Glib headers inconsistent with current compiler setting. You might be using 32 bit Glib with a 64 bit compiler, check PKG_CONFIG_PATH

     

     

     

     

     

     

     


    #AIXOpenSource
    #AIX-Open-Source-Software


  • 4.  Re: glib2: Glib headers inconsistent

    Posted Fri March 29, 2019 01:49 AM

    Originally posted by: sangameshm


    Looks like if you want to use POSIX threads support by having -pthread option, then you need to have /lib/mcrt0.o file present.

     

    # ls -l /lib/mcrt0.o
    lrwxrwxrwx 1 bin bin 20 Apr  4  2017 /lib/mcrt0.o -> /usr/ccs/lib/mcrt0.o


    # ls -l /usr/ccs/lib/mcrt0.o
    -r--r--r-- 1 bin bin 12176 Mar 17  2016 /usr/ccs/lib/mcrt0.o

    # lslpp -w /usr/ccs/lib/mcrt0.o
      File                                        Fileset               Type
      ----------------------------------------------------------------------------
      /usr/ccs/lib/mcrt0.o                        bos.adt.prof          File

     

    Thanks,

    Sangamesh


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 5.  Re: glib2: Glib headers inconsistent

    Posted Fri March 29, 2019 02:41 AM

    Originally posted by: AyappanP


    What is the package you are trying to compile ? 

    To avoid these kind of problems, it's always better to use GCC instead of XLC.


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 6.  Re: glib2: Glib headers inconsistent

    Posted Fri March 29, 2019 08:17 AM

    Originally posted by: ctremel


    i tried to build a syslog-ng package. i the end i gave up on it, as its full of linux specific calls/functions and migrated our syslog-ng instance over to linux. its just not worth the effort.


    #AIX-Open-Source-Software
    #AIXOpenSource