GCC 3 on OS/2
(fix 1)

Installing binary files:

You need EMX distribution
Unpack the whole directory somewhere
Set PATH to bin subdirectory or copy the files gcc.exe, cpp.exe and gcov.exe
  somewhere to your path.
You can rename gcc.exe to gcc3.exe, if you want to have both GCC 3 and GCC
  2.7.2.1 from EMX distribution available.
If you copy gcc.exe somewhere else, you must set variable GCC_EXEC_PREFIX to
  gcc-lib subdirectory of the compiler tree. (the path MUST end with a slash.
  For example GCC_EXEC_PREFIX=g:/gcc-3/lib/gcc-lib/)

Compatibility notes:

Almost all -Zxxx options from EMX GCC 2.7.2.1 are supported.
-mepilogue is not supported. -mprobe is supported.
Function attributes "emxcall" and "system" are not supported.

Using GCC on DOS EMX:

You can use GCC 3 on DOS EMX.
You need newer RSX. Version (32bit rel 5) from some EMX distribution crashes on
  fault 12. RSX (32-bit rel 5.10) from EmTeX distribution works fine.
You can't have both old 2.7.2.1 and new 3.0.4 GCC versions installed on DOS. You
  must copy GCC 3 over existing EMX compiler.
Copy files gcc.exe, cpp.exe, gcov.exe, cc1.exe, cpp0.exe, tradcpp0.exe to
  emx/bin directory over existing files. Copy files st/gcc.a, st/gcc_p.a,
  mt/gcc.a to emx/lib/st and emx/lib/mt subdirectories. Delete emx/lib/gcc.a and
  emx/lib/gcc_p.a. Now the compiler can be used in DOS.

Known bugs:

When the source contains #include of nonexisting file, you get message
  file: Error 0
It is a bug in gcc, complain to gcc authors.

-funroll-loops can produce wrong code. Fixed in later gcc releases.

(unsigned)((int)x/2)/2 produces wrong code. Bug in gcc.

Compiling GCC from sources:

You need EMX distribution, GNU bash and various GNU tools.
You can compile GCC with gcc-2.7.2.1 from EMX or with itself.

First, you must set some variables to point at available tools. For example:

HOSTTYPE=i586
MACHTYPE=i586-pc-os2
CONFIG_SHELL=d:/prg/gnu/bin/bash.exe
CC=d:/prg/emx/bin/gcc.exe
MAKE=d:/prg/emx/bin/make.exe

In case you compile with itself, for better performance, you can set
CFLAGS=-O3 -mcpu=pentiumpro -fomit-frame-pointer -mpreferred-stack-boundary=2
-fforce-addr -funroll-loops

Gcc 2.7.2.1 from EMX does not understand all those optimization flags, so when
  you use it, set
CFLAGS=-O2 -m486 -malign-jumps=2 -malign-loops=2 -malign-functions=2
-fomit-frame-pointer -fforce-addr -funroll-loops -fexpensive-optimizations

configure script tries to run ranlib sometimes, but there's no ranlib.exe in EMX
  distribution. You must create ranlib.exe with copy true.exe ranlib.exe

From bash, run ./configure --prefix=g:/gcc-3/ --disable-nls
The path after prefix is a directory where new files will be installed. But you
  can move them elsewhere, providing that you run GCC from a bin/ subdirectory
  OR set GCC_EXEC_PREFIX to gcc-lib/ subdirectory.

Don't forget to kill EMXLOAD.EXE, if you are recompiling already compiled
  sources. EMXLOAD keeps compiler EXE files loaded in memory and the system
  locks them and doesn't allow to overwrite them during compilation.

Type make to build the distribution.

Type make install to copy files to directory specified in prefix parameter.

If you want to use -liberty, rename libiberty.a to iberty.a and move it to EMX
  library directory.

Changes:

fix 1:	Provided empty __eh_frame_init and __eh_frame_term for compatibility
	with EMX 0.9d


vim: textwidth=80

