• 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
17ifeq ($(TARGET_ARCH),arm)
18	arch := arm
19else ifeq ($(TARGET_ARCH),x86)
20	arch := x86
21endif
22ifdef arch
23
24common_cflags := \
25	-Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wmissing-declarations \
26	-Wno-pointer-sign -Wno-sign-compare -Wno-unused-parameter -Wno-shadow \
27	-fno-strict-aliasing -fno-stack-protector \
28	-DVGA_$(arch)=1 \
29	-DVGO_linux=1 \
30	-DVGP_$(arch)_linux=1 \
31	-DVG_PLATFORM=\"$(arch)-linux\" \
32	-DVG_LIBDIR=\"/system/lib/valgrind\" \
33	-DANDROID_SYMBOLS_DIR=\"/data/local/symbols\"
34
35common_includes := \
36	external/valgrind/main \
37	external/valgrind/main/include \
38	external/valgrind/main/VEX/pub \
39	external/valgrind/main/coregrind
40
41vex_ldflags := -nodefaultlibs
42
43ifeq ($(TARGET_ARCH),arm)
44tool_ldflags := -static -Wl,--build-id=none,-Ttext=0x38000000 -nodefaultlibs -nostartfiles -u _start -e_start
45else
46tool_ldflags := -static -Wl,-Ttext=0x38000000 -nodefaultlibs -nostartfiles -u _start -e_start
47endif
48
49preload_ldflags := -nodefaultlibs -Wl,-z,interpose,-z,initfirst
50# Remove this when the all toolchains are GCC 4.4
51ifeq ($(TARGET_ARCH),arm)
52  preload_ldflags += -Wl,--icf=none
53endif
54
55# Build libvex-($arch)-linux.a
56include $(CLEAR_VARS)
57
58LOCAL_MODULE := libvex-$(arch)-linux
59LOCAL_MODULE_TAGS := optional
60LOCAL_ARM_MODE := arm
61
62LOCAL_SRC_FILES := \
63	VEX/priv/main_globals.c \
64	VEX/priv/main_main.c \
65	VEX/priv/main_util.c \
66	VEX/priv/ir_defs.c \
67	VEX/priv/ir_match.c \
68	VEX/priv/ir_opt.c \
69	VEX/priv/guest_generic_bb_to_IR.c \
70	VEX/priv/guest_generic_x87.c \
71	VEX/priv/guest_x86_helpers.c \
72	VEX/priv/guest_x86_toIR.c \
73	VEX/priv/guest_amd64_helpers.c \
74	VEX/priv/guest_amd64_toIR.c \
75	VEX/priv/guest_ppc_helpers.c \
76	VEX/priv/guest_ppc_toIR.c \
77	VEX/priv/guest_arm_helpers.c \
78	VEX/priv/guest_arm_toIR.c \
79	VEX/priv/host_generic_regs.c \
80	VEX/priv/host_generic_simd64.c \
81	VEX/priv/host_generic_simd128.c \
82	VEX/priv/host_generic_reg_alloc2.c \
83	VEX/priv/host_x86_defs.c \
84	VEX/priv/host_x86_isel.c \
85	VEX/priv/host_amd64_defs.c \
86	VEX/priv/host_amd64_isel.c \
87	VEX/priv/host_ppc_defs.c \
88	VEX/priv/host_ppc_isel.c \
89	VEX/priv/host_arm_defs.c \
90	VEX/priv/host_arm_isel.c
91
92LOCAL_C_INCLUDES := $(common_includes)
93
94LOCAL_CFLAGS := $(common_cflags) \
95	-Wbad-function-cast \
96	-Wcast-qual \
97	-Wcast-align \
98	-fstrict-aliasing
99
100include $(BUILD_STATIC_LIBRARY)
101
102# Build libcoregrind-$(arch)-linux.a
103include $(CLEAR_VARS)
104
105LOCAL_MODULE := libcoregrind-$(arch)-linux
106LOCAL_MODULE_TAGS := optional
107LOCAL_ARM_MODE := arm
108
109LOCAL_SRC_FILES := \
110	coregrind/m_commandline.c \
111	coregrind/m_clientstate.c \
112	coregrind/m_cpuid.S \
113	coregrind/m_debugger.c \
114	coregrind/m_debuglog.c \
115	coregrind/m_errormgr.c \
116	coregrind/m_execontext.c \
117	coregrind/m_hashtable.c \
118	coregrind/m_libcbase.c \
119	coregrind/m_libcassert.c \
120	coregrind/m_libcfile.c \
121	coregrind/m_libcprint.c \
122	coregrind/m_libcproc.c \
123	coregrind/m_libcsignal.c \
124	coregrind/m_machine.c \
125	coregrind/m_main.c \
126	coregrind/m_mallocfree.c \
127	coregrind/m_options.c \
128	coregrind/m_oset.c \
129	coregrind/m_redir.c \
130	coregrind/m_seqmatch.c \
131	coregrind/m_signals.c \
132	coregrind/m_sparsewa.c \
133	coregrind/m_stacks.c \
134	coregrind/m_stacktrace.c \
135	coregrind/m_syscall.c \
136	coregrind/m_threadstate.c \
137	coregrind/m_tooliface.c \
138	coregrind/m_trampoline.S \
139	coregrind/m_translate.c \
140	coregrind/m_transtab.c \
141	coregrind/m_vki.c \
142	coregrind/m_vkiscnums.c \
143	coregrind/m_wordfm.c \
144	coregrind/m_xarray.c \
145	coregrind/m_aspacehl.c \
146	coregrind/m_aspacemgr/aspacemgr-common.c \
147	coregrind/m_aspacemgr/aspacemgr-linux.c \
148	coregrind/m_aspacemgr/aspacemgr-aix5.c \
149	coregrind/m_coredump/coredump-elf.c \
150	coregrind/m_coredump/coredump-macho.c \
151	coregrind/m_coredump/coredump-xcoff.c \
152	coregrind/m_debuginfo/misc.c \
153	coregrind/m_debuginfo/d3basics.c \
154	coregrind/m_debuginfo/debuginfo.c \
155	coregrind/m_debuginfo/readdwarf.c \
156	coregrind/m_debuginfo/readdwarf3.c \
157	coregrind/m_debuginfo/readelf.c \
158	coregrind/m_debuginfo/readmacho.c \
159	coregrind/m_debuginfo/readpdb.c \
160	coregrind/m_debuginfo/readstabs.c \
161	coregrind/m_debuginfo/readxcoff.c \
162	coregrind/m_debuginfo/storage.c \
163	coregrind/m_debuginfo/tytypes.c \
164	coregrind/m_demangle/cp-demangle.c \
165	coregrind/m_demangle/cplus-dem.c \
166	coregrind/m_demangle/demangle.c \
167	coregrind/m_demangle/dyn-string.c \
168	coregrind/m_demangle/safe-ctype.c \
169	coregrind/m_dispatch/dispatch-x86-linux.S \
170	coregrind/m_dispatch/dispatch-amd64-linux.S \
171	coregrind/m_dispatch/dispatch-ppc32-linux.S \
172	coregrind/m_dispatch/dispatch-ppc64-linux.S \
173	coregrind/m_dispatch/dispatch-arm-linux.S \
174	coregrind/m_dispatch/dispatch-ppc32-aix5.S \
175	coregrind/m_dispatch/dispatch-ppc64-aix5.S \
176	coregrind/m_dispatch/dispatch-x86-darwin.S \
177	coregrind/m_dispatch/dispatch-amd64-darwin.S \
178	coregrind/m_initimg/initimg-linux.c \
179	coregrind/m_initimg/initimg-aix5.c \
180	coregrind/m_initimg/initimg-darwin.c \
181	coregrind/m_initimg/initimg-pathscan.c \
182	coregrind/m_mach/mach_basics.c \
183	coregrind/m_mach/mach_msg.c \
184	coregrind/m_mach/mach_traps-x86-darwin.S \
185	coregrind/m_mach/mach_traps-amd64-darwin.S \
186	coregrind/m_replacemalloc/replacemalloc_core.c \
187	coregrind/m_scheduler/scheduler.c \
188	coregrind/m_scheduler/sema.c \
189	coregrind/m_sigframe/sigframe-x86-linux.c \
190	coregrind/m_sigframe/sigframe-amd64-linux.c \
191	coregrind/m_sigframe/sigframe-ppc32-linux.c \
192	coregrind/m_sigframe/sigframe-ppc64-linux.c \
193	coregrind/m_sigframe/sigframe-arm-linux.c \
194	coregrind/m_sigframe/sigframe-ppc32-aix5.c \
195	coregrind/m_sigframe/sigframe-ppc64-aix5.c \
196	coregrind/m_sigframe/sigframe-x86-darwin.c \
197	coregrind/m_sigframe/sigframe-amd64-darwin.c \
198	coregrind/m_syswrap/syscall-x86-linux.S \
199	coregrind/m_syswrap/syscall-amd64-linux.S \
200	coregrind/m_syswrap/syscall-ppc32-linux.S \
201	coregrind/m_syswrap/syscall-ppc64-linux.S \
202	coregrind/m_syswrap/syscall-arm-linux.S \
203	coregrind/m_syswrap/syscall-ppc32-aix5.S \
204	coregrind/m_syswrap/syscall-ppc64-aix5.S \
205	coregrind/m_syswrap/syscall-x86-darwin.S \
206	coregrind/m_syswrap/syscall-amd64-darwin.S \
207	coregrind/m_syswrap/syswrap-main.c \
208	coregrind/m_syswrap/syswrap-generic.c \
209	coregrind/m_syswrap/syswrap-linux.c \
210	coregrind/m_syswrap/syswrap-linux-variants.c \
211	coregrind/m_syswrap/syswrap-aix5.c \
212	coregrind/m_syswrap/syswrap-darwin.c \
213	coregrind/m_syswrap/syswrap-x86-linux.c \
214	coregrind/m_syswrap/syswrap-amd64-linux.c \
215	coregrind/m_syswrap/syswrap-ppc32-linux.c \
216	coregrind/m_syswrap/syswrap-ppc64-linux.c \
217	coregrind/m_syswrap/syswrap-arm-linux.c \
218	coregrind/m_syswrap/syswrap-ppc32-aix5.c \
219	coregrind/m_syswrap/syswrap-ppc64-aix5.c \
220	coregrind/m_syswrap/syswrap-x86-darwin.c \
221	coregrind/m_syswrap/syswrap-amd64-darwin.c \
222	coregrind/m_ume/elf.c \
223	coregrind/m_ume/macho.c \
224	coregrind/m_ume/main.c \
225	coregrind/m_ume/script.c
226
227LOCAL_C_INCLUDES := $(common_includes)
228
229LOCAL_LDFLAGS := $(vex_ldflags)
230
231LOCAL_CFLAGS := $(common_cflags)
232
233include $(BUILD_STATIC_LIBRARY)
234
235# Build libreplacemalloc_toolpreload-$(arch)-linux.a
236include $(CLEAR_VARS)
237
238LOCAL_MODULE := libreplacemalloc_toolpreload-$(arch)-linux
239LOCAL_MODULE_TAGS := optional
240LOCAL_ARM_MODE := arm
241
242LOCAL_SRC_FILES := \
243	coregrind/m_replacemalloc/vg_replace_malloc.c
244
245LOCAL_C_INCLUDES := $(common_includes)
246
247LOCAL_LDFLAGS := $(preload_ldflags)
248
249LOCAL_CFLAGS := $(common_cflags)
250
251include $(BUILD_STATIC_LIBRARY)
252
253# Build vgpreload_core-$(arch)-linux.so
254include $(CLEAR_VARS)
255
256LOCAL_MODULE := vgpreload_core-$(arch)-linux
257LOCAL_MODULE_TAGS := optional
258LOCAL_MODULE_CLASS := SHARED_LIBRARIES
259LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/valgrind
260LOCAL_ARM_MODE := arm
261LOCAL_STRIP_MODULE := false
262LOCAL_NO_CRT := true
263LOCAL_PRELINK_MODULE := false
264
265LOCAL_SRC_FILES := \
266	coregrind/vg_preloaded.c
267
268LOCAL_C_INCLUDES := $(common_includes)
269
270LOCAL_LDFLAGS := $(preload_ldflags)
271
272LOCAL_CFLAGS := $(common_cflags)
273
274include $(BUILD_SHARED_LIBRARY)
275
276# Build memcheck-$(arch)-linux
277include $(CLEAR_VARS)
278
279LOCAL_MODULE := memcheck-$(arch)-linux
280LOCAL_MODULE_TAGS := optional
281LOCAL_MODULE_CLASS := SHARED_LIBRARIES
282LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/valgrind
283LOCAL_ARM_MODE := arm
284LOCAL_FORCE_STATIC_EXECUTABLE := true
285LOCAL_NO_CRT := true
286LOCAL_SYSTEM_SHARED_LIBRARIES :=
287
288LOCAL_SRC_FILES := \
289	memcheck/mc_leakcheck.c \
290	memcheck/mc_malloc_wrappers.c \
291	memcheck/mc_main.c \
292	memcheck/mc_translate.c \
293	memcheck/mc_machine.c \
294	memcheck/mc_errors.c
295
296LOCAL_C_INCLUDES := $(common_includes)
297
298LOCAL_LDFLAGS := $(tool_ldflags)
299
300LOCAL_CFLAGS := $(common_cflags)
301
302LOCAL_STATIC_LIBRARIES := libcoregrind-$(arch)-linux libvex-$(arch)-linux
303
304include $(BUILD_EXECUTABLE)
305
306# Build vgpreload_memcheck-$(arch)-linux.so
307include $(CLEAR_VARS)
308
309LOCAL_MODULE := vgpreload_memcheck-$(arch)-linux
310LOCAL_MODULE_TAGS := optional
311LOCAL_MODULE_CLASS := SHARED_LIBRARIES
312LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/valgrind
313LOCAL_ARM_MODE := arm
314LOCAL_STRIP_MODULE := false
315LOCAL_NO_CRT := true
316LOCAL_PRELINK_MODULE := false
317
318LOCAL_SRC_FILES := \
319	memcheck/mc_replace_strmem.c
320
321LOCAL_C_INCLUDES := $(common_includes)
322
323LOCAL_LDFLAGS := $(preload_ldflags)
324
325LOCAL_CFLAGS := $(common_cflags)
326
327LOCAL_WHOLE_STATIC_LIBRARIES := libreplacemalloc_toolpreload-$(arch)-linux
328
329include $(BUILD_SHARED_LIBRARY)
330
331# Build cachegrind-$(arch)-linux
332include $(CLEAR_VARS)
333
334LOCAL_MODULE := cachegrind-$(arch)-linux
335LOCAL_MODULE_TAGS := optional
336LOCAL_MODULE_CLASS := SHARED_LIBRARIES
337LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/valgrind
338LOCAL_ARM_MODE := arm
339LOCAL_FORCE_STATIC_EXECUTABLE := true
340LOCAL_NO_CRT := true
341LOCAL_SYSTEM_SHARED_LIBRARIES :=
342
343LOCAL_SRC_FILES := \
344	cachegrind/cg_main.c \
345	cachegrind/cg-x86-amd64.c \
346	cachegrind/cg-ppc32.c \
347	cachegrind/cg-ppc64.c \
348	cachegrind/cg-arm.c
349
350LOCAL_C_INCLUDES := $(common_includes)
351
352LOCAL_LDFLAGS := $(tool_ldflags)
353
354LOCAL_CFLAGS := $(common_cflags)
355
356LOCAL_STATIC_LIBRARIES := libcoregrind-$(arch)-linux libvex-$(arch)-linux
357
358include $(BUILD_EXECUTABLE)
359
360# Build callgrind-$(arch)-linux
361include $(CLEAR_VARS)
362
363LOCAL_MODULE := callgrind-$(arch)-linux
364LOCAL_MODULE_TAGS := optional
365LOCAL_MODULE_CLASS := SHARED_LIBRARIES
366LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/valgrind
367LOCAL_ARM_MODE := arm
368LOCAL_FORCE_STATIC_EXECUTABLE := true
369LOCAL_NO_CRT := true
370LOCAL_SYSTEM_SHARED_LIBRARIES :=
371
372LOCAL_SRC_FILES := \
373	callgrind/bb.c \
374	callgrind/bbcc.c \
375	callgrind/callstack.c \
376	callgrind/clo.c \
377	callgrind/command.c \
378	callgrind/context.c \
379	callgrind/costs.c \
380	callgrind/debug.c \
381	callgrind/dump.c \
382	callgrind/events.c \
383	callgrind/fn.c \
384	callgrind/jumps.c \
385	callgrind/main.c \
386	callgrind/sim.c \
387	callgrind/threads.c \
388	cachegrind/cg-x86-amd64.c \
389	cachegrind/cg-ppc32.c \
390	cachegrind/cg-ppc64.c \
391	cachegrind/cg-arm.c
392
393LOCAL_C_INCLUDES := $(common_includes) \
394	external/valgrind/main/cachegrind
395
396LOCAL_LDFLAGS := $(tool_ldflags)
397
398LOCAL_CFLAGS := $(common_cflags)
399
400LOCAL_STATIC_LIBRARIES := libcoregrind-$(arch)-linux libvex-$(arch)-linux
401
402include $(BUILD_EXECUTABLE)
403
404# Build helgrind-$(arch)-linux
405include $(CLEAR_VARS)
406
407LOCAL_MODULE := helgrind-$(arch)-linux
408LOCAL_MODULE_TAGS := optional
409LOCAL_MODULE_CLASS := SHARED_LIBRARIES
410LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/valgrind
411LOCAL_ARM_MODE := arm
412LOCAL_FORCE_STATIC_EXECUTABLE := true
413LOCAL_NO_CRT := true
414LOCAL_SYSTEM_SHARED_LIBRARIES :=
415
416LOCAL_SRC_FILES := \
417	helgrind/hg_basics.c \
418	helgrind/hg_errors.c \
419	helgrind/hg_lock_n_thread.c \
420	helgrind/hg_main.c \
421	helgrind/hg_wordset.c \
422	helgrind/libhb_core.c
423
424LOCAL_C_INCLUDES := $(common_includes)
425
426LOCAL_LDFLAGS := $(tool_ldflags)
427
428LOCAL_CFLAGS := $(common_cflags)
429
430LOCAL_STATIC_LIBRARIES := libcoregrind-$(arch)-linux libvex-$(arch)-linux
431
432include $(BUILD_EXECUTABLE)
433
434# Build vgpreload_helgrind-$(arch)-linux.so
435include $(CLEAR_VARS)
436
437LOCAL_MODULE := vgpreload_helgrind-$(arch)-linux
438LOCAL_MODULE_TAGS := optional
439LOCAL_MODULE_CLASS := SHARED_LIBRARIES
440LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/valgrind
441LOCAL_ARM_MODE := arm
442LOCAL_STRIP_MODULE := false
443LOCAL_NO_CRT := true
444LOCAL_PRELINK_MODULE := false
445
446LOCAL_SRC_FILES := \
447	helgrind/hg_intercepts.c
448
449LOCAL_C_INCLUDES := $(common_includes)
450
451LOCAL_LDFLAGS := $(preload_ldflags)
452
453LOCAL_CFLAGS := $(common_cflags)
454
455LOCAL_WHOLE_STATIC_LIBRARIES := libreplacemalloc_toolpreload-$(arch)-linux
456
457include $(BUILD_SHARED_LIBRARY)
458
459# Build drd-$(arch)-linux
460include $(CLEAR_VARS)
461
462LOCAL_MODULE := drd-$(arch)-linux
463LOCAL_MODULE_TAGS := optional
464LOCAL_MODULE_CLASS := SHARED_LIBRARIES
465LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/valgrind
466LOCAL_ARM_MODE := arm
467LOCAL_FORCE_STATIC_EXECUTABLE := true
468LOCAL_NO_CRT := true
469LOCAL_SYSTEM_SHARED_LIBRARIES :=
470
471LOCAL_SRC_FILES := \
472	drd/drd_barrier.c \
473	drd/drd_bitmap2_node.c \
474	drd/drd_clientobj.c \
475	drd/drd_clientreq.c \
476	drd/drd_cond.c \
477	drd/drd_cond_initializer.c \
478	drd/drd_error.c \
479	drd/drd_hb.c \
480	drd/drd_load_store.c \
481	drd/drd_main.c \
482	drd/drd_malloc_wrappers.c \
483	drd/drd_mutex.c \
484	drd/drd_rwlock.c \
485	drd/drd_semaphore.c \
486	drd/drd_suppression.c
487
488LOCAL_C_INCLUDES := $(common_includes)
489
490LOCAL_LDFLAGS := $(tool_ldflags)
491
492LOCAL_CFLAGS := $(common_cflags)
493
494LOCAL_STATIC_LIBRARIES := libcoregrind-$(arch)-linux libvex-$(arch)-linux
495
496include $(BUILD_EXECUTABLE)
497
498# Build vgpreload_drd-$(arch)-linux.so
499include $(CLEAR_VARS)
500
501LOCAL_MODULE := vgpreload_drd-$(arch)-linux
502LOCAL_MODULE_TAGS := optional
503LOCAL_MODULE_CLASS := SHARED_LIBRARIES
504LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/valgrind
505LOCAL_ARM_MODE := arm
506LOCAL_STRIP_MODULE := false
507LOCAL_NO_CRT := true
508LOCAL_PRELINK_MODULE := false
509
510LOCAL_SRC_FILES := \
511	drd/drd_pthread_intercepts.c \
512	drd/drd_qtcore_intercepts.c \
513	drd/drd_strmem_intercepts.c
514
515LOCAL_C_INCLUDES := $(common_includes)
516
517LOCAL_LDFLAGS := $(preload_ldflags)
518
519LOCAL_CFLAGS := $(common_cflags)
520
521LOCAL_WHOLE_STATIC_LIBRARIES := libreplacemalloc_toolpreload-$(arch)-linux
522
523include $(BUILD_SHARED_LIBRARY)
524
525# Build massif-$(arch)-linux
526include $(CLEAR_VARS)
527
528LOCAL_MODULE := massif-$(arch)-linux
529LOCAL_MODULE_TAGS := optional
530LOCAL_MODULE_CLASS := SHARED_LIBRARIES
531LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/valgrind
532LOCAL_ARM_MODE := arm
533LOCAL_FORCE_STATIC_EXECUTABLE := true
534LOCAL_NO_CRT := true
535LOCAL_SYSTEM_SHARED_LIBRARIES :=
536
537LOCAL_SRC_FILES := \
538	massif/ms_main.c
539
540LOCAL_C_INCLUDES := $(common_includes)
541
542LOCAL_LDFLAGS := $(tool_ldflags)
543
544LOCAL_CFLAGS := $(common_cflags)
545
546LOCAL_STATIC_LIBRARIES := libcoregrind-$(arch)-linux libvex-$(arch)-linux
547
548include $(BUILD_EXECUTABLE)
549
550# Build vgpreload_massif-$(arch)-linux.so
551include $(CLEAR_VARS)
552
553LOCAL_MODULE := vgpreload_massif-$(arch)-linux
554LOCAL_MODULE_TAGS := optional
555LOCAL_MODULE_CLASS := SHARED_LIBRARIES
556LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/valgrind
557LOCAL_ARM_MODE := arm
558LOCAL_STRIP_MODULE := false
559LOCAL_NO_CRT := true
560LOCAL_PRELINK_MODULE := false
561
562LOCAL_SRC_FILES :=
563
564LOCAL_C_INCLUDES := $(common_includes)
565
566LOCAL_LDFLAGS := $(preload_ldflags)
567
568LOCAL_CFLAGS := $(common_cflags)
569
570LOCAL_WHOLE_STATIC_LIBRARIES := libreplacemalloc_toolpreload-$(arch)-linux
571
572include $(BUILD_SHARED_LIBRARY)
573
574# Build none-$(arch)-linux
575include $(CLEAR_VARS)
576
577LOCAL_MODULE := none-$(arch)-linux
578LOCAL_MODULE_TAGS := optional
579LOCAL_MODULE_CLASS := SHARED_LIBRARIES
580LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/valgrind
581LOCAL_ARM_MODE := arm
582LOCAL_FORCE_STATIC_EXECUTABLE := true
583LOCAL_NO_CRT := true
584LOCAL_SYSTEM_SHARED_LIBRARIES :=
585
586LOCAL_SRC_FILES := \
587	none/nl_main.c
588
589LOCAL_C_INCLUDES := $(common_includes)
590
591LOCAL_LDFLAGS := $(tool_ldflags)
592
593LOCAL_CFLAGS := $(common_cflags)
594
595LOCAL_STATIC_LIBRARIES := libcoregrind-$(arch)-linux libvex-$(arch)-linux
596
597include $(BUILD_EXECUTABLE)
598
599# Build valgrind
600include $(CLEAR_VARS)
601
602LOCAL_MODULE := valgrind
603LOCAL_MODULE_TAGS := optional
604LOCAL_ARM_MODE := arm
605
606LOCAL_SRC_FILES := \
607	coregrind/launcher-linux.c \
608	coregrind/m_debuglog.c
609
610LOCAL_C_INCLUDES := $(common_includes)
611
612LOCAL_CFLAGS := $(common_cflags)
613
614include $(BUILD_EXECUTABLE)
615
616# Copy prebuilt suppressions
617include $(CLEAR_VARS)
618
619LOCAL_MODULE := default.supp
620LOCAL_MODULE_TAGS := optional
621LOCAL_MODULE_CLASS := SHARED_LIBRARIES
622LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/valgrind
623LOCAL_SRC_FILES := bionic.supp
624
625include $(BUILD_PREBUILT)
626
627endif
628