1# Copyright (C) 2011 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15LOCAL_PATH:= $(call my-dir)
16
17ANDROID_HARDWARE := ANDROID_HARDWARE_generic
18
19ifneq ($(filter arm arm64 x86 x86_64,$(TARGET_ARCH)),)
20
21vg_arch:=$(TARGET_ARCH)
22
23ifneq ($(filter x86_64, $(TARGET_ARCH)),)
24  vg_arch:=amd64
25endif
26
27common_cflags := \
28	-Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wmissing-declarations \
29	-Wno-pointer-sign -Wno-sign-compare -Wno-unused-parameter -Wno-shadow \
30	-fno-strict-aliasing -fno-stack-protector \
31	-DVGO_linux=1 \
32	-DANDROID_SYMBOLS_DIR=\"/data/local/symbols\" \
33  -std=gnu99
34
35ifeq ($(TARGET_IS_64_BIT),true)
36  vg_target_module_path := /system/lib64/valgrind
37else
38  vg_target_module_path := /system/lib/valgrind
39endif
40
41target_arch_cflags := \
42	-DVGA_$(vg_arch)=1 \
43	-DVGP_$(vg_arch)_linux=1 \
44	-DVGPV_$(vg_arch)_linux_android=1 \
45	-DVG_LIBDIR=\"$(vg_target_module_path)\" \
46	-DVG_PLATFORM=\"$(vg_arch)-linux\"
47
48ifdef TARGET_2ND_ARCH
49target_2nd_arch_cflags := \
50	-DVGA_$(TARGET_2ND_ARCH)=1 \
51	-DVGP_$(TARGET_2ND_ARCH)_linux=1 \
52	-DVGPV_$(TARGET_2ND_ARCH)_linux_android=1 \
53	-DVG_LIBDIR=\"$(vg_target_module_path)\" \
54	-DVG_PLATFORM=\"$(TARGET_2ND_ARCH)-linux\"
55vg_second_arch := $(TARGET_2ND_ARCH)
56
57endif
58
59# The supported host platform are linux amd64 and linux x86
60host_arch_cflags := \
61  -DVGA_amd64=1 \
62  -DVGP_amd64_linux=1 \
63  -DVG_PLATFORM=\"amd64-linux\" \
64  -DVG_LIBDIR=\"$(realpath $(HOST_OUT_SHARED_LIBRARIES))/valgrind\"
65
66host_2nd_arch_cflags := \
67  -DVGA_x86=1 \
68  -DVGP_x86_linux=1 \
69  -DVG_PLATFORM=\"x86-linux\" \
70  -DVG_LIBDIR=\"$(realpath $(HOST_OUT_SHARED_LIBRARIES))/valgrind\"
71
72common_includes := \
73	external/valgrind \
74	external/valgrind/include \
75	external/valgrind/VEX/pub \
76	external/valgrind/coregrind
77
78vex_ldflags := -nodefaultlibs
79
80ifeq (,$(filter $(TARGET_ARCH),arm arm64))
81tool_ldflags := -static -Wl,--build-id=none,-Ttext=0x38000000 -nodefaultlibs -nostartfiles -Wl,-e,_start
82else
83tool_ldflags := -static -Wl,-Ttext=0x38000000 -nodefaultlibs -nostartfiles -Wl,-e,_start
84endif
85
86common_cflags += -D$(ANDROID_HARDWARE)
87
88preload_ldflags := -nodefaultlibs -Wl,-z,interpose,-z,initfirst
89# Remove this when the all toolchains are GCC 4.4
90ifeq ($(TARGET_ARCH),arm)
91  preload_ldflags += -Wl,--icf=none
92endif
93
94# Build libvex-($TARGET_ARCH)-linux.a
95vg_local_module=libvex
96
97vg_local_cflags := $(common_cflags) \
98    -Wbad-function-cast \
99    -Wcast-qual \
100    -Wcast-align \
101    -fstrict-aliasing \
102
103vg_local_src_files := \
104	VEX/priv/main_globals.c \
105	VEX/priv/main_main.c \
106	VEX/priv/main_util.c \
107	VEX/priv/ir_defs.c \
108	VEX/priv/ir_match.c \
109	VEX/priv/ir_opt.c \
110	VEX/priv/ir_inject.c \
111	VEX/priv/guest_generic_bb_to_IR.c \
112	VEX/priv/guest_generic_x87.c \
113	VEX/priv/guest_mips_helpers.c \
114	VEX/priv/guest_mips_toIR.c \
115	VEX/priv/guest_x86_helpers.c \
116	VEX/priv/guest_x86_toIR.c \
117	VEX/priv/guest_amd64_helpers.c \
118	VEX/priv/guest_amd64_toIR.c \
119	VEX/priv/guest_ppc_helpers.c \
120	VEX/priv/guest_ppc_toIR.c \
121	VEX/priv/guest_arm_helpers.c \
122	VEX/priv/guest_arm_toIR.c \
123	VEX/priv/guest_arm64_helpers.c \
124	VEX/priv/guest_arm64_toIR.c \
125	VEX/priv/guest_s390_helpers.c \
126	VEX/priv/guest_s390_toIR.c \
127	VEX/priv/host_generic_maddf.c \
128	VEX/priv/host_generic_regs.c \
129	VEX/priv/host_generic_simd64.c \
130	VEX/priv/host_generic_simd128.c \
131	VEX/priv/host_generic_simd256.c \
132	VEX/priv/host_generic_reg_alloc2.c \
133	VEX/priv/host_x86_defs.c \
134	VEX/priv/host_x86_isel.c \
135	VEX/priv/host_amd64_defs.c \
136	VEX/priv/host_amd64_isel.c \
137	VEX/priv/host_mips_defs.c \
138	VEX/priv/host_mips_isel.c \
139	VEX/priv/host_ppc_defs.c \
140	VEX/priv/host_ppc_isel.c \
141	VEX/priv/host_arm_defs.c \
142	VEX/priv/host_arm_isel.c \
143	VEX/priv/host_arm64_defs.c \
144	VEX/priv/host_arm64_isel.c \
145	VEX/priv/host_s390_defs.c \
146	VEX/priv/host_s390_isel.c \
147	VEX/priv/s390_disasm.c
148
149vg_local_target := STATIC_LIBRARY
150include $(LOCAL_PATH)/Android.build_all.mk
151
152# Build libcoregrind-$(TARGET_ARCH)-linux.a
153vg_local_module := libcoregrind
154vg_local_target := STATIC_LIBRARY
155
156vg_local_src_files := \
157	coregrind/m_addrinfo.c \
158	coregrind/m_cache.c \
159	coregrind/m_commandline.c \
160	coregrind/m_clientstate.c \
161	coregrind/m_cpuid.S \
162	coregrind/m_debugger.c \
163	coregrind/m_debuglog.c \
164	coregrind/m_errormgr.c \
165	coregrind/m_execontext.c \
166	coregrind/m_hashtable.c \
167	coregrind/m_libcbase.c \
168	coregrind/m_libcassert.c \
169	coregrind/m_libcfile.c \
170	coregrind/m_libcprint.c \
171	coregrind/m_libcproc.c \
172	coregrind/m_libcsetjmp.c \
173	coregrind/m_libcsignal.c \
174	coregrind/m_machine.c \
175	coregrind/m_main.c \
176	coregrind/m_mallocfree.c \
177	coregrind/m_options.c \
178	coregrind/m_oset.c \
179	coregrind/m_poolalloc.c \
180	coregrind/m_rangemap.c \
181	coregrind/m_redir.c \
182	coregrind/m_seqmatch.c \
183	coregrind/m_signals.c \
184	coregrind/m_sparsewa.c \
185	coregrind/m_stacks.c \
186	coregrind/m_stacktrace.c \
187	coregrind/m_syscall.c \
188	coregrind/m_threadstate.c \
189	coregrind/m_tooliface.c \
190	coregrind/m_trampoline.S \
191	coregrind/m_translate.c \
192	coregrind/m_transtab.c \
193	coregrind/m_vki.c \
194	coregrind/m_vkiscnums.c \
195	coregrind/m_wordfm.c \
196	coregrind/m_xarray.c \
197	coregrind/m_aspacehl.c \
198	coregrind/m_aspacemgr/aspacemgr-common.c \
199	coregrind/m_aspacemgr/aspacemgr-linux.c \
200	coregrind/m_aspacemgr/aspacemgr-segnames.c \
201	coregrind/m_coredump/coredump-elf.c \
202	coregrind/m_coredump/coredump-macho.c \
203	coregrind/m_debuginfo/image.c \
204	coregrind/m_debuginfo/misc.c \
205	coregrind/m_debuginfo/d3basics.c \
206	coregrind/m_debuginfo/debuginfo.c \
207	coregrind/m_debuginfo/readdwarf.c \
208	coregrind/m_debuginfo/readdwarf3.c \
209	coregrind/m_debuginfo/readelf.c \
210	coregrind/m_debuginfo/readexidx.c \
211	coregrind/m_debuginfo/readmacho.c \
212	coregrind/m_debuginfo/readpdb.c \
213	coregrind/m_debuginfo/storage.c \
214	coregrind/m_debuginfo/tytypes.c \
215	coregrind/m_deduppoolalloc.c \
216	coregrind/m_demangle/cp-demangle.c \
217	coregrind/m_demangle/cplus-dem.c \
218	coregrind/m_demangle/demangle.c \
219	coregrind/m_demangle/dyn-string.c \
220	coregrind/m_demangle/safe-ctype.c \
221	coregrind/m_dispatch/dispatch-x86-linux.S \
222	coregrind/m_dispatch/dispatch-amd64-linux.S \
223	coregrind/m_dispatch/dispatch-ppc32-linux.S \
224	coregrind/m_dispatch/dispatch-ppc64be-linux.S \
225	coregrind/m_dispatch/dispatch-ppc64le-linux.S \
226	coregrind/m_dispatch/dispatch-arm-linux.S \
227	coregrind/m_dispatch/dispatch-arm64-linux.S \
228	coregrind/m_dispatch/dispatch-x86-darwin.S \
229	coregrind/m_dispatch/dispatch-amd64-darwin.S \
230	coregrind/m_initimg/initimg-linux.c \
231	coregrind/m_initimg/initimg-darwin.c \
232	coregrind/m_initimg/initimg-pathscan.c \
233	coregrind/m_mach/mach_basics.c \
234	coregrind/m_mach/mach_msg.c \
235	coregrind/m_mach/mach_traps-x86-darwin.S \
236	coregrind/m_mach/mach_traps-amd64-darwin.S \
237	coregrind/m_replacemalloc/replacemalloc_core.c \
238	coregrind/m_sbprofile.c \
239	coregrind/m_scheduler/sched-lock.c \
240	coregrind/m_scheduler/sched-lock-generic.c \
241	coregrind/m_scheduler/scheduler.c \
242	coregrind/m_scheduler/sema.c \
243	coregrind/m_scheduler/ticket-lock-linux.c \
244	coregrind/m_sigframe/sigframe-common.c \
245	coregrind/m_sigframe/sigframe-x86-linux.c \
246	coregrind/m_sigframe/sigframe-amd64-linux.c \
247	coregrind/m_sigframe/sigframe-ppc32-linux.c \
248	coregrind/m_sigframe/sigframe-ppc64-linux.c \
249	coregrind/m_sigframe/sigframe-arm-linux.c \
250	coregrind/m_sigframe/sigframe-arm64-linux.c \
251	coregrind/m_sigframe/sigframe-x86-darwin.c \
252	coregrind/m_sigframe/sigframe-amd64-darwin.c \
253	coregrind/m_sigframe/sigframe-s390x-linux.c \
254	coregrind/m_syswrap/syscall-x86-linux.S \
255	coregrind/m_syswrap/syscall-amd64-linux.S \
256	coregrind/m_syswrap/syscall-ppc32-linux.S \
257	coregrind/m_syswrap/syscall-ppc64be-linux.S \
258	coregrind/m_syswrap/syscall-ppc64le-linux.S \
259	coregrind/m_syswrap/syscall-arm-linux.S \
260	coregrind/m_syswrap/syscall-arm64-linux.S \
261	coregrind/m_syswrap/syscall-x86-darwin.S \
262	coregrind/m_syswrap/syscall-amd64-darwin.S \
263	coregrind/m_syswrap/syscall-s390x-linux.S \
264	coregrind/m_syswrap/syswrap-main.c \
265	coregrind/m_syswrap/syswrap-generic.c \
266	coregrind/m_syswrap/syswrap-linux.c \
267	coregrind/m_syswrap/syswrap-linux-variants.c \
268	coregrind/m_syswrap/syswrap-darwin.c \
269	coregrind/m_syswrap/syswrap-x86-linux.c \
270	coregrind/m_syswrap/syswrap-amd64-linux.c \
271	coregrind/m_syswrap/syswrap-ppc32-linux.c \
272	coregrind/m_syswrap/syswrap-ppc64-linux.c \
273	coregrind/m_syswrap/syswrap-arm-linux.c \
274	coregrind/m_syswrap/syswrap-arm64-linux.c \
275	coregrind/m_syswrap/syswrap-x86-darwin.c \
276	coregrind/m_syswrap/syswrap-amd64-darwin.c \
277	coregrind/m_syswrap/syswrap-s390x-linux.c \
278	coregrind/m_syswrap/syswrap-xen.c \
279	coregrind/m_ume/elf.c \
280	coregrind/m_ume/macho.c \
281	coregrind/m_ume/main.c \
282	coregrind/m_ume/script.c \
283	coregrind/vgdb.c \
284	coregrind/m_gdbserver/inferiors.c \
285	coregrind/m_gdbserver/m_gdbserver.c \
286	coregrind/m_gdbserver/regcache.c \
287	coregrind/m_gdbserver/remote-utils.c \
288	coregrind/m_gdbserver/server.c \
289	coregrind/m_gdbserver/signals.c \
290	coregrind/m_gdbserver/target.c \
291	coregrind/m_gdbserver/utils.c \
292	coregrind/m_gdbserver/valgrind-low-amd64.c \
293	coregrind/m_gdbserver/valgrind-low-arm.c \
294	coregrind/m_gdbserver/valgrind-low-arm64.c \
295	coregrind/m_gdbserver/valgrind-low-ppc32.c \
296	coregrind/m_gdbserver/valgrind-low-ppc64.c \
297	coregrind/m_gdbserver/valgrind-low-s390x.c \
298	coregrind/m_gdbserver/valgrind-low-x86.c \
299	coregrind/m_gdbserver/version.c
300
301vg_local_ldflags := $(vex_ldflags)
302vg_local_cflags := $(common_cflags)
303
304include $(LOCAL_PATH)/Android.build_all.mk
305
306# Build libreplacemalloc_toolpreload-$(TARGET_ARCH)-linux.a
307vg_local_module := libreplacemalloc_toolpreload
308vg_local_target := STATIC_LIBRARY
309
310vg_local_src_files := \
311	coregrind/m_replacemalloc/vg_replace_malloc.c
312
313vg_local_ldflags := $(preload_ldflags)
314
315vg_local_cflags := $(common_cflags)
316
317include $(LOCAL_PATH)/Android.build_all.mk
318
319# Build vgpreload_core-$(TARGET_ARCH)-linux.so
320vg_local_module := vgpreload_core
321vg_local_target := SHARED_LIBRARY
322vg_local_module_class := SHARED_LIBRARIES
323
324vg_local_src_files := \
325	coregrind/vg_preloaded.c
326
327#LOCAL_STRIP_MODULE := false
328#vg_local_no_crt := true
329
330vg_local_ldflags := $(preload_ldflags)
331vg_local_cflags := $(common_cflags)
332
333vg_local_arch_cflags := $(target_arch_cflags)
334
335include $(LOCAL_PATH)/Android.build_all.mk
336
337# Build memcheck-$(TARGET_ARCH)-linux
338vg_local_module := memcheck
339vg_local_target := EXECUTABLE
340vg_local_module_class := SHARED_LIBRARIES
341vg_local_src_files := \
342	memcheck/mc_leakcheck.c \
343	memcheck/mc_malloc_wrappers.c \
344	memcheck/mc_main.c \
345	memcheck/mc_translate.c \
346	memcheck/mc_machine.c \
347	memcheck/mc_errors.c
348
349vg_local_cflags := $(common_cflags)
350vg_local_ldflags := $(tool_ldflags)
351vg_local_static_libraries := libcoregrind libvex
352
353vg_local_without_system_shared_libraries := true
354vg_local_no_crt := true
355
356include $(LOCAL_PATH)/Android.build_all.mk
357
358# Build vgpreload_memcheck-$(TARGET_ARCH)-linux.so
359vg_local_module := vgpreload_memcheck
360vg_local_module_class := SHARED_LIBRARIES
361vg_local_target := SHARED_LIBRARY
362
363vg_local_src_files := \
364	memcheck/mc_replace_strmem.c
365
366vg_local_ldflags := $(preload_ldflags)
367vg_local_cflags := $(common_cflags)
368
369vg_local_whole_static_libraries := libreplacemalloc_toolpreload
370
371include $(LOCAL_PATH)/Android.build_all.mk
372
373# Build cachegrind-$(TARGET_ARCH)-linux
374vg_local_module := cachegrind
375vg_local_module_class := SHARED_LIBRARIES
376vg_local_target := EXECUTABLE
377vg_local_no_crt := true
378vg_local_without_system_shared_libraries := true
379
380vg_local_src_files := \
381	cachegrind/cg_arch.c \
382	cachegrind/cg_main.c
383
384vg_local_ldflags := $(tool_ldflags)
385vg_local_cflags := $(common_cflags)
386
387vg_local_static_libraries := libcoregrind libvex
388
389include $(LOCAL_PATH)/Android.build_all.mk
390
391#LOCAL_FORCE_STATIC_EXECUTABLE := true
392
393# Build callgrind-$(TARGET_ARCH)-linux
394
395vg_local_module := callgrind
396vg_local_module_class := SHARED_LIBRARIES
397vg_local_target := EXECUTABLE
398vg_local_no_crt := true
399vg_local_without_system_shared_libraries := true
400
401vg_local_src_files := \
402	callgrind/bb.c \
403	callgrind/bbcc.c \
404	callgrind/callstack.c \
405	callgrind/clo.c \
406	callgrind/context.c \
407	callgrind/costs.c \
408	callgrind/debug.c \
409	callgrind/dump.c \
410	callgrind/events.c \
411	callgrind/fn.c \
412	callgrind/jumps.c \
413	callgrind/main.c \
414	callgrind/sim.c \
415	callgrind/threads.c
416
417vg_local_c_includes := external/valgrind/cachegrind
418vg_local_ldflags := $(tool_ldflags)
419vg_local_cflags := $(common_cflags)
420vg_local_static_libraries := libcoregrind libvex
421
422include $(LOCAL_PATH)/Android.build_all.mk
423
424#LOCAL_FORCE_STATIC_EXECUTABLE := true
425
426# Build helgrind-$(TARGET_ARCH)-linux
427vg_local_module := helgrind
428vg_local_module_class := SHARED_LIBRARIES
429vg_local_target := EXECUTABLE
430vg_local_no_crt := true
431vg_local_without_system_shared_libraries := true
432vg_local_src_files := \
433    helgrind/hg_addrdescr.c \
434    helgrind/hg_basics.c \
435    helgrind/hg_errors.c \
436    helgrind/hg_lock_n_thread.c \
437    helgrind/hg_main.c \
438    helgrind/hg_wordset.c \
439    helgrind/libhb_core.c
440
441vg_local_ldflags := $(tool_ldflags)
442vg_local_cflags := $(common_cflags)
443vg_local_static_libraries := libcoregrind libvex
444
445include $(LOCAL_PATH)/Android.build_all.mk
446
447#LOCAL_FORCE_STATIC_EXECUTABLE := true
448
449# Build vgpreload_helgrind-$(TARGET_ARCH)-linux.so
450vg_local_module := vgpreload_helgrind
451vg_local_module_class := SHARED_LIBRARIES
452vg_local_target := SHARED_LIBRARY
453#LOCAL_STRIP_MODULE := false
454vg_local_no_crt := true
455
456vg_local_src_files := \
457	helgrind/hg_intercepts.c
458
459
460vg_local_ldflags := $(preload_ldflags)
461vg_local_cflags := $(common_cflags)
462vg_local_whole_static_libraries := libreplacemalloc_toolpreload
463
464include $(LOCAL_PATH)/Android.build_all.mk
465
466# Build drd-$(TARGET_ARCH)-linux
467vg_local_module := drd
468vg_local_module_class := SHARED_LIBRARIES
469vg_local_target := EXECUTABLE
470#LOCAL_FORCE_STATIC_EXECUTABLE := true
471vg_local_no_crt := true
472vg_local_without_system_shared_libraries := true
473
474vg_local_src_files := \
475	drd/drd_barrier.c \
476	drd/drd_clientobj.c \
477	drd/drd_clientreq.c \
478	drd/drd_cond.c \
479	drd/drd_cond_initializer.c \
480	drd/drd_error.c \
481	drd/drd_hb.c \
482	drd/drd_load_store.c \
483	drd/drd_main.c \
484	drd/drd_malloc_wrappers.c \
485	drd/drd_mutex.c \
486	drd/drd_rwlock.c \
487	drd/drd_semaphore.c \
488	drd/drd_suppression.c
489
490vg_local_ldflags := $(tool_ldflags)
491vg_local_cflags := $(common_cflags)
492
493vg_local_static_libraries := libcoregrind libvex
494
495include $(LOCAL_PATH)/Android.build_all.mk
496
497# Build vgpreload_drd-$(TARGET_ARCH)-linux.so
498vg_local_module := vgpreload_drd
499vg_local_module_class := SHARED_LIBRARIES
500vg_local_target := SHARED_LIBRARY
501vg_local_no_crt := true
502
503vg_local_src_files := \
504	drd/drd_pthread_intercepts.c \
505	drd/drd_qtcore_intercepts.c \
506	drd/drd_strmem_intercepts.c
507
508vg_local_ldflags := $(preload_ldflags)
509vg_local_cflags := $(common_cflags)
510
511vg_local_whole_static_libraries := libreplacemalloc_toolpreload
512
513include $(LOCAL_PATH)/Android.build_all.mk
514
515# Build massif-$(TARGET_ARCH)-linux
516vg_local_module := massif
517vg_local_module_class := SHARED_LIBRARIES
518vg_local_target := EXECUTABLE
519vg_local_no_crt := true
520vg_local_without_system_shared_libraries := true
521
522vg_local_src_files := \
523	massif/ms_main.c
524
525vg_local_ldflags := $(tool_ldflags)
526vg_local_cflags := $(common_cflags)
527
528vg_local_static_libraries := libcoregrind libvex
529
530include $(LOCAL_PATH)/Android.build_all.mk
531
532# Build vgpreload_massif-$(TARGET_ARCH)-linux.so
533vg_local_module := vgpreload_massif
534vg_local_module_class := SHARED_LIBRARIES
535vg_local_target := SHARED_LIBRARY
536vg_local_no_crt := true
537
538vg_local_src_files :=
539
540vg_local_ldflags := $(preload_ldflags)
541vg_local_cflags := $(common_cflags)
542vg_local_whole_static_libraries := libreplacemalloc_toolpreload
543
544include $(LOCAL_PATH)/Android.build_all.mk
545
546# Build none-$(TARGET_ARCH)-linux
547vg_local_module := none
548vg_local_module_class := SHARED_LIBRARIES
549vg_local_target := EXECUTABLE
550
551vg_local_no_crt := true
552vg_local_without_system_shared_libraries := true
553
554vg_local_src_files := \
555	none/nl_main.c
556
557vg_local_ldflags := $(tool_ldflags)
558vg_local_cflags := $(common_cflags)
559vg_local_static_libraries := libcoregrind libvex
560
561include $(LOCAL_PATH)/Android.build_all.mk
562
563# Build valgrind
564include $(CLEAR_VARS)
565LOCAL_MODULE := valgrind
566LOCAL_ARM_MODE := arm
567LOCAL_SRC_FILES := \
568	coregrind/launcher-linux.c \
569	coregrind/m_debuglog.c
570
571LOCAL_C_INCLUDES := $(common_includes)
572LOCAL_CFLAGS := $(common_cflags)
573
574LOCAL_CFLAGS_$(TARGET_ARCH) = $(target_arch_cflags)
575
576include $(BUILD_EXECUTABLE)
577
578# Build valgrind for linux host
579ifeq ($(HOST_OS), linux)
580include $(CLEAR_VARS)
581LOCAL_MODULE := valgrind
582LOCAL_SRC_FILES := \
583	coregrind/launcher-linux.c \
584	coregrind/m_debuglog.c
585
586LOCAL_C_INCLUDES := $(common_includes)
587LOCAL_CFLAGS := $(common_cflags) $(host_arch_cflags)
588LOCAL_MULTILIB := 64
589
590include $(BUILD_HOST_EXECUTABLE)
591endif
592
593#vg_build_tests := true
594# Build tests (some of them)...
595# TODO: tests need separate build framework it terms of 2ND_ARCH
596ifeq ($(vg_build_tests),true)
597ifeq ($(TARGET_ARCH),arm)
598test := v6intThumb
599include $(LOCAL_PATH)/Android.test.mk
600test := vfp
601include $(LOCAL_PATH)/Android.test.mk
602endif
603
604ifeq ($(TARGET_ARCH),arm64)
605test := integer
606include $(LOCAL_PATH)/Android.test.mk
607test := fp_and_simd
608include $(LOCAL_PATH)/Android.test.mk
609test := memory
610include $(LOCAL_PATH)/Android.test.mk
611endif
612endif
613
614# Copy prebuilt suppressions
615include $(CLEAR_VARS)
616LOCAL_MODULE := default.supp
617LOCAL_MODULE_CLASS := SHARED_LIBRARIES
618LOCAL_MODULE_PATH := $(PRODUCT_OUT)$(vg_target_module_path)
619LOCAL_STRIP_MODULE := false
620LOCAL_SRC_FILES := bionic.supp
621
622include $(BUILD_PREBUILT)
623
624ifeq ($(HOST_OS), linux)
625include $(CLEAR_VARS)
626LOCAL_IS_HOST_MODULE := true
627LOCAL_MODULE := default.supp
628LOCAL_MODULE_CLASS := SHARED_LIBRARIES
629LOCAL_MODULE_PATH := $(HOST_OUT_SHARED_LIBRARIES)/valgrind
630LOCAL_STRIP_MODULE := false
631LOCAL_SRC_FILES := bionic.supp
632
633include $(BUILD_PREBUILT)
634endif
635
636endif
637