Unpack the GNU Compiler Collection for the z/TPF system

You can unpack a binary package as an alternative to building the GNU Compiler Collection (GCC).

Before you begin

  • Ensure that you have approximately 1 GB of free DASD to unpack the executable and linking format (ELF)-compatible compiler, which is also known as a cross-compiler.
  • Ensure that you have the s390x-linux-gnu-x-s390x-ibm-tpf.tar.bz2 binary source files. For more information about how to get these files, contact IBM® Support.
  • Download the compressed tpf-sysroot-ibm.version.tar.bz2 sysroot file that corresponds to the version of the compiler that you use from the TPF Family Products: Tools web page.
Note: The directory names that are used in the following instructions and examples are only suggestions. You can use any directory names that are appropriate for your environment. The following procedure uses /opt/tpf-gcc as the root location for the compiler.

Procedure

  1. Set up a parent directory to use for unpacking the compiler.
    mkdir -p /opt
  2. Unpack the binary package.
    tar -xjf s390x-linux-gnu-x-s390x-ibm-tpf.tar.bz2
    mv tpf-version-subversion /opt/tpf-gcc
    
  3. Optional: Unpack the sysroot files and apply them to the compiler. The sysroot files that are included in the binary package were up-to-date when the binary package was created. Those files might need to be updated independently when you update the compiler later.
    tar -xjf tpf-sysroot-ibm.version.tar.bz2 
    /opt/tpf-gcc/H-s390x-linux-gnu/bin/refix

    You are prompted to enter the location for the sysroot files, for example: /cur/path/sys-root.

  4. Complete setup and verification.
    1. Update or create the following environment variables as part of your profile file (such as $HOME/.bash_profile, $HOME/.profile, or /etc/profile.local). For example, enter the following commands to use the GCC 7.3.0 compiler in your current session.
      export PATH=/opt/tpf-gcc/H-s390x-linux-gnu/bin:$PATH
      export TPF_X_GCC=/opt/tpf-gcc/s390x-ibm-tpf/include/c++/7.3.0
      export TPF_X_LIBS=/opt/tpf-gcc/H-s390x-linux-gnu/lib/gcc/s390x-ibm-tpf/7.3.0
      export TPF_INFO=/opt/tpf-gcc/share/info
      export INFOPATH=$TPF_INFO:$INFOPATH
      
    2. Optional: To provide a choice of GCC compiler versions to application programmers, customize the tpftools/include_ztpf_user/maketpf.rules_cfg_GNU file to set four environment variables to define the installation location for the supported levels of the compiler. The following example shows a set of environment variables for GCC 7.
      ifeq ($(TPFGCC_VERSION),7)
        export TPF_X_GCC:=/opt/tpf-gcc-7/tpf_x_gcc
        export TPF_X_LIBS:=/opt/tpf-gcc-7/libs
        export TPF_INFO:=/opt/tpf-gcc-7/share/info
        export PATH:=/opt/tpf-gcc-7/bin:$(PATH)
      endif
      
    3. Verify that the compiler was unpacked successfully. Start a new Linux session and enter the following command:
      tpf-gcc -v
      If the compiler was built successfully and you use the GCC 7 compiler, you might see the output as the following example shows.
      Using built-in specs.
      COLLECT_GCC=tpf-gcc
      COLLECT_LTO_WRAPPER=/opt/tpf-17r1-7/H-s390x-linux-gnu/bin/../libexec/gcc/s390x-ibm-tpf/7.3.0/lto-
      wrapper
      Target: s390x-ibm-tpf
      Configured with: /cteam/gcc_src/tpf-17r1-7/src-cross/configure --prefix=/cteam/tpf-17r1-7 --exec-
      prefix=/cteam/tpf-17r1-7/H-s390x-linux-gnu --host=s390x-linux-gnu --target=s390x-ibm-tpf --build=s390x-
      linux-gnu --disable-bootstrap --enable-languages=c,c++ --program-prefix=tpf- --without-newlib --with-sysroot
      Thread model: tpf
      gcc version 7.3.0 20230127 (tpf-17r1-7) (GCC)
  5. Set up access to the IBM2047 code page. For more information, see Set up access to the IBM2047 code page.
  6. If APAR PJ45408 was installed before the GCC 7 compiler was installed, follow the migration considerations for the APAR.