MIPS GCC 4.4.3 use .cfi_* directives by default

Since we are building GCC 4.4.3 with binutils-2.21 whose
ld has support for read-only .eh_frames

Without this, "ld.mcld --eh-frame-hdr" very often

Change-Id: Ie77b5e8eba02edc4fa44de060cb37fc1d569f027
Add for READELF and READELF_FOR_TARGET for GCC 4.6

    2011-11-09  Roland McGrath  <mcgrathr@google.com>

	* configure.ac: Add tool checks for READELF and READELF_FOR_TARGET.
	* configure: Rebuild.
	* Makefile.def (flags_to_pass): Add READELF_FOR_TARGET.
	* Makefile.tpl (READELF, READELF_FOR_TARGET): New variables.
	(HOST_EXPORTS): Add READELF, READELF_FOR_TARGET.
	(BASE_FLAGS_TO_PASS): Add READELF_FOR_TARGET.
	(BASE_TARGET_EXPORTS, EXTRA_HOST_FLAGS, EXTRA_TARGET_FLAGS):
	Add READELF.
	* Makefile.in: Rebuild.

2011-11-09  Jason Merrill  <jason@redhat.com>

Change-Id: I6f8c1e7ef25a9232d7f1ed549cdb8f02a0b044b0
Use READELF_FOR_TARGET in GCC 4.6/4.7

In darwin where readelf isn't available, gcc/configure fails
to set HAVE_LD_PERSONALITY_RELAXATION for MIPS, causes
TARGET_WRITABLE_EH_FRAME=1 and flag_dwarf2_cfi_asm=0 (ie. disable
CFI directive), and fails ld.mcld

It's curious that the successful detection of the
/tmp/ndk-$USER/gcc/binutils-2.21/readelf requires binutils
to exist in the GCC's source tree, according to gcc/configure.

Other tools (objdump, nm, ld, as, etc) can be successfully
located because of OBJDUMP_FOR_TARGET, NM_FOR_TARGET, etc.
Fix to look for READELF_FOR_TARGET in gcc/configure

See
  https://android-review.googlesource.com/#/c/54760
  https://android-review.googlesource.com/#/c/54770
  https://android-review.googlesource.com/#/c/54710

Change-Id: I8b057a70d43389d3d9d02b5c54b8365ebe6487d1
Merge "Use READELF_FOR_TARGET in GCC 4.6/4.7"
[GCC 4.8] Initial check-in of GCC 4.8.0

Change-Id: I0719d8a6d0f69b367a6ab6f10eb75622dbf12771
[4.8] 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

Change-Id: I288f349d2140918babf3a872728da02c5706a971
[4.8] Fix crash on null context in cp/mangle.c::write_unscoped_name

See related CL:
  a22b5261da70bebfad7c6f4e948501e293db172d for GCC 4.7
  737fc2a978ff2364d91e634a6b990979df60058f for GCC 4.6

Change-Id: Ic5c924fa61bd839270d0218bf5f6f25d1ace8422
[4.8] 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

Change-Id: I2c24a06f96cd183e9b250d22dacd2379b9f10b04
[4.8] 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

Change-Id: Ia668c962b7251dd673cc028dac8a111b1aeeb47d
[4.8] 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

Change-Id: I0be1f1111870070f25d92d390d2738b52315865d
[4.8] Port MIPS Android support to GCC-4.8

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

Change-Id: I7526fc1f1c3304c14b8f6f6d5a0b26ddc1c7e4a0
[4.8] Simplify GCC 4.7 BASE-VER

Change 4.8.0 -> 4.8

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

Change-Id: I2656771699a188060403b4c2094134d77191566b
[4.8] 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

Change-Id: I4808ebaedc5495cbc074999b22e3ffea5ba2947c
[4.8] Add -mstack-protector-guard= to x86 compilers

To choose between "global" (default) and "tls" (new)
for -fstack-protector, -fstack-protector-all, and
-fstack-protector-strong (GCC 4.6+).

Note that this alone doesn't enable any -fstack-protector*

For NDK: The default "global" generates code backward
compatible with older bionic

For AOSP: build may add "-mstack-protector-guard=tls" to
build platform code with new bionic (*1)

Related CL:
  ad88a0863110798cef5169dcf917e18b967a7cf6 (*1)
  e804643b6dfcfb5842dea4b714601c6dd89f4944

Change-Id: I341c9022530b37ca289d94e1174dfa86a8eaa1bf
[4.8] Enable armv7/thumb2 multilib for arm-eabi.

Configured multilib:

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

See 978fb74a5c086cc5572dc2e3f37d207acad969d7

Change-Id: Ia04c9e23cb5abb924702639c6c0f3afc9c485ff0
[4.8] Backport a gimplify fix.

See
  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55245
  6014e0c5342ece48f16f5b02f1b0657d2538a036

Change-Id: I25bfcfdbf0911f18db9b554012258f4d9aa060bd
[4.8] Enable MIPS floating-point madd/msub/nmadd/nmsub/recip/rsqrt with 32-bit FPU.

See 7609f724df8ca390935f63243fa72e1de39d00c6

Change-Id: Id77b56a1cf886584020cf30a4211de0a87b4f56e
[4.8] 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

Change-Id: I15498b73eebdbd5f4d62aafa943290ca341378bb
[4.8] 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

Change-Id: Ibbc2ed2bf665bbdd9529e6d962312b10a0da320f
[4.8] Enable _GLIBCXX_HAS_GTHREADS in GCC 4.8

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

Change-Id: I13bd69f45ddee8b38055f0264c8aa484df0761d2