AIX Open Source

 View Only
  • 1.  gettext-0.20.2-1: package rebuild error

    Posted Mon March 01, 2021 11:19 AM
    i need to rebuild the gettext package, alas an compiler error is thrown. all dependencies are up to date and no noteworthy changes are made (just disabled this stupid iconv hardcode patch). so just a plain rpmbuild -ba gettext-0.20.2-1.spec.

    this error is a little bit odd, as gcc 8.3  is used?!

    In file included from ./localename.c:34:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include-fixed/string.h:364:19: error: conflicting types for 'wcscoll_l'
       extern int      wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
                       ^~~~~~~~~
    In file included from /opt/freeware/include/iconv.h:110,
                     from ./gettextP.h:27,
                     from ./localename.c:25:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include-fixed/wchar.h:307:12: note: previous declaration of 'wcscoll_l' was here
     extern int wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
                ^~~~~~~~~
    In file included from ./localename.c:34:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include-fixed/string.h:365:19: error: conflicting types for 'wcsxfrm_l'
       extern size_t   wcsxfrm_l(wchar_t *, const wchar_t *, size_t, locale_t);
                       ^~~~~~~~~
    In file included from /opt/freeware/include/iconv.h:110,
                     from ./gettextP.h:27,
                     from ./localename.c:25:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include-fixed/wchar.h:362:15: note: previous declaration of 'wcsxfrm_l' was here
     extern size_t wcsxfrm_l(wchar_t * __restrict__, const wchar_t * __restrict__, size_t, locale_t);
                   ^~~~~~~~~
    ​


    any hints?



    ------------------------------
    I regret starting this entire conversation
    ------------------------------


  • 2.  RE: gettext-0.20.2-1: package rebuild error

    Posted Tue March 02, 2021 07:51 AM
    Probably you need to create the pre-processing file to figure out the issue. 
    Capture the entire compilation command, add " -E ", run it manually and capture the generated pre-processing file. 
    Then you can look for "wcscoll_l" in the file and see the conflicting declarations.

    ------------------------------
    Ayappan P
    ------------------------------



  • 3.  RE: gettext-0.20.2-1: package rebuild error

    Posted Tue March 02, 2021 09:21 AM
    Edited by C- -T Tue March 02, 2021 10:45 AM
    the preprocessor output revealed nothing really helpful...

    packagebuilder@aixbuildhostng: /home/packagebuilder/rpmbuild/BUILD/gettext-0.20.2/64bit/gettext-runtime/intl # gcc -DHAVE_CONFIG_H -I. -I.. -DLOCALEDIR=\"/usr/local/share/locale\" -DLOCALE_ALIAS_PATH=\"\" -DLIBDIR=\"/usr/local/lib\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"/usr/local/lib\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -Drelocate2=libintl_relocate2 -DDEPENDS_ON_LIBICONV=1 -D_THREAD_SAFE -fvisibility=hidden -g -O2  -c ./localename.c  -fPIC -DPIC -o .libs/localename.o -E
    packagebuilder@aixbuildhostng: /home/packagebuilder/rpmbuild/BUILD/gettext-0.20.2/64bit/gettext-runtime/intl # cd .libs/
    packagebuilder@aixbuildhostng: /home/packagebuilder/rpmbuild/BUILD/gettext-0.20.2/64bit/gettext-runtime/intl/.libs # grep wcscoll_l localename.o
    extern int wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
      extern int wcscoll_l(const wchar_t *, const wchar_t *,
    packagebuilder@aixbuildhostng: /home/packagebuilder/rpmbuild/BUILD/gettext-0.20.2/64bit/gettext-runtime/intl/.libs # grep  wcsxfrm_l localename.o
    extern size_t wcsxfrm_l(wchar_t *
      extern size_t wcsxfrm_l(wchar_t *, const wchar_t *, size_t,
    ​


    commenting out the definitions in /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include-fixed/wchar.h makes compilation go through, but editing compiler internal files is not a valid fix.
     especially as there are more errors about to come along...

    gcc -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I..  -I../intl -I../intl -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1  -D_THREAD_SAFE  -g -O2 -c -o propername.o propername.c
    propername.c: In function 'mbsstr_trimmed_wordbounded':
    propername.c:67:11: error: conversion to non-scalar type requested
               if (MB_CUR_MAX > 1)
               ^~
    gmake[6]: *** [Makefile:1645: propername.o] Error 1
    gmake[6]: Leaving directory '/home/packagebuilder/rpmbuild/BUILD/gettext-0.20.2/64bit/gettext-runtime/gnulib-lib'
    



     so how for heavens sake did you ever get this stuff build correctly?  any special settings in your build env which i'am not aware off?



    ------------------------------
    I regret starting this entire conversation
    ------------------------------



  • 4.  RE: gettext-0.20.2-1: package rebuild error

    Posted Tue March 02, 2021 12:05 PM
    Edited by Ayappan P Tue March 02, 2021 12:05 PM
    We built gettext in AIX 6.1 ( like most of the packages in Toolbox ) and AIX 6.1 don't have these conflicting functions ( wcscoll_l & wcsxfrm_l ).
    These are introduced in AIX 7.1. I will trigger a build in AIX 7.1 and see how it goes.

    ------------------------------
    Ayappan P
    ------------------------------



  • 5.  RE: gettext-0.20.2-1: package rebuild error

    Posted Wed March 03, 2021 08:30 AM
    You need to disable patch4 in the spec file as it is applicable only for AIX 6.1 
    Also the following patch is required.

    # cat gettext-0.20.2-aix-new.patch
    --- ./gettext-runtime/intl/Makefile.in_orig 2021-03-03 14:07:57 +0000
    +++ ./gettext-runtime/intl/Makefile.in 2021-03-03 14:08:50 +0000
    @@ -1841,7 +1841,7 @@
    localename-table.h: $(srcdir)/localename-table.in.h $(srcdir)/export.h
    sed -e 's/extern \([^"]\)/extern LIBINTL_DLL_EXPORTED \1/' \
    -e 's/extern,/extern LIBINTL_DLL_EXPORTED,/' \
    - -e "/#if HAVE_USELOCALE/r $(srcdir)/export.h" \
    + -e "/#if HAVE_WORKING_USELOCALE/r $(srcdir)/export.h" \
    < $(srcdir)/localename-table.in.h \
    | sed -e 's,@''HAVE_VISIBILITY''@,@HAVE_VISIBILITY@,g' \
    > localename-table.h

    ------------------------------
    Ayappan P
    ------------------------------



  • 6.  RE: gettext-0.20.2-1: package rebuild error

    Posted Wed March 03, 2021 08:41 AM
      |   view attached
    Attaching the patch here

    ------------------------------
    Ayappan P
    ------------------------------

    Attachment(s)



  • 7.  RE: gettext-0.20.2-1: package rebuild error

    Posted Wed March 03, 2021 10:53 AM
    after ruling out some local idiocy, the package built successfully, thank you for your support. one thing, i noticed that "slibclean" is called somewhere in the specfile, as this is a "root only" command this can not be executed as my build user (not even with sudo), and building as root is a no go.how did you accomplish that?

    ------------------------------
    I regret starting this entire conversation
    ------------------------------



  • 8.  RE: gettext-0.20.2-1: package rebuild error

    Posted Wed March 03, 2021 11:35 AM
    We use RBAC settings for build user.

    # lssecattr -c /usr/sbin/slibclean

    /usr/sbin/slibclean accessauths=aix.system.config.kext.global,aix.system.config.kext.wpar innateprivs=PV_KER_VARS,PV_KER_CONF secflags=FSF_EPS
    # mkrole authorizations=aix.system.config.kext.global buildrole
    # chuser roles=buildrole default_roles=buildrole buildusr
    # setkst

    Login again as buildusr, you will be able to execute slibclean command.


    ------------------------------
    Ayappan P
    ------------------------------