AIX Open Source

 View Only
Expand all | Collapse all

GCC struct sigset_t conflicts with AIX sys/time.h

  • 1.  GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Tue December 29, 2020 03:05 PM

    Hello, this pretty much seem a new problem affecting all releases of GCC under 7.2 latest TL.

    The following code is unable to compile under AIX 7.2 TL5, probably because the sigset_t struct is now defined in /usr/include/sys/time.h:

    #include <sys/wait.h>
    
    int main(){
      return 0;
    }
    

    Stack trace:

    gcc -o program program.c
    In file included from /usr/include/sys/resource.h:57,
                     from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.1.0/include-fixed/sys/wait.h:56,
                     from program.c:1:
    /usr/include/sys/time.h:108:16: error: redefinition of 'struct sigset_t'
     typedef struct sigset_t {
                    ^~~~~~~~
    In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.1.0/include-fixed/sys/wait.h:45,
                     from program.c:1:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.1.0/include-fixed/sys/types.h:345:16: note: originally defined here
     typedef struct sigset_t {
                    ^~~~~~~~
    In file included from /usr/include/sys/resource.h:57,
                     from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.1.0/include-fixed/sys/wait.h:56,
                     from program.c:1:
    /usr/include/sys/time.h:124:3: error: conflicting types for 'sigset_t'
     } sigset_t;
       ^~~~~~~~
    In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.1.0/include-fixed/sys/wait.h:45,
                     from program.c:1:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.1.0/include-fixed/sys/types.h:361:3: note: previous declaration of 'sigset_t' was here
     } sigset_t;
       ^~~~~~~~
    

    I ain't sure when sigset_t was placed in time.h header but I do have an old backup where it is not present (probably in TL3, not sure about TL4). In any case, this is breaking all releases of GCC under that TL.

    My workaround was simply define _SIGSET_T under GCC types.h header, but perhaps someone may be able to come up with a more fashionable and proper way to fix this.

    May be a good idea to look into other structs that may be conflicting as well, sigset_t was the one that brought up my attention.

    Thanks!



    ------------------------------
    Felipe Cardeneti Mendes
    UNIX Engineer
    ------------------------------


  • 2.  RE: GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Tue December 29, 2020 11:41 PM

    Hi Felipe,

    Yes we are aware of the issue and it is because change in AIX header in 72TL5.

    We have already updated gcc and published the fixed one.

    Could you please update latest gcc from toolbox and let us know if that is not fixing your issue. 



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



  • 3.  RE: GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Wed December 30, 2020 07:51 AM

    Hi  @SANKET RATHI ,

    Thanks for your feedback. You forgot to mention the last published GCC is still in the beta folder. The 8.3.0-3 present in the main repos is still broken.

    Yes, the beta one fixes the problem. It seems the same update you guys did is the workaround I came up with to compile my code, so I will just stick with my changes until you guys push it out from beta. Glad my C skills are still worth something :-)



    ------------------------------
    Felipe Cardeneti Mendes
    ------------------------------



  • 4.  RE: GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Wed January 06, 2021 06:56 AM
    Hi Felipe,

    Could you let me know the exact issue you faced with the gcc-8.3.0-3 ?
    gcc-8.3.0-3 should have the required header file fixes.

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



  • 5.  RE: GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Wed April 28, 2021 05:26 AM
    Hi Sangamesh,
    It seems that the issue has been re-introduced by gcc-8.3.0-4. I can no longer find the header fixes there. Could you please have a look?
    Regards
    Johannes

    ------------------------------
    Johannes Kurz
    ------------------------------



  • 6.  RE: GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Wed April 28, 2021 07:32 AM
    Hi Johannes,

    Did you try compiling the sample program ?
    gcc8-8.3.0-4 should have the required header file changes.

    FYI. The fix-include related script is run in the post install part and then the required fix-include headers will be present.

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



  • 7.  RE: GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Wed April 28, 2021 07:50 AM
    Thanks for your prompt answer. I just re-installed gcc-8.3.0-4 and afterwards i was able to compile the above sample.

    ------------------------------
    Johannes Kurz
    ------------------------------



  • 8.  RE: GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Wed May 12, 2021 10:14 AM
    Hi Sangamesh,
              I am facing similar issue on the AIX with GCC version 9.3. When I try to compile the file (contents pasted below)

    bash-5.0$ cat myfile.c
    #include<stdio.h>
    #include<sys/wait.h>
    int main()
    {
    printf("I am here\n" );
    }



    bash-5.0$ gcc myfile.c
    In file included from /usr/include/sys/resource.h:57,
    from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/9/include-fixed/sys/wait.h:56,
    from myfile.c:2:
    /usr/include/sys/time.h:108:16: error: redefinition of 'struct sigset_t'
    108 | typedef struct sigset_t {
    | ^~~~~~~~
    In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/9/include-fixed/stdio.h:501,
    from myfile.c:1:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/9/include-fixed/sys/types.h:345:16: note: originally defined here
    345 | typedef struct sigset_t {
    | ^~~~~~~~
    In file included from /usr/include/sys/resource.h:57,
    from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/9/include-fixed/sys/wait.h:56,
    from myfile.c:2:
    /usr/include/sys/time.h:124:3: error: conflicting types for 'sigset_t'
    124 | } sigset_t;
    | ^~~~~~~~
    In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/9/include-fixed/stdio.h:501,
    from myfile.c:1:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/9/include-fixed/sys/types.h:361:3: note: previous declaration of 'sigset_t' was here
    361 | } sigset_t;
    | ^~~~~~~~

    ------------------------------
    Mandar Shahane
    ------------------------------



  • 9.  RE: GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Wed May 12, 2021 10:16 AM
    Hi Mandar,
    From where did you install gcc 9.3 ?

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



  • 10.  RE: GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Wed May 12, 2021 10:20 AM
    I am not sure, DEVOPS teams have done it, If you can suggest any location I will try and download it from there

    ------------------------------
    Mandar Shahane
    ------------------------------



  • 11.  RE: GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Wed May 12, 2021 11:51 AM
    Can you paste output of "rpm -qi <gcc package>" ? 
    Between this issue is because of recent header file changes in AIX 72TL5.
    gcc make some changes in the AIX header files to make it c++ safe and put it in its include directory for use.
    If the gcc was installed and then system is updated to newer AIX level then gcc include would have older AIX headers and issue can come.
    You can reinstall latest gcc and that should fix the issue and that would be better approach.

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



  • 12.  RE: GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Wed May 12, 2021 11:59 AM
    as asked,

    bash-5.0$ rpm -qi gcc9-cpp-9.3.0-2.ppc
    Name : gcc9-cpp
    Version : 9.3.0
    Release : 2
    Architecture: ppc
    Install Date: Wed May 12 09:48:27 CDT 2021
    Group : Development/Languages
    Size : 32158670
    License : GPL
    Signature : (none)
    Source RPM : gcc9-9.3.0-2.src.rpm
    Build Date : Tue Apr 28 08:32:50 CDT 2020
    Build Host : castor4.coopibm.frec.bull.fr
    URL : http://gcc.gnu.org/
    Summary : The C Preprocessor
    Description :
    Cpp is the GNU C-Compatible Compiler Preprocessor.
    Cpp is a macro processor which is used automatically
    by the C compiler to transform your program before actual
    compilation. It is called a macro processor because it allows
    you to define macros, abbreviations for longer
    constructs.

    The C preprocessor provides four separate functionalities: the
    inclusion of header files (files of declarations that can be
    substituted into your program); macro expansion (you can define macros,
    and the C preprocessor will replace the macros with their definitions
    throughout the program); conditional compilation (using special
    preprocessing directives, you can include or exclude parts of the
    program according to various conditions); and line control (if you use
    a program to combine or rearrange source files into an intermediate
    file which is then compiled, you can use line control to inform the
    compiler about where each source line originated).

    You should install this package if you are a C programmer and you use
    macros.

    ------------------------------
    Mandar Shahane
    ------------------------------



  • 13.  RE: GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Wed May 12, 2021 12:22 PM
    From the build host it looks like it was installed from bullfreeware.com
    You can install latest gcc9-9.3.0-6 from bullfreeware.
    But recently there is a change in the gcc delivery to keep different versions of gcc on AIX together.
    Each gcc is named with its version. so gcc-9.3 is called gcc9
    And the binary will also be called gcc9. 
    There is a default gcc also but I think that is gcc8 for bullfreeware. 


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



  • 14.  RE: GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Sat February 05, 2022 07:31 AM
    Hi
    I upgraded production server from Aix 7.2 TL4 SP2 to Aix 7.2 TL5 SP3

    Getting error while compiling 

    /usr/include/sys/time.h:126:3: error: conflicting types for 'sigset_t'
    } sigset_t;


    I have following RPM


    -bash-4.3# rpm -qa
    bash-4.3.30-1.ppc
    dos2unix-7.0-1.ppc
    emacs-nox-24.5-1.ppc
    expect-5.42.1-3.ppc
    findutils-4.6.0-1.ppc
    freetype2-2.6.2-1.ppc
    gcc-c++-4.8.3-1.ppc
    gdb-7.8.1-1.ppc
    gettext-0.17-8.ppc
    glib2-2.34.3-1.ppc
    info-5.1-2.ppc
    libXft-2.3.2-1.ppc
    libffi-3.2.1-1.ppc
    libiconv-1.14-22.ppc
    libpng-1.6.20-1.ppc
    libssh2-1.4.3-3.ppc
    libstdc++-devel-4.8.3-1.ppc
    m4-1.4.17-1.ppc
    mktemp-1.7-1.ppc
    oracle_client-11.2.0-1.ppc
    perl-5.8.8-2.ppc
    popt-1.16-1.ppc
    rlwrap-0.42-1.ppc
    sed-4.4-1.ppc
    sqlite-3.12.1-1.ppc
    sudo-1.6.9p23-1.ppc
    tcl-8.6.3-1.ppc
    unzip-6.0-4.ppc
    ncurses-5.9-3.ppc
    db-4.8.24-4.ppc
    vim-enhanced-6.3-1.ppc
    file-5.12-2.ppc
    lua-5.1.5-1.ppc
    httpd-2.4.25-1.ppc
    curl-7.56.1-1.ppc
    gpe-agent-aix-3.6-3.ppc
    openssl-1.0.1s-1.ppc
    bzip2-1.0.6-1.ppc
    emacs-24.5-1.ppc
    expat-2.1.1-1.ppc
    fontconfig-2.10.2-1.ppc
    gcc-4.8.3-1.ppc
    gcc-cpp-4.8.3-1.ppc
    gdbm-1.11-1.ppc
    gmp-6.1.0-1.ppc
    less-481-1.ppc
    libXrender-0.9.9-1.ppc
    libgcc-4.8.3-1.ppc
    libmpc-1.0.3-1.ppc
    libsigsegv-2.10-1.ppc
    libstdc++-4.8.3-1.ppc
    logrotate-3.8.5-1.ppc
    make-4.1-1.ppc
    mpfr-3.1.2-3.ppc
    pcre-8.39-1.ppc
    pkg-config-0.28-1.ppc
    readline-6.3-5.ppc
    rsync_64-3.1.2-1.ppc
    serf-1.2.1-1.ppc
    tar-1.28-1.ppc
    tk-8.6.3-1.ppc
    vim-common-7.4.460-1.ppc
    wget-1.17.1-1.ppc
    zlib-1.2.5-6.ppc
    python-2.7.6-1.ppc
    git-2.2.2-2.ppc
    file-libs-5.12-2.ppc
    openldap-2.4.40-1.ppc
    subversion-1.9.5-1.ppc
    ca-certificates-2016.10.7-2.ppc
    gpe-agent-comm-2.7-1.ppc
    AIX-rpm-7.2.5.101-14.ppc

    What are our options ? if i try to update RPM i have to update lot of them, is there option to fix this without updating RPMs?


    ------------------------------
    Rajesh Pandey
    ------------------------------



  • 15.  RE: GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Mon February 07, 2022 12:08 AM
    Your gcc version is very old. The latest gcc version have fixed this error. 
    It is possible to get this error if anytime you update AIX version and AIX version has some header files changed.
    Please update to latest gcc version.

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



  • 16.  RE: GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Thu May 26, 2022 07:27 AM
    Sanket, 
      Where can I pull the latest gcc version from?  bullfreeware.com is not up and http://www.oss4aix.org/ only has version 6.3.0, which produces the same error.

    Thanks,
    Adam

    ------------------------------
    Adam Swartz
    ------------------------------



  • 17.  RE: GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Thu May 26, 2022 07:32 AM
    Get it from AIX Toolbox --> https://www.ibm.com/support/pages/aix-toolbox-open-source-software-downloads-alpha
    Use dnf package manager to install packages.

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



  • 18.  RE: GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Thu May 26, 2022 03:48 PM
    Ayappan,

    I cannot use dnf as the machine is on a restricted network :(  I tried to download the latest gcc (10.3.0).  When I try to install I am getting dependency issues:

    1) gcc requires GMP 6.2.1
    # rpm --qf '[%{REQUIRENAME}-%{REQUIREVERSION}\n]' -qp gcc10-cpp-10.3.0-6.aix7.1.ppc.rpm | grep gmp
    gmp-6.2.1
    libgmp.a(libgmp.so.10)-

    2) but GMP 6.2.1 shows it needs the unshared version of gcc 8.3.0:
    # rpm --qf '[%{REQUIRENAME}-%{REQUIREVERSION}\n]' -qp gmp-6.2.1-1.aix6.1.ppc.rpm | grep libgcc
    libgcc-8.3.0-2
    libgcc_s.a(shr.o)-

    3) The problem is that the unshared version of 8.3.0 is not on AIX Toolbox. 

    The version 8.1 is:
    # rpm --queryformat='%{NAME}-%{VERSION}' -qp libgcc-8-1.aix7.1.ppc.rpm
    libgcc-8

    and the shared version 8.3.0 is:
    # rpm --queryformat='%{NAME}-%{VERSION}' -qp libgcc8-8.3.0-6.aix7.1.ppc.rpm
    libgcc8-8.3.0

    Any ideas where I can get the dependencies I need?

    Thanks





    ------------------------------
    Adam Swartz
    ------------------------------



  • 19.  RE: GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Mon May 30, 2022 11:31 AM

    dnf is the best way to install rpm packages and same applies for AIX toolbox.

    If you have private network then you should create a local dnf repo from AIX toolbox or you can use proxy server.

    If you really do not want to install dnf then you will have to resolve and install dependencies manually and all the dependencies are available on AIX toolbox. 




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



  • 20.  RE: GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Fri June 03, 2022 10:36 AM
    FYI, to use the proxy for installing dnf you can export HTTP_PROXY.  Once that was set (and openssl installed) I was able to run dnf_aixtoolbox.sh and get dnf installed.  It would be nice if the AIX Toolbox page mentioned that under the tips.

    ------------------------------
    Adam Swartz
    ------------------------------



  • 21.  RE: GCC struct sigset_t conflicts with AIX sys/time.h

    Posted Mon June 06, 2022 01:58 PM
    Hi Adam,
    Good to know that you could resolve the issue. 
    Yes we will add a blog/article about it soon.

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