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.nlPrincipal Consultant Adams Systems Consultancy
https://adamssystems.nl/
Original Message:
Sent: 4/21/2022 11:22:00 AM
From: Michael Shon
Subject: RE: Getting CSSC replacement for SCCS source control system to compile on AIX
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
------------------------------
</http:></wchar.h></wchar.h></http:></wchar.h></wchar.h></cstring></cstring></sys></some-temp-dir>