[trunk] Initial check-in of gcc trunk at r202723

This is purely for research purposes
[trunk] Disable warning: the mangling of <va_list> has changed in GCC 4.4

Please see commit message of the same fix in previous GCC
GCC 4.7 3800bda255b20023e993ed786674f70c909d60b5
GCC 4.6 a9fcd9b1ecb8954f67738a94b8553ab234d6def5
GCC 4.4.3 329ca6fa5d9972ad6dad8387036b4dbe9cfa1f27
[trunk] Workaround for Android __cxa_finalize bug

Used to be local NDK patch at $NDK/build/tools/toolchain-patches/
gcc/0003-Work-around-for-Android-__cxa_finalize-bug.patch

See c3e4e5654d02106a19f315b736d56acb581246f9
[trunk] Enable assembler linker default for security

Used to be local NDK patch at $NDK/build/tools/toolchain-patches/
gcc/0009-Enable-assembler-linker-default-for-security.patch

See 7e66b0108987a56a58c6150672fe7cf8cf88e69a
[trunk] Enable x86/arm gcc defaults; Remove march/mtune/mfpmath hardcoded values

See c779c1ff50bde450eb49b3998353804602c4d963
Used to be local NDK patch at $NDK/build/tools/toolchain-patches/
gcc/0004-Enable-x86-gcc-defaults.patch
Also see 5578813961a205a7c5d3e9da8a1b5ec00d4dac3c
They should be passed in configure to work correctly.
See https://android-review.googlesource.com/50815
[trunk] Port MIPS Android support to GCC-trunk

Used to be local NDK patch at $NDK/build/tools/toolchain-patches/
gcc/0008-Port-MIPS-Android-support-to-GCC-4.6.patch

See ec1a2a51fa75883e4bdf9f4f03e8fd16a261c275
[trunk] Simplify GCC trunk BASE-VER

Change 4.9.0 -> 4.9
NOTE: 4.9 is *not* final, this is for research purposes only

In NDK gnu-libstdc++ is built seperately and copied over to
standalone.  This change simplifies script doing that and make
it less sensitive to future minor version upgrade

See 4b8d41c82a2da3c7b7d9a19e254eba11e05f53fa
[trunk] Handle NULL return value of setlocale() in libstdc++

Bionic setlocale() always returns NULL.  $NDK/tests/device/test-gnustl-2
(as well as others using iostream, etc) segfault w/o this change

See d3029b5a1a770d75806370618f7311a991107119,
20ffc596a2771a96ac9b4a4838edc7779a48f0af and
https://code.google.com/p/android/issues/detail?id=46718
[trunk] Enable armv7/thumb2 multilib for arm-eabi.

Configured multilib:

> arm-eabi-gcc -print-multi-lib
.;
thumb;@mthumb
thumb/thumb2;@mthumb@march=armv7

See 978fb74a5c086cc5572dc2e3f37d207acad969d7
[trunk] Enable MIPS floating-point madd/msub/nmadd/nmsub/recip/rsqrt with 32-bit FPU.

See 7609f724df8ca390935f63243fa72e1de39d00c6
[trunk] Fix ARM GCC fail to links code using 64-bit atomic built-in

For ARM w/o dmb a helper function is called for 64-bit atomic
built-in, which call __write when helper version is too old.
Change to call write instead for Android.

See http://code.google.com/p/android/issues/detail?id=41297
e42abc641966570528522d61ba625e926e979ac7
[trunk] Patch GCC libstdc++ to work with Clang in C++11

See http://clang.llvm.org/cxx_status.html
http://code.google.com/p/android/issues/detail?id=39600
https://android-review.googlesource.com/#/c/47836/
1e4edc8addf7fc21d821e64cc81d85315561bcd9
[trunk] Enable _GLIBCXX_HAS_GTHREADS in GCC trunk

Fix a test in libstdc++/confiugre to include $glibcxx_thread_h instead
of gthr.h otherwise it will fail to detect gthread lib because the
new gthr.h only include gthr-default.h which doesn't exist in source
directory

See issue http://code.google.com/p/android/issues/detail?id=41770
946c2a6b57ac7d3b2b656ac628bcb14a216ec635
[trunk] Disable libstdc versioning

Used to be first half of NDK local patch at $NDK/build/tools/
toolchain-patches/gcc/0006-Disable-libstdc-versioning.patch

See 4a0927423d51f594b870e58b3eb51574327f8b0e
[trunk] Use memalign instead of posix_memalign in GCC x86 mm_malloc.h

posix_memalign doesn't exist in NDK.  Code inludes ?mmintrin.h
which in turn includes mm_malloc.h may fail to link

For AOSP platform build which uses the same compiler, add
-DHAVE_POSIX_MEMALIGN to restore the original behavior.

Other than non-zero return value which _mm_alloc already ignores, both
paths are functioanlly identical (under the hood dlmalloc.c in 32-bit
ensure alignment is at least 16-byte)
[trunk] Add mclinker support: -fuse-ld=mcld

See http://code.google.com/p/mclinker/
    6502f082fed932c0609b475d5d6917103700e5a8
[trunk] Fix MIPS GCC to emit -m elf32ltsmip for linker

ARM/X86 GCC in NDK explicitly emit -m armelf_linux_eabi and -m elf_i386,
respectively, for linker.  Fix MIPS to do the same, to help mclinker
which is built vanilla and relies on either filename (eg.
eg. arm-linux-androideabi-ld.mcd implies arm) or -mtriple/-march/-m
to figure out the target

See 125708b8e3afa6007ce3aa7132165d27b719ccc3
[trunk] Fixed ICE gen_thumb_movhi_clobber at config/arm/arm.md:5832

See issue https://code.google.com/p/android/issues/detail?id=52732,
and fix http://gcc.gnu.org/ml/gcc-patches/2010-12/msg00732.html

Also see 78a68e851a2f6f9d00367cd38eeedf670bb80f01
[trunk] Use default visibility for the __cxa functions in eh_arm.cc.
[trunk] Use READELF_FOR_TARGET

See
b159d4300781ae367096e05076df56b1467d0d9b
4ecf441b08bb3f039e3836b7517f079be70583ad
651152db0b741de25918b21c42d604b8b6564eaa
3c138513fb44386c87bd5276725d5459f9243833