AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system

 View Only
Expand all | Collapse all

gcc

  • 1.  gcc

    Posted Mon June 13, 2022 08:22 AM
    Our server team updated the software on our AIX system.  It's still 7.2 but some of the libraries and programs have been updated.  In doing so, the gcc installation from AIX Toolbox stopped working.  There were issues with the include files.  I read in an earlier post on this forum that a similar situation was fixed by updating the GNU compiler.  Tried to do an update of the gcc package, but it didn't help.  I installed gcc-10 and it works when compiling.  However, it looks like the results are still pointing to the gcc 8 libraries.  Any suggestions on best way to update the GNU compiler suite or how to switch to gcc-10 completely?  Have concerns over mixing and matching versions of gcc and would like to clean this up if possible.  Thanks.

    ------------------------------
    Laura Michaels
    ------------------------------


  • 2.  RE: gcc

    Posted Mon June 13, 2022 10:15 AM
    On AIX 7.2 gcc-8 is still default gcc from AIX Toolbox soon we will be moving to gcc-10 as default.
    So right now gcc (/opt/freeware/bin/gcc) will point to gcc-8 only. 
    You can install gcc-10 together will gcc-8 and you will have to use it as gcc-10.
    In your case I think first you should update gcc-8 and other subrpms of gcc-8 to latest and if it is at latest then try to reinstall it that will fix the header file issues.
    If you want to have gcc-10 as well then install gcc10 and its libraries and subrpms and use it with gcc-10. 
    If I am not wrong then using gcc-10 points to gcc-10 library first.
    Following is same dump of a binary that compiled with gcc-10 and in library search path gcc-10 library path is first

    ***Import File Strings***
    INDEX PATH BASE MEMBER
    0 /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10:/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10/../../..:/opt/freeware/lib:/usr/lib:/lib
    1 libc.a shr.o

    I think best is to reinstall gcc8 and all gcc8 related rpms with "dnf reinstall <packages> or "yum reinstall <packages>"


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



  • 3.  RE: gcc

    Posted Mon June 13, 2022 10:47 AM
    I tried to reinstall/update before I installed gcc-10.  Still getting errors.  When I switched to gcc-10 instead of gcc as the compiler (export CC=gcc10), the issue was resolved.  gcc was working fine before our server team did their updates.  Now only gcc-10 appears to be working.


    Getting errors such as the following with gcc:
    In file included from strcasecmp.c:2:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/stdlib.h:341:25: error: unknown type name 'exit'
    extern _NORETURN(void, exit)(int);

    from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/stdlib.h:411,
    from strcasecmp.c:2:
    /usr/include/sys/time.h:126:3: error: conflicting types for 'sigset_t'
    } sigset_t;

    ------------------------------
    Laura Michaels
    ------------------------------



  • 4.  RE: gcc

    Posted Tue June 14, 2022 06:36 AM
    Hi Laura,

    Please let me know the output of "rpm -qa | grep gcc8" and "oslevel -s".
    With a sample program like strcasecmp.c with stdlib.h include you are able to see the error ?



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



  • 5.  RE: gcc

    Posted Tue June 14, 2022 07:31 AM
    The output of rpm is:
    gcc8-8.3.0-6.ppc
    libgcc8-8.3.0-6.ppc
    gcc8-cpp-8.3.0-6.ppc
    gcc8-c++-8.3.0-6.ppc
    oslevel -s shows:
    7200-05-03-2148

    Was getting the error when attempting to build some libraries from source using gcc with 32 bit support.  Was working perfectly fine before our server team made their updates.  If I export CC=gcc-10 in place of export CC=gcc, it compiles normally without the errors.

    Here's an example of the errors output when I tried to compile psqlodbc version13.02.0000:
    from info.c:19:
    /usr/include/sys/time.h:126:3: error: conflicting types for 'sigset_t'
    } sigset_t;
    ^~~~~~~~
    In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/stdio.h:503,
    from psqlodbc.h:21,
    from info.c:19:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/sys/types.h:361:3: note: previous declaration of 'sigset_t' was here
    } sigset_t;
    ^~~~~~~~
    make[1]: *** [Makefile:657: psqlodbcw_la-info.lo] Error 1

    Thanks.

    ------------------------------
    Laura Michaels
    ------------------------------



  • 6.  RE: gcc

    Posted Tue June 14, 2022 01:02 PM
    Hi Laura,

    Looks gcc's sys/types.h isn't proper.
    You have mentioned that you could reinstall and verify after that.
    During the reinstall did you see the messages related to header files being fixed something like this ?

    Applying io_quotes_def to sys/stropts.h
    Applying aix_null to sys/types.h
    Applying gnu_types to sys/types.h
    Fixed: sys/types.h
    Applying next_wait_union to sys/wait.h
    Fixed: sys/wait.h
    Applying aix_null to time.h
    Fixed: time.h
    Applying aix_null to unistd.h
    Fixed: unistd.h
    Applying io_quotes_def to usersec.h
    .....


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



  • 7.  RE: gcc

    Posted Tue June 14, 2022 01:36 PM
    When I do sudo yum reinstall gcc, I see:
    Downloading Packages:
    Running Transaction Check
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
    Installing : 1:gcc-8-1.ppc 1/2
    Cleanup : gcc 2/2

    Installed:
    gcc.ppc 1:8-1


    ------------------------------
    Laura Michaels
    ------------------------------



  • 8.  RE: gcc

    Posted Wed June 15, 2022 02:02 AM
    Hi Lauran,

    The gcc-8-1 is a meta package which just contains soft link to the original files installed by gcc8 package.
    You need to be reinstalling the "gcc8-8.3.0-6" to fix the gcc header files.

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



  • 9.  RE: gcc

    Posted Wed June 15, 2022 07:06 AM
    Tried yum reinstall gcc and gcc-8.  It just goes to package 8-1.  Is there a way to get yum to reinstall 8.3.0-6 or do you have alternative instructions on best way to get this to reinstall?  Thank you.

    ------------------------------
    Laura Michaels
    ------------------------------



  • 10.  RE: gcc

    Posted Wed June 15, 2022 10:21 AM
    Hi Laura,

    Command "yum reinstall gcc8-8.3.0-6.ppc" should reinstall the gcc8

    # yum reinstall gcc8-8.3.0-6.ppc
    Setting up Reinstall Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package gcc8.ppc 0:8.3.0-6 will be reinstalled
    --> Finished Dependency Resolution
    ......

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