Menu

How to build on Ubuntu22/RHEL7/RHEL8/RockyLinux/OracleLinux/SLES/Solaris on s390x/sparc/amd64/aarch64

2023-02-10
2023-02-22
  • Simon Sobisch

    Simon Sobisch - 2023-02-10

    Intro

    For testing the GC 3.2RC2 I needed a big-endian machine, so have gone with the the IBM LinuxOne Community Clou (after renewing, this time only got the minimal free tier [1 instance, 2 cores], but enough to test an s390x build). This is therefore also partially a follow-up to [c4bd93052a], The reason to post it here, although no help is needed is to provide the help on building GnuCOBOL from source.

    Here are the build recipes from source.

    Ubuntu 22

    # Prerequisites
    $ sudo apt update  # necessary
    $ sudo apt upgrade # optional to get newest versions
    $ sudo apt install build-essential libgmp-dev libdb-dev libncurses-dev libxml2-dev libjson-c-dev
    # possibly add GDB, drop xml/curses/json if not needed
    
    # GnuCOBOL
    $ tar -xvf gnucobol-3.2-rc2.tar.gz
    $ cd gnucobol-3.2-rc2
    $ mkdir build && cd build  # because I wanted some environments with different configurations - and an extra build folder is always cleaner
    $ ../configure --enable-hardening
    configure: GnuCOBOL Configuration:
    configure:  CC                gcc
    configure:  CFLAGS            -O2 -fstack-protector-strong -pipe -finline-functions -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k
    configure:  LDFLAGS            -Wl,-z,relro,-z,now,-O1
    configure:  LIBCOB_LIBS        -lgmp -lxml2 -ljson-c -lncursesw -ldb-5.3
    configure:  COB_CC            gcc
    configure:  COB_CFLAGS        -fstack-protector-strong -pipe -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -I/usr/local/include -Wno-unused -fsigned-char -Wno-pointer-sign -O
    configure:  COB_LDFLAGS       -fstack-protector-strong
    configure:  COB_DEBUG_FLAGS   -ggdb3 -fasynchronous-unwind-tables
    configure:  COB_LIBS          -L${exec_prefix}/lib -lcob
    configure:  COB_CONFIG_DIR    ${datarootdir}/gnucobol/config
    configure:  COB_COPY_DIR      ${datarootdir}/gnucobol/copy
    configure:  COB_LIBRARY_PATH  ${exec_prefix}/lib/gnucobol
    configure:  COB_OBJECT_EXT    o
    configure:  COB_MODULE_EXT    so
    configure:  COB_EXE_EXT
    configure:  COB_SHARED_OPT    -shared
    configure:  COB_PIC_FLAGS     -fPIC -DPIC
    configure:  COB_EXPORT_DYN    -Wl,--export-dynamic
    configure:  COB_STRIP_CMD     strip --strip-unneeded
    configure:  Dynamic loading:                             System
    configure:  Use gettext for international messages:      yes
    configure:  Use fcntl for file locking:                  yes
    configure:  Use math multiple precision library:         gmp
    configure:  Use curses library for screen I/O:           ncursesw
    configure:  Use Berkeley DB for INDEXED I/O:             yes
    configure:  Used for XML I/O:                            libxml2
    configure:  Used for JSON I/O:                           json-c
    $ make -j3
    # no compiler warnings
    $ make -j2 checkall
    # passes all of NIST, testsuite: 741 742 850 1097 1098 1161 failed ("exotics")
    $ ./pre-inst-env cobc --info
    cobc (GnuCOBOL) 3.2-dev.0
    Copyright (C) 2023 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
    Built     Feb 09 2023 18:58:54
    Packaged  Feb 02 2023 10:49:43 UTC
    C version "11.3.0"
    
    build information
    build environment        : s390x-ibm-linux-gnu
    CC                       : gcc
    C version                : "11.3.0"
    CPPFLAGS                 :
    CFLAGS                   : -O0 -ggdb3 -fasynchronous-unwind-tables -pipe
                               -fsigned-char -Wall -Wwrite-strings
                               -Wmissing-prototypes -Wno-format-y2k
    LD                       : /usr/bin/ld -m elf64_s390
    LDFLAGS                  :  -Wl,-z,relro,-z,now,-O1
    
    GnuCOBOL information
    COB_CC                   : gcc
    COB_CFLAGS               : -pipe -I/usr/local/include -Wno-unused
                               -fsigned-char -Wno-pointer-sign
      env: COB_CFLAGS        : -I/home/linux1/gnucobol-3.2-dev/build_debug/..
                               -pipe -I/usr/local/include -Wno-unused
                               -fsigned-char -Wno-pointer-sign
    COB_DEBUG_FLAGS          : -ggdb3 -fasynchronous-unwind-tables
    COB_LDFLAGS              :
      env: COB_LDFLAGS       :
    COB_LIBS                 : -L/usr/local/lib -lcob
      env: COB_LIBS          : -L/home/linux1/gnucobol-3.2-dev/build_debug/libcob/.libs
                               -L/usr/local/lib -lcob
    COB_CONFIG_DIR           : /usr/local/share/gnucobol/config
      env: COB_CONFIG_DIR    : /home/linux1/gnucobol-3.2-dev/build_debug/../config
    COB_COPY_DIR             : /usr/local/share/gnucobol/copy
      env: COB_COPY_DIR      : /home/linux1/gnucobol-3.2-dev/build_debug/../copy
    COB_MSG_FORMAT           : GCC
    COB_OBJECT_EXT           : o
    COB_MODULE_EXT           : so
    COB_EXE_EXT              :
    64bit-mode               : yes
    BINARY-C-LONG            : 8 bytes
    endianness               : big-endian
    native EBCDIC            : no
    extended screen I/O      : ncursesw
    variable file format     : 0
    sequential file handler  : built-in
    indexed file handler     : BDB
    mathematical library     : GMP
    XML library              : libxml2
    JSON library             : json-c
    

    RHEL7

    # Prerequisites, note: no "build-essentials", json-c is outdated, so used local cJSON later
    sudo yum install gcc make gmp-devel libxml2-devel ncurses-devel libdb-devel
    # possibly add GDB and for "nicer" debugging also vim (not installed by default) or emacs, drop xml/curses if not needed
    
    # GnuCOBOL
    $ tar -xvf gnucobol-3.2-rc2.tar.gz
    $ cd gnucobol-3.2-rc2
    $ mkdir build && cd build  # because I wanted some environments with different configurations - and an extra build folder is always cleaner
    $ # cJSON now
    $ mkdir libcob
    $ curl https://raw.githubusercontent.com/DaveGamble/cJSON/master/cJSON.h -o libcob/cJSON.h
    $ curl https://raw.githubusercontent.com/DaveGamble/cJSON/master/cJSON.c -o libcob/cJSON.c
    $ ../configure --enable-hardening
    configure: GnuCOBOL Configuration:
    configure:  CC                gcc
    configure:  CFLAGS            -O2 -fstack-protector-strong -pipe -finline-functions -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k
    configure:  LDFLAGS            -Wl,-z,relro,-z,now,-O1
    configure:  LIBCOB_LIBS        -lgmp -lxml2   -lncursesw -ldb-5.3 -ldl
    configure:  COB_CC            gcc
    configure:  COB_CFLAGS        -fstack-protector-strong -pipe -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -I/usr/local/include -Wno-unused -fsigned-char -Wno-pointer-sign -O
    configure:  COB_LDFLAGS       -fstack-protector-strong
    configure:  COB_DEBUG_FLAGS   -ggdb3 -fasynchronous-unwind-tables
    configure:  COB_LIBS          -L${exec_prefix}/lib -lcob
    configure:  COB_CONFIG_DIR    ${datarootdir}/gnucobol/config
    configure:  COB_COPY_DIR      ${datarootdir}/gnucobol/copy
    configure:  COB_LIBRARY_PATH  ${exec_prefix}/lib/gnucobol
    configure:  COB_OBJECT_EXT    o
    configure:  COB_MODULE_EXT    so
    configure:  COB_EXE_EXT
    configure:  COB_SHARED_OPT    -shared
    configure:  COB_PIC_FLAGS     -fPIC -DPIC
    configure:  COB_EXPORT_DYN    -Wl,--export-dynamic
    configure:  COB_STRIP_CMD     strip --strip-unneeded
    configure:  Dynamic loading:                             System
    configure:  Use gettext for international messages:      yes
    configure:  Use fcntl for file locking:                  yes
    configure:  Use math multiple precision library:         gmp
    configure:  Use curses library for screen I/O:           ncursesw
    configure:  Use Berkeley DB for INDEXED I/O:             yes
    configure:  Used for XML I/O:                            libxml2
    configure:  Used for JSON I/O:                           local
    $ make -j3
    # one strange compiler warning for termio (pretty_display_numeric) -Wmissing-breaces
    # but that's https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119
    $ make -j2 checkall
    # as with Ubuntu: passes all of NIST, testsuite: 741 742 850 1097 1098 1161 failed ("exotics")
    $ LANG=C ./pre-inst-env cobc --info
    cobc (GnuCOBOL) 3.2-dev.0
    Copyright (C) 2023 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
    Built     Feb 09 2023 14:49:04
    Packaged  Feb 02 2023 10:49:43 UTC
    C version "4.8.5 20150623 (Red Hat 4.8.5-44)"
    
    build information
    build environment        : s390x-ibm-linux-gnu
    CC                       : gcc
    C version                : "4.8.5 20150623 (Red Hat 4.8.5-44)"
    CPPFLAGS                 :
    CFLAGS                   : -O0 -ggdb3 -fasynchronous-unwind-tables -pipe
                               -fsigned-char -Wall -Wwrite-strings
                               -Wmissing-prototypes -Wno-format-y2k
    LD                       : /usr/bin/ld -m elf64_s390
    LDFLAGS                  :  -Wl,-z,relro,-z,now,-O1
    
    GnuCOBOL information
    COB_CC                   : gcc
    COB_CFLAGS               : -pipe -I/usr/local/include -Wno-unused
                               -fsigned-char -Wno-pointer-sign
      env: COB_CFLAGS        : -I/home/linux1/gnucobol-3.2-dev/build_dbg/..
                               -pipe -I/usr/local/include -Wno-unused
                               -fsigned-char -Wno-pointer-sign
    COB_DEBUG_FLAGS          : -ggdb3 -fasynchronous-unwind-tables
    COB_LDFLAGS              :
      env: COB_LDFLAGS       :
    COB_LIBS                 : -L/usr/local/lib -lcob
      env: COB_LIBS          : -L/home/linux1/gnucobol-3.2-dev/build_dbg/libcob/.libs
                               -L/usr/local/lib -lcob
    COB_CONFIG_DIR           : /usr/local/share/gnucobol/config
      env: COB_CONFIG_DIR    : /home/linux1/gnucobol-3.2-dev/build_dbg/../config
    COB_COPY_DIR             : /usr/local/share/gnucobol/copy
      env: COB_COPY_DIR      : /home/linux1/gnucobol-3.2-dev/build_dbg/../copy
    COB_MSG_FORMAT           : GCC
    COB_OBJECT_EXT           : o
    COB_MODULE_EXT           : so
    COB_EXE_EXT              :
    64bit-mode               : yes
    BINARY-C-LONG            : 8 bytes
    endianness               : big-endian
    native EBCDIC            : no
    extended screen I/O      : ncursesw
    variable file format     : 0
    sequential file handler  : built-in
    indexed file handler     : BDB
    mathematical library     : GMP
    XML library              : libxml2
    JSON library             : cjson
    
    # version output part only:
    $ ./pre-inst-env cobcrun --verbose --info
    indexed file handler     : BDB, version 5.3.21
    mathematical library     : GMP, version 6.0.0
    XML library              : libxml2, version 2.9.1
    JSON library             : cJSON, version 1.7.15
    extended screen I/O      : ncursesw, version 5.9.20130511 (CHTYPE=64, WIDE=1)
                               xterm with 256 colors
    mouse support            : yes
    

    RHEL8

    # Prerequisites
    sudo dnf install gcc make gmp-devel ncurses-devel libdb-devel libxml2-devel json-c-devel
    # possibly add GDB and for "nicer" debugging also vim (not installed by default) or emacs, drop xml/curses/json if not needed
    
    # GnuCOBOL
    $ tar -xvf gnucobol-3.2-rc2.tar.gz
    $ cd gnucobol-3.2-rc2
    $ mkdir build && cd build  # because I wanted some environments with different configurations - and an extra build folder is always cleaner
    configure: GnuCOBOL Configuration:
    configure:  CC                gcc
    configure:  CFLAGS            -O2 -fstack-protector-strong -pipe -finline-functions -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k
    configure:  LDFLAGS            -Wl,-z,relro,-z,now,-O1
    configure:  LIBCOB_LIBS        -lgmp -lxml2  -ljson-c  -lncursesw -ldb-5.3 -ldl
    configure:  COB_CC            gcc
    configure:  COB_CFLAGS        -fstack-protector-strong -pipe -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -I/usr/local/include -Wno-unused -fsigned-char -Wno-pointer-sign -O
    configure:  COB_LDFLAGS       -fstack-protector-strong
    configure:  COB_DEBUG_FLAGS   -ggdb3 -fasynchronous-unwind-tables
    configure:  COB_LIBS          -L${exec_prefix}/lib -lcob
    configure:  COB_CONFIG_DIR    ${datarootdir}/gnucobol/config
    configure:  COB_COPY_DIR      ${datarootdir}/gnucobol/copy
    configure:  COB_LIBRARY_PATH  ${exec_prefix}/lib/gnucobol
    configure:  COB_OBJECT_EXT    o
    configure:  COB_MODULE_EXT    so
    configure:  COB_EXE_EXT
    configure:  COB_SHARED_OPT    -shared
    configure:  COB_PIC_FLAGS     -fPIC -DPIC
    configure:  COB_EXPORT_DYN    -Wl,--export-dynamic
    configure:  COB_STRIP_CMD     strip --strip-unneeded
    configure:  Dynamic loading:                             System
    configure:  Use gettext for international messages:      yes
    configure:  Use fcntl for file locking:                  yes
    configure:  Use math multiple precision library:         gmp
    configure:  Use curses library for screen I/O:           ncursesw
    configure:  Use Berkeley DB for INDEXED I/O:             yes
    configure:  Used for XML I/O:                            libxml2
    configure:  Used for JSON I/O:                           json-c
    $ make -j3
    # two times the same warning (false-positive) in intrinsic.c (cob_intr_integer_of_formatted_date) [-Wformat-truncation]
    $ make -j2 checkall
    # as with Ubuntu: passes all of NIST, testsuite: 741 742 850 1097 1098 1161 failed ("exotics")
    $ LANG=C ./pre-inst-env cobc --info
    cobc (GnuCOBOL) 3.2-dev.0
    Copyright (C) 2023 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
    Built     Feb 09 2023 15:45:32
    Packaged  Feb 02 2023 10:49:43 UTC
    C version "8.5.0 20210514 (Red Hat 8.5.0-16)"
    
    build information
    build environment        : s390x-ibm-linux-gnu
    CC                       : gcc
    C version                : "8.5.0 20210514 (Red Hat 8.5.0-16)"
    CPPFLAGS                 :  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
    CFLAGS                   : -O2 -fstack-protector-strong -pipe
                               -finline-functions -fsigned-char -Wall
                               -Wwrite-strings -Wmissing-prototypes
                               -Wno-format-y2k
    LD                       : /usr/bin/ld -m elf64_s390
    LDFLAGS                  :  -Wl,-z,relro,-z,now,-O1
    
    GnuCOBOL information
    COB_CC                   : gcc
    COB_CFLAGS               : -fstack-protector-strong -pipe
                               -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
                               -I/usr/local/include -Wno-unused
                               -fsigned-char -Wno-pointer-sign -O
      env: COB_CFLAGS        : -I/home/linux1/gnucobol-3.2-dev/build/..
                               -fstack-protector-strong -pipe
                               -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
                               -I/usr/local/include -Wno-unused
                               -fsigned-char -Wno-pointer-sign -O
    COB_DEBUG_FLAGS          : -ggdb3 -fasynchronous-unwind-tables
    COB_LDFLAGS              : -fstack-protector-strong
      env: COB_LDFLAGS       : -fstack-protector-strong
    COB_LIBS                 : -L/usr/local/lib -lcob
      env: COB_LIBS          : -L/home/linux1/gnucobol-3.2-dev/build/libcob/.libs
                               -L/usr/local/lib -lcob
    COB_CONFIG_DIR           : /usr/local/share/gnucobol/config
      env: COB_CONFIG_DIR    : /home/linux1/gnucobol-3.2-dev/build/../config
    COB_COPY_DIR             : /usr/local/share/gnucobol/copy
      env: COB_COPY_DIR      : /home/linux1/gnucobol-3.2-dev/build/../copy
    COB_MSG_FORMAT           : GCC
    COB_OBJECT_EXT           : o
    COB_MODULE_EXT           : so
    COB_EXE_EXT              :
    64bit-mode               : yes
    BINARY-C-LONG            : 8 bytes
    endianness               : big-endian
    native EBCDIC            : no
    extended screen I/O      : ncursesw
    variable file format     : 0
    sequential file handler  : built-in
    indexed file handler     : BDB
    mathematical library     : GMP
    XML library              : libxml2
    JSON library             : json-c
    
    # version output part only:
    $ ./pre-inst-env cobcrun --verbose --info
    indexed file handler     : BDB, version 5.3.28
    mathematical library     : GMP, version 6.1.2
    XML library              : libxml2, version 2.9.7
    JSON library             : json-c, version 0.13.1
    extended screen I/O      : ncursesw, version 6.1.20180224 (CHTYPE=32, WIDE=1)
                               xterm with 256 colors
    mouse support            : yes
    

    SLES 15

    # Just showcasing the nice package that's available already
    $ sudo zypper install gnu-cobol
    $ LANG=C cobc --info
    cobc (GnuCOBOL) 3.1.2.0
    Copyright (C) 2020 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
    Built     Dec 23 2020 12:00:00
    Packaged  Dec 23 2020 12:04:58 UTC
    C version "7.5.0"
    
    build information
    build environment        : s390x-ibm-linux-gnu
    CC                       : gcc
    C version                : "7.5.0"
    CPPFLAGS                 :  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
    CFLAGS                   : -fmessage-length=0 -grecord-gcc-switches -O2
                               -Wall -D_FORTIFY_SOURCE=2
                               -fstack-protector-strong -funwind-tables
                               -fasynchronous-unwind-tables
                               -fstack-clash-protection -g
                               -fstack-protector-strong -pipe
                               -finline-functions -fsigned-char -Wall
                               -Wwrite-strings -Wmissing-prototypes
                               -Wno-format-y2k
    LD                       : /usr/s390x-suse-linux/bin/ld -m elf64_s390
    LDFLAGS                  :  -Wl,-z,relro,-z,now,-O1
    
    GnuCOBOL information
    COB_CC                   : gcc
    COB_CFLAGS               : -fmessage-length=0 -grecord-gcc-switches
                               -Wall -D_FORTIFY_SOURCE=2
                               -fstack-protector-strong
                               -fstack-clash-protection
                               -fstack-protector-strong -pipe
                               -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
                               -I/usr/include -Wno-unused -fsigned-char
                               -Wno-pointer-sign -O
    COB_DEBUG_FLAGS          : -ggdb3 -fasynchronous-unwind-tables
    COB_LDFLAGS              : -fstack-protector-strong
    COB_LIBS                 : -L/usr/lib64 -lcob -lm
    COB_CONFIG_DIR           : /usr/share/gnucobol/config
    COB_COPY_DIR             : /usr/share/gnucobol/copy
    COB_MSG_FORMAT           : GCC
    COB_OBJECT_EXT           : o
    COB_MODULE_EXT           : so
    COB_EXE_EXT              :
    64bit-mode               : yes
    BINARY-C-LONG            : 8 bytes
    endianness               : big-endian
    native EBCDIC            : no
    extended screen I/O      : ncursesw
    variable file format     : 0
    sequential file handler  : built-in
    indexed file handler     : BDB
    mathematical library     : GMP
    XML library              : libxml2
    JSON library             : json-c
    
    # from:  LANG=C cobcrun --verbose --info
    indexed file handler     : BDB, version 4.8.30
    mathematical library     : GMP, version 6.1.2
    XML library              : libxml2, version 2.9.12
    JSON library             : json-c, version 0.13.0
    extended screen I/O      : ncursesw, version 6.1.20180317 (CHTYPE=32, WIDE=1)
    mouse support            : yes
    
    # Now building from scratch - Prerequisites
    $ sudo zypper install make gcc gmp-devel libjson-c-devel ncurses-devel libxml2-devel libdb-4_8-devel
    # possibly add GDB (vim is pre-installed), drop xml/curses/json if not needed
    
    # GnuCOBOL
    $ tar -xvf gnucobol-3.2-rc2.tar.gz
    $ cd gnucobol-3.2-rc2
    $ mkdir build && cd build  # because I wanted some environments with different configurations - and an extra build folder is always cleaner
    $ ../configure --enable-hardening
    configure: GnuCOBOL Configuration:
    configure:  CC                gcc
    configure:  CFLAGS            -O2 -fstack-protector-strong -pipe -finline-functions -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k
    configure:  LDFLAGS            -Wl,-z,relro,-z,now,-O1
    configure:  LIBCOB_LIBS        -lgmp -lxml2 -ljson-c -lncursesw -ldb-5.3
    configure:  COB_CC            gcc
    configure:  COB_CFLAGS        -fstack-protector-strong -pipe -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -I/usr/local/include -Wno-unused -fsigned-char -Wno-pointer-sign -O
    configure:  COB_LDFLAGS       -fstack-protector-strong
    configure:  COB_DEBUG_FLAGS   -ggdb3 -fasynchronous-unwind-tables
    configure:  COB_LIBS          -L${exec_prefix}/lib -lcob
    configure:  COB_CONFIG_DIR    ${datarootdir}/gnucobol/config
    configure:  COB_COPY_DIR      ${datarootdir}/gnucobol/copy
    configure:  COB_LIBRARY_PATH  ${exec_prefix}/lib/gnucobol
    configure:  COB_OBJECT_EXT    o
    configure:  COB_MODULE_EXT    so
    configure:  COB_EXE_EXT
    configure:  COB_SHARED_OPT    -shared
    configure:  COB_PIC_FLAGS     -fPIC -DPIC
    configure:  COB_EXPORT_DYN    -Wl,--export-dynamic
    configure:  COB_STRIP_CMD     strip --strip-unneeded
    configure:  Dynamic loading:                             System
    configure:  Use gettext for international messages:      yes
    configure:  Use fcntl for file locking:                  yes
    configure:  Use math multiple precision library:         gmp
    configure:  Use curses library for screen I/O:           ncursesw
    configure:  Use Berkeley DB for INDEXED I/O:             yes
    configure:  Used for XML I/O:                            libxml2
    configure:  Used for JSON I/O:                           json-c
    $ make -j3
    # no compiler warnings
    $ make -j2 checkall
    # passes all of NIST, testsuite: 741 742 850 1097 1098 1161 failed ("exotics")
    $ ./pre-inst-env cobc --info
    cobc (GnuCOBOL) 3.2-dev.0
    Copyright (C) 2023 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
    Built     Feb 09 2023 18:58:54
    Packaged  Feb 02 2023 10:49:43 UTC
    C version "11.3.0"
    
    build information
    build environment        : s390x-ibm-linux-gnu
    CC                       : gcc
    C version                : "11.3.0"
    CPPFLAGS                 :
    CFLAGS                   : -O0 -ggdb3 -fasynchronous-unwind-tables -pipe
                               -fsigned-char -Wall -Wwrite-strings
                               -Wmissing-prototypes -Wno-format-y2k
    LD                       : /usr/bin/ld -m elf64_s390
    LDFLAGS                  :  -Wl,-z,relro,-z,now,-O1
    
    GnuCOBOL information
    COB_CC                   : gcc
    COB_CFLAGS               : -pipe -I/usr/local/include -Wno-unused
                               -fsigned-char -Wno-pointer-sign
      env: COB_CFLAGS        : -I/home/linux1/gnucobol-3.2-dev/build_debug/..
                               -pipe -I/usr/local/include -Wno-unused
                               -fsigned-char -Wno-pointer-sign
    COB_DEBUG_FLAGS          : -ggdb3 -fasynchronous-unwind-tables
    COB_LDFLAGS              :
      env: COB_LDFLAGS       :
    COB_LIBS                 : -L/usr/local/lib -lcob
      env: COB_LIBS          : -L/home/linux1/gnucobol-3.2-dev/build_debug/libcob/.libs
                               -L/usr/local/lib -lcob
    COB_CONFIG_DIR           : /usr/local/share/gnucobol/config
      env: COB_CONFIG_DIR    : /home/linux1/gnucobol-3.2-dev/build_debug/../config
    COB_COPY_DIR             : /usr/local/share/gnucobol/copy
      env: COB_COPY_DIR      : /home/linux1/gnucobol-3.2-dev/build_debug/../copy
    COB_MSG_FORMAT           : GCC
    COB_OBJECT_EXT           : o
    COB_MODULE_EXT           : so
    COB_EXE_EXT              :
    64bit-mode               : yes
    BINARY-C-LONG            : 8 bytes
    endianness               : big-endian
    native EBCDIC            : no
    extended screen I/O      : ncursesw
    variable file format     : 0
    sequential file handler  : built-in
    indexed file handler     : BDB
    mathematical library     : GMP
    XML library              : libxml2
    JSON library             : json-c
    

    Solaris (sparc, 32 + 64bit)

    ... another big-endian machine.

    This environment already had GnuCOBOL installed from source once, so no listing for the prerequisites here

    $ gzip -d tar -xvf gnucobol-3.2-rc2.tar.gz
    $ tar -xvf gnucobol-3.2-rc2.tar
    $ cd gnucobol-3.2-rc2
    $ mkdir build && cd build  # because we're doing two environments - and an extra build folder is always cleaner
    $ ../configure
    configure: GnuCOBOL Configuration:
    configure:  CC                gcc
    configure:  CFLAGS            -O2 -pipe
    configure:  LDFLAGS
    configure:  LIBCOB_LIBS        -lgmp   -lxml2   -ljson-c   -lncurses -ldb-5.3
    configure:  COB_CC            gcc
    configure:  COB_CFLAGS        -pipe -I/usr/include/gmp -I/usr/local/include -Wno-unused -fsigned-char -Wno-pointer-sign
    configure:  COB_LDFLAGS
    configure:  COB_DEBUG_FLAGS   -ggdb3 -fasynchronous-unwind-tables
    configure:  COB_LIBS          -L${exec_prefix}/lib -lcob
    configure:  COB_CONFIG_DIR    ${datarootdir}/gnucobol/config
    configure:  COB_COPY_DIR      ${datarootdir}/gnucobol/copy
    configure:  COB_LIBRARY_PATH  ${exec_prefix}/lib/gnucobol
    configure:  COB_OBJECT_EXT    o
    configure:  COB_MODULE_EXT    so
    configure:  COB_EXE_EXT
    configure:  COB_SHARED_OPT    -shared
    configure:  COB_PIC_FLAGS     -fPIC -DPIC
    configure:  COB_EXPORT_DYN
    configure:  Dynamic loading:                             System
    configure:  Use gettext for international messages:      yes
    configure:  Use fcntl for file locking:                  yes
    configure:  Use math multiple precision library:         gmp
    configure:  Use curses library for screen I/O:           ncurses
    configure:  Use Berkeley DB for INDEXED I/O:             yes
    configure:  Used for XML I/O:                            libxml2
    configure:  Used for JSON I/O:                           json-c
    
    $ make  # this isn't GNU make
    # one warning for intrinsic.c (cob_intr_random) -Wpointer-to-int-cast, but that's "ok", we just use it as part of a random number
    
    $ make check
    # testsuite: 850 1161 failed
    
    $ make test  (originally raised an error with the download, can be worked around with GNU make (see below), but I wanted to use the system make so edited tests/cobol85/Makefile and set CURL_FLAG=k there)
    # all of NIST pass
    
    $ ./pre-inst-env cobc --info
    cobc (GnuCOBOL) 3.2-dev.0
    Copyright (C) 2023 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
    Built     Feb 09 2023 23:48:55
    Packaged  Feb 02 2023 10:49:43 UTC
    C version "4.8.2"
    
    build information
    build environment        : sparc-sun-solaris2.11
    CC                       : gcc
    C version                : "4.8.2"
    CPPFLAGS                 :  -I/usr/include/gmp
    CFLAGS                   : -O2 -pipe
    LD                       : /usr/bin/ld
    LDFLAGS                  :
    
    GnuCOBOL information
    COB_CC                   : gcc
    COB_CFLAGS               : -pipe -I/usr/include/gmp -I/usr/local/include
                               -Wno-unused -fsigned-char -Wno-pointer-sign
      env: COB_CFLAGS        : -I/tmp/gnucobol-3.2-dev/build/.. -pipe
                               -I/usr/include/gmp -I/usr/local/include
                               -Wno-unused -fsigned-char -Wno-pointer-sign
    COB_DEBUG_FLAGS          : -ggdb3 -fasynchronous-unwind-tables
    COB_LDFLAGS              :
      env: COB_LDFLAGS       :
    COB_LIBS                 : -L/usr/local/lib -lcob
      env: COB_LIBS          : -L/tmp/gnucobol-3.2-dev/build/libcob/.libs
                               -L/usr/local/lib -lcob
    COB_CONFIG_DIR           : /usr/local/share/gnucobol/config
      env: COB_CONFIG_DIR    : /tmp/gnucobol-3.2-dev/build/../config
    COB_COPY_DIR             : /usr/local/share/gnucobol/copy
      env: COB_COPY_DIR      : /tmp/gnucobol-3.2-dev/build/../copy
    COB_MSG_FORMAT           : GCC
    COB_OBJECT_EXT           : o
    COB_MODULE_EXT           : so
    COB_EXE_EXT              :
    64bit-mode               : no
    BINARY-C-LONG            : 4 bytes
    endianness               : big-endian
    native EBCDIC            : no
    extended screen I/O      : ncurses
    variable file format     : 0
    sequential file handler  : built-in
    indexed file handler     : BDB
    mathematical library     : GMP
    XML library              : libxml2
    JSON library             : json-c
    
    $  ./pre-inst-env cobcrun --verbose --info
    indexed file handler     : BDB, version 5.3.21
    mathematical library     : GMP, version 4.3.2
    XML library              : libxml2, version 2.9.4
    JSON library             : json-c, version 0.12.0
    extended screen I/O      : ncurses, version 5.7.20081102 (CHTYPE=32, WIDE=0)
                               dec vt100 (w/advanced video)
    mouse support            : unknown
    
    # ... and now...
    
    $ cd ..
    $ mkdir build64
    $ ../configure CC="gcc -m64" --libdir=/usr/local/lib/sparcv9
    configure: GnuCOBOL Configuration:
    configure:  CC                gcc -m64
    configure:  CFLAGS            -O2 -pipe
    configure:  LDFLAGS
    configure:  LIBCOB_LIBS        -lgmp   -lxml2   -ljson-c   -lncurses -ldb-5.3
    configure:  COB_CC            gcc -m64
    configure:  COB_CFLAGS        -pipe -I/usr/include/gmp -I/usr/local/include -Wno-unused -fsigned-char -Wno-pointer-sign
    configure:  COB_LDFLAGS
    configure:  COB_DEBUG_FLAGS   -ggdb3 -fasynchronous-unwind-tables
    configure:  COB_LIBS          -L/usr/local/lib/sparcv9 -lcob
    configure:  COB_CONFIG_DIR    ${datarootdir}/gnucobol/config
    configure:  COB_COPY_DIR      ${datarootdir}/gnucobol/copy
    configure:  COB_LIBRARY_PATH  /usr/local/lib/sparcv9/gnucobol
    configure:  COB_OBJECT_EXT    o
    configure:  COB_MODULE_EXT    so
    configure:  COB_EXE_EXT
    configure:  COB_SHARED_OPT    -shared
    configure:  COB_PIC_FLAGS     -fPIC -DPIC
    configure:  COB_EXPORT_DYN
    configure:  Dynamic loading:                             System
    configure:  Use gettext for international messages:      yes
    configure:  Use fcntl for file locking:                  yes
    configure:  Use math multiple precision library:         gmp
    configure:  Use curses library for screen I/O:           ncurses
    configure:  Use Berkeley DB for INDEXED I/O:             yes
    configure:  Used for XML I/O:                            libxml2
    configure:  Used for JSON I/O:                           json-c
    $ make  # no warnings
    $ make check
    # testsuite: 741 742 850 1097 1098 1161 failed
    $ gmake -C tests/cobol85/ newcob.val CURL_FLAGS=-k # needs an updated gmake...
    $ gmake test -j5   # the system has nothing to do on its 64 cores and we do a late-night build, so use multiple cores - if we have an updated gmake
    # all of NIST pass
    
    $ ./pre-inst-env cobc --info
    cobc (GnuCOBOL) 3.2-dev.0
    Copyright (C) 2023 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
    Built     Feb 09 2023 23:54:04
    Packaged  Feb 02 2023 10:49:43 UTC
    C version "4.8.2"
    
    build information
    build environment        : sparc-sun-solaris2.11
    CC                       : gcc -m64
    C version                : "4.8.2"
    CPPFLAGS                 :  -I/usr/include/gmp
    CFLAGS                   : -O2 -pipe
    LD                       : /usr/bin/ld -64
    LDFLAGS                  :
    
    GnuCOBOL information
    COB_CC                   : gcc -m64
    COB_CFLAGS               : -pipe -I/usr/include/gmp -I/usr/local/include
                               -Wno-unused -fsigned-char -Wno-pointer-sign
      env: COB_CFLAGS        : -I/tmp/gnucobol-3.2-dev/build64/.. -pipe
                               -I/usr/include/gmp -I/usr/local/include
                               -Wno-unused -fsigned-char -Wno-pointer-sign
    COB_DEBUG_FLAGS          : -ggdb3 -fasynchronous-unwind-tables
    COB_LDFLAGS              :
      env: COB_LDFLAGS       :
    COB_LIBS                 : -L/usr/local/lib/sparcv9 -lcob
      env: COB_LIBS          : -L/tmp/gnucobol-3.2-dev/build64/libcob/.libs
                               -L/usr/local/lib/sparcv9 -lcob
    COB_CONFIG_DIR           : /usr/local/share/gnucobol/config
      env: COB_CONFIG_DIR    : /tmp/gnucobol-3.2-dev/build64/../config
    COB_COPY_DIR             : /usr/local/share/gnucobol/copy
      env: COB_COPY_DIR      : /tmp/gnucobol-3.2-dev/build64/../copy
    COB_MSG_FORMAT           : GCC
    COB_OBJECT_EXT           : o
    COB_MODULE_EXT           : so
    COB_EXE_EXT              :
    64bit-mode               : yes
    BINARY-C-LONG            : 8 bytes
    endianness               : big-endian
    native EBCDIC            : no
    extended screen I/O      : ncurses
    variable file format     : 0
    sequential file handler  : built-in
    indexed file handler     : BDB
    mathematical library     : GMP
    XML library              : libxml2
    JSON library             : json-c
    
    # ... and now "Solaris Native"
    
    $ cd ..
    $ mkdir build_sol12_2
    export PATH=/opt/solstudio12.2/bin:$PATH
    $ ../configure --without-db --enable-debug CC=cc MAKE=dmake GMP_CFLAGS="-I/opt/csw/include" GMP_LIBS="-L/opt/csw/lib -lgmp" JSON_C_LIBS="-L/opt/csw/lib -ljson-c" LDFLAGS="-R/opt/csw/lib"
    configure: GnuCOBOL Configuration:
    configure:  CC                cc
    configure:  CFLAGS            -g -xstrconst
    configure:  LDFLAGS           -R/opt/csw/lib
    configure:  LIBCOB_LIBS        -L/opt/csw/lib -lgmp -lxml2 -lpthread -lz -lm -lsocket -lnsl   -L/opt/csw/lib -ljson-c -lrt -lcurses
    configure:  COB_CC            cc
    configure:  COB_CFLAGS        -g -I/opt/csw/include -I/usr/local/include -xstrconst
    configure:  COB_LDFLAGS       -R/opt/csw/lib
    configure:  COB_DEBUG_FLAGS   -g
    configure:  COB_LIBS          -L${exec_prefix}/lib -lcob
    configure:  COB_CONFIG_DIR    ${datarootdir}/gnucobol/config
    configure:  COB_COPY_DIR      ${datarootdir}/gnucobol/copy
    configure:  COB_LIBRARY_PATH  ${exec_prefix}/lib/gnucobol
    configure:  COB_OBJECT_EXT    o
    configure:  COB_MODULE_EXT    so
    configure:  COB_EXE_EXT
    configure:  COB_SHARED_OPT    -G
    configure:  COB_PIC_FLAGS     -KPIC -DPIC
    configure:  COB_EXPORT_DYN
    configure:  Dynamic loading:                             System
    configure:  Use gettext for international messages:      no
    configure:  Use fcntl for file locking:                  yes
    configure:  Use math multiple precision library:         gmp
    configure:  Use curses library for screen I/O:           curses
    configure:  INDEXED I/O (no handler configured):         NO
    configure:  Used for XML I/O:                            libxml2
    configure:  Used for JSON I/O:                           json-c
    
    $ dmake -j4 
    
    #"../../libcob/screenio.c", line 947: warning: argument #2 is incompatible with prototype:
    #        prototype: pointer to char : "/usr/include/curses.h", line 401
    #        argument : pointer to const char
    
    
    $ cd tests && make check-local TESTSUITEFLAGS="--jobs=4" # did not work with dmake
    # testsuite: 594 703 704 763 850 1098 1161 failed
    # 594 is "missing ename" - fixed with r5003
    # 703 + 704 are signed char warnings fixed with r5004; 736 is similar but called from COBOL, leaving as is for now
    
    # Makefile in NIST Modules raise an error in the Makefile with all "dmake" on this system, so done half-manual
    $ bash
    $ cd tests/cobol85
    $ . ../atconfig && . ../atlocal
    $ dmake modules # no multiple jobs as that breaks
    $ rm -rf DB # otherwise DBNOIX
    $ for mod in $(ls -d [A-Z]*/.); do pushd $mod && (dmake test-local || echo failed) && popd ; done
    $ for mod in $(ls -d [A-Z]*/.); do pushd $mod && (dmake diff || echo failed) && popd ; done
    $ dmake diff # no NIST failures
    
    
    $ ./pre-inst-env cobc --info
    cobc (GnuCOBOL) 3.2-dev.0
    Copyright (C) 2023 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
    Built     Feb 09 2023 23:54:04
    Packaged  Feb 02 2023 10:49:43 UTC
    C version (Sun C) 0x5110
    
    build information
    build environment        : sparc-sun-solaris2.10
    CC                       : cc
    C version                : (Sun C) 0x5110
    CPPFLAGS                 :  -I/opt/csw/include
    CFLAGS                   : -g -xstrconst
    LD                       : /usr/ccs/bin/ld
    LDFLAGS                  : -R/opt/csw/lib
    
    GnuCOBOL information
    COB_CC                   : cc
    COB_CFLAGS               : -g -I/opt/csw/include -I/usr/local/include
                               -xstrconst
      env: COB_CFLAGS        : -I/home/cf-mensch/gnucobol-3.2-rc2/build_ss/..
                               -g -I/opt/csw/include -I/usr/local/include
                               -xstrconst
    COB_DEBUG_FLAGS          : -g
    COB_LDFLAGS              : -R/opt/csw/lib
      env: COB_LDFLAGS       : -R/opt/csw/lib
    COB_LIBS                 : -L/usr/local/lib -lcob
      env: COB_LIBS          : -L/home/cf-mensch/gnucobol-3.2-rc2/build_ss/libcob/.l              ibs
                               -L/usr/local/lib -lcob
    COB_CONFIG_DIR           : /usr/local/share/gnucobol/config
      env: COB_CONFIG_DIR    : /home/cf-mensch/gnucobol-3.2-rc2/build_ss/../config
    COB_COPY_DIR             : /usr/local/share/gnucobol/copy
      env: COB_COPY_DIR      : /home/cf-mensch/gnucobol-3.2-rc2/build_ss/../copy
    COB_MSG_FORMAT           : GCC
    COB_OBJECT_EXT           : o
    COB_MODULE_EXT           : so
    COB_EXE_EXT              :
    64bit-mode               : no
    BINARY-C-LONG            : 4 bytes
    endianness               : big-endian
    native EBCDIC            : no
    extended screen I/O      : curses
    variable file format     : 0
    sequential file handler  : built-in
    indexed file handler     : disabled
    mathematical library     : GMP
    XML library              : libxml2
    JSON library             : json-c
    
    $ ./pre-inst-env cobcrun --verbose --info
    mathematical library     : GMP, version 6.1.2
    XML library              : libxml2, version 2.6.23
    JSON library             : json-c, version 0.12.99
    extended screen I/O      : curses (CHTYPE=32) xterm terminal emulator
    mouse support            : disabled
    

    AIX on PowerPC

    ... another big-endian machine.

    This environment already had GnuCOBOL installed from source once,
    with previously having installed GMP to /opt/gnucobol and no BDB,
    so no listing for the prerequisites here.

    $ unzip gnucobol-3.2-rc2.tar.gz
    $ tar -xvf gnucobol-3.2-rc2.tar  # on-the-fly with decompress did not work
    $ cd gnucobol-3.2-rc2
    $ mkdir build && cd build  # originally I wanted to do 32 and 64 bit environment, but I only had 64bit GMP there
    $ ../configure CC="gcc -maix64" PKG_CONFIG_PATH=/opt/gnucobol/lib/pkgconfig --without-db
    configure: GnuCOBOL Configuration:
    configure:  CC                gcc -maix64
    configure:  CFLAGS            -O2 -pipe
    configure:  LDFLAGS
    configure:  LIBCOB_LIBS        -L/opt/gnucobol/lib -lgmp   -L/opt/freeware/lib -lxml2   -lcurses -lintl
    configure:  PROGRAMS_LIBS         -lintl
    configure:  COB_CC            gcc -maix64
    configure:  COB_CFLAGS        -pipe -I/opt/gnucobol/include -I/usr/local/include -Wno-unused -fsigned-char -Wno-pointer-sign
    configure:  COB_LDFLAGS
    configure:  COB_DEBUG_FLAGS   -ggdb3 -fasynchronous-unwind-tables
    configure:  COB_LIBS          -L${exec_prefix}/lib -lcob
    configure:  COB_CONFIG_DIR    ${datarootdir}/gnucobol/config
    configure:  COB_COPY_DIR      ${datarootdir}/gnucobol/copy
    configure:  COB_LIBRARY_PATH  ${exec_prefix}/lib/gnucobol
    configure:  COB_OBJECT_EXT    o
    configure:  COB_MODULE_EXT    so
    configure:  COB_EXE_EXT
    configure:  COB_SHARED_OPT    -shared
    configure:  COB_PIC_FLAGS     -fPIC -DPIC
    configure:  COB_EXPORT_DYN    -Wl,-bexpfull -Wl,-brtl
    configure:  Dynamic loading:                             System
    configure:  Use gettext for international messages:      yes
    configure:  Use fcntl for file locking:                  yes
    configure:  Use math multiple precision library:         gmp
    configure:  Use curses library for screen I/O:           curses
    configure:  INDEXED I/O (no handler configured):         NO
    configure:  Used for XML I/O:                            libxml2
    configure:  JSON I/O (no handler found):                 NO
    
    
    $ make -j4   # this isn't GNU make
    # two warnings in termio.c: discards qualifiers from pointer target type
    
    $ make check # multiple jobs led to a hanging testsuite, possibly lock of temporary files
    # testsuite: 591 741 742 850 1097 1098 1161 failed
    
    $ cp ~/COBOL/newcob.val tests/cobol85/  # neither curl nor wget here
    
    $ make test # multiple jobs led to a hanging testsuite, possibly lock of temporary files
    # all of NIST pass
    
    $ ./pre-inst-env cobc --info
    cobc (GnuCOBOL) 3.2-dev.0
    Copyright (C) 2023 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
    Built     Feb 10 2023 22:23:29
    Packaged  Feb 10 2023 13:49:07 UTC
    C version "4.2.0"
    
    build information
    build environment        : powerpc-ibm-aix7.1.1.0
    CC                       : gcc -maix64
    C version                : "4.2.0"
    CPPFLAGS                 :  -I/opt/gnucobol/include
    CFLAGS                   : -O2 -pipe
    LD                       : /usr/bin/ld
    LDFLAGS                  :
    
    GnuCOBOL information
    COB_CC                   : gcc -maix64
    COB_CFLAGS               : -pipe -I/opt/gnucobol/include
                               -I/usr/local/include -Wno-unused
                               -fsigned-char -Wno-pointer-sign
      env: COB_CFLAGS        : -I/tmp/gnucobol-3.2-dev/build/.. -pipe
                               -I/opt/gnucobol/include -I/usr/local/include
                               -Wno-unused -fsigned-char -Wno-pointer-sign
    COB_DEBUG_FLAGS          : -ggdb3 -fasynchronous-unwind-tables
    COB_LDFLAGS              :
      env: COB_LDFLAGS       :
    COB_LIBS                 : -L/usr/local/lib -lcob
      env: COB_LIBS          : -L/tmp/gnucobol-3.2-dev/build/libcob/.libs
                               -L/usr/local/lib -lcob
    COB_CONFIG_DIR           : /usr/local/share/gnucobol/config
      env: COB_CONFIG_DIR    : /tmp/gnucobol-3.2-dev/build/../config
    COB_COPY_DIR             : /usr/local/share/gnucobol/copy
      env: COB_COPY_DIR      : /tmp/gnucobol-3.2-dev/build/../copy
    COB_MSG_FORMAT           : GCC
    COB_OBJECT_EXT           : o
    COB_MODULE_EXT           : so
    COB_EXE_EXT              :
    64bit-mode               : yes
    BINARY-C-LONG            : 8 bytes
    endianness               : big-endian
    native EBCDIC            : no
    extended screen I/O      : curses
    variable file format     : 0
    sequential file handler  : built-in
    indexed file handler     : disabled
    mathematical library     : GMP
    XML library              : libxml2
    JSON library             : not found
    
    
    $  ./pre-inst-env cobcrun --verbose --info
    indexed file handler     : disabled
    mathematical library     : GMP, version 6.2.1
    XML library              : libxml2, version 2.7.8
    JSON library             : disabled
    extended screen I/O      : curses (CHTYPE=32) Digital VT100
    mouse support            : disabled
    

    Debian 6.1 on PowerPC

    ... another big-endian machine, provided by the GNU compiler farm (gcc203)

    This environment had no BDB installed, so I disabled that.

    $ gpg --verify gnucobol-3.2-rc2.tar.gz.sig gnucobol-3.2-rc2.tar.gz
    $ tar -xvf gnucobol-3.2-rc2.tar.gz
    $ cd gnucobol-3.2-rc2
    # "unclean" direct in the source tree, as this must work, too 
    $ ../configure --without-db
    configure: GnuCOBOL Configuration:
    configure:  CC                gcc
    configure:  CFLAGS            -O2 -pipe -finline-functions -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k
    configure:  LDFLAGS            -Wl,-z,relro,-z,now,-O1
    configure:  LIBCOB_LIBS        -lgmp  -lxml2  -ljson-c  -lncursesw
    configure:  COB_CC            gcc
    configure:  COB_CFLAGS        -pipe -I/usr/local/include -Wno-unused -fsigned-char -Wno-pointer-sign
    configure:  COB_LDFLAGS
    configure:  COB_DEBUG_FLAGS   -ggdb3 -fasynchronous-unwind-tables
    configure:  COB_LIBS          -L${exec_prefix}/lib -lcob
    configure:  COB_CONFIG_DIR    ${datarootdir}/gnucobol/config
    configure:  COB_COPY_DIR      ${datarootdir}/gnucobol/copy
    configure:  COB_LIBRARY_PATH  ${exec_prefix}/lib/gnucobol
    configure:  COB_OBJECT_EXT    o
    configure:  COB_MODULE_EXT    so
    configure:  COB_EXE_EXT
    configure:  COB_SHARED_OPT    -shared
    configure:  COB_PIC_FLAGS     -fPIC -DPIC
    configure:  COB_EXPORT_DYN    -Wl,--export-dynamic
    configure:  COB_STRIP_CMD     strip --strip-unneeded
    configure:  Dynamic loading:                             System
    configure:  Use gettext for international messages:      yes
    configure:  Use fcntl for file locking:                  yes
    configure:  Use math multiple precision library:         gmp
    configure:  Use curses library for screen I/O:           ncursesw
    configure:  INDEXED I/O (no handler configured):         NO
    configure:  Used for XML I/O:                            libxml2
    configure:  Used for JSON I/O:                           json-c
    
    $ make -j8   # I was alone on that machine, which has 64 cpus
    # no warnings
    
    $ make -j 6 checkall TESTSUITEFLAGS="--jobs=20" # always nice to work on powered machines
    # testsuite: 741 742 850 1097 1098 1161 failed
    # all of NIST pass
    
    $ ./pre-inst-env cobc --info
    cobc (GnuCOBOL) 3.2-rc2.0
    Copyright (C) 2023 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
    Built     Feb 24 2023 14:16:17
    Packaged  Feb 11 2023 01:47:30 UTC
    C version "12.2.0"
    
    build information
    build environment        : powerpc64-unknown-linux-gnu
    CC                       : gcc
    C version                : "12.2.0"
    CPPFLAGS                 :
    CFLAGS                   : -O2 -pipe -finline-functions -fsigned-char
                               -Wall -Wwrite-strings -Wmissing-prototypes
                               -Wno-format-y2k
    LD                       : /usr/bin/ld
    LDFLAGS                  :  -Wl,-z,relro,-z,now,-O1
    
    GnuCOBOL information
    COB_CC                   : gcc
    COB_CFLAGS               : -pipe -I/usr/local/include -Wno-unused
                               -fsigned-char -Wno-pointer-sign
      env: COB_CFLAGS        : -I/home/cf-mensch/gnucobol-3.2-rc2 -pipe
                               -I/usr/local/include -Wno-unused
                               -fsigned-char -Wno-pointer-sign
    COB_DEBUG_FLAGS          : -ggdb3 -fasynchronous-unwind-tables
    COB_LDFLAGS              :
      env: COB_LDFLAGS       :
    COB_LIBS                 : -L/usr/local/lib -lcob
      env: COB_LIBS          : -L/home/cf-mensch/gnucobol-3.2-rc2/libcob/.libs
                               -L/usr/local/lib -lcob
    COB_CONFIG_DIR           : /usr/local/share/gnucobol/config
      env: COB_CONFIG_DIR    : /home/cf-mensch/gnucobol-3.2-rc2/config
    COB_COPY_DIR             : /usr/local/share/gnucobol/copy
      env: COB_COPY_DIR      : /home/cf-mensch/gnucobol-3.2-rc2/copy
    COB_MSG_FORMAT           : GCC
    COB_OBJECT_EXT           : o
    COB_MODULE_EXT           : so
    COB_EXE_EXT              :
    64bit-mode               : yes
    BINARY-C-LONG            : 8 bytes
    endianness               : big-endian
    native EBCDIC            : no
    extended screen I/O      : ncursesw
    variable file format     : 0
    sequential file handler  : built-in
    indexed file handler     : disabled
    mathematical library     : GMP
    XML library              : libxml2
    JSON library             : json-c
    
    
    $  ./pre-inst-env cobcrun --verbose --info
    indexed file handler     : disabled
    mathematical library     : GMP, version 6.2.1
    XML library              : libxml2, version 2.9.14
    JSON library             : json-c, version 0.16.0
    extended screen I/O      : ncursesw, version 6.4.20221231 (CHTYPE=32, WIDE=1)
                               xterm with 256 colors
    mouse support            : yes
    

    As this is fast and also has latest GCC and GDB installed that's a good environment to possibly work on those testsuite failures.

    Oracle Linux 9 on Ampera A1 (aarch64)

    Kind of a follow-up to the Oracle Cloud free tier post [659b15d346].

    # Prerequisites, note: there is json-c, but that is "binary only"
    sudo dnf install gmp-devel ncurses-devel libdb-devel libxml2-devel
    # possibly add GDB and for "nicer" debugging also vim (not installed by default) or emacs, drop xml/curses/json if not needed
    
    # GnuCOBOL
    $ tar -xvf gnucobol-3.2-rc2.tar.gz
    $ cd gnucobol-3.2-rc2
    $ mkdir build && cd build  # because I wanted some environments with different configurations - and an extra build folder is always cleaner
    $ mkdir libcob
    $ curl https://raw.githubusercontent.com/DaveGamble/cJSON/master/cJSON.h -o libcob/cJSON.h
    $ curl https://raw.githubusercontent.com/DaveGamble/cJSON/master/cJSON.c -o libcob/cJSON.c
    $ ../configure --enable-hardening
    configure: GnuCOBOL Configuration:
    configure:  CC                gcc
    configure:  CFLAGS            -O2 -fstack-protector-strong -pipe -finline-functions -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k
    configure:  LDFLAGS            -Wl,-z,relro,-z,now,-O1
    configure:  LIBCOB_LIBS        -lgmp  -lxml2  -lncursesw -ldb-5.3
    configure:  COB_CC            gcc
    configure:  COB_CFLAGS        -fstack-protector-strong -pipe -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -I/usr/local/include -Wno-unused -fsigned-char -Wno-pointer-sign -O
    configure:  COB_LDFLAGS       -fstack-protector-strong
    configure:  COB_DEBUG_FLAGS   -ggdb3 -fasynchronous-unwind-tables
    configure:  COB_LIBS          -L${exec_prefix}/lib -lcob
    configure:  COB_CONFIG_DIR    ${datarootdir}/gnucobol/config
    configure:  COB_COPY_DIR      ${datarootdir}/gnucobol/copy
    configure:  COB_LIBRARY_PATH  ${exec_prefix}/lib/gnucobol
    configure:  COB_OBJECT_EXT    o
    configure:  COB_MODULE_EXT    so
    configure:  COB_EXE_EXT
    configure:  COB_SHARED_OPT    -shared
    configure:  COB_PIC_FLAGS     -fPIC -DPIC
    configure:  COB_EXPORT_DYN    -Wl,--export-dynamic
    configure:  COB_STRIP_CMD     strip --strip-unneeded
    configure:  Dynamic loading:                             System
    configure:  Use gettext for international messages:      yes
    configure:  Use fcntl for file locking:                  yes
    configure:  Use math multiple precision library:         gmp
    configure:  Use curses library for screen I/O:           ncursesw
    configure:  Use Berkeley DB for INDEXED I/O:             yes
    configure:  Used for XML I/O:                            libxml2
    configure:  Used for JSON I/O:                           local
    $ make -j3
    # no warnings
    $ make -j2 checkall
    # as with RHEL8 on amd64: all tests pass
    $ ./pre-inst-env cobc --info
    cobc (GnuCOBOL) 3.2-dev.0
    Copyright (C) 2023 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
    Built     Feb 10 2023 00:40:17
    Packaged  Feb 02 2023 10:49:43 UTC
    C version "11.3.1 20220421 (Red Hat 11.3.1-2.1.0.1)"
    
    build information
    build environment        : aarch64-unknown-linux-gnu
    CC                       : gcc
    C version                : "11.3.1 20220421 (Red Hat 11.3.1-2.1.0.1)"
    CPPFLAGS                 :  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
    CFLAGS                   : -O2 -fstack-protector-strong -pipe
                               -finline-functions -fsigned-char -Wall
                               -Wwrite-strings -Wmissing-prototypes
                               -Wno-format-y2k
    LD                       : /usr/bin/ld
    LDFLAGS                  :  -Wl,-z,relro,-z,now,-O1
    
    GnuCOBOL information
    COB_CC                   : gcc
    COB_CFLAGS               : -fstack-protector-strong -pipe
                               -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
                               -I/usr/local/include -Wno-unused
                               -fsigned-char -Wno-pointer-sign -O
      env: COB_CFLAGS        : -I/home/opc/gnucobol-3.2-dev/build/..
                               -fstack-protector-strong -pipe
                               -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
                               -I/usr/local/include -Wno-unused
                               -fsigned-char -Wno-pointer-sign -O
    COB_DEBUG_FLAGS          : -ggdb3 -fasynchronous-unwind-tables
    COB_LDFLAGS              : -fstack-protector-strong
      env: COB_LDFLAGS       : -fstack-protector-strong
    COB_LIBS                 : -L/usr/local/lib -lcob
      env: COB_LIBS          : -L/home/opc/gnucobol-3.2-dev/build/libcob/.libs
                               -L/usr/local/lib -lcob
    COB_CONFIG_DIR           : /usr/local/share/gnucobol/config
      env: COB_CONFIG_DIR    : /home/opc/gnucobol-3.2-dev/build/../config
    COB_COPY_DIR             : /usr/local/share/gnucobol/copy
      env: COB_COPY_DIR      : /home/opc/gnucobol-3.2-dev/build/../copy
    COB_MSG_FORMAT           : GCC
    COB_OBJECT_EXT           : o
    COB_MODULE_EXT           : so
    COB_EXE_EXT              :
    64bit-mode               : yes
    BINARY-C-LONG            : 8 bytes
    endianness               : little-endian
    native EBCDIC            : no
    extended screen I/O      : ncursesw
    variable file format     : 0
    sequential file handler  : built-in
    indexed file handler     : BDB
    mathematical library     : GMP
    XML library              : libxml2
    JSON library             : cjson
    
    # version output part only:
    $ ./pre-inst-env cobcrun --verbose --info
    indexed file handler     : BDB, version 5.3.28
    mathematical library     : GMP, version 6.2.0
    XML library              : libxml2, version 2.9.13
    JSON library             : cJSON, version 1.7.15
    extended screen I/O      : ncursesw, version 6.2.20210508 (CHTYPE=32, WIDE=1)
                               xterm with 256 colors
    mouse support            : yes
    

    RockyLinux on AMD64

    .. just some cloud machine, note that's already "outdated", as it is still Rocky8; prerequisites as in RHEL8

    # extra checks
    $ sudo dnf install libubsan libasan
    
    $ tar -xvf gnucobol-3.2-rc2.tar.gz
    $ cd gnucobol-3.2-rc2
    $ mkdir build && cd build
    $ ../configure --enable-hardening LFLAGS="-lasan -lubsan"
    # that did not worked well because libasan does not work with the wrappers we use
    
    $ ../configure --enable-hardening LFLAGS="-lubsan"
    configure: GnuCOBOL Configuration:
    configure:  CC                gcc
    configure:  CFLAGS            -O2 -fstack-protector-strong -pipe -finline-functions -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k
    configure:  LDFLAGS           -lubsan -Wl,-z,relro,-z,now,-O1
    configure:  LIBCOB_LIBS        -lgmp -lxml2  -ljson-c  -lncursesw -ldb-5.3 -ldl
    configure:  COB_CC            gcc
    configure:  COB_CFLAGS        -fstack-protector-strong -pipe -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -I/usr/local/include -Wno-unused -fsigned-char -Wno-pointer-sign -O
    configure:  COB_LDFLAGS       -lubsan -fstack-protector-strong
    configure:  COB_DEBUG_FLAGS   -ggdb3 -fasynchronous-unwind-tables
    configure:  COB_LIBS          -L${exec_prefix}/lib -lcob
    configure:  COB_CONFIG_DIR    ${datarootdir}/gnucobol/config
    configure:  COB_COPY_DIR      ${datarootdir}/gnucobol/copy
    configure:  COB_LIBRARY_PATH  ${exec_prefix}/lib/gnucobol
    configure:  COB_OBJECT_EXT    o
    configure:  COB_MODULE_EXT    so
    configure:  COB_EXE_EXT
    configure:  COB_SHARED_OPT    -shared
    configure:  COB_PIC_FLAGS     -fPIC -DPIC
    configure:  COB_EXPORT_DYN    -Wl,--export-dynamic
    configure:  COB_STRIP_CMD     strip --strip-unneeded
    configure:  Dynamic loading:                             System
    configure:  Use gettext for international messages:      yes
    configure:  Use fcntl for file locking:                  yes
    configure:  Use math multiple precision library:         gmp
    configure:  Use curses library for screen I/O:           ncursesw
    configure:  Use Berkeley DB for INDEXED I/O:             yes
    configure:  Used for XML I/O:                            libxml2
    configure:  Used for JSON I/O:                           json-c
    
    $ make -j4   # intrinsic.c warnings as seen in RHL8
    
    $ make checkall -j4 TESTSUITEFLAGS="--jobs=6"
    # everything passed
    
    
    $ ./pre-inst-env cobc--info
    cobc (GnuCOBOL) 3.2-dev.0
    Copyright (C) 2023 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
    Built     Feb 10 2023 00:43:44
    Packaged  Feb 02 2023 10:49:43 UTC
    C version "8.5.0 20210514 (Red Hat 8.5.0-4)"
    
    build information
    build environment        : x86_64-pc-linux-gnu
    CC                       : gcc
    C version                : "8.5.0 20210514 (Red Hat 8.5.0-4)"
    CPPFLAGS                 :  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
    CFLAGS                   : -O2 -fstack-protector-strong -pipe
                               -finline-functions -fsigned-char -Wall
                               -Wwrite-strings -Wmissing-prototypes
                               -Wno-format-y2k
    LD                       : /usr/bin/ld -m elf_x86_64
    LDFLAGS                  : -lubsan -Wl,-z,relro,-z,now,-O1
    
    GnuCOBOL information
    COB_CC                   : gcc
    COB_CFLAGS               : -fstack-protector-strong -pipe
                               -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
                               -I/usr/local/include -Wno-unused
                               -fsigned-char -Wno-pointer-sign -O
      env: COB_CFLAGS        : -I/tmp/gnucobol-3.2-dev/build/..
                               -fstack-protector-strong -pipe
                               -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
                               -I/usr/local/include -Wno-unused
                               -fsigned-char -Wno-pointer-sign -O
    COB_DEBUG_FLAGS          : -ggdb3 -fasynchronous-unwind-tables
    COB_LDFLAGS              : -lubsan -fstack-protector-strong
      env: COB_LDFLAGS       : -lubsan -fstack-protector-strong
    COB_LIBS                 : -L/usr/local/lib -lcob
      env: COB_LIBS          : -L/tmp/gnucobol-3.2-dev/build/libcob/.libs
                               -L/usr/local/lib -lcob
    COB_CONFIG_DIR           : /usr/local/share/gnucobol/config
      env: COB_CONFIG_DIR    : /tmp/gnucobol-3.2-dev/build/../config
    COB_COPY_DIR             : /usr/local/share/gnucobol/copy
      env: COB_COPY_DIR      : /tmp/gnucobol-3.2-dev/build/../copy
    COB_MSG_FORMAT           : GCC
    COB_OBJECT_EXT           : o
    COB_MODULE_EXT           : so
    COB_EXE_EXT              :
    64bit-mode               : yes
    BINARY-C-LONG            : 8 bytes
    endianness               : little-endian
    native EBCDIC            : no
    extended screen I/O      : ncursesw
    variable file format     : 0
    sequential file handler  : built-in
    indexed file handler     : BDB
    mathematical library     : GMP
    XML library              : libxml2
    JSON library             : json-c
    
    $ ./pre-inst-env cobcrun --verbose --info
    indexed file handler     : BDB, version 5.3.28
    mathematical library     : GMP, version 6.1.2
    XML library              : libxml2, version 2.9.7
    JSON library             : json-c, version 0.13.1
    extended screen I/O      : ncursesw, version 6.1.20180224 (CHTYPE=32, WIDE=1)
                               xterm terminal emulator (X Window System)
    mouse support            : yes
    

    Note: the" false-positive warning in termio.c old GCC" was worked around with a code change.
    The testsuite failures on Solaris with Solaris Studio were partially fixed.

    Furthermore did run the tests ?--without-db on loongarch64 (crafted linux), riscv64 (Ubuntu) - all build and tested as above, passing all internal and NIST test.

     

    Related

    Discussion: c4bd93052a
    Discussion: 659b15d346


    Last edit: Simon Sobisch 2024-01-23
    • Brian Tiffin

      Brian Tiffin - 2023-02-22

      Nice work, Simon. This is awesome.

      First pre-req listing, typo. Second sudo apt update should be sudo apt upgrade

      I was just going to fix it, but then I figured I'd pester you to attach all the goodies as a script file or nine too, and have the correction upstream. ;-)

      Nice,
      Blue

       
      • Simon Sobisch

        Simon Sobisch - 2023-02-22

        please edit to fix issues you see and feel free to make some scripts out of it, attaching them on a reply to the message

         
  • Simon Sobisch

    Simon Sobisch - 2023-02-21

    And, as addition because that's not a "build from source": here are the Fedora build logs and rpms (including the common x86_64 , i686 next to less common ppc64le, aarch64 and one big-endian s390x), using full hardening with

    CFLAGS='-O2  -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -fasynchronous-unwind-tables -fstack-clash-protection'
    LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1'
    

    (via CFLAGS there's also full system-specific optimizations like -m64 -mcpu=power8 -mtune=power8)

    and configured with --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --runstatedir=/run --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-hardening --with-db --with-xml2 --with-curses=ncursesw --with-json=json-c

    rpms ready-to-use and full build logs can be found below https://koji.fedoraproject.org/koji/taskinfo?taskID=97824901

    Aarch64 fails EXTFH: Indexed with FH--FCD - details in [bugs:#878], s390x does the same.
    s390x additionally has the same failures as in the "build from source" from above.

    All other environments execute the internal tests without any issue.
    In all environments NIST85 passes.

     

    Related

    Bugs: #878

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.