AIX Open Source

 View Only
Expand all | Collapse all

Getting CSSC replacement for SCCS source control system to compile on AIX

  • 1.  Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Fri April 15, 2022 12:35 PM

    At our site we make extensive use of SCCS (the UNIX native source code control system) for tracking changes to our system files and to our scripts and simple documents and man pages.
    To keep this short, let me just say that when we moved our source and configuration repository from GPFS to an enterprise NFS system, we were stunned to find that SCCS on AIX does not work the same for the root user on NFS as it does on local filesystems or on GPFS.
    This creates a significant problem for us.

    We have worked a case with IBM and found the underlying issue with SCCS, which will take a LONG time to fix, it they decide that it can be fixed without creating other problems.

    There is an open source SCCS-workalike called "CSSC" used on Linux where SCCS is needed, and it behaves as expected on NFS (in Linux).
    IBM asked us whether CSSC on AIX would be an acceptable alternative, and it would, but I have been unable to get CSSC to build on AIX.
    IBM asked us to bring it up in this forum to help prioritize and to see if others might assist.

    I'm pretty sure that the problem is a simple one which people working with open source on AIX have probably solved many times over.
    I have not compiled much code on AIX, due in large part to several excellent sites which have supplied AIX with open source tools for years. 

    I am deeply grateful for their work.  More recently, yum/dnf on AIX has been extremely helpful.


    The  CSSC configure script actually suggests what to do about the problem,
    but
      A)   I'm pretty sure that the indicated error is incorrect
      B)  I have done what it suggests to the best of my abilities, and there is no improvement.
              I might have done it wrong, or the configure tool might have assumed that there is Linux underneath it,

               with a problem of a different sort, such that the suggested fix is not the right one for AIX.




    Configure says this:

    checking whether lstat correctly handles trailing slash... no
    checking for promoted mode_t type... mode_t
    checking for stdbool.h that conforms to C99... yes
    checking for _Bool... yes
    checking for wint_t... yes
    checking whether <wchar.h> uses 'inline' correctly... no
    configure: error: <wchar.h> cannot be used with this compiler (gcc -g ).
    This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
    C99 mode. You have four options:
      - Add the flag -fgnu89-inline to CC and reconfigure, or
      - Fix your include files, using parts of
        <http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
      - Use a gcc version older than 4.3, or
      - Don't use the flags -std=c99 or -std=gnu99.
    Configuration aborted.
    
    


    HOWEVER
    I don't think that this is true -
    If I read the log correctly, the file compiles but does not link, and the link failure is what triggers the message.

    configure:23638: checking whether <wchar.h> uses 'inline' correctly
    configure:23660: gcc -c -g  conftest.c >&5
    configure:23663: $? = 0
    configure:23681: gcc -c -g  conftest.c >&5
    configure:23684: $? = 0
    ld: 0711-317 ERROR: Undefined symbol: .renamed_wcstod
    ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
    collect2: error: ld returned 8 exit status
    configure:23697: result: no
    configure:23700: error: <wchar.h> cannot be used with this compiler (gcc -g ).
    This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
    C99 mode. You have four options:
      - Add the flag -fgnu89-inline to CC and reconfigure, or
      - Fix your include files, using parts of
        <http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
      - Use a gcc version older than 4.3, or
      - Don't use the flags -std=c99 or -std=gnu99.
    Configuration aborted.
    


    As I said, I have been unable to get past this.
    I don't think the message is correct, but I did try to follow the suggestions, just in case, using the two flag-related options.

    At gcc8, using a gcc older than 4.3 seems crazy, assuming that it is even possible.
    I am loathe to "fix my include files" since they are as they were supplied by AIX, and are that way for a reason.
    Any changes that I might make would probably create other issues, or be erased by the next AIX update.

    Does anyone know how to get past this and get on to finding out whether CSSC  will even compile and run ?

    Installed Packages
    AIX-rpm.ppc                            7.2.5.1-19                   @System
    autoconf.noarch                        2.71-1                       @AIX_Toolbox_noarch
    automake.noarch                        1.16.2-1                     @AIX_Toolbox_noarch
    bash.ppc                               5.1.4-2                      @AIX_Toolbox
    bzip2.ppc                              1.0.8-2                      @System
    ca-certificates.ppc                    2020.06.01-2                 @AIX_Toolbox
    ctags.ppc                              5.8-1                        @System
    curl.ppc                               7.79.1-1                     @AIX_Toolbox
    cyrus-sasl.ppc                         2.1.26-5                     @AIX_Toolbox
    db.ppc                                 1:5.3.28-1                   @AIX_Toolbox
    df1020e21410e304.noarch                00011000040041500026-1       @System
    diffutils.ppc                          3.7-1                        @AIX_Toolbox
    dnf.noarch                             4.2.17-32_1                  @System
    dnf-automatic.noarch                   4.2.17-32_1                  @System
    dnf-data.noarch                        4.2.17-32_1                  @System
    expat.ppc                              2.4.4-1                      @AIX_Toolbox
    expect.ppc                             5.45.4-2                     @AIX_Toolbox
    fontconfig.ppc                         2.11.95-4                    @AIX_Toolbox
    freetype2.ppc                          2.10.4-1                     @AIX_Toolbox
    gcc.ppc                                1:8-1                        @AIX_Toolbox_72
    gcc-cpp.ppc                            1:8-1                        @AIX_Toolbox_72
    gcc8.ppc                               8.3.0-6                      @AIX_Toolbox_72
    gcc8-cpp.ppc                           8.3.0-6                      @AIX_Toolbox_72
    gdbm.ppc                               1.19-1                       @AIX_Toolbox
    gettext.ppc                            0.20.2-1                     @AIX_Toolbox
    glib2.ppc                              2.56.1-3                     @AIX_Toolbox
    gmp.ppc                                6.2.1-1                      @AIX_Toolbox
    gnutls.ppc                             3.7.1-1                      @AIX_Toolbox
    gpe-agent-aix.ppc                      3.5-1                        @System
    gpe-agent-comm.ppc                     2.6-5                        @System
    grep.ppc                               3.4-1                        @AIX_Toolbox
    gzip.ppc                               1.10-1                       @System
    info.ppc                               6.7-1                        @AIX_Toolbox
    krb5-libs.ppc                          1.18.4-1                     @AIX_Toolbox
    less.ppc                               557-1                        @AIX_Toolbox
    lftp.ppc                               4.9.1-1                      @AIX_Toolbox
    libXft.ppc                             2.3.2-4waixX11               @AIX_Toolbox
    libXrender.ppc                         0.9.8-3waixX11               @AIX_Toolbox
    libcomps.ppc                           0.1.11-32_1                  @System
    libdnf.ppc                             0.39.1-32_1                  @System
    libffi.ppc                             3.2.1-3                      @AIX_Toolbox
    libgcc.ppc                             1:8-1                        @AIX_Toolbox_72
    libgcc8.ppc                            8.3.0-6                      @AIX_Toolbox_72
    libgcrypt.ppc                          1.9.4-1                      @AIX_Toolbox
    libgomp.ppc                            1:8-1                        @AIX_Toolbox_72
    libgomp8.ppc                           8.3.0-6                      @AIX_Toolbox_72
    libgpg-error.ppc                       1.42-1                       @AIX_Toolbox
    libiconv.ppc                           1.16-1                       @AIX_Toolbox
    libmodulemd.ppc                        1.5.2-32_1                   @System
    libmpc.ppc                             1.2.1-1                      @AIX_Toolbox
    libnghttp2.ppc                         1.46.0-1                     @AIX_Toolbox
    libpng.ppc                             1.6.27-3                     @AIX_Toolbox
    librepo.ppc                            1.11.0-32_1                  @System
    libsmartcols.ppc                       2.34-32_1                    @System
    libsodium.ppc                          1.0.18-1                     @AIX_Toolbox
    libsolv.ppc                            0.7.9-32_1                   @System
    libssh2.ppc                            1.9.0-1                      @AIX_Toolbox
    libstdc++.ppc                          1:8-1                        @AIX_Toolbox_72
    libstdc++8.ppc                         8.3.0-6                      @AIX_Toolbox_72
    libtasn1.ppc                           4.16.0-1                     @AIX_Toolbox
    libtextstyle.ppc                       0.20.2-1                     @AIX_Toolbox
    libtool.ppc                            2.4.6-2                      @AIX_Toolbox
    libunistring.ppc                       0.9.10-1                     @AIX_Toolbox
    libxml2.ppc                            2.9.11-1                     @AIX_Toolbox
    libzstd.ppc                            1.4.4-32_1                   @System
    lz4.ppc                                1.9.2-1                      @AIX_Toolbox
    m4.ppc                                 1.4.18-1                     @AIX_Toolbox
    mpfr.ppc                               4.1.0-1                      @AIX_Toolbox
    ncurses.ppc                            6.2-3                        @AIX_Toolbox
    nettle.ppc                             3.7.3-1                      @AIX_Toolbox
    openldap.ppc                           2.4.58-1                     @AIX_Toolbox
    p11-kit.ppc                            0.23.22-1                    @AIX_Toolbox
    p11-kit-tools.ppc                      0.23.22-1                    @AIX_Toolbox
    pcre.ppc                               8.44-2                       @AIX_Toolbox
    perl.ppc                               1:5.30.3-2                   @AIX_Toolbox
    pysqlite.ppc                           2.8.3-2                      @AIX_Toolbox
    python.ppc                             2.7.18-3                     @AIX_Toolbox
    python-devel.ppc                       2.7.18-3                     @AIX_Toolbox
    python-iniparse.noarch                 0.4-1                        @System
    python-pycurl.ppc                      7.43.0-1                     @AIX_Toolbox
    python-tools.ppc                       2.7.18-3                     @AIX_Toolbox
    python-urlgrabber.noarch               3.10.1-1                     @System
    python3.ppc                            3.7.12-1                     @AIX_Toolbox
    python3-dateutil.noarch                2.8.0-1                      @System
    python3-dnf.noarch                     4.2.17-32_1                  @System
    python3-dnf-plugin-migrate.noarch      4.0.16-32_1                  @System
    python3-dnf-plugins-core.noarch        4.0.16-32_1                  @System
    python3-gpgme.ppc                      1.13.1-32_1                  @System
    python3-hawkey.ppc                     0.39.1-32_1                  @System
    python3-libcomps.ppc                   0.1.11-32_1                  @System
    python3-libdnf.ppc                     0.39.1-32_1                  @System
    python3-librepo.ppc                    1.11.0-32_1                  @System
    python3-six.noarch                     1.13.0-1                     @System
    readline.ppc                           8.1-1                        @AIX_Toolbox
    rpm-python3.ppc                        4.15.1-32_1                  @System
    rsync.ppc                              3.2.3-1                      @AIX_Toolbox
    screen.ppc                             4.7.0-1                      @AIX_Toolbox
    sed.ppc                                4.8-1                        @AIX_Toolbox
    sqlite.ppc                             3.35.5-1                     @AIX_Toolbox
    sudo.ppc                               1.9.5p2-1                    @AIX_Toolbox
    tcl.ppc                                8.6.11-1                     @AIX_Toolbox
    tk.ppc                                 8.6.11-1                     @AIX_Toolbox
    unzip.ppc                              6.0-3                        @System
    vim-common.ppc                         8.2.4286-1                   @AIX_Toolbox
    vim-enhanced.ppc                       8.2.4286-1                   @AIX_Toolbox
    wget.ppc                               1.21.2-1                     @AIX_Toolbox
    which.ppc                              2.14-1                       @System
    xz-libs.ppc                            5.2.5-1                      @AIX_Toolbox
    yum.noarch                             4.2.17-32_1                  @System
    yum-metadata-parser.ppc                1.1.4-2                      @System
    zchunk-libs.ppc                        1.1.4-32_1                   @System
    zlib.ppc                               1.2.11-2                     @AIX_Toolbox
    


    Any help or discussion about SCCS and/or CSSC is very much appreciated.



    ------------------------------
    Michael Shon
    ------------------------------


  • 2.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Fri April 15, 2022 01:18 PM
    Michael,

    I'm curious how you're using SCCS? Do you have any examples?

    Sorry I can't help with CSSC, but can you compile an older version
    perhaps?

    On Fri, Apr 15, 2022 at 04:35:04PM +0000, Michael Shon via IBM Community wrote:
    > At our site we make extensive use of SCCS (the UNIX native source code control system) for tracking changes to our system files and to our scripts and simple documents and man pages.
    > To keep this short, let me just say that when we moved our source and configuration repository from GPFS to an enterprise NFS system, we were stunned to find that SCCS on AIX does not work the same for the root user on NFS as it does on local filesystems or on GPFS.
    > This creates a significant problem for us.
    >
    >
    > We have worked a case with IBM and found the underlying issue with SCCS, which will take a LONG time to fix, it they decide that it can be fixed without creating other problems.
    >
    > There is an open source SCCS-workalike called "CSSC" used on Linux where SCCS is needed, and it behaves as expected on NFS (in Linux).
    > IBM asked us whether CSSC on AIX would be an acceptable alternative, and it would, but I have been unable to get CSSC to build on AIX.
    > IBM asked us to bring it up in this forum to help prioritize and to see if others might assist.
    >
    > I'm pretty sure that the problem is a simple one which people working with open source on AIX have probably solved many times over.
    > I have not compiled much code on AIX, due in large part to several excellent sites which have supplied AIX with open source tools for years.
    >
    >
    > I am deeply grateful for their work. More recently, yum/dnf on AIX has been extremely helpful.
    >
    >
    > The CSSC configure script actually suggests what to do about the problem,
    > but
    > A) I'm pretty sure that the indicated error is incorrect
    > B) I have done what it suggests to the best of my abilities, and there is no improvement.
    > I might have done it wrong, or the configure tool might have assumed that there is Linux underneath it,
    >
    >
    > with a problem of a different sort, such that the suggested fix is not the right one for AIX.
    >
    >
    >
    >
    > Configure says this:
    >
    > checking whether lstat correctly handles trailing slash... no
    > checking for promoted mode_t type... mode_t
    > checking for stdbool.h that conforms to C99... yes
    > checking for _Bool... yes
    > checking for wint_t... yes
    > checking whether <wchar.h> uses 'inline' correctly... no
    > configure: error: <wchar.h> cannot be used with this compiler (gcc -g ).
    > This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
    > C99 mode. You have four options:
    > - Add the flag -fgnu89-inline to CC and reconfigure, or
    > - Fix your include files, using parts of
    > <http: sourceware.org/git/?p="glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621">, or
    > - Use a gcc version older than 4.3, or
    > - Don't use the flags -std=c99 or -std=gnu99.
    > Configuration aborted.
    >
    >
    >
    >
    > HOWEVER
    > I don't think that this is true -
    > If I read the log correctly, the file compiles but does not link, and the link failure is what triggers the message.
    >
    > configure:23638: checking whether <wchar.h> uses 'inline' correctly
    > configure:23660: gcc -c -g conftest.c >&5
    > configure:23663: $? = 0
    > configure:23681: gcc -c -g conftest.c >&5
    > configure:23684: $? = 0
    > ld: 0711-317 ERROR: Undefined symbol: .renamed_wcstod
    > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
    > collect2: error: ld returned 8 exit status
    > configure:23697: result: no
    > configure:23700: error: <wchar.h> cannot be used with this compiler (gcc -g ).
    > This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
    > C99 mode. You have four options:
    > - Add the flag -fgnu89-inline to CC and reconfigure, or
    > - Fix your include files, using parts of
    > <http: sourceware.org/git/?p="glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621">, or
    > - Use a gcc version older than 4.3, or
    > - Don't use the flags -std=c99 or -std=gnu99.
    > Configuration aborted.
    >
    >
    >
    > As I said, I have been unable to get past this.
    > I don't think the message is correct, but I did try to follow the suggestions, just in case, using the two flag-related options.
    >
    > At gcc8, using a gcc older than 4.3 seems crazy, assuming that it is even possible.
    > I am loathe to "fix my include files" since they are as they were supplied by AIX, and are that way for a reason.
    > Any changes that I might make would probably create other issues, or be erased by the next AIX update.
    >
    > Does anyone know how to get past this and get on to finding out whether CSSC will even compile and run ?
    >
    >
    >
    > Installed Packages
    > AIX-rpm.ppc 7.2.5.1-19 @System
    > autoconf.noarch 2.71-1 @AIX_Toolbox_noarch
    > automake.noarch 1.16.2-1 @AIX_Toolbox_noarch
    > bash.ppc 5.1.4-2 @AIX_Toolbox
    > bzip2.ppc 1.0.8-2 @System
    > ca-certificates.ppc 2020.06.01-2 @AIX_Toolbox
    > ctags.ppc 5.8-1 @System
    > curl.ppc 7.79.1-1 @AIX_Toolbox
    > cyrus-sasl.ppc 2.1.26-5 @AIX_Toolbox
    > db.ppc 1:5.3.28-1 @AIX_Toolbox
    > df1020e21410e304.noarch 00011000040041500026-1 @System
    > diffutils.ppc 3.7-1 @AIX_Toolbox
    > dnf.noarch 4.2.17-32_1 @System
    > dnf-automatic.noarch 4.2.17-32_1 @System
    > dnf-data.noarch 4.2.17-32_1 @System
    > expat.ppc 2.4.4-1 @AIX_Toolbox
    > expect.ppc 5.45.4-2 @AIX_Toolbox
    > fontconfig.ppc 2.11.95-4 @AIX_Toolbox
    > freetype2.ppc 2.10.4-1 @AIX_Toolbox
    > gcc.ppc 1:8-1 @AIX_Toolbox_72
    > gcc-cpp.ppc 1:8-1 @AIX_Toolbox_72
    > gcc8.ppc 8.3.0-6 @AIX_Toolbox_72
    > gcc8-cpp.ppc 8.3.0-6 @AIX_Toolbox_72
    > gdbm.ppc 1.19-1 @AIX_Toolbox
    > gettext.ppc 0.20.2-1 @AIX_Toolbox
    > glib2.ppc 2.56.1-3 @AIX_Toolbox
    > gmp.ppc 6.2.1-1 @AIX_Toolbox
    > gnutls.ppc 3.7.1-1 @AIX_Toolbox
    > gpe-agent-aix.ppc 3.5-1 @System
    > gpe-agent-comm.ppc 2.6-5 @System
    > grep.ppc 3.4-1 @AIX_Toolbox
    > gzip.ppc 1.10-1 @System
    > info.ppc 6.7-1 @AIX_Toolbox
    > krb5-libs.ppc 1.18.4-1 @AIX_Toolbox
    > less.ppc 557-1 @AIX_Toolbox
    > lftp.ppc 4.9.1-1 @AIX_Toolbox
    > libXft.ppc 2.3.2-4waixX11 @AIX_Toolbox
    > libXrender.ppc 0.9.8-3waixX11 @AIX_Toolbox
    > libcomps.ppc 0.1.11-32_1 @System
    > libdnf.ppc 0.39.1-32_1 @System
    > libffi.ppc 3.2.1-3 @AIX_Toolbox
    > libgcc.ppc 1:8-1 @AIX_Toolbox_72
    > libgcc8.ppc 8.3.0-6 @AIX_Toolbox_72
    > libgcrypt.ppc 1.9.4-1 @AIX_Toolbox
    > libgomp.ppc 1:8-1 @AIX_Toolbox_72
    > libgomp8.ppc 8.3.0-6 @AIX_Toolbox_72
    > libgpg-error.ppc 1.42-1 @AIX_Toolbox
    > libiconv.ppc 1.16-1 @AIX_Toolbox
    > libmodulemd.ppc 1.5.2-32_1 @System
    > libmpc.ppc 1.2.1-1 @AIX_Toolbox
    > libnghttp2.ppc 1.46.0-1 @AIX_Toolbox
    > libpng.ppc 1.6.27-3 @AIX_Toolbox
    > librepo.ppc 1.11.0-32_1 @System
    > libsmartcols.ppc 2.34-32_1 @System
    > libsodium.ppc 1.0.18-1 @AIX_Toolbox
    > libsolv.ppc 0.7.9-32_1 @System
    > libssh2.ppc 1.9.0-1 @AIX_Toolbox
    > libstdc++.ppc 1:8-1 @AIX_Toolbox_72
    > libstdc++8.ppc 8.3.0-6 @AIX_Toolbox_72
    > libtasn1.ppc 4.16.0-1 @AIX_Toolbox
    > libtextstyle.ppc 0.20.2-1 @AIX_Toolbox
    > libtool.ppc 2.4.6-2 @AIX_Toolbox
    > libunistring.ppc 0.9.10-1 @AIX_Toolbox
    > libxml2.ppc 2.9.11-1 @AIX_Toolbox
    > libzstd.ppc 1.4.4-32_1 @System
    > lz4.ppc 1.9.2-1 @AIX_Toolbox
    > m4.ppc 1.4.18-1 @AIX_Toolbox
    > mpfr.ppc 4.1.0-1 @AIX_Toolbox
    > ncurses.ppc 6.2-3 @AIX_Toolbox
    > nettle.ppc 3.7.3-1 @AIX_Toolbox
    > openldap.ppc 2.4.58-1 @AIX_Toolbox
    > p11-kit.ppc 0.23.22-1 @AIX_Toolbox
    > p11-kit-tools.ppc 0.23.22-1 @AIX_Toolbox
    > pcre.ppc 8.44-2 @AIX_Toolbox
    > perl.ppc 1:5.30.3-2 @AIX_Toolbox
    > pysqlite.ppc 2.8.3-2 @AIX_Toolbox
    > python.ppc 2.7.18-3 @AIX_Toolbox
    > python-devel.ppc 2.7.18-3 @AIX_Toolbox
    > python-iniparse.noarch 0.4-1 @System
    > python-pycurl.ppc 7.43.0-1 @AIX_Toolbox
    > python-tools.ppc 2.7.18-3 @AIX_Toolbox
    > python-urlgrabber.noarch 3.10.1-1 @System
    > python3.ppc 3.7.12-1 @AIX_Toolbox
    > python3-dateutil.noarch 2.8.0-1 @System
    > python3-dnf.noarch 4.2.17-32_1 @System
    > python3-dnf-plugin-migrate.noarch 4.0.16-32_1 @System
    > python3-dnf-plugins-core.noarch 4.0.16-32_1 @System
    > python3-gpgme.ppc 1.13.1-32_1 @System
    > python3-hawkey.ppc 0.39.1-32_1 @System
    > python3-libcomps.ppc 0.1.11-32_1 @System
    > python3-libdnf.ppc 0.39.1-32_1 @System
    > python3-librepo.ppc 1.11.0-32_1 @System
    > python3-six.noarch 1.13.0-1 @System
    > readline.ppc 8.1-1 @AIX_Toolbox
    > rpm-python3.ppc 4.15.1-32_1 @System
    > rsync.ppc 3.2.3-1 @AIX_Toolbox
    > screen.ppc 4.7.0-1 @AIX_Toolbox
    > sed.ppc 4.8-1 @AIX_Toolbox
    > sqlite.ppc 3.35.5-1 @AIX_Toolbox
    > sudo.ppc 1.9.5p2-1 @AIX_Toolbox
    > tcl.ppc 8.6.11-1 @AIX_Toolbox
    > tk.ppc 8.6.11-1 @AIX_Toolbox
    > unzip.ppc 6.0-3 @System
    > vim-common.ppc 8.2.4286-1 @AIX_Toolbox
    > vim-enhanced.ppc 8.2.4286-1 @AIX_Toolbox
    > wget.ppc 1.21.2-1 @AIX_Toolbox
    > which.ppc 2.14-1 @System
    > xz-libs.ppc 5.2.5-1 @AIX_Toolbox
    > yum.noarch 4.2.17-32_1 @System
    > yum-metadata-parser.ppc 1.1.4-2 @System
    > zchunk-libs.ppc 1.1.4-32_1 @System
    > zlib.ppc 1.2.11-2 @AIX_Toolbox
    >
    >
    >
    > Any help or discussion about SCCS and/or CSSC is very much appreciated.
    >
    >
    > ------------------------------
    > Michael Shon
    > ------------------------------
    >
    >
    > Reply to Sender : https://community.ibm.com/community/user/eGroups/PostReply?GroupId=6211&MID=253057&SenderKey=e6f5e66a-4df1-46cf-ba9a-79aef6a4faf4
    >
    > Reply to Discussion : https://community.ibm.com/community/user/eGroups/PostReply?GroupId=6211&MID=253057
    >
    >
    >
    > You are subscribed to "AIX Open Source" as Russell.Adams@AdamsSystems.nl. To change your subscriptions, go to http://community.ibm.com/community/user/preferences?section=Subscriptions. To unsubscribe from this community discussion, go to http://community.ibm.com/HigherLogic/eGroups/Unsubscribe.aspx?UserKey=c23dfccc-9910-40ae-beeb-fdcbced5bf1f&sKey=KeyRemoved&GroupKey=af5415f8-d8d8-4ac4-b3cb-08a8da184054.


    ------------------------------------------------------------------
    Russell Adams Russell.Adams@AdamsSystems.nl
    Principal Consultant Adams Systems Consultancy
    https://adamssystems.nl/




  • 3.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Tue April 19, 2022 04:01 PM
    You seem to be asking "why use SCCS (or any other source control system)?"
    I wouldn't try to run an enterprise without it, or something equivalent.

    I believe that (as much as possible) whenever you change a file (pretty much any text file), 
    • you should be able to get the previous version back (or any other version) in case the new one is wrong
    • you should be able to see when the change was made
    • you should be able to see who made the change and especially why

    So for example you change things like
    • the nameservers or search path in /etc/resolv.conf
    • the hosts and addresses in /etc/hosts
    • the content of  any crontab
    • the users and aliases in /etc/mail/aliases
    • the rules or the relay in /etc/mail/sendmail.cf (ignoring whether that's the right place to do it)
    • the mappings in any of the automount maps
    • the source code for any of the zillion scripts which keep your site running
    • the content of the .profile / .bashrc, etc for anyone, but especially root
    • the history of your ssh keys, authorized_keys, known_hosts  (ever had an AIX upgrade break all of your ssh access)
    • the content in any of the master files or templates for your new-system-build processes


    All of these should have a readily-accessible history of the changes to the content,  and it is a particular bonus when you also have comments explaining what was changed any why.
    SCCS (maybe CSSC) is the more-or-less built-in way to do that on AIX and other UNIXes.

    The SCCS change history makes it simple to reverse any change by pulling back any previous version, or to compare any two versions.
    All versions are available right there where the file is (unless you go to some effort to put them somewhere else) so it is extremely convenient to work with any version of a file.
         (SCCS keeps the change history and comments for /path/to/somefile   in /path/to/SCCS/s.somefile )

    With a wrapper or two to make the steps involved in using SCCS simple, (check-out, edit, gather-comments-check-in) this can be quite easy.
    You just need the cooperation of your system admins, and just a little discipline.

         There are better source control systems (all based on what was learned from using SCCS) but they are all more heavyweight.
          That weight might be worthwhile, especially if you have (for example) a "subversion" or "git" infrastructure in place for some other reason.

    As a simple example, we have a wrapper named "checkinfile" which (for a list of files) checks in the file (the first time) or checks in any changes since the previous version was checked in.  
    We run it before we make any change to a file, and if someone has previously changed the file and did not check in the result, it gets checked in before we modify it again.
    We (ideally) run it again after the change that we have just made, and that change is checked in, and we can tell if it gets altered after that.

    It can also take a series of files which are previous versions of a file (foo.01 foo.02 foo.pre-upgrade, foo.post-upgrade) which so many of us have laying around and checks them in to SCCS, in order, as the history of the file - a series of versions which we can get back without having the copies laying around making a mess.

    For quick interactive changes or larger source-code changes, we have a more complex wrapper "sccsci" (SCCS check-in) which

    • makes the file(s) ready to edit,
    • launches your favorite editor for each one,
    • as the editor exits, creates a file which includes your user name and password-file GECOS description (for who-made-the-change)
      as well as all of the changes you made and
    • launches the editor on that file so that you can enter comments (i.e. what kind of things were changed, and why) .
    • When that editor exits, it extracts your name and the comments you added to it and uses them as the change-comments for your file as it
    • checks the changes back in. 

    It takes care to preserve the permissions (and with sudo's help the owner and group) in the process.
    Hard to describe, but it is a very  simple one-command way to make a change, document it, and check in the result WITH comments, for safekeeping.
             sccsci -e /etc/mail/aliases
    It also has a hook to use "visudo -f " to allow you to use sccsci to change the sudoers file under source control and still have the benefit of visudo .


    crontab example :
    Since "crontab -e" is more-or-less necessary for changing crontab files but has no concept of keeping the old, working crontab safe,. we have a root cron job which periodically reaches out to all of our systems and brings back the crontabs for all users, and (with checkinfile) checks in any recent changes to our central crontab "source" repository by system and user.

    You can later find out when a cron change was made within a  a few minutes of when it happened, and can easily get back the previous working version when someone breaks something , or accidentally erases the crontab by using the "crontab" command badly.


    That should give you good examples of how to make use of SCCS to make system management and change control more reliable, traceable, and resilient.

    As they used to say - "Don't leave home without it"
    -Mike Shon



    ------------------------------
    Michael Shon
    ------------------------------



  • 4.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Tue April 19, 2022 05:22 PM
    Bravo! Impressive usage!!!  I certainly understand your "root" usage now!!!!

    ------------------------------
    Jan Harris
    AIX Development Support (Liaison to the AIX Toolbox for Open Source)
    IBM (Contract)
    Austin TX
    ------------------------------



  • 5.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Wed April 20, 2022 05:35 AM
    I've used VC and DVCS for ages, including in systems administration of AIX. I used to install RCS to version single files in /etc. Git and other systems are too large, and I don't want to setup a project directory. I just want to track changes to a file.

    I was asking for an example of SCCS because I didn't realize it was available on AIX. That's great if it's already present, one less thing to install! An example of your workflow around SCCS would be useful (ie: commands).

    With a little searching I found: https://www.ibm.com/docs/en/aix/7.2?topic=concepts-source-code-control-system

    Very nice!

    ------------------------------
    ========================
    Russell Adams
    https://adamssystems.nl/
    ========================
    ------------------------------



  • 6.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Thu April 21, 2022 10:07 AM
    Well  then,  you don't need any convincing that source control is a very important part of system change management.
    My apologies for assuming otherwise.

    I'm only 9 years into AIX, (about 40 years into UNIX) and when I first started with AIX, SCCS was not installed, but I did figure out where to get the packages in the AIX releases, and I installed it ASAP.

    I have the impression that somewhere around AIX 7 it started coming in the base OS, but I could easily be wrong.
    I don't recall having installed it manually for several years, but I might have just forgotten.
    As for workflow -
    the "sccs" command is sort of a wrapper for the common SCCS functions,
    which are generally available as  independent commands like "get", "unget", "delta" .

    It provides some common combinations, like "delget" ( delta, then get ) and usually uses the name of the file that you want to work with like /etc/hosts, not the names of the "SCCS file" for your file, /etc/SCCS/s.hosts

    The basic steps are something like this.
    I use wrapper scripts to preserve the file permissions, make the directory, etc.

    To get a file under SCCs control
             mkdir SCCS             # all SCCS state files go into a SCCS subdir in the file's directory
             sccs create filename # neverusedagain
                   # this leaves the original filename set aside with a comma in front , as ",filename"
                   # and the s-dot file containing its metadata and history :  SCCS/s.filename
             rm ,filename   # no need for comma-file anymore
             sccs get filename
                  # this leaves a read-only copy of the file
                  
     
    To update a file which has not been changed since the last checkin
             sccs edit filename
                  # this leaves a writable copy of the most recent version
                  # AND a p-dot file showing that it is being edited   SCCS/p.filename
             <edit the file with your favorite editor or automated process>

                  # check in the changes - (the "delta" )  and get a read-only copy back
                  # runs "delta"  ,then "get"
                sccs delget  [ -y" comments about what changed and why" ]  filename
                     It will ask for comments if they are not on the command line

        Note that if you "sccs edit" a file which has been changed since the last checkin
        it will  FIRST check out the last checked-in version and you will lose the changes.

        The wrapper that I use makes sure that the file has not been changed since the last checkin.
         If it has, then it makes sure that I preserve those changes in SCCS before I make any more changes.
         It makes a copy of the changed file, "sccs edit"s the original file, overwrites it with the copy,
         shows me the differences from the last check-ed-in version,
         and helps me comment and check in those pending changes,
         BEFORE allowing me to make the changes that I was planning to make.
        
             
    To see what files in a directory are out-for-editing
             sccs tell            # just gets the names
             sccs info          # gets the names, revision numbers, users
                 e.g.   filename is being edited: 1.1 1.2 username 22/04/21 09:58:56

     To see what is different since the last check-in
    sccs diffs filename
    ------- filename  -------
    1a2,4
    >
    > The first new line
    > and another

    To see the change  history of the file including comments
             sccs prs filename


    ​​​​​​​​​​​​​

    ------------------------------
    Michael Shon
    ------------------------------



  • 7.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Fri April 15, 2022 01:35 PM
    Hi, Michael

    I used this:

    # export
    gl_cv_header_wchar_h_correct_inline=yes;./configure

    I found this out on some discussions, and am not quite sure what this does, but it did result in completion.

    However I could not make yet .. and do not think that is related to the wchar variable I used (well, at least not yet :-) )


    In file included from opendir-safer.c:20:
    ../../config.h:1290:16: error: duplicate 'unsigned'
    #define size_t unsigned int
    ^~~~~~~~
    ../../config.h:1290:25: error: two or more data types in declaration specifiers
    #define size_t unsigned int
    ^~~
    make: 1254-004 The error code from the last command is 1.





    ------------------------------
    Jan Harris
    AIX Development Support (Liaison to the AIX Toolbox for Open Source)
    IBM (Contract)
    Austin TX
    ------------------------------



  • 8.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Fri April 15, 2022 04:15 PM
    Some things I tried today...

    1) Changed config.h (Commented out the duplicate size_t)

    /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
    'size_t'. */​

    2) Ran configure
    # export gl_cv_header_wchar_h_correct_inline=yes;./configure

    3)  Removed testutils from Makefile: (had multiple errors, but don't need it anyway...)

    ! SUBDIRS = gl docs auxfiles src sccs-cgi unit-tests tests
    + # Removed testutils​

    4)  Added cstring to src/run.cc

    + #include <cstring> to run.cc​

    5)  Defined pfail in src/sccs.c:

    + char *pfail;
      pfail = getenv(binary_support);​


    But ultimately hit another failure... 

    /bin/sh ../libtool --tag=CXX --mode=link g++ -g -L../gl/lib -o get get.o pf-add.o sf-chkid.o sf-kw.o sf-get2.o pf-del.o libcssc.a
    libtool: link: g++ -g -o get get.o pf-add.o sf-chkid.o sf-kw.o sf-get2.o pf-del.o -L../gl/lib libcssc.a
    ld: 0711-317 ERROR: Undefined symbol: .user_is_group_member(unsigned int)
    ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
    collect2: error: ld returned 8 exit status

    ------------------------------
    Jan Harris
    AIX Development Support (Liaison to the AIX Toolbox for Open Source)
    IBM (Contract)
    Austin TX
    ------------------------------



  • 9.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Fri April 15, 2022 05:49 PM
    Thanks very much for all of this - you got much farther than I.
    But isn't that the way ... you cure another problem and feel like that should do it, and then BAM!

    With your help I finally got it to compile and run, although it bothers me that it compiles on Linux without those changes in the source files.
    I suppose it must be sections of conditional code that doesn't get used for Linux.

    I think that the only other thing that I did was to add  these to config.h

    /* Define to 1 if you have the `getegid' function. */
    /* #undef HAVE_GETEGID */
    #define HAVE_GETEGID 1

    /* Define to 1 if you have the `geteuid' function. */
    /* #undef HAVE_GETEUID */
    #define HAVE_GETEUID 1


    I need to redo it with options to relocates the binaries somewhere where they are handy but won't conflict with the native SCCS files.

    Thanks!


    ------------------------------
    Michael Shon
    ------------------------------



  • 10.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Fri April 15, 2022 07:52 PM
    Hooray! I finally scored ONE POINT for the day - haha! 

    I removed the objects and libs, and ran configure/make again, and testutils built.  The previous errors could be due to the order I was building/hacking previously.

    Hopefully one of the guys from the AIX Toolbox team will have some ideas about the compiling differences.

    Meanwhile, I will post the latest steps for them to review, in case they will consider building this for the toolbox.

    -----------------------------------------
    1) Modify config.h
    -----------------------------------------
    * 1.1. Comment out the duplicate size_t

    /* Define to `unsigned int' if <sys/types.h> does not define. */
    /* #undef size_t */

    * 1.2. Define getegid/geteuid

    /* Define to 1 if you have the `getegid' function. */
    /* #undef HAVE_GETEGID */
    #define HAVE_GETEGID 1

    /* Define to 1 if you have the `geteuid' function. */
    /* #undef HAVE_GETEUID */
    #define HAVE_GETEUID 1

    -----------------------------------------
    2) Run configure with wchar inline setting:
    -----------------------------------------
    # export gl_cv_header_wchar_h_correct_inline=yes;./configure

    -----------------------------------------
    3) Modify src/run.cc
    -----------------------------------------
    + #include <cstring> to run.cc​

    -----------------------------------------
    4) Modify src/sccs.c
    -----------------------------------------
    + char *pfail;
    pfail = getenv(binary_support);​

    -----------------------------------------
    5) Run make
    -----------------------------------------
    # make

    -----------------------------------------
    6) test:
    -----------------------------------------

    # if make check 2>&1 | tee make.log
    then
    echo SUCCESS
    else
    echo FAILURE
    fi

    This got pretty far, but then I hit errors building the googletest:

    Making check in unit-tests
    make test_sid test_relvbr test_release test_sid_list test_rel_list test_sccsdate test_delta test_delta-table test_encoding test_encoding2 test_linebuf test_bigfile testwrapper.sh
    /bin/sh ../libtool --tag=CXX --mode=link g++ -D_THREAD_SAFE -DGTEST_HAS_PTHREAD=1 -g -O2 -o test_sid test_sid.o googletest/lib/libgtest.la googletest/lib/libgtest_main.la ../src/libcssc.a
    libtool: link: g++ -D_THREAD_SAFE -DGTEST_HAS_PTHREAD=1 -g -O2 -o test_sid test_sid.o googletest/lib/.libs/libgtest.a googletest/lib/.libs/libgtest_main.a ../src/libcssc.a
    ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_destroy
    ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock
    ld: 0711-317 ERROR: Undefined symbol: .pthread_self
    ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock
    ld: 0711-317 ERROR: Undefined symbol: .pthread_getspecific
    ld: 0711-317 ERROR: Undefined symbol: .pthread_key_delete
    ld: 0711-317 ERROR: Undefined symbol: .pthread_setspecific
    ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_init
    ld: 0711-317 ERROR: Undefined symbol: .pthread_key_create
    ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
    collect2: error: ld returned 8 exit status
    make: The error code from the last command is 1.

    I just manually added the -pthread to unit-tests/Makefile

    CXXFLAGS = -g -O2 -pthread

    This got a little further, but then hit a bunch of new errors:

    g++ -DHAVE_CONFIG_H -I. -I.. -I./googletest//include -lpthread -I./../src -D_THREAD_SAFE -DGTEST_HAS_PTHREAD=1 -g -O2 -pthread -MT test_sid_list.o -MD -MP -MF .deps/test_sid_list.Tpo -c -o test_sid_list.o test_sid_list.cc
    In file included from /usr/include/pthread.h:65,
    from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include/c++/powerpc-ibm-aix7.1.0.0/pthread/bits/gthr-posix.h:35,
    from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include/c++/powerpc-ibm-aix7.1.0.0/pthread/bits/gthr-default.h:30,
    from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include/c++/powerpc-ibm-aix7.1.0.0/pthread/bits/gthr.h:148,
    from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include/c++/ext/atomicity.h:35,
    from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include/c++/bits/basic_string.h:39,
    from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include/c++/string:52,
    from ./../src/cssc.h:33,
    from ./../src/sl-merge.h:30,
    from test_sid_list.cc:24:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include-fixed/unistd.h:210:16: error: conflicting declaration of C function 'off64_t lseek64(int, off64_t, int)'
    extern off64_t lseek64(int, off64_t, int);
    ^~~~~~~
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include-fixed/unistd.h:208:14: note: previous declaration 'off_t lseek64(int, off_t, int)'
    extern off_t lseek(int, off_t, int);
    ^~~~~

    So..... I decided I don't know enough about the pthread stuff in this application, as I saw comments in the change log about disabling pthread stuff.

    -----------------------------------------
    7) Install
    -----------------------------------------
    # make install

    This completed successfully​​​​

    ------------------------------
    Jan Harris
    AIX Development Support (Liaison to the AIX Toolbox for Open Source)
    IBM (Contract)
    Austin TX
    ------------------------------



  • 11.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Thu April 21, 2022 10:34 AM
    I tried compiling CSSC 1.4.1 version in AIX 7.1. It is a clean build for me. No changes required. All the test cases are also passed. 

    export CC="gcc -pthread -maix64 -D_ALL_SOURCE -D_LINUX_COMPAT -O2"
    export CXX="g++ -pthread -maix64 -D_ALL_SOURCE -D_LINUX_COMPAT -O2"
    export OBJECT_MODE=64

    ./configure 
    gmake 
    gmake install DESTDIR=<some-temp-dir>

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



  • 12.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Thu April 21, 2022 11:22 AM
    Well, that is a dramatically different result.
    I was pretty sure that the people here would know the secret handshake to make this work.

    I had no idea whatsoever what to use for $CC or $CXX , and did not know about OBJECT_MODE

    I did not have "gmake", but the Toolkit had "make" in it, so I took a chance, and that installed make/gmake in /opt//freeware .
    I fully expect that to work a lot better with OpenSource code with a Linux heritage than the AIX make .

    When I tried your example on AIX 7.2 , the configure went great, but I did not quite get through the make:

    gmake[2]: Entering directory '/tmp/CSSC/attempt2/CSSC-1.4.1/work/testutils'
    gcc -pthread -maix64 -D_ALL_SOURCE -D_LINUX_COMPAT -O2 -std=gnu99 -DHAVE_CONFIG_H -I. -I../../testutils -I.. -I ../gl/lib -I ../../testutils/../gl/lib -g -O2 -MT lndir.o -MD -MP -MF .deps/lndir.Tpo -c -o lndir.o ../../testutils/lndir.c
    mv -f .deps/lndir.Tpo .deps/lndir.Po
    /bin/sh ../libtool --tag=CC --mode=link gcc -pthread -maix64 -D_ALL_SOURCE -D_LINUX_COMPAT -O2 -std=gnu99 -g -O2 -L../gl/lib -o lndir lndir.o
    libtool: link: gcc -pthread -maix64 -D_ALL_SOURCE -D_LINUX_COMPAT -O2 -std=gnu99 -g -O2 -o lndir lndir.o -L../gl/lib -pthread
    g++ -pthread -maix64 -D_ALL_SOURCE -D_LINUX_COMPAT -O2 -DHAVE_CONFIG_H -I. -I../../testutils -I.. -I ../gl/lib -I ../../testutils/../gl/lib -g -O2 -MT realpwd.o -MD -MP -MF .deps/realpwd.Tpo -c -o realpwd.o ../../testutils/realpwd.cc
    In file included from ../../testutils/realpwd.cc:25:
    ../gl/lib/stddef.h:104:3: error: conflicting declaration 'typedef union max_align_t max_align_t'
    } max_align_t;
    ^~~~~~~~~~~
    In file included from ../gl/lib/stddef.h:55,
    from ../../testutils/realpwd.cc:25:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include/stddef.h:437:3: note: previous declaration as 'typedef struct max_align_t max_align_t'
    } max_align_t;
    ^~~~~~~~~~~
    gmake[2]: *** [Makefile:1222: realpwd.o] Error 1


    Still, far, far better than my earlier attempts.
    Thanks!

    ------------------------------
    Michael Shon
    ------------------------------



  • 13.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Thu April 21, 2022 11:32 AM
    Might be worth asking in IRC (Libera.chat ##aix), some people there
    compile their own software.

    On Thu, Apr 21, 2022 at 03:21:57PM +0000, Michael Shon via IBM Community wrote:
    > Well, that is a dramatically different result.
    > I was pretty sure that the people here would know the secret handshake to make this work.
    >
    > I had no idea whatsoever what to use for $CC or $CXX , and did not know about OBJECT_MODE
    >
    > I did not have "gmake", but the Toolkit had "make" in it, so I took a chance, and that installed make/gmake in /opt//freeware .
    > I fully expect that to work a lot better with OpenSource code with a Linux heritage than the AIX make .
    >
    > When I tried your example on AIX 7.2 , the configure went great, but I did not quite get through the make:
    >
    > gmake[2]: Entering directory '/tmp/CSSC/attempt2/CSSC-1.4.1/work/testutils'
    > gcc -pthread -maix64 -D_ALL_SOURCE -D_LINUX_COMPAT -O2 -std=gnu99 -DHAVE_CONFIG_H -I. -I../../testutils -I.. -I ../gl/lib -I ../../testutils/../gl/lib -g -O2 -MT lndir.o -MD -MP -MF .deps/lndir.Tpo -c -o lndir.o ../../testutils/lndir.c
    > mv -f .deps/lndir.Tpo .deps/lndir.Po
    > /bin/sh ../libtool --tag=CC --mode=link gcc -pthread -maix64 -D_ALL_SOURCE -D_LINUX_COMPAT -O2 -std=gnu99 -g -O2 -L../gl/lib -o lndir lndir.o
    > libtool: link: gcc -pthread -maix64 -D_ALL_SOURCE -D_LINUX_COMPAT -O2 -std=gnu99 -g -O2 -o lndir lndir.o -L../gl/lib -pthread
    > g++ -pthread -maix64 -D_ALL_SOURCE -D_LINUX_COMPAT -O2 -DHAVE_CONFIG_H -I. -I../../testutils -I.. -I ../gl/lib -I ../../testutils/../gl/lib -g -O2 -MT realpwd.o -MD -MP -MF .deps/realpwd.Tpo -c -o realpwd.o ../../testutils/realpwd.cc
    > In file included from ../../testutils/realpwd.cc:25:
    > ../gl/lib/stddef.h:104:3: error: conflicting declaration 'typedef union max_align_t max_align_t'
    > } max_align_t;
    > ^~~~~~~~~~~
    > In file included from ../gl/lib/stddef.h:55,
    > from ../../testutils/realpwd.cc:25:
    > /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include/stddef.h:437:3: note: previous declaration as 'typedef struct max_align_t max_align_t'
    > } max_align_t;
    > ^~~~~~~~~~~
    > gmake[2]: *** [Makefile:1222: realpwd.o] Error 1
    >
    >
    > Still, far, far better than my earlier attempts.
    > Thanks!
    >
    > ------------------------------
    > Michael Shon
    > ------------------------------
    > -------------------------------------------
    > Original Message:
    > Sent: Thu April 21, 2022 10:33 AM
    > From: Ayappan P
    > Subject: Getting CSSC replacement for SCCS source control system to compile on AIX
    >
    > I tried compiling CSSC 1.4.1 version in AIX 7.1. It is a clean build for me. No changes required. All the test cases are also passed.
    >
    > export CC="gcc -pthread -maix64 -D_ALL_SOURCE -D_LINUX_COMPAT -O2"
    > export CXX="g++ -pthread -maix64 -D_ALL_SOURCE -D_LINUX_COMPAT -O2"
    > export OBJECT_MODE=64
    >
    > ./configure
    > gmake
    > gmake install DESTDIR=<some-temp-dir>
    >
    > ------------------------------
    > Ayappan P
    > ------------------------------
    >
    > Original Message:
    > Sent: Fri April 15, 2022 07:52 PM
    > From: Jan Harris
    > Subject: Getting CSSC replacement for SCCS source control system to compile on AIX
    >
    > Hooray! I finally scored ONE POINT for the day - haha!
    >
    > I removed the objects and libs, and ran configure/make again, and testutils built. The previous errors could be due to the order I was building/hacking previously.
    >
    > Hopefully one of the guys from the AIX Toolbox team will have some ideas about the compiling differences.
    >
    > Meanwhile, I will post the latest steps for them to review, in case they will consider building this for the toolbox.
    >
    > -----------------------------------------
    > 1) Modify config.h
    > -----------------------------------------
    > * 1.1. Comment out the duplicate size_t
    >
    > /* Define to `unsigned int' if <sys types.h=""> does not define. */
    > /* #undef size_t */
    >
    > * 1.2. Define getegid/geteuid
    >
    > /* Define to 1 if you have the `getegid' function. */
    > /* #undef HAVE_GETEGID */
    > #define HAVE_GETEGID 1
    >
    > /* Define to 1 if you have the `geteuid' function. */
    > /* #undef HAVE_GETEUID */
    > #define HAVE_GETEUID 1
    >
    > -----------------------------------------
    > 2) Run configure with wchar inline setting:
    > -----------------------------------------
    > # export gl_cv_header_wchar_h_correct_inline=yes;./configure
    >
    > -----------------------------------------
    > 3) Modify src/run.cc
    > -----------------------------------------
    > + #include <cstring> to run.cc
    >
    > -----------------------------------------
    > 4) Modify src/sccs.c
    > -----------------------------------------
    > + char *pfail;
    > pfail = getenv(binary_support);
    >
    > -----------------------------------------
    > 5) Run make
    > -----------------------------------------
    > # make
    >
    > -----------------------------------------
    > 6) test:
    > -----------------------------------------
    >
    > # if make check 2>&1 | tee make.log
    > then
    > echo SUCCESS
    > else
    > echo FAILURE
    > fi
    >
    > This got pretty far, but then I hit errors building the googletest:
    >
    > Making check in unit-tests
    > make test_sid test_relvbr test_release test_sid_list test_rel_list test_sccsdate test_delta test_delta-table test_encoding test_encoding2 test_linebuf test_bigfile testwrapper.sh
    > /bin/sh ../libtool --tag=CXX --mode=link g++ -D_THREAD_SAFE -DGTEST_HAS_PTHREAD=1 -g -O2 -o test_sid test_sid.o googletest/lib/libgtest.la googletest/lib/libgtest_main.la ../src/libcssc.a
    > libtool: link: g++ -D_THREAD_SAFE -DGTEST_HAS_PTHREAD=1 -g -O2 -o test_sid test_sid.o googletest/lib/.libs/libgtest.a googletest/lib/.libs/libgtest_main.a ../src/libcssc.a
    > ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_destroy
    > ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock
    > ld: 0711-317 ERROR: Undefined symbol: .pthread_self
    > ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock
    > ld: 0711-317 ERROR: Undefined symbol: .pthread_getspecific
    > ld: 0711-317 ERROR: Undefined symbol: .pthread_key_delete
    > ld: 0711-317 ERROR: Undefined symbol: .pthread_setspecific
    > ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_init
    > ld: 0711-317 ERROR: Undefined symbol: .pthread_key_create
    > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
    > collect2: error: ld returned 8 exit status
    > make: The error code from the last command is 1.
    >
    > I just manually added the -pthread to unit-tests/Makefile
    >
    > CXXFLAGS = -g -O2 -pthread
    >
    > This got a little further, but then hit a bunch of new errors:
    >
    > g++ -DHAVE_CONFIG_H -I. -I.. -I./googletest//include -lpthread -I./../src -D_THREAD_SAFE -DGTEST_HAS_PTHREAD=1 -g -O2 -pthread -MT test_sid_list.o -MD -MP -MF .deps/test_sid_list.Tpo -c -o test_sid_list.o test_sid_list.cc
    > In file included from /usr/include/pthread.h:65,
    > from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include/c++/powerpc-ibm-aix7.1.0.0/pthread/bits/gthr-posix.h:35,
    > from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include/c++/powerpc-ibm-aix7.1.0.0/pthread/bits/gthr-default.h:30,
    > from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include/c++/powerpc-ibm-aix7.1.0.0/pthread/bits/gthr.h:148,
    > from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include/c++/ext/atomicity.h:35,
    > from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include/c++/bits/basic_string.h:39,
    > from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include/c++/string:52,
    > from ./../src/cssc.h:33,
    > from ./../src/sl-merge.h:30,
    > from test_sid_list.cc:24:
    > /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include-fixed/unistd.h:210:16: error: conflicting declaration of C function 'off64_t lseek64(int, off64_t, int)'
    > extern off64_t lseek64(int, off64_t, int);
    > ^~~~~~~
    > /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include-fixed/unistd.h:208:14: note: previous declaration 'off_t lseek64(int, off_t, int)'
    > extern off_t lseek(int, off_t, int);
    > ^~~~~
    >
    > So..... I decided I don't know enough about the pthread stuff in this application, as I saw comments in the change log about disabling pthread stuff.
    >
    > -----------------------------------------
    > 7) Install
    > -----------------------------------------
    > # make install
    >
    > This completed successfully
    >
    > ------------------------------
    > Jan Harris
    > AIX Development Support (Liaison to the AIX Toolbox for Open Source)
    > IBM (Contract)
    > Austin TX
    >
    > Original Message:
    > Sent: Fri April 15, 2022 05:48 PM
    > From: Michael Shon
    > Subject: Getting CSSC replacement for SCCS source control system to compile on AIX
    >
    > Thanks very much for all of this - you got much farther than I.
    > But isn't that the way ... you cure another problem and feel like that should do it, and then BAM!
    >
    > With your help I finally got it to compile and run, although it bothers me that it compiles on Linux without those changes in the source files.
    > I suppose it must be sections of conditional code that doesn't get used for Linux.
    >
    > I think that the only other thing that I did was to add these to config.h
    >
    > /* Define to 1 if you have the `getegid' function. */
    > /* #undef HAVE_GETEGID */
    > #define HAVE_GETEGID 1
    >
    > /* Define to 1 if you have the `geteuid' function. */
    > /* #undef HAVE_GETEUID */
    > #define HAVE_GETEUID 1
    >
    >
    > I need to redo it with options to relocates the binaries somewhere where they are handy but won't conflict with the native SCCS files.
    >
    > Thanks!
    >
    >
    > ------------------------------
    > Michael Shon
    >
    > Original Message:
    > Sent: Fri April 15, 2022 04:14 PM
    > From: Jan Harris
    > Subject: Getting CSSC replacement for SCCS source control system to compile on AIX
    >
    > Some things I tried today...
    >
    > 1) Changed config.h (Commented out the duplicate size_t)
    >
    > /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type'size_t'. */
    > 2) Ran configure
    > # export gl_cv_header_wchar_h_correct_inline=yes;./configure
    >
    > 3) Removed testutils from Makefile: (had multiple errors, but don't need it anyway...)
    >
    > ! SUBDIRS = gl docs auxfiles src sccs-cgi unit-tests tests+ # Removed testutils
    > 4) Added cstring to src/run.cc
    >
    > + #include <cstring> to run.cc
    > 5) Defined pfail in src/sccs.c:
    >
    > + char *pfail; pfail = getenv(binary_support);
    >
    > But ultimately hit another failure...
    >
    > /bin/sh ../libtool --tag=CXX --mode=link g++ -g -L../gl/lib -o get get.o pf-add.o sf-chkid.o sf-kw.o sf-get2.o pf-del.o libcssc.a
    > libtool: link: g++ -g -o get get.o pf-add.o sf-chkid.o sf-kw.o sf-get2.o pf-del.o -L../gl/lib libcssc.a
    > ld: 0711-317 ERROR: Undefined symbol: .user_is_group_member(unsigned int)
    > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
    > collect2: error: ld returned 8 exit status
    >
    > ------------------------------
    > Jan Harris
    > AIX Development Support (Liaison to the AIX Toolbox for Open Source)
    > IBM (Contract)
    > Austin TX
    >
    > Original Message:
    > Sent: Fri April 15, 2022 01:34 PM
    > From: Jan Harris
    > Subject: Getting CSSC replacement for SCCS source control system to compile on AIX
    >
    > Hi, Michael
    >
    > I used this:
    >
    > # export gl_cv_header_wchar_h_correct_inline=yes;./configure
    >
    > I found this out on some discussions, and am not quite sure what this does, but it did result in completion.
    >
    > However I could not make yet .. and do not think that is related to the wchar variable I used (well, at least not yet :-) )
    >
    >
    > In file included from opendir-safer.c:20:
    > ../../config.h:1290:16: error: duplicate 'unsigned'
    > #define size_t unsigned int
    > ^~~~~~~~
    > ../../config.h:1290:25: error: two or more data types in declaration specifiers
    > #define size_t unsigned int
    > ^~~
    > make: 1254-004 The error code from the last command is 1.
    >
    >
    >
    >
    >
    > ------------------------------
    > Jan Harris
    > AIX Development Support (Liaison to the AIX Toolbox for Open Source)
    > IBM (Contract)
    > Austin TX
    >
    > Original Message:
    > Sent: Fri April 15, 2022 12:13 PM
    > From: Michael Shon
    > Subject: Getting CSSC replacement for SCCS source control system to compile on AIX
    >
    >
    > At our site we make extensive use of SCCS (the UNIX native source code control system) for tracking changes to our system files and to our scripts and simple documents and man pages.
    > To keep this short, let me just say that when we moved our source and configuration repository from GPFS to an enterprise NFS system, we were stunned to find that SCCS on AIX does not work the same for the root user on NFS as it does on local filesystems or on GPFS.
    > This creates a significant problem for us.
    >
    > We have worked a case with IBM and found the underlying issue with SCCS, which will take a LONG time to fix, it they decide that it can be fixed without creating other problems.
    >
    > There is an open source SCCS-workalike called "CSSC" used on Linux where SCCS is needed, and it behaves as expected on NFS (in Linux).
    > IBM asked us whether CSSC on AIX would be an acceptable alternative, and it would, but I have been unable to get CSSC to build on AIX.
    > IBM asked us to bring it up in this forum to help prioritize and to see if others might assist.
    >
    > I'm pretty sure that the problem is a simple one which people working with open source on AIX have probably solved many times over.
    > I have not compiled much code on AIX, due in large part to several excellent sites which have supplied AIX with open source tools for years.
    >
    > I am deeply grateful for their work. More recently, yum/dnf on AIX has been extremely helpful.
    >
    >
    > The CSSC configure script actually suggests what to do about the problem,
    > but
    > A) I'm pretty sure that the indicated error is incorrect
    > B) I have done what it suggests to the best of my abilities, and there is no improvement.
    > I might have done it wrong, or the configure tool might have assumed that there is Linux underneath it,
    >
    > with a problem of a different sort, such that the suggested fix is not the right one for AIX.
    >
    >
    >
    >
    > Configure says this:
    > checking whether lstat correctly handles trailing slash... nochecking for promoted mode_t type... mode_tchecking for stdbool.h that conforms to C99... yeschecking for _Bool... yeschecking for wint_t... yeschecking whether <wchar.h> uses 'inline' correctly... noconfigure: error: <wchar.h> cannot be used with this compiler (gcc -g ).This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 inC99 mode. You have four options: - Add the flag -fgnu89-inline to CC and reconfigure, or - Fix your include files, using parts of <http: sourceware.org/git/?p="glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621">, or - Use a gcc version older than 4.3, or - Don't use the flags -std=c99 or -std=gnu99.Configuration aborted.
    >
    > HOWEVER
    > I don't think that this is true -
    > If I read the log correctly, the file compiles but does not link, and the link failure is what triggers the message.
    > configure:23638: checking whether <wchar.h> uses 'inline' correctlyconfigure:23660: gcc -c -g conftest.c >&5configure:23663: $? = 0configure:23681: gcc -c -g conftest.c >&5configure:23684: $? = 0ld: 0711-317 ERROR: Undefined symbol: .renamed_wcstodld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.collect2: error: ld returned 8 exit statusconfigure:23697: result: noconfigure:23700: error: <wchar.h> cannot be used with this compiler (gcc -g ).This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 inC99 mode. You have four options: - Add the flag -fgnu89-inline to CC and reconfigure, or - Fix your include files, using parts of <http: sourceware.org/git/?p="glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621">, or - Use a gcc version older than 4.3, or - Don't use the flags -std=c99 or -std=gnu99.Configuration aborted.
    >
    > As I said, I have been unable to get past this.
    > I don't think the message is correct, but I did try to follow the suggestions, just in case, using the two flag-related options.
    >
    > At gcc8, using a gcc older than 4.3 seems crazy, assuming that it is even possible.
    > I am loathe to "fix my include files" since they are as they were supplied by AIX, and are that way for a reason.
    > Any changes that I might make would probably create other issues, or be erased by the next AIX update.
    >
    > Does anyone know how to get past this and get on to finding out whether CSSC will even compile and run ?
    >
    >
    > Installed PackagesAIX-rpm.ppc 7.2.5.1-19 @Systemautoconf.noarch 2.71-1 @AIX_Toolbox_noarchautomake.noarch 1.16.2-1 @AIX_Toolbox_noarchbash.ppc 5.1.4-2 @AIX_Toolboxbzip2.ppc 1.0.8-2 @Systemca-certificates.ppc 2020.06.01-2 @AIX_Toolboxctags.ppc 5.8-1 @Systemcurl.ppc 7.79.1-1 @AIX_Toolboxcyrus-sasl.ppc 2.1.26-5 @AIX_Toolboxdb.ppc 1:5.3.28-1 @AIX_Toolboxdf1020e21410e304.noarch 00011000040041500026-1 @Systemdiffutils.ppc 3.7-1 @AIX_Toolboxdnf.noarch
    > 4.2.17-32_1 @Systemdnf-automatic.noarch 4.2.17-32_1 @Systemdnf-data.noarch 4.2.17-32_1 @Systemexpat.ppc 2.4.4-1 @AIX_Toolboxexpect.ppc 5.45.4-2 @AIX_Toolboxfontconfig.ppc 2.11.95-4 @AIX_Toolboxfreetype2.ppc 2.10.4-1 @AIX_Toolboxgcc.ppc 1:8-1 @AIX_Toolbox_72gcc-cpp.ppc 1:8-1 @AIX_Toolbox_72gcc8.ppc 8.3.0-6 @AIX_Toolbox_72gcc8-cpp.ppc 8.3.0-6 @AIX_Toolbox_72gdbm.ppc 1.19-1 @AIX_Toolboxgettext.ppc 0.20.2-1
    > @AIX_Toolboxglib2.ppc 2.56.1-3 @AIX_Toolboxgmp.ppc 6.2.1-1 @AIX_Toolboxgnutls.ppc 3.7.1-1 @AIX_Toolboxgpe-agent-aix.ppc 3.5-1 @Systemgpe-agent-comm.ppc 2.6-5 @Systemgrep.ppc 3.4-1 @AIX_Toolboxgzip.ppc 1.10-1 @Systeminfo.ppc 6.7-1 @AIX_Toolboxkrb5-libs.ppc 1.18.4-1 @AIX_Toolboxless.ppc 557-1 @AIX_Toolboxlftp.ppc 4.9.1-1 @AIX_ToolboxlibXft.ppc 2.3.2-4waixX11 @AIX_ToolboxlibXrender.ppc
    > 0.9.8-3waixX11 @AIX_Toolboxlibcomps.ppc 0.1.11-32_1 @Systemlibdnf.ppc 0.39.1-32_1 @Systemlibffi.ppc 3.2.1-3 @AIX_Toolboxlibgcc.ppc 1:8-1 @AIX_Toolbox_72libgcc8.ppc 8.3.0-6 @AIX_Toolbox_72libgcrypt.ppc 1.9.4-1 @AIX_Toolboxlibgomp.ppc 1:8-1 @AIX_Toolbox_72libgomp8.ppc 8.3.0-6 @AIX_Toolbox_72libgpg-error.ppc 1.42-1 @AIX_Toolboxlibiconv.ppc 1.16-1 @AIX_Toolboxlibmodulemd.ppc 1.5.2-32_1 @Systemlibmpc.ppc 1.2.1-1
    > @AIX_Toolboxlibnghttp2.ppc 1.46.0-1 @AIX_Toolboxlibpng.ppc 1.6.27-3 @AIX_Toolboxlibrepo.ppc 1.11.0-32_1 @Systemlibsmartcols.ppc 2.34-32_1 @Systemlibsodium.ppc 1.0.18-1 @AIX_Toolboxlibsolv.ppc 0.7.9-32_1 @Systemlibssh2.ppc 1.9.0-1 @AIX_Toolboxlibstdc++.ppc 1:8-1 @AIX_Toolbox_72libstdc++8.ppc 8.3.0-6 @AIX_Toolbox_72libtasn1.ppc 4.16.0-1 @AIX_Toolboxlibtextstyle.ppc 0.20.2-1 @AIX_Toolboxlibtool.ppc 2.4.6-2 @AIX_Toolboxlibunistring.ppc
    > 0.9.10-1 @AIX_Toolboxlibxml2.ppc 2.9.11-1 @AIX_Toolboxlibzstd.ppc 1.4.4-32_1 @Systemlz4.ppc 1.9.2-1 @AIX_Toolboxm4.ppc 1.4.18-1 @AIX_Toolboxmpfr.ppc 4.1.0-1 @AIX_Toolboxncurses.ppc 6.2-3 @AIX_Toolboxnettle.ppc 3.7.3-1 @AIX_Toolboxopenldap.ppc 2.4.58-1 @AIX_Toolboxp11-kit.ppc 0.23.22-1 @AIX_Toolboxp11-kit-tools.ppc 0.23.22-1 @AIX_Toolboxpcre.ppc 8.44-2 @AIX_Toolboxperl.ppc 1:5.30.3-2
    > @AIX_Toolboxpysqlite.ppc 2.8.3-2 @AIX_Toolboxpython.ppc 2.7.18-3 @AIX_Toolboxpython-devel.ppc 2.7.18-3 @AIX_Toolboxpython-iniparse.noarch 0.4-1 @Systempython-pycurl.ppc 7.43.0-1 @AIX_Toolboxpython-tools.ppc 2.7.18-3 @AIX_Toolboxpython-urlgrabber.noarch 3.10.1-1 @Systempython3.ppc 3.7.12-1 @AIX_Toolboxpython3-dateutil.noarch 2.8.0-1 @Systempython3-dnf.noarch 4.2.17-32_1 @Systempython3-dnf-plugin-migrate.noarch 4.0.16-32_1 @Systempython3-dnf-plugins-core.noarch 4.0.16-32_1 @Systempython3-gpgme.ppc 1.13.1-32_1
    > @Systempython3-hawkey.ppc 0.39.1-32_1 @Systempython3-libcomps.ppc 0.1.11-32_1 @Systempython3-libdnf.ppc 0.39.1-32_1 @Systempython3-librepo.ppc 1.11.0-32_1 @Systempython3-six.noarch 1.13.0-1 @Systemreadline.ppc 8.1-1 @AIX_Toolboxrpm-python3.ppc 4.15.1-32_1 @Systemrsync.ppc 3.2.3-1 @AIX_Toolboxscreen.ppc 4.7.0-1 @AIX_Toolboxsed.ppc 4.8-1 @AIX_Toolboxsqlite.ppc 3.35.5-1 @AIX_Toolboxsudo.ppc 1.9.5p2-1 @AIX_Toolboxtcl.ppc
    > 8.6.11-1 @AIX_Toolboxtk.ppc 8.6.11-1 @AIX_Toolboxunzip.ppc 6.0-3 @Systemvim-common.ppc 8.2.4286-1 @AIX_Toolboxvim-enhanced.ppc 8.2.4286-1 @AIX_Toolboxwget.ppc 1.21.2-1 @AIX_Toolboxwhich.ppc 2.14-1 @Systemxz-libs.ppc 5.2.5-1 @AIX_Toolboxyum.noarch 4.2.17-32_1 @Systemyum-metadata-parser.ppc 1.1.4-2 @Systemzchunk-libs.ppc 1.1.4-32_1 @Systemzlib.ppc 1.2.11-2 @AIX_Toolbox
    >
    > Any help or discussion about SCCS and/or CSSC is very much appreciated.
    >
    >
    > ------------------------------
    > Michael Shon
    > ------------------------------
    >
    >
    > Reply to Sender : https://community.ibm.com/community/user/eGroups/PostReply?GroupId=6211&MID=253571&SenderKey=e6f5e66a-4df1-46cf-ba9a-79aef6a4faf4
    >
    > Reply to Discussion : https://community.ibm.com/community/user/eGroups/PostReply?GroupId=6211&MID=253571
    >
    >
    >
    > You are subscribed to "AIX Open Source" as Russell.Adams@AdamsSystems.nl. To change your subscriptions, go to http://community.ibm.com/community/user/preferences?section=Subscriptions. To unsubscribe from this community discussion, go to http://community.ibm.com/HigherLogic/eGroups/Unsubscribe.aspx?UserKey=c23dfccc-9910-40ae-beeb-fdcbced5bf1f&sKey=KeyRemoved&GroupKey=af5415f8-d8d8-4ac4-b3cb-08a8da184054.


    ------------------------------------------------------------------
    Russell Adams Russell.Adams@AdamsSystems.nl
    Principal Consultant Adams Systems Consultancy
    https://adamssystems.nl/




  • 14.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Thu April 21, 2022 11:57 AM

    It should not use the header file from "gl/lib/" directory.  
    Is this machine migrate from older AIX levels to 7.2 level? If so , then libgcc, gcc, g++. libstdc++ rpms are re-installed ?
    Attach your configure output and config.log file generated here.



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



  • 15.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Thu April 21, 2022 12:39 PM

    Yes, the machine was probably upgraded from 7.1.
    As for being reinstalled, I can't say for certain, but while some were installed by "yum" within the last couple of years, some have a long history.
    g++ is definitely new - I had to install that a couple of days ago for CSSC .

    This is what I can find ... there might be a way to get what you want from rpm, but I'm an rpm rookie

    Install Date: Fri Apr 15 17:28:21 EDT 2022 : gcc8-c++-8.3.0-6.ppc
    Install Date: Fri Apr 15 17:28:21 EDT 2022 : gcc-c++-8-1.ppc
    Install Date: Fri Apr 15 17:28:20 EDT 2022 : libstdc++8-devel-8.3.0-6.ppc
    Install Date: Tue Mar 15 14:35:22 EDT 2022 : gcc8-8.3.0-6.ppc
    Install Date: Tue Mar 15 14:35:18 EDT 2022 : gcc8-cpp-8.3.0-6.ppc
    Install Date: Tue Mar 15 14:32:46 EDT 2022 : libstdc++8-8.3.0-6.ppc
    Install Date: Tue Mar 15 14:32:44 EDT 2022 : libgcc8-8.3.0-6.ppc
    Install Date: Fri Apr 30 13:29:15 EDT 2021 : libstdc++-8-1.ppc
    Install Date: Fri Apr 30 13:29:15 EDT 2021 : gcc-cpp-8-1.ppc
    Install Date: Fri Apr 30 13:29:15 EDT 2021 : gcc-8-1.ppc
    Install Date: Fri Apr 30 13:28:28 EDT 2021 : libgcc-8-1.ppc


    To make this work properly, do I need to uninstall and re-install these?
    I fully expect that to create dependency problems - what is the best way to avoid that, or is that just my pre-yum experience talking?



    ------------------------------
    Michael Shon
    ------------------------------

    Attachment(s)

    txt
    config.h.txt   43 KB 1 version
    txt
    configure.out.txt   27 KB 1 version
    log
    config.log   524 KB 1 version
    txt
    config.status.txt   98 KB 1 version


  • 16.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Fri April 22, 2022 01:28 AM
    From the config.log, it looks like there is a problem due to header file mismatch. The problem is discussed in this thread --> https://community.ibm.com/community/user/power/communities/community-home/digestviewer/viewthread?GroupId=6211&MessageKey=8e4ad4d1-cbf4-4bf2-8097-1f5b734a271a&CommunityKey=10c1d831-47ee-4d92-a138-b03f7896f7c9&tab=digestviewer

    You can re-install gcc8 rpm and try the build again. Run "gmake distclean" before triggering the build.

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



  • 17.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Fri April 22, 2022 05:27 PM
    I reinstalled gcc8, cleaned the distribution, and the configure/gmake ran perfectly.

    Thanks!

    so.... I'm thinking that the environment variable settings that you provided
    might be a really good place to start any new effort like this on AIX   -

    is that true - are these your standard starting place, or was there something about CSSC which led you to pick these particular values?

    Thanks again


    ------------------------------
    Michael Shon
    ------------------------------



  • 18.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Fri April 22, 2022 10:34 PM
    Same here - I just started from scratch, using 

    export CC="gcc -pthread -maix64 -D_ALL_SOURCE -D_LINUX_COMPAT -O2"
    export CXX="g++ -pthread -maix64 -D_ALL_SOURCE -D_LINUX_COMPAT -O2"
    export OBJECT_MODE=64


    I think, at first, I had added -O2, and since I did not clean and start over, I probably had some mixed files. Then, I fixed a few others as I went, and should have started over from the beginning, I think.

    Nonetheless, it is good to know this built easily, and I too would like to know if these are the recommended build options.


    ------------------------------
    Jan Harris
    AIX Development Support (Liaison to the AIX Toolbox for Open Source)
    IBM (Contract)
    Austin TX
    ------------------------------



  • 19.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Sat April 23, 2022 09:37 AM
    Yes, these exports are the standard starting place to compile any Opensource softwares in AIX. The "-pthread" option is only needed if the software uses pthread. 
    There is one other important variable "LDFLAGS" which we also use to compile Opensource softwares for AIX Toolbox. The value of this variable is based on the build ecosystem used. To compile a Opensource software (which uses pthread) with Toolbox compiler & ecosystem in 64bit mode, the value will be export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib/pthread/ppc64:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib"


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



  • 20.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    IBM Champion
    Posted Thu April 21, 2022 07:11 AM

    I'm a bit curious about this part: "we were stunned to find that SCCS on AIX does not work the same for the root user on NFS as it does on local filesystems or on GPFS."

    What's different on NFS ?



    ------------------------------
    José Pina Coelho
    IT Specialist at Kyndryl
    ------------------------------



  • 21.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Thu April 21, 2022 10:55 AM

    Thanks for asking...

    On a non-NFS filesystem, when a file has been checked into SCCS and is sitting there, read-only (-r--r--r--)
    root (or any user with adequate permissions) can do "sccs get file" and it succeeds,
    replacing the read-only file with a copy of the most recent revision, writable and ready to edit.

    On NFS, (on a mount where root is not being mapped to another ID, and root can do all the usual root things)
    the "sccs get" FAILS with the message "get: 1255-104 A writable version of file exists. (ge4)" .


    like so:
           ls -ld file
    -r--r--r-- 1 root system 392 Apr 21 08:06 file

        sudo sccs get file
    SCCS/s.file: get: 1255-104 A writable version of file exists. (ge4)

    If you let that sink in, "stunned" is I think, the correct word.
    It just can't be !  

    Try it a dozen different ways and control all of the parameters of user ID, directory permissions, root login (not sudo), etc.
    and it's always the same - it works fine for any user EXCEPT root - the so-called "superuser" ,

    We tracked it down to the SCCS "get" code calling accessx() to check for write permissions with a "who" parameter of "ACC_ANY" which is NOT documented in the accessx(3) man page .
              accessx(pathname, W_OK, ACC_ANY)

    When that gets to the NFS layer, the decision comes back that the file is writable, when it clearly isn't by its permissions - and there are no ACLs involved.
    I forget why, but NFS is not able to actually determine precisely what the correct answer is, and it makes a guess which in this case works out badly.

    And although you could try to argue that it  IS  writable, because root can write it any time it wants to,
    you can't have it both ways --
    on a JFS/JFS2 or GPFS filesystem, it is seen to be NOT writable even for root, and the get succeeds.

    On other Unix-like systems (including Linux running CSSC) the file is NOT deemed writable, and it works just as it would on any other filesystem, even for root.

    On AIX, it doesn't.  NFS is NOT like other filesystems, even though we all think it is.
    This makes it hard for root to use SCCS for files in NFS.
    Source management processes and scripts which work fine elsewhere can fail utterly for root on AIX.

    And nowhere has it EVER been said ANYWHERE that root is not allowed to use any particular app on NFS -
    since NFS is supposed to preserve normal Unix filesystem semantics, it would be a serious failing of NFS to have that kind of restriction.
    I would contend that working as root on NFS is not at all unusual, and that many build environments have all the files in NFS.
    But, apparently, it is not done in AIX environments, because it doesn't work very well.

    The "root" cause (as I see it) is really that in AIX the SCCS  source was modified  to make use of "accessx()" which is an AIX thing, with parameters whose behavior is not well defined, and which is not fully taken into account in NFS filesystem code which came from a different UNIX.
    Other versions of SCCS use "access()" which is not as "smart" in some situations, but is at least unsurprising in combination with the permission-checking code in NFS.


    The AIX team is now deciding whether SCCS should be changed, or NFS should be changed, or if anything will be changed.
    Since both have been this way for literally decades, they are naturally very concerned about making any change which might break something else. 
    There are a lot of detailed reviews and evaluations to make.

    Please, weigh in on how you feel about it if you have an educated opinion on the matter -
    particularly if you use source control of some kind as root on NFS filesystems.
    I don't think it needs to be SCCS - the general requirement is probably good enough,
    and some like RCS and CVS are essentially SCCS-descendants and used for much the same kind of things.

    Thank goodness, AIX will shortly be documenting the ACC_ANY parameter, which by the way is NOT supposed to take into account the effective user (if I remember correctly from the notes in the case) - so the fact that the user is root is not supposed to matter.

    In the end (after asking for help with CSSC) I hit upon what might seem to be a truly obvious workaround
    but which had not occurred to me, because it had never been necessary in my 4 decades of using SCCS -
        if you remove the file before running "sccs get",  the get succeeds, and work can go on.
    Removing any source file makes me nervous so I recoil from the idea that it is necessary,
    but in the end, that's what "get" is doing anyway.

    It requires adding a new step in manual processes,
    and finding and updating makefiles and several wrapper scripts, and a number of  documented processes,
    but it does get around the problem that AIX does not let root use SCCS on NFS.



    ------------------------------
    Michael Shon
    ------------------------------



  • 22.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    IBM Champion
    Posted Tue April 26, 2022 07:24 AM

    That is ugly.

    Have you checked if ACC_SELF or ACC_INVOKER give a different result ?



    ------------------------------
    José Pina Coelho
    IT Specialist at Kyndryl
    ------------------------------



  • 23.  RE: Getting CSSC replacement for SCCS source control system to compile on AIX

    Posted Wed April 27, 2022 10:42 AM
    I didn't check those myself, mostly because I don't have SCCS source code, so it doesn't help me to find out that some other mode might work the way I think it should. That would just make me crazy (er).

    As you may see below, it looks like NFS does this using "ACC_SELF" unless you call accessx with ACC_OTHERS.

    ACC_INVOKER would be mostly the same unless you ran the program with (something like) sudo such that the real and effective IDs were different. 
    That would add another surprising behavior and probably only makes things worse.

    I did try a test binary provided by IBM to verify using just the minimal code around the accessx(pathname, W_OK, ACC_ANY) , that the status returned indicates a writable file when it isn't, really.

    For reference (if anyone else is interested and still reading this, from the access/accessx man page)
    ACC_SELF
    Determines if access is permitted for the current process. The effective user and group IDs, the concurrent group set
    and the privilege of the current process are used for the calculation.
    ACC_INVOKER
    Determines if access is permitted for the invoker of the current process. The real user and group IDs, the concurrent
    group set, and the privilege of the invoker are used for the calculation. Note: The expression access (PathName,
    Mode) is equivalent to accessx (PathName, Mode, ACC_INVOKER).
    ACC_OTHERS
    Determines if the specified access is permitted for any user other than the object owner. The Mode parameter must
    contain only one of the valid modes. Privilege is not considered in the calculation.
    ACC_ALL
    Determines if the specified access is permitted for all users. The Mode parameter must contain only one of the valid
    modes. Privilege is not considered in the calculation . Note: The accessx subroutine shows the same behavior by both
    the user and root with ACC_ALL.

    In the service ticket for this case TS007892389,  there is a PROPOSED definition for how ACC_ANY is supposed to work (for the  update to the man page),
    ACC_ANY
    Determines if the specified access is permitted for any user.
    The Mode parameter must contain only one of the valid modes.
    Privilege is not considered in the calculation.



    I have reason to think that "Privilege is not considered in the calculation." means that it does not matter if the effective user is root , as a special case where everything is writable.  It means (I think) that Permissions are what matters, not privilege.


    In the service case there are also some bits gathered from here and there (like the NFS client ) which when combined provide a good chance of a correct guess at how it would behave.

    the NFS version 3 protocol client
          can not reliably perform an access check with only current
          file attributes.

          In the NFS version 2 protocol, the only reliable way to
          determine whether an operation was allowed was to try it
          and see if it succeeded or failed.
    Using the ACCESS procedure in the NFS version 3 protocol, the client can
          ask the server to indicate whether or not one or more
          classes of operations are permitted.  The ACCESS operation
          is provided to allow clients to check before doing a
          series of operations.
    There is no way to pass the "who" parameter to the server.
    The server takes only 2 arguments - the filehandle and the access mode.
    So, the returned value would be applicable only for ACC_SELF.
    To implement the other cases, the NFS3 client does this:
    "If the "who" parameter is ACC_OTHERS, the NFS client uses the mode bits
    (the group field and the others field of the mode bits, specifically).
    For all other values (self/invoker/all), it returns success or failure
    based on the ACC_SELF case.
    This is the current limitation based on the NFS protocol architecture."

    This seems to be in conflict with the man page for accessx() which says

    "ACC_INVOKER
    Determines if access is permitted for the invoker of the current process.
    The real user and group IDs, the concurrent group set,
    and the privilege of the invoker are used for the calculation.
    Note: The expression access (PathName, Mode)
    is equivalent to accessx (PathName, Mode, ACC_INVOKER).



    So accessx() documents that access(PathName, mode) comes down to ACC_INVOKER based on real UID,
    but NFSv3 is implemented to behave like it comes down to ACC_SELF, based on effective ID.

    As a user, of these two options, I very much prefer NFS to use ACC_SELF, (as it mostly does)
    because once a process has changed effective ID to become "me" ,

    I do not care that the process started as root (or another user) -
    I want to know what the process can do right now as "me",
    not what it could do in theory if it switched back to the other user first.

    As a practical matter, ACC_SELF is much more relevant to actually doing things on NFS filesystems
    and I would say that it was the better option - of these two.

    To resolve this conflict (which appears in the accessx() documentation, but is hidden in NFS)
    I would say that it would be better to move the special Note about access() equivalence
    from ACC_INVOKER to ACC_SELF ,  
    to reflect what I'm told is a long-standing NFS truth that the expression
               access (PathName, Mode) is equivalent to accessx (PathName, Mode, ACC_SELF).

    However, for the use of accessx() by SCCS,
    what I really want is "Privilege is not considered in the calculation."
    and that is not part of either ACC_SELF or ACC_INVOKER.

    So, the proposed definition of ACC_ANY (already as coded in SCCS) would be fine ,
    and if NFS took ACC_ANY into consideration as it does ACC_OTHERS,
    SCCS would work on NFS just as any non-AIX user would expect.

    For a given file and its intended purpose, I want to be able to set the permissions
    to predict - and get - an unsurprising, desired behavior from calling access/accessx on a file.
    The fact that root  (or root-via-sudo) could *potentially* do something different is not relevant.
    If  my application wants to push past what access/accessx tells me, then I could just try it (like writing a read-only file) and see if it succeeds.

    Interestingly, CSSC avoided this potential problem by doing the obvious thing  - checking the permissions. 
    I suspect that this won't always be strictly "correct" but I do think that it will never be surprising
    and that counts a LOT with users.
            (I don't think CSSC even tries to handle ACLs) 

    The code includes this comment, 

    /* Determine if a given file is "writable". If we
    * are root, we can write to a mode 000 file, but
    * we deem files of that sort not writable for these
    * purposes -- we in fact only care about this for
    * the safeguards in "get -e" and "get". This avoids
    * overwriting a file which we might be editing.
    *
    * The previous implementation used to actually use
    * access/eaccess, but those return 0 for root for
    * files that we choose to not actually count as
    * writeable.
    */
    ... and then the code checks the "write bits"  of the file mode - 0222 .


    ------------------------------
    Michael Shon
    ------------------------------