Simple configure wrapper for OS/2.
(cherry picked from commit aa77bf5062c7dba3c0dbff1a0d08d6c3245cbd18)
Modified libtool.gcc to replace broken one created by libstdc++-v3 on OS/2
(cherry picked from commit 8436aa969796cf775706f41a5773c12888ad9c5b)
Add missing gthr-os2.h.
(cherry picked from commit 80660a84f2157d704c453f9467a39abd7396d45e)
Apply OS/2-EMX specific files and patches.

Note: This is a cumulative patch containing the work of several people
which is impossible to separate now.

This patch contains a number of '#ifdef 0'-like hacks that need to be
reviewed and fixed properly as they are unlikely to be accepted upstream
in the current form. Also, some patches may be not relevant any more.
(cherry picked from commit 25ebd257ce836444e0914e35a7baf3fdff67e3b9)

Conflicts:

        Makefile.in
        gcc/Makefile.in
        gcc/config.build
        gcc/config.gcc
        gcc/config.host
        gcc/config/i386/i386-protos.h
        gcc/config/i386/i386.c
        gcc/config/i386/i386.h
        gcc/config/i386/i386.md
        gcc/cp/class.c
        gcc/cp/decl.c
        gcc/cp/error.c
        gcc/cp/g++spec.c
        gcc/cp/mangle.c
        gcc/cppdefault.c
        gcc/fix-header.c
        gcc/gcc.c
        gcc/gengtype.c
        gcc/gthr.h
        gcc/langhooks.c
        gcc/libgcc2.c
        gcc/target-def.h
        include/filenames.h
        libgcc/config.host
        libiberty/configure
        libiberty/configure.ac
        libstdc++-v3/include/bits/stringfwd.h
        libstdc++-v3/libsupc++/typeinfo
Replace kRx.exe with cmd.exe.
(cherry picked from commit c0820b67e23c148261bdac02ed275fe4f7dfa2b2)
Remove version number from system import library for gccXXX.dll.

The library is now named libgcc_so_d which corresponds to the
original (old) behavior. The comments said that it was done to solve
bootstrapping problems but since we configure with --disable-bootstrap
now, it's irrelevant. More over, I'm not really sure that using libgcc
funcitons from GCC 3 (that live in libcXXX.dll) in GCC 4 while
bootstrapping was correct anyway.
(cherry picked from commit 2117da05122aad7ac0b64eb454411a10faa22644)
Clean up code dealing with syscall/fastcall/stcall based on Windows code.

Recent upstream changes in winnt.c were taken and adopted for EMX, all old
patches were removed. Note that this breaks automatic suppressing of C++
name mangling for syscall (_System) functions which is to be restored
in further patches.
(cherry picked from commit 0c7d9c085bba4a6d8cd4897d1c6274dc8eca3e98)

Conflicts:

        gcc/cp/mangle.c
        gcc/langhooks.c
Clean up code dealing with syscall/fastcall/stcall based on Windows code.

Recent upstream changes in winnt.c were taken and adopted for EMX, all old
patches were removed. Note that this breaks automatic suppressing of C++
name mangling for syscall (_System) functions which is to be restored
in further patches.
(cherry picked from commit 0c7d9c085bba4a6d8cd4897d1c6274dc8eca3e98)

Conflicts:

	gcc/cp/mangle.c
	gcc/langhooks.c
Pass attributes from function pointer types to target function types only
if they are not function return types.

This fixes definitions like:

  typedef void proc(void);
  proc * __stdcall foo(void);

where the __stdcall attribute would otherwise go to the "proc"
function type rather than "foo" (where it semantically belongs).
(cherry picked from commit b2e253aefce316f974d22fa5000d60da557ed017)
Make system and optlink attributes incompatible with otner cconv ones.
(cherry picked from commit 24b0ee149ec702aef0018976938fcc90c12622b3)

Conflicts:

	gcc/config/i386/i386.c
In EMX, imply `extern "C"' for certain calling conventions.

This disables C++ mangling for functions using these calling conventions
declared in C++ code. This matches the behavior of IBM VAC and needed to
simplify porting/building sources targeted at this compiler.
(cherry picked from commit 2e73649db617b1778b3a96bd5db2911ab807d4dc)

Conflicts:

	gcc/config/i386/i386.c
Disable underscore for `optlink' cconv.

This is the IBM VAC behavior, as well as for `system'. This fixes
the regression of 0c7d9c085b.
(cherry picked from commit 48e94fccfc4953135a8eb32be83c2506706e383b)
Fix broken _Optlink calling convention.
(cherry picked from commit 89e310f78e4ffbf03326bf8f17204b1a94cccd6f)
Fix vararg call generation broken in 89e310f78 and fix _Optlink support.

Any funciton with vararg would be treaten as _Optlink (typo bug) but
_Optlink itself was broken so that it would try to pass all arguments
in registers including varargs which is not correct.
(cherry picked from commit 22a7d6473b975049ebcb67f237ffad94f016ae78)

Conflicts:

	gcc/config/i386/i386.c
libiberty: Use spawn instead of fork + exec on OS/2.
(cherry picked from commit 330b45f3b9783fb9ea587b9ae3aa2d3ea7edd320)

Conflicts:

	libiberty/configure
OS/2: Don't use ordinals in gccXXX.dll for better backward compatiblity.
(cherry picked from commit b7d6c604ea3515ed1589ed6664493a57477aed50)
OS/2: Fix passing more than 2 arguments to _Optlink functions.
(cherry picked from commit d5fe6e43b6fa83e42d9eb19182e3c445abd616f5)

Conflicts:

	gcc/config/i386/i386.c
Fix "Internal compiler error..." when spawned cc1/cc1plus returns error.

This is a regression of 330b45f3b9.
(cherry picked from commit b857cb74bf9f204bb145434dd5399bf73535de39)
OS/2: Remove unnecessary DLL init routine from libgcc.

This routine is the same as the default one added by libc so
it doesn't make sense.

Also, the libgcc DLL flags have been corrected (no need to have
solo data in there and no need for the temrination hook to be
global).
(cherry picked from commit 6911250e305a24338ac4782c2893d5968907301f)
OS/2: Pass args to spawned tools in response files if larger than 32K.

This is due to the limitation of DosExecPgm (32K) on the command line
length.

In particular, this change fixes building of OOo.
(cherry picked from commit ff64e7fb19aae4e917c725030f2a2458c9b36fcf)