Skip to content
Jun 2, 2019
30 May 2019 "stable" build-ia16 commit (tkchia)

This is a DJGPP/MS-DOS-hosted (32-bit x86) port of the GNU C and C++ compiler toolchain to the IA-16 target (16-bit Intel x86), by Rask Ingemann Lambertsen, Andrew Jenner, myself, and various contributors. The toolchain itself is 32-bit, but it will output 16-bit code.

Binary + source diff packages, and documentation packages, for FreeDOS:

  • i16butil.zip, i16gcc.zip, i16newli.zip: Binutils, GCC, and Newlib C library and math library for 16-bit MS-DOS target.
  • i16budoc.zip, i16gcdoc.zip: documentation for Binutils and GCC (including IA-16-specific GCC options).
  • i16nlelk.zip, i16elklc.zip: optional packages, for cross-compiling programs for ELKS OS (see below).
  • I am also separately distributing packages for my libi86 library of non-standard routines.

Changes since 10 Apr 2019:

  • The malloc memory allocator in the Newlib C library now uses less heap memory. Thanks to @bartoldeman for contributing the patches (#10, #11).
  • Some experimental features have been added:
    • A new -mdpmiable option will produce MS-DOS programs which try to run themselves in protected mode using the DOS Protected Mode Interface (DPMI), if they detect a DPMI host (the programs will continue to run in real/V86 mode if this is not possible).
    • You can now more easily cross-compile programs for the Embeddable Linux Kernel Subset (ELKS) operating system. The programs can either be linked with the Newlib C library (with the -melks option), or with ELKS's own libc (-melks-libc).
  • Various internal improvements.

Notes:

  • These FreeDOS packages do not contain support for C++ or link-time optimization (LTO).
  • The toolchain sources --- patches for Binutils and GCC, and full sources for Newlib --- are included in the i16*.zip files. The "Source code" links (produced by GitHub) point only to the build scripts.
  • To view the packages' contents, you can use the 7-Zip program (other unzip-programs may not handle the LZMA compression these packages use). Versions of 7-Zip are available for MS-DOS (via ibiblio), Ubuntu Linux (as 7za under p7zip-full), and other systems.
  • If you get the error message i16gcc.exe: fatal error: environment variable DJGPP not defined when running i16gcc.exe, please install the DJGPP base environment first, and then set the DJGPP DOS variable to point to its djgpp.env, e.g. set DJGPP=c:\devel\djgpp\djgpp.env. (See DJGPP's readme.1st for more information.)
  • If you run i16gcc -mcmodel=small ..., you may get an error message like
    i16gcc.exe: error: small: No such file or directory (ENOENT)
    i16gcc.exe: error: unrecognized command line option '-mcmodel'
    
    (as if you wrote -mcmodel small instead). For now, you can work around the issue by quoting arguments with = signs in them, e.g. i16gcc "-mcmodel=small" ... . Using fdnpkg 0.99.6 and above should fix this issue.
Assets 9

This is a DJGPP/MS-DOS-hosted (32-bit x86) port of the GNU C and C++ compiler toolchain to the IA-16 target (16-bit Intel x86), by Rask Ingemann Lambertsen, Andrew Jenner, myself, and various contributors. The toolchain itself is 32-bit, but it will output 16-bit code.

Binary + source diff packages, and documentation packages, for FreeDOS:

  • i16butil.zip, i16gcc.zip, i16newli.zip: Binutils, GCC, and Newlib C library and math library
  • i16budoc.zip, i16gcdoc.zip: documentation for Binutils and GCC (including IA-16-specific GCC options).
  • I am also separately distributing packages for my libi86 library of non-standard routines.

Changes since 10 Mar 2019:

  • Various improvements to aid in the quest to reduce output code size:
    • Added an experimental -mnewlib-nano-stdio option to link against a limited version of the formatted I/O (stdio) routines which only supports C89 features.
    • Added an experimental -mnewlib-autofloat-stdio option, which tries to auto-detect whether floating-point stdio support is needed, and alters the link process accordingly. To use this switch, specify it at both compile time and link time. This option is based on a suggestion by Tom Ehlert.
    • Fixed a bug which caused GCC to emit branch-less code when optimizing for size (-Os), even if using conditional jumps would yield shorter code. Thanks to @mfld-fr for reporting the bug.
    • Tweaked the libgcc and Newlib libraries, and their build processes, to reduce their space usage.
  • Within a C module, far functions which are placed outside the default text segment --- using __attribute__ ((far_section)) --- may now call non-far functions in the default text segment. However, such calls are currently not very efficient.

Notes:

  • These FreeDOS packages do not contain support for C++ or link-time optimization (LTO).
  • The toolchain sources --- patches for Binutils and GCC, and full sources for Newlib --- are included in the i16*.zip files. The "Source code" links (produced by GitHub) point only to the build scripts.
  • To view the packages' contents, you can use the 7-Zip program (other unzip-programs may not handle the LZMA compression these packages use). Versions of 7-Zip are available for MS-DOS (via ibiblio), Ubuntu Linux (as 7za under p7zip-full), and other systems.
  • If you get the error message i16gcc.exe: fatal error: environment variable DJGPP not defined when running i16gcc.exe, please install the DJGPP base environment first, and then set the DJGPP DOS variable to point to its djgpp.env, e.g. set DJGPP=c:\devel\djgpp\djgpp.env. (See DJGPP's readme.1st for more information.)
  • If you run i16gcc -mcmodel=small ..., you may get an error message like
    i16gcc.exe: error: small: No such file or directory (ENOENT)
    i16gcc.exe: error: unrecognized command line option '-mcmodel'
    
    (as if you wrote -mcmodel small instead). For now, you can work around the issue by quoting arguments with = signs in them, e.g. i16gcc "-mcmodel=small" ... . Using fdnpkg 0.99.6 and above should fix this issue.
Assets 7

This is a DJGPP/MS-DOS-hosted (32-bit x86) port of the GNU C and C++ compiler toolchain to the IA-16 target (16-bit Intel x86), by Rask Ingemann Lambertsen, Andrew Jenner, myself, and various contributors. The toolchain itself is 32-bit, but it will output 16-bit code.

Binary + source diff packages, and documentation packages, for FreeDOS:

  • i16butil.zip, i16gcc.zip, i16newli.zip: Binutils, GCC, and Newlib C library and math library
  • i16budoc.zip, i16gcdoc.zip: documentation for Binutils and GCC (including IA-16-specific GCC options).
  • I am also separately distributing packages for my libi86 library of non-standard routines.

Changes since 20190224:

  • Fixed a bug which caused GCC to produce incorrect code for certain 3-way comparisons of int values to 0. Thanks to @mfld-fr for reporting the bug.
  • Some minor changes to the C runtime library (Newlib).

Notes:

  • These FreeDOS packages do not contain support for C++ or link-time optimization (LTO).
  • The toolchain sources --- patches for Binutils and GCC, and full sources for Newlib --- are included in the i16*.zip files. The "Source code" links (produced by GitHub) point only to the build scripts.
  • To view the packages' contents, you can use the 7-Zip program (available on e.g. Ubuntu Linux as 7za under p7zip-full). The packages have been packed using LZMA compression, which other unzip-programs may not handle.
  • If you get the error message i16gcc.exe: fatal error: environment variable DJGPP not defined when running i16gcc.exe, please install the DJGPP base environment first, and then set the DJGPP DOS variable to point to its djgpp.env, e.g. set DJGPP=c:\devel\djgpp\djgpp.env. (See DJGPP's readme.1st for more information.)
  • If you run i16gcc -mcmodel=small ..., you may get an error message like
    i16gcc.exe: error: small: No such file or directory (ENOENT)
    i16gcc.exe: error: unrecognized command line option '-mcmodel'
    
    (as if you wrote -mcmodel small instead). For now, you can work around the issue by quoting arguments with = signs in them, e.g. i16gcc "-mcmodel=small" ... . Using fdnpkg 0.99.6 and above should fix this issue.
Assets 7

This is a DJGPP/MS-DOS-hosted (32-bit x86) port of the GNU C and C++ compiler toolchain to the IA-16 target (16-bit Intel x86), by Rask Ingemann Lambertsen, Andrew Jenner, myself, and various contributors. The toolchain itself is 32-bit, but it will output 16-bit code.

Binary + source diff packages, and documentation packages, for FreeDOS:

  • i16butil.zip, i16gcc.zip, i16newli.zip: Binutils, GCC, and Newlib C library and math library
  • i16budoc.zip, i16gcdoc.zip: documentation for Binutils and GCC (including IA-16-specific GCC options).
  • I am also separately distributing packages for my libi86 library of non-standard routines.
  • Update 2019-03-10: there is a new release which fixes a code generation bug in the compiler.
  • Update 2019-02-28: the file paths in the Newlib package's linker scripts were wrong. They should be fixed now. Thanks to Rugxulo for reporting the problem.

Changes since 20190101:

  • The C runtime library (Newlib) now defines a _heaplen variable (of type size_t), similar to Borland's Turbo C. You can use it to control the maximum size of the malloc (.) memory heap.
  • GCC now accepts options -march=i186, -mtune=i286, etc. as synonyms of -march=i80186, -mtune=i80286, etc. (The shorter names agree with those of mainline GNU Binutils.)
  • Writing programs that do not use the standard C library or startup files is now more convenient. The -nostdlib, -nodefaultlibs, or-nostartfiles option no longer require you to provide a linker script.
  • GCC now has an (experimental) -mmsdos-handle-v1 option, which says to output .exe files that will fail gracefully, rather than crash, when run on MS-DOS v1.x.
  • Sundry minor fixes and optimizations.

Notes:

  • These FreeDOS packages do not contain support for C++ or link-time optimization (LTO).
  • The toolchain sources --- patches for Binutils and GCC, and full sources for Newlib --- are included in the i16*.zip files. The "Source code" links (produced by GitHub) point only to the build scripts.
  • To view the packages' contents, you can use the 7-Zip program (available on e.g. Ubuntu Linux as 7za under p7zip-full). The packages have been packed using LZMA compression, which other unzip-programs may not handle.
  • If you get the error message i16gcc.exe: fatal error: environment variable DJGPP not defined when running i16gcc.exe, please install the DJGPP base environment first, and then set the DJGPP DOS variable to point to its djgpp.env, e.g. set DJGPP=c:\devel\djgpp\djgpp.env. (See DJGPP's readme.1st for more information.)
  • If you run i16gcc -mcmodel=small ..., you may get an error message like
    i16gcc.exe: error: small: No such file or directory (ENOENT)
    i16gcc.exe: error: unrecognized command line option '-mcmodel'
    
    (as if you wrote -mcmodel small instead). For now, you can work around the issue by quoting arguments with = signs in them, e.g. i16gcc "-mcmodel=small" ... . Using fdnpkg 0.99.6 and above should fix this issue.
Assets 7
Feb 11, 2019
10 Feb 2019 "stable" build-ia16 commit (tkchia)
You can’t perform that action at this time.