Add triple to detect Android toolchain.

Add i686-linux-android to detect the Android X86 toolchain.
Enhance test cases for Android toolchain detection.

Conflicts:
	test/Driver/linux-ld.c
Fix clang to add libstdc++ linker path

Conflicts:

	lib/Driver/ToolChains.cpp

Change-Id: Id60556895727fa391e0bbbac314ef5f265a7d23a
Use D16 for ARM VFP2

Adapted to 3.4
Silence "treating c input as c++" warning.

Change-Id: I222ba9810dfa6fd93beb5068a33f8757dae6b514
Add -fuse-ld option.
Define _Unwind_GetIP() for ARM.

Conflicts:
	lib/Headers/unwind.h
Add mstack-protector-guard option for x86.

Because the old x86 bionic did not put the
stack protector cookie at %gs:20, the program
with stack protector is likely to crash.

As the result, we should give an option to the
programmer to decide whether they opt for backward
compatibility or performance.

Conflicts:
	lib/Driver/Tools.cpp
Enable ARM EHABI exception handling table for Android.

Conflicts:
	lib/Driver/Tools.cpp
Fix LLVMgold path for Windows and Darwin.
Use memalign for Android.

Android Bionic does not have posix_memalign(), thus
we have to use memalign() instead.  Otherwise, the
code which includes <mmintrin.h> or <mm_malloc.h> can't
be linked.
Remove redundant -lgcc for linker.

Conflicts:
	lib/Driver/Tools.cpp
Add a flag to disable C++ missing return semantics.

Conflicts:
	include/clang/Driver/Options.td
Add -fno-global-ctor-const-promotion option.

The global variable optimization pass of LLVM will try to
evalutate the global variables with static constructors, and
promote the global constants.  Although this optimization is
correct, it may cause some incompatability between gcc in
some incorrect code, which uses const_cast to cast the
constant to mutable.  If you are compiling the legacy code,
then you can try to add -fno-global-ctor-const-promotion
to your CXXFLAGS.

Change-Id: I96657c3ae0f06ef6302f295237bb5781691fbfaa

Conflicts:
	include/clang/Driver/Options.td
Add le32-none-ndk triple and toolchain.

[WORK IN PROGRESS]  Non-trivial API changes:

* isRecordWithNonTrivialDestructorOrCopyConstructor() ->
  getRecordArgABI()

* CXXABI -> TheCXXABI.set(TargetCXXABI::GenericARM)

* New override isPIEDefault()

Conflicts:
	lib/Basic/Targets.cpp
	lib/Driver/Tools.cpp
Use intrinsic for unwind header size on le32 ndk target.

Change-Id: I9ef08e305d40927c079e4296d004f0976a0a0d3f
Signed-off-by: WenHan Gu <Wenhan.gu@mediatek.com>
Pass --sysroot to le32-none-ndk-link.

Change-Id: I5469f3806af7d508d776299d8cf14bfd3e513321
Define __le32__ for target le32-none-ndk

Also define whatever LinuxTargetInfo define, because target
le32-none-ndk implies Android which is based on Linux.
Enable PIC for Android even if "-static" is specified.

[WORK IN PROGRESS] XXX Missing test cases.

Android only supports a limited subset of the relocation
types on ARM and MIPS architecture.  Without this fix,
the Android build system can't link the executable properly.
Use i686 as Android target CPU instead of core2 for gcc compatibility.