Make host valgrind work with clang/llvm.
Bug: 28454823
* Add -fno-builtin-memset flag.
Bug: 31035712
* Make esp 16-byte aligned before calling x86 functions.
Bug: https://bugs.kde.org/show_bug.cgi?id=368120
Note that this does not fix other errors on x86 emulator.
Change-Id: Ibc19d0902aaba68edbb9f3758da368c35294128b
Test: Run valgrind on linux host and arm/x86 targets.
Test: In art run "mm valgrind-test-art-host"
diff --git a/coregrind/m_main.c b/coregrind/m_main.c
index 1821c94..140efbf 100644
--- a/coregrind/m_main.c
+++ b/coregrind/m_main.c
@@ -2925,12 +2925,13 @@
"\tmovl $vgPlain_interim_stack, %eax\n"
"\taddl $"VG_STRINGIFY(VG_STACK_GUARD_SZB)", %eax\n"
"\taddl $"VG_STRINGIFY(VG_DEFAULT_STACK_ACTIVE_SZB)", %eax\n"
+ /* allocate at least 16 bytes on the new stack, and aligned */
"\tsubl $16, %eax\n"
"\tandl $~15, %eax\n"
/* install it, and collect the original one */
"\txchgl %eax, %esp\n"
/* call _start_in_C_linux, passing it the startup %esp */
- "\tpushl %eax\n"
+ "\tmovl %eax, (%esp)\n"
"\tcall _start_in_C_linux\n"
"\thlt\n"
".previous\n"