OS/2 SDK¶
C programs for OS/2 with clang-retro's clang, picolibc and JWlink:
| Target | Triple | Output | Runs on |
|---|---|---|---|
| 16-bit OS/2 1.x | i8086-pc-os2 |
NE program or DLL | OS/2 1.x, and 2.x to 4.x and ArcaOS |
| 32-bit OS/2 | i386-pc-os2 |
LX program or DLL | OS/2 2.0 to 4.x, eComStation, ArcaOS |
clang --target=i386-pc-os2 -Os hello.c -o hello.exe # 32-bit
clang --target=i386-pc-os2 -mwindows -Os pmhello.c -o pmhello.exe # 32-bit PM
clang --target=i386-pc-os2 -shared -Os mylib.c -o MYLIB.DLL # 32-bit DLL
clang --target=i8086-pc-os2 -Os hello.c -o hello.exe # 16-bit, small model
clang --target=i8086-pc-os2 -mcmodel=large -Os app.c -o app.exe # 16-bit, large model
clang --target=i8086-pc-os2 -shared -Os mylib.c -o MYLIB.DLL # 16-bit DLL
python3 tools/os2-imports.py MYLIB.DLL > mylib.lnk # its imports
clang --target=i8086-pc-os2 -Os app.c -Wl,@mylib.lnk -o app.exe # a program that uses it
-
What's here
The headers, import lists and examples for 16-bit OS/2 1.x and 32-bit OS/2.
-
How programs are built
ELF to LX, OMF to NE: the startup code, the heap and the C library.
-
Testing
OS/2 Warp 3 in QEMU, booted from its diskettes.
-
Get it
The sysroots ship in the clang-dos toolchain package.