[ndk] 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.

Change-Id: I6b29e972ea9f4ea79454b1ffb50e933e076d8d1f
[ndk] Fix clang to add libstdc++ linker path.

Changes compared with the original patch:

getMultiarchSuffix() -> getBiarchSuffix()

Change-Id: I91ec4858683fe9c7c620e4379b7c4959fcee6d99
[ndk][arm] Use D16 for ARM VFP (VFP2.)

Change-Id: I2767707667e525fef832fb4f8c791299604c9eb2

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

Conflicts:

	lib/Driver/Tools.cpp

Change-Id: Ia9ac0d3265e212ba165f2689872f35d13f2fde7c
[ndk] Add -fuse-ld option.

Remove the fuse_ld_EQ definition, since clang just ignores this option.

Conflicts:

	lib/Driver/Tools.h

Change-Id: I8472d25644064f8152ebf391379894a9aee0aa0b
[ndk] Silence "treating c input as c++" warning.

Change-Id: Ifcd764c4920bf9d1c0101be402d263aa903e40a8
[ndk] Remove redundant -lgcc for linker.

Conflicts:

	lib/Driver/Tools.cpp

Change-Id: I81a07ecd452db56756931c9d97b6d8ace9d87288
[ndk] Add a flag to disable C++ missing return semantics.

Conflicts:

	include/clang/Driver/Options.td

Change-Id: Id8125986a3f6d1326f9c2fb3ce19ef886104cca8

Conflicts:
	lib/CodeGen/CodeGenFunction.cpp
[ndk] 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.

Conflicts:

	include/clang/Driver/Options.td

Change-Id: I33df8c551ac14f37c9be3922ce063ff9a43f92ed
[ndk][pndk] Use intrinsic for unwind header size on le32 ndk target.

Change-Id: I4249e3a7e8672bf42d3575a9ee50a05c60f4b5d8
Signed-off-by: WenHan Gu <Wenhan.gu@mediatek.com>
[ndk] 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.

Change-Id: Ic94170d33b67d351aba5681b80919f37ea256721
[ndk] Add new option -Qignore-c-std-not-allowed-with-cplusplus

To suppress option like -std=gnu99 defined in LOCAL_CFLAGS but get
passed for C++ compilation by both Android and NDK build system.
Since -std=gnu99 is C and not for C++, clang may error with message
reads (while g++ gives warning):

  error: invalid argument '-std=gnu99' not allowed with 'C++/ObjC++'

This flag is useful for "clang -fsyntax-only" to accept options originally
work for g++

Conflicts:

	include/clang/Driver/Options.td

Change-Id: I699d37fe55cf6d76e8a7f92ebf2b0822b587e1c8