Cross-os2emx

July 23, 2026 ยท View on GitHub

This is a cross compilation toolchain for i686-pc-os2-emx target.

This consists of binutils, gcc, LIBCn, meson, CMake, libtool, and some build tools.

Tested hosts:

  • x86_64-unknown-linux-gnu
  • x86_64-apple-darwin
  • aarch64-apple-darwin

History

  • cross-os2emx v1.4.0 (2026/07/23)

    • Added installzip to install non-RPM ZIPs
    • Added installrpm to install RPMs
    • Added PKG_CONFIG_LIBDIR and ACLOCAL_PATH to setemxenv
    • Added pkg-config wrapper script
    • Added the patch work for os2tk45/os2medef.h
    • Added pkg-config, exe_wrapper to meson cross files
    • Added omflibs to convert multiple .a to .lib
    • Linux: Removed lxlite file from repo for OSes with case-insensitive file systems such as macOS. Issue #59. Reported by @dmik
    • Improved installrpmzip
      • Added support of partial package name and multiple packages
      • Added support of URLs and local files
      • Added -e option to support experimental repo
    • Fixed path separator of gcc
    • Fixed sys_root of meson cross files
    • Fixed misc.
  • cross-os2emx v1.3.1 (2026/06/20)

    • Fixed c_args and cpp_args of meson is in [properties] section not in [built-in options] section.
  • cross-os2emx v1.3.0 (2026/06/19)

    • Added -Zsym support to emxbind and ld
    • Added include path for os2tk45 to the cross files of meson and CMake
    • Added setemxenv script to help to set env vars for cross-os2emx
      • Use source setemxenv or use alias for this
    • Added meson v1.11.1
    • macOS: Added lxlite stub
    • macOS: Updated kdllar
    • Fixed emxbind -s command and strip command for aout binaries
    • Linux: Fixed kmapsym does not recognize Address Export Alias block
  • cross-os2emx v1.2.0 (2026/05/26)

    • Added macOS support by @josch1710
    • Added lxLite v1.3.9 and kmapsym for Linux
    • Added __declspec(dllexport) support to the aout linker, ld and emxbind
    • Updated kdllar to v1.4.0
    • Updated the executables in extras to statically linked versions
    • Fixed -Zomf -Zsyms does not generate .sym file. Issue #8
    • Fixed Unix Makefiles generator of CMake fails compile tests. Issue #12
    • Fixed kdllar fails on macOS due to __.SYMDEF. Issue #28
    • Fixed emxbind does not recognize a.out files with old-EMX startup code. Issue #30
    • Fixed misc.
  • cross-os2emx v1.1.1 (2026/04/02)

    • Added _envargs() support
      • Now EMXOMFOPT for emxomf, EMXOMFSTRIPOPT for emxomfstrip, GASOPT for as, and GCCOPT for gcc are supported.
    • Updated kdllar to support response files
    • Fixed misc.
  • cross-os2emx v1.1.0 (2026/03/29)

    • Updated binutils to v2.44
    • Updated gcc to v15.2.0
    • Added libtool v2.5.4
    • Added response file support to emx tools
    • Fixed emxaout fails on OMF object files generated by cross-os2emx. Issue #7
    • Fixed build problems due to autotools.
      • Now autoconf v2.69, automake v1.18.1, and libtool v2.5.4 are built and used internally
    • Fixed the sources including fenv.h in C++ could not be linked
    • Fixed misc.
  • cross-os2emx v1.0.0 (2026/03/15)

    • Renamed to cross-os2emx
    • Added 64-bit version of wl and wrc
    • Added kdllar v1.3.0, nasm v3.01, ninja v1.13.1, and cmake v3.31.7
    • Added shared libgcc and libstdc++-v3
    • Added libssp
    • Added cross build definition files for Meson (i686-pc-os2-emx-aout.txt for aout, and i686-pc-os2-emx-omf.txt for omf in /path/to/opt/os2emx/share/meson/cross)
    • Added a basic cross file for CMake (i686-pc-os2-emx.cmake in /path/to/opt/os2emx/share/cmake/cross)
    • Added installrpmzip to install additional libs from netlabs rpm server
    • Fixed bashism. Issue #4. Reported by Dave Yeo
    • Fixed ICE due to __declspec(dllexport). Issue #9
    • Fixed misc.
  • os2emx-cross-toolchain-b1 (2026/02/23)

    • Released at github
  • os2emx-cross-toolchain-test2 (2026/02/19)

    • Added emxomf, emxomfar, emxomfld, emxomfstrip, listomf and stripomf
      • emxomfld supports only WLINK
    • Added -Zomf option with watcom tools such as wlink and wrc
    • Fixed symbolic link problems
  • os2emx-cross-toolchain-test1 (2026/02/15)

    • Added binutils v2.33.1
    • Added emxexp, emximp, emxbind and OS/2 ld
    • Added gcc v9.2.0
      • Always link to libgcc.a

How to use

Here are the examples.

  1. Set env vars for cross-os2emx

You should set env vars such as PATH for cross-os2emx like:

. setemxenv
  1. autotools
./configure --host=i686-pc-os2-emx
  1. meson

For aout:

meson setup build_dir -Dos2_emxomf=false --cross-file=$HOME/opt/os2emx/share/meson/cross/i686-pc-os2-emx-aout.txt

You can omit -Dos2_emxomf=false for aout.

For omf:

meson setup build_dir -Dos2_emxomf=true --cross-file=$HOME/opt/os2emx/share/meson/cross/i686-pc-os2-emx-omf.txt
  1. CMake
cmake -S . -B build_dir -DCMAKE_TOOLCHAIN_FILE=$HOME/opt/os2emx/share/cmake/cross/i686-pc-os2-emx.cmake
  1. Others
export CC=i686-pc-os2-emx-gcc
export CXX=i686-pc-os2-emx-g++
export AR=i686-pc-os2-emx-ar
export STRIP=i686-pc-os2-emx-strip
and so on

If you use -Zomf to compile sources not to link, then you should set AR to i686-pc-os2-emx-emxomfar like:

export AR=i686-pc-os2-emx-emxomfar

NOTE: You should modify the path to/in the above files to the proper ones according to your system env.

How to install additional libs with installrpmzip

  1. Find the necessary libs at https://rpm.netlabs.org/release/00/zip

  2. Copy the package name or the URL

  3. Execute installrpmzip with the package name. For example, if you want to install pthread:

    /path/to/opt/os2emx/bin/installrpmzip pthread-0_2_6-1_oc00.zip
  1. Local files are supported.

  2. Leading partial name or wildcards such as '*', '?' are supported:

    /path/to/opt/os2emx/bin/installrpmzip pthread-0_2_6
    /path/to/opt/os2emx/bin/installrpmzip pthread-*

If the matched packages are many, only the latest version is installed out of the matched packages with the same package name excluding version info.

How to install additional libs with installrpm

  1. Find the necessary libs at https://rpm.netlabs.org/release/00/pentium4/pentium4/

  2. Copy the package name or the URL

  3. Execute installrpm with the package name. For example, if you want to install pthread:

    /path/to/opt/os2emx/bin/installrpm pthread-devel-0.2.6-1.oc00.pentium4.rpm
  1. Local files are supported

  2. Leading partial name or wildcards such as '*', '?' are supported:

    /path/to/opt/os2emx/bin/installrpm pthread-devel-0.2.6
    /path/to/opt/os2emx/bin/installrpm pthread-devel-0*

If the matched packages are many, only the latest version is installed out of the matched packages with the same package name excluding version info.

How to install additional libs with installzip

  1. Execute installzip with the URL:
  /path/to/opt/os2emx/bin/installzip URL-for-zip
  1. Local files are supported

  2. The zip file should have /lib, /include directory.

How to build

  1. Clone the sources from github: git clone https://github.com/komh/cross-os2emx.git

  2. Bootstrap: ./bootstrap

  3. Build: make

  4. Install: make install

    This will install the built files into $HOME/opt/os2emx.

  • NOTE 1: Some tools and libs such as gettext, autopoint, textinfo, flex, bison, and so on are required by binutils and gcc.
  • NOTE 2: libssl and libcrypto of openssl are required by CMake.
  • NOTE 3: wget, tar, and unzip are required to download and to extract autotools and LIBCn binaries.
  • NOTE 4: Unless you set PREFIXROOT, PREFIXROOT is set to $HOME by default. If you want to set PREFIXROOT to other directory than $HOME. then you should set PREFIXROOT to the same value WHENEVER calling make. For example,
    make PREFIXROOT=/
    make install PREFIXROOT=/

This will install into $PREFIXROOT/opt/os2emx.

Known problems

Donation

If you are satisfied with this program and want to donate to me, please visit the following URL.

https://www.os2.kr/komh/os2factory/

Or, please click the Ads in the following blog.

https://lvzuufx.blogspot.com/

Contact

Please use the issue tracker of github:

https://github.com/komh/cross-os2emx/issues

KO Myung-Hun