Discussion:
Valgrind: r16384 - in /trunk: NEWS coregrind/m_main.c
(too old to reply)
s***@valgrind.org
2017-05-16 08:50:49 UTC
Permalink
Raw Message
Author: iraisr
Date: Tue May 16 09:50:48 2017
New Revision: 16384

Log:
Implement required stubs for Android on arm when built with clang/llvm.
Fixes BZ#368529
Slightly modified patch by: Elliott Hughes <***@google.com>

Modified:
trunk/NEWS
trunk/coregrind/m_main.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Tue May 16 09:50:48 2017
@@ -117,6 +117,7 @@
362223 assertion failed when .valgrindrc is a directory instead of a file
367543 bt/btc/btr/bts x86/x86_64 instructions are poorly-handled wrt flags
367942 Segfault vgPlain_do_sys_sigaction (m_signals.c:1138)
+368529 Android arm target link error, missing atexit and pthread_atfork
368863 WARNING: unhandled arm64-linux syscall: 100 (get_robust_list)
368865 WARNING: unhandled arm64-linux syscall: 272 (kcmp)
368868 disInstr(arm64): unhandled instruction 0xD53BE000 = cntfrq_el0 (ARMv8)

Modified: trunk/coregrind/m_main.c
==============================================================================
--- trunk/coregrind/m_main.c (original)
+++ trunk/coregrind/m_main.c Tue May 16 09:50:48 2017
@@ -2439,7 +2439,47 @@
VG_(printf)("Something called __aeabi_unwind_cpp_pr1()\n");
vg_assert(0);
}
-#endif
+
+#if defined(__ANDROID__)
+/* Replace __aeabi_memcpy* functions with vgPlain_memcpy. */
+void *__aeabi_memcpy(void *dest, const void *src, SizeT n);
+void *__aeabi_memcpy(void *dest, const void *src, SizeT n)
+{
+ return VG_(memcpy)(dest, src, n);
+}
+
+void *__aeabi_memcpy4(void *dest, const void *src, SizeT n);
+void *__aeabi_memcpy4(void *dest, const void *src, SizeT n)
+{
+ return VG_(memcpy)(dest, src, n);
+}
+
+void *__aeabi_memcpy8(void *dest, const void *src, SizeT n);
+void *__aeabi_memcpy8(void *dest, const void *src, SizeT n)
+{
+ return VG_(memcpy)(dest, src, n);
+}
+
+/* Replace __aeabi_memclr* functions with vgPlain_memset. */
+void *__aeabi_memclr(void *dest, SizeT n);
+void *__aeabi_memclr(void *dest, SizeT n)
+{
+ return VG_(memset)(dest, 0, n);
+}
+
+void *__aeabi_memclr4(void *dest, SizeT n);
+void *__aeabi_memclr4(void *dest, SizeT n)
+{
+ return VG_(memset)(dest, 0, n);
+}
+
+void *__aeabi_memclr8(void *dest, SizeT n);
+void *__aeabi_memclr8(void *dest, SizeT n)
+{
+ return VG_(memset)(dest, 0, n);
+}
+#endif /* defined(__ANDROID__) */
+#endif /* defined(VGP_arm_linux) */

/* ---------------- Requirement 2 ---------------- */

Loading...