• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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=\"$(abspath $(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=\"$(abspath $(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_debuglog.c \
163	coregrind/m_errormgr.c \
164	coregrind/m_execontext.c \
165	coregrind/m_hashtable.c \
166	coregrind/m_libcbase.c \
167	coregrind/m_libcassert.c \
168	coregrind/m_libcfile.c \
169	coregrind/m_libcprint.c \
170	coregrind/m_libcproc.c \
171	coregrind/m_libcsetjmp.c \
172	coregrind/m_libcsignal.c \
173	coregrind/m_machine.c \
174	coregrind/m_main.c \
175	coregrind/m_mallocfree.c \
176	coregrind/m_options.c \
177	coregrind/m_oset.c \
178	coregrind/m_poolalloc.c \
179	coregrind/m_rangemap.c \
180	coregrind/m_redir.c \
181	coregrind/m_seqmatch.c \
182	coregrind/m_signals.c \
183	coregrind/m_sparsewa.c \
184	coregrind/m_stacks.c \
185	coregrind/m_stacktrace.c \
186	coregrind/m_syscall.c \
187	coregrind/m_threadstate.c \
188	coregrind/m_tooliface.c \
189	coregrind/m_trampoline.S \
190	coregrind/m_translate.c \
191	coregrind/m_transtab.c \
192	coregrind/m_vki.c \
193	coregrind/m_vkiscnums.c \
194	coregrind/m_wordfm.c \
195	coregrind/m_xarray.c \
196	coregrind/m_aspacehl.c \
197	coregrind/m_aspacemgr/aspacemgr-common.c \
198	coregrind/m_aspacemgr/aspacemgr-linux.c \
199	coregrind/m_aspacemgr/aspacemgr-segnames.c \
200	coregrind/m_coredump/coredump-elf.c \
201	coregrind/m_coredump/coredump-macho.c \
202	coregrind/m_debuginfo/image.c \
203	coregrind/m_debuginfo/misc.c \
204	coregrind/m_debuginfo/d3basics.c \
205	coregrind/m_debuginfo/debuginfo.c \
206	coregrind/m_debuginfo/readdwarf.c \
207	coregrind/m_debuginfo/readdwarf3.c \
208	coregrind/m_debuginfo/readelf.c \
209	coregrind/m_debuginfo/readexidx.c \
210	coregrind/m_debuginfo/readmacho.c \
211	coregrind/m_debuginfo/readpdb.c \
212	coregrind/m_debuginfo/storage.c \
213	coregrind/m_debuginfo/tytypes.c \
214	coregrind/m_deduppoolalloc.c \
215	coregrind/m_demangle/cp-demangle.c \
216	coregrind/m_demangle/cplus-dem.c \
217	coregrind/m_demangle/demangle.c \
218	coregrind/m_demangle/dyn-string.c \
219	coregrind/m_demangle/safe-ctype.c \
220	coregrind/m_dispatch/dispatch-x86-linux.S \
221	coregrind/m_dispatch/dispatch-amd64-linux.S \
222	coregrind/m_dispatch/dispatch-ppc32-linux.S \
223	coregrind/m_dispatch/dispatch-ppc64be-linux.S \
224	coregrind/m_dispatch/dispatch-ppc64le-linux.S \
225	coregrind/m_dispatch/dispatch-arm-linux.S \
226	coregrind/m_dispatch/dispatch-arm64-linux.S \
227	coregrind/m_dispatch/dispatch-x86-darwin.S \
228	coregrind/m_dispatch/dispatch-amd64-darwin.S \
229	coregrind/m_initimg/initimg-linux.c \
230	coregrind/m_initimg/initimg-darwin.c \
231	coregrind/m_initimg/initimg-pathscan.c \
232	coregrind/m_mach/mach_basics.c \
233	coregrind/m_mach/mach_msg.c \
234	coregrind/m_mach/mach_traps-x86-darwin.S \
235	coregrind/m_mach/mach_traps-amd64-darwin.S \
236	coregrind/m_replacemalloc/replacemalloc_core.c \
237	coregrind/m_sbprofile.c \
238	coregrind/m_scheduler/sched-lock.c \
239	coregrind/m_scheduler/sched-lock-generic.c \
240	coregrind/m_scheduler/scheduler.c \
241	coregrind/m_scheduler/sema.c \
242	coregrind/m_scheduler/ticket-lock-linux.c \
243	coregrind/m_sigframe/sigframe-common.c \
244	coregrind/m_sigframe/sigframe-x86-linux.c \
245	coregrind/m_sigframe/sigframe-amd64-linux.c \
246	coregrind/m_sigframe/sigframe-ppc32-linux.c \
247	coregrind/m_sigframe/sigframe-ppc64-linux.c \
248	coregrind/m_sigframe/sigframe-arm-linux.c \
249	coregrind/m_sigframe/sigframe-arm64-linux.c \
250	coregrind/m_sigframe/sigframe-x86-darwin.c \
251	coregrind/m_sigframe/sigframe-amd64-darwin.c \
252	coregrind/m_sigframe/sigframe-s390x-linux.c \
253	coregrind/m_syswrap/syscall-x86-linux.S \
254	coregrind/m_syswrap/syscall-amd64-linux.S \
255	coregrind/m_syswrap/syscall-ppc32-linux.S \
256	coregrind/m_syswrap/syscall-ppc64be-linux.S \
257	coregrind/m_syswrap/syscall-ppc64le-linux.S \
258	coregrind/m_syswrap/syscall-arm-linux.S \
259	coregrind/m_syswrap/syscall-arm64-linux.S \
260	coregrind/m_syswrap/syscall-x86-darwin.S \
261	coregrind/m_syswrap/syscall-amd64-darwin.S \
262	coregrind/m_syswrap/syscall-s390x-linux.S \
263	coregrind/m_syswrap/syswrap-main.c \
264	coregrind/m_syswrap/syswrap-generic.c \
265	coregrind/m_syswrap/syswrap-linux.c \
266	coregrind/m_syswrap/syswrap-linux-variants.c \
267	coregrind/m_syswrap/syswrap-darwin.c \
268	coregrind/m_syswrap/syswrap-x86-linux.c \
269	coregrind/m_syswrap/syswrap-amd64-linux.c \
270	coregrind/m_syswrap/syswrap-ppc32-linux.c \
271	coregrind/m_syswrap/syswrap-ppc64-linux.c \
272	coregrind/m_syswrap/syswrap-arm-linux.c \
273	coregrind/m_syswrap/syswrap-arm64-linux.c \
274	coregrind/m_syswrap/syswrap-x86-darwin.c \
275	coregrind/m_syswrap/syswrap-amd64-darwin.c \
276	coregrind/m_syswrap/syswrap-s390x-linux.c \
277	coregrind/m_syswrap/syswrap-xen.c \
278	coregrind/m_ume/elf.c \
279	coregrind/m_ume/macho.c \
280	coregrind/m_ume/main.c \
281	coregrind/m_ume/script.c \
282	coregrind/vgdb.c \
283	coregrind/m_gdbserver/inferiors.c \
284	coregrind/m_gdbserver/m_gdbserver.c \
285	coregrind/m_gdbserver/regcache.c \
286	coregrind/m_gdbserver/remote-utils.c \
287	coregrind/m_gdbserver/server.c \
288	coregrind/m_gdbserver/signals.c \
289	coregrind/m_gdbserver/target.c \
290	coregrind/m_gdbserver/utils.c \
291	coregrind/m_gdbserver/valgrind-low-amd64.c \
292	coregrind/m_gdbserver/valgrind-low-arm.c \
293	coregrind/m_gdbserver/valgrind-low-arm64.c \
294	coregrind/m_gdbserver/valgrind-low-ppc32.c \
295	coregrind/m_gdbserver/valgrind-low-ppc64.c \
296	coregrind/m_gdbserver/valgrind-low-s390x.c \
297	coregrind/m_gdbserver/valgrind-low-x86.c \
298	coregrind/m_gdbserver/version.c
299
300ifeq (arm64, $(TARGET_ARCH))
301  vg_local_src_files += android/aarch64/setjmp.S
302endif
303
304vg_local_ldflags := $(vex_ldflags)
305vg_local_cflags := $(common_cflags)
306
307include $(LOCAL_PATH)/Android.build_all.mk
308
309# Build libreplacemalloc_toolpreload-$(TARGET_ARCH)-linux.a
310vg_local_module := libreplacemalloc_toolpreload
311vg_local_target := STATIC_LIBRARY
312
313vg_local_src_files := \
314	coregrind/m_replacemalloc/vg_replace_malloc.c
315
316vg_local_ldflags := $(preload_ldflags)
317
318vg_local_cflags := $(common_cflags)
319
320include $(LOCAL_PATH)/Android.build_all.mk
321
322# Build vgpreload_core-$(TARGET_ARCH)-linux.so
323vg_local_module := vgpreload_core
324vg_local_target := SHARED_LIBRARY
325vg_local_module_class := SHARED_LIBRARIES
326
327vg_local_src_files := \
328	coregrind/vg_preloaded.c
329
330#LOCAL_STRIP_MODULE := false
331#vg_local_no_crt := true
332
333vg_local_ldflags := $(preload_ldflags)
334vg_local_cflags := $(common_cflags)
335
336vg_local_arch_cflags := $(target_arch_cflags)
337
338include $(LOCAL_PATH)/Android.build_all.mk
339
340# Build memcheck-$(TARGET_ARCH)-linux
341vg_local_module := memcheck
342vg_local_target := EXECUTABLE
343vg_local_module_class := SHARED_LIBRARIES
344vg_local_src_files := \
345	memcheck/mc_leakcheck.c \
346	memcheck/mc_malloc_wrappers.c \
347	memcheck/mc_main.c \
348	memcheck/mc_translate.c \
349	memcheck/mc_machine.c \
350	memcheck/mc_errors.c
351
352vg_local_cflags := $(common_cflags)
353vg_local_ldflags := $(tool_ldflags)
354vg_local_static_libraries := libcoregrind libvex
355
356vg_local_without_system_shared_libraries := true
357vg_local_no_crt := true
358
359include $(LOCAL_PATH)/Android.build_all.mk
360
361# Build vgpreload_memcheck-$(TARGET_ARCH)-linux.so
362vg_local_module := vgpreload_memcheck
363vg_local_module_class := SHARED_LIBRARIES
364vg_local_target := SHARED_LIBRARY
365
366vg_local_src_files := \
367	memcheck/mc_replace_strmem.c
368
369vg_local_ldflags := $(preload_ldflags)
370vg_local_cflags := $(common_cflags)
371
372vg_local_whole_static_libraries := libreplacemalloc_toolpreload
373
374include $(LOCAL_PATH)/Android.build_all.mk
375
376# Build cachegrind-$(TARGET_ARCH)-linux
377vg_local_module := cachegrind
378vg_local_module_class := SHARED_LIBRARIES
379vg_local_target := EXECUTABLE
380vg_local_no_crt := true
381vg_local_without_system_shared_libraries := true
382
383vg_local_src_files := \
384	cachegrind/cg_arch.c \
385	cachegrind/cg_main.c
386
387vg_local_ldflags := $(tool_ldflags)
388vg_local_cflags := $(common_cflags)
389
390vg_local_static_libraries := libcoregrind libvex
391
392include $(LOCAL_PATH)/Android.build_all.mk
393
394#LOCAL_FORCE_STATIC_EXECUTABLE := true
395
396# Build callgrind-$(TARGET_ARCH)-linux
397
398vg_local_module := callgrind
399vg_local_module_class := SHARED_LIBRARIES
400vg_local_target := EXECUTABLE
401vg_local_no_crt := true
402vg_local_without_system_shared_libraries := true
403
404vg_local_src_files := \
405	callgrind/bb.c \
406	callgrind/bbcc.c \
407	callgrind/callstack.c \
408	callgrind/clo.c \
409	callgrind/context.c \
410	callgrind/costs.c \
411	callgrind/debug.c \
412	callgrind/dump.c \
413	callgrind/events.c \
414	callgrind/fn.c \
415	callgrind/jumps.c \
416	callgrind/main.c \
417	callgrind/sim.c \
418	callgrind/threads.c
419
420vg_local_c_includes := external/valgrind/cachegrind
421vg_local_ldflags := $(tool_ldflags)
422vg_local_cflags := $(common_cflags)
423vg_local_static_libraries := libcoregrind libvex
424
425include $(LOCAL_PATH)/Android.build_all.mk
426
427#LOCAL_FORCE_STATIC_EXECUTABLE := true
428
429# Build helgrind-$(TARGET_ARCH)-linux
430vg_local_module := helgrind
431vg_local_module_class := SHARED_LIBRARIES
432vg_local_target := EXECUTABLE
433vg_local_no_crt := true
434vg_local_without_system_shared_libraries := true
435vg_local_src_files := \
436    helgrind/hg_addrdescr.c \
437    helgrind/hg_basics.c \
438    helgrind/hg_errors.c \
439    helgrind/hg_lock_n_thread.c \
440    helgrind/hg_main.c \
441    helgrind/hg_wordset.c \
442    helgrind/libhb_core.c
443
444vg_local_ldflags := $(tool_ldflags)
445vg_local_cflags := $(common_cflags)
446vg_local_static_libraries := libcoregrind libvex
447
448include $(LOCAL_PATH)/Android.build_all.mk
449
450#LOCAL_FORCE_STATIC_EXECUTABLE := true
451
452# Build vgpreload_helgrind-$(TARGET_ARCH)-linux.so
453vg_local_module := vgpreload_helgrind
454vg_local_module_class := SHARED_LIBRARIES
455vg_local_target := SHARED_LIBRARY
456#LOCAL_STRIP_MODULE := false
457vg_local_no_crt := true
458
459vg_local_src_files := \
460	helgrind/hg_intercepts.c
461
462
463vg_local_ldflags := $(preload_ldflags)
464vg_local_cflags := $(common_cflags)
465vg_local_whole_static_libraries := libreplacemalloc_toolpreload
466
467include $(LOCAL_PATH)/Android.build_all.mk
468
469# Build drd-$(TARGET_ARCH)-linux
470vg_local_module := drd
471vg_local_module_class := SHARED_LIBRARIES
472vg_local_target := EXECUTABLE
473#LOCAL_FORCE_STATIC_EXECUTABLE := true
474vg_local_no_crt := true
475vg_local_without_system_shared_libraries := true
476
477vg_local_src_files := \
478	drd/drd_barrier.c \
479	drd/drd_clientobj.c \
480	drd/drd_clientreq.c \
481	drd/drd_cond.c \
482	drd/drd_cond_initializer.c \
483	drd/drd_error.c \
484	drd/drd_hb.c \
485	drd/drd_load_store.c \
486	drd/drd_main.c \
487	drd/drd_malloc_wrappers.c \
488	drd/drd_mutex.c \
489	drd/drd_rwlock.c \
490	drd/drd_semaphore.c \
491	drd/drd_suppression.c
492
493vg_local_ldflags := $(tool_ldflags)
494vg_local_cflags := $(common_cflags)
495
496vg_local_static_libraries := libcoregrind libvex
497
498include $(LOCAL_PATH)/Android.build_all.mk
499
500# Build vgpreload_drd-$(TARGET_ARCH)-linux.so
501vg_local_module := vgpreload_drd
502vg_local_module_class := SHARED_LIBRARIES
503vg_local_target := SHARED_LIBRARY
504vg_local_no_crt := true
505
506vg_local_src_files := \
507	drd/drd_pthread_intercepts.c \
508	drd/drd_qtcore_intercepts.c \
509	drd/drd_strmem_intercepts.c
510
511vg_local_ldflags := $(preload_ldflags)
512vg_local_cflags := $(common_cflags)
513
514vg_local_whole_static_libraries := libreplacemalloc_toolpreload
515
516include $(LOCAL_PATH)/Android.build_all.mk
517
518# Build massif-$(TARGET_ARCH)-linux
519vg_local_module := massif
520vg_local_module_class := SHARED_LIBRARIES
521vg_local_target := EXECUTABLE
522vg_local_no_crt := true
523vg_local_without_system_shared_libraries := true
524
525vg_local_src_files := \
526	massif/ms_main.c
527
528vg_local_ldflags := $(tool_ldflags)
529vg_local_cflags := $(common_cflags)
530
531vg_local_static_libraries := libcoregrind libvex
532
533include $(LOCAL_PATH)/Android.build_all.mk
534
535# Build vgpreload_massif-$(TARGET_ARCH)-linux.so
536vg_local_module := vgpreload_massif
537vg_local_module_class := SHARED_LIBRARIES
538vg_local_target := SHARED_LIBRARY
539vg_local_no_crt := true
540
541vg_local_src_files :=
542
543vg_local_ldflags := $(preload_ldflags)
544vg_local_cflags := $(common_cflags)
545vg_local_whole_static_libraries := libreplacemalloc_toolpreload
546
547include $(LOCAL_PATH)/Android.build_all.mk
548
549# Build none-$(TARGET_ARCH)-linux
550vg_local_module := none
551vg_local_module_class := SHARED_LIBRARIES
552vg_local_target := EXECUTABLE
553
554vg_local_no_crt := true
555vg_local_without_system_shared_libraries := true
556
557vg_local_src_files := \
558	none/nl_main.c
559
560vg_local_ldflags := $(tool_ldflags)
561vg_local_cflags := $(common_cflags)
562vg_local_static_libraries := libcoregrind libvex
563
564include $(LOCAL_PATH)/Android.build_all.mk
565
566# Build valgrind
567include $(CLEAR_VARS)
568LOCAL_MODULE := valgrind
569LOCAL_ARM_MODE := arm
570LOCAL_SRC_FILES := \
571	coregrind/launcher-linux.c \
572	coregrind/m_debuglog.c
573
574LOCAL_C_INCLUDES := $(common_includes)
575LOCAL_CFLAGS := $(common_cflags)
576
577LOCAL_CFLAGS_$(TARGET_ARCH) = $(target_arch_cflags)
578
579include $(BUILD_EXECUTABLE)
580
581# Build valgrind for linux host
582ifeq ($(HOST_OS), linux)
583include $(CLEAR_VARS)
584LOCAL_MODULE := valgrind
585LOCAL_SRC_FILES := \
586	coregrind/launcher-linux.c \
587	coregrind/m_debuglog.c
588
589LOCAL_C_INCLUDES := $(common_includes)
590LOCAL_CFLAGS := $(common_cflags) $(host_arch_cflags)
591LOCAL_MULTILIB := 64
592
593include $(BUILD_HOST_EXECUTABLE)
594endif
595
596#vg_build_tests := true
597# Build tests (some of them)...
598# TODO: tests need separate build framework it terms of 2ND_ARCH
599ifeq ($(vg_build_tests),true)
600ifeq ($(TARGET_ARCH),arm)
601test := v6intThumb
602include $(LOCAL_PATH)/Android.test.mk
603test := vfp
604include $(LOCAL_PATH)/Android.test.mk
605endif
606
607ifeq ($(TARGET_ARCH),arm64)
608test := integer
609include $(LOCAL_PATH)/Android.test.mk
610test := fp_and_simd
611include $(LOCAL_PATH)/Android.test.mk
612test := memory
613include $(LOCAL_PATH)/Android.test.mk
614endif
615endif
616
617# Copy prebuilt suppressions
618include $(CLEAR_VARS)
619LOCAL_MODULE := default.supp
620LOCAL_MODULE_CLASS := ETC
621LOCAL_MODULE_PATH := $(PRODUCT_OUT)$(vg_target_module_path)
622LOCAL_SRC_FILES := bionic.supp
623
624include $(BUILD_PREBUILT)
625
626ifeq ($(HOST_OS), linux)
627include $(CLEAR_VARS)
628LOCAL_IS_HOST_MODULE := true
629LOCAL_MODULE := default.supp
630LOCAL_MODULE_CLASS := ETC
631LOCAL_MODULE_PATH := $(HOST_OUT_SHARED_LIBRARIES)/valgrind
632LOCAL_SRC_FILES := bionic.supp
633
634include $(BUILD_PREBUILT)
635endif
636
637endif
638