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_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 300vg_local_ldflags := $(vex_ldflags) 301vg_local_cflags := $(common_cflags) 302 303include $(LOCAL_PATH)/Android.build_all.mk 304 305# Build libreplacemalloc_toolpreload-$(TARGET_ARCH)-linux.a 306vg_local_module := libreplacemalloc_toolpreload 307vg_local_target := STATIC_LIBRARY 308 309vg_local_src_files := \ 310 coregrind/m_replacemalloc/vg_replace_malloc.c 311 312vg_local_ldflags := $(preload_ldflags) 313 314vg_local_cflags := $(common_cflags) 315 316include $(LOCAL_PATH)/Android.build_all.mk 317 318# Build vgpreload_core-$(TARGET_ARCH)-linux.so 319vg_local_module := vgpreload_core 320vg_local_target := SHARED_LIBRARY 321vg_local_module_class := SHARED_LIBRARIES 322 323vg_local_src_files := \ 324 coregrind/vg_preloaded.c 325 326#LOCAL_STRIP_MODULE := false 327#vg_local_no_crt := true 328 329vg_local_ldflags := $(preload_ldflags) 330vg_local_cflags := $(common_cflags) 331 332vg_local_arch_cflags := $(target_arch_cflags) 333 334include $(LOCAL_PATH)/Android.build_all.mk 335 336# Build memcheck-$(TARGET_ARCH)-linux 337vg_local_module := memcheck 338vg_local_target := EXECUTABLE 339vg_local_module_class := SHARED_LIBRARIES 340vg_local_src_files := \ 341 memcheck/mc_leakcheck.c \ 342 memcheck/mc_malloc_wrappers.c \ 343 memcheck/mc_main.c \ 344 memcheck/mc_translate.c \ 345 memcheck/mc_machine.c \ 346 memcheck/mc_errors.c 347 348vg_local_cflags := $(common_cflags) 349vg_local_ldflags := $(tool_ldflags) 350vg_local_static_libraries := libcoregrind libvex 351 352vg_local_without_system_shared_libraries := true 353vg_local_no_crt := true 354 355include $(LOCAL_PATH)/Android.build_all.mk 356 357# Build vgpreload_memcheck-$(TARGET_ARCH)-linux.so 358vg_local_module := vgpreload_memcheck 359vg_local_module_class := SHARED_LIBRARIES 360vg_local_target := SHARED_LIBRARY 361 362vg_local_src_files := \ 363 memcheck/mc_replace_strmem.c 364 365vg_local_ldflags := $(preload_ldflags) 366vg_local_cflags := $(common_cflags) 367 368vg_local_whole_static_libraries := libreplacemalloc_toolpreload 369 370include $(LOCAL_PATH)/Android.build_all.mk 371 372# Build cachegrind-$(TARGET_ARCH)-linux 373vg_local_module := cachegrind 374vg_local_module_class := SHARED_LIBRARIES 375vg_local_target := EXECUTABLE 376vg_local_no_crt := true 377vg_local_without_system_shared_libraries := true 378 379vg_local_src_files := \ 380 cachegrind/cg_arch.c \ 381 cachegrind/cg_main.c 382 383vg_local_ldflags := $(tool_ldflags) 384vg_local_cflags := $(common_cflags) 385 386vg_local_static_libraries := libcoregrind libvex 387 388include $(LOCAL_PATH)/Android.build_all.mk 389 390#LOCAL_FORCE_STATIC_EXECUTABLE := true 391 392# Build callgrind-$(TARGET_ARCH)-linux 393 394vg_local_module := callgrind 395vg_local_module_class := SHARED_LIBRARIES 396vg_local_target := EXECUTABLE 397vg_local_no_crt := true 398vg_local_without_system_shared_libraries := true 399 400vg_local_src_files := \ 401 callgrind/bb.c \ 402 callgrind/bbcc.c \ 403 callgrind/callstack.c \ 404 callgrind/clo.c \ 405 callgrind/context.c \ 406 callgrind/costs.c \ 407 callgrind/debug.c \ 408 callgrind/dump.c \ 409 callgrind/events.c \ 410 callgrind/fn.c \ 411 callgrind/jumps.c \ 412 callgrind/main.c \ 413 callgrind/sim.c \ 414 callgrind/threads.c 415 416vg_local_c_includes := external/valgrind/cachegrind 417vg_local_ldflags := $(tool_ldflags) 418vg_local_cflags := $(common_cflags) 419vg_local_static_libraries := libcoregrind libvex 420 421include $(LOCAL_PATH)/Android.build_all.mk 422 423#LOCAL_FORCE_STATIC_EXECUTABLE := true 424 425# Build helgrind-$(TARGET_ARCH)-linux 426vg_local_module := helgrind 427vg_local_module_class := SHARED_LIBRARIES 428vg_local_target := EXECUTABLE 429vg_local_no_crt := true 430vg_local_without_system_shared_libraries := true 431vg_local_src_files := \ 432 helgrind/hg_addrdescr.c \ 433 helgrind/hg_basics.c \ 434 helgrind/hg_errors.c \ 435 helgrind/hg_lock_n_thread.c \ 436 helgrind/hg_main.c \ 437 helgrind/hg_wordset.c \ 438 helgrind/libhb_core.c 439 440vg_local_ldflags := $(tool_ldflags) 441vg_local_cflags := $(common_cflags) 442vg_local_static_libraries := libcoregrind libvex 443 444include $(LOCAL_PATH)/Android.build_all.mk 445 446#LOCAL_FORCE_STATIC_EXECUTABLE := true 447 448# Build vgpreload_helgrind-$(TARGET_ARCH)-linux.so 449vg_local_module := vgpreload_helgrind 450vg_local_module_class := SHARED_LIBRARIES 451vg_local_target := SHARED_LIBRARY 452#LOCAL_STRIP_MODULE := false 453vg_local_no_crt := true 454 455vg_local_src_files := \ 456 helgrind/hg_intercepts.c 457 458 459vg_local_ldflags := $(preload_ldflags) 460vg_local_cflags := $(common_cflags) 461vg_local_whole_static_libraries := libreplacemalloc_toolpreload 462 463include $(LOCAL_PATH)/Android.build_all.mk 464 465# Build drd-$(TARGET_ARCH)-linux 466vg_local_module := drd 467vg_local_module_class := SHARED_LIBRARIES 468vg_local_target := EXECUTABLE 469#LOCAL_FORCE_STATIC_EXECUTABLE := true 470vg_local_no_crt := true 471vg_local_without_system_shared_libraries := true 472 473vg_local_src_files := \ 474 drd/drd_barrier.c \ 475 drd/drd_clientobj.c \ 476 drd/drd_clientreq.c \ 477 drd/drd_cond.c \ 478 drd/drd_cond_initializer.c \ 479 drd/drd_error.c \ 480 drd/drd_hb.c \ 481 drd/drd_load_store.c \ 482 drd/drd_main.c \ 483 drd/drd_malloc_wrappers.c \ 484 drd/drd_mutex.c \ 485 drd/drd_rwlock.c \ 486 drd/drd_semaphore.c \ 487 drd/drd_suppression.c 488 489vg_local_ldflags := $(tool_ldflags) 490vg_local_cflags := $(common_cflags) 491 492vg_local_static_libraries := libcoregrind libvex 493 494include $(LOCAL_PATH)/Android.build_all.mk 495 496# Build vgpreload_drd-$(TARGET_ARCH)-linux.so 497vg_local_module := vgpreload_drd 498vg_local_module_class := SHARED_LIBRARIES 499vg_local_target := SHARED_LIBRARY 500vg_local_no_crt := true 501 502vg_local_src_files := \ 503 drd/drd_pthread_intercepts.c \ 504 drd/drd_qtcore_intercepts.c \ 505 drd/drd_strmem_intercepts.c 506 507vg_local_ldflags := $(preload_ldflags) 508vg_local_cflags := $(common_cflags) 509 510vg_local_whole_static_libraries := libreplacemalloc_toolpreload 511 512include $(LOCAL_PATH)/Android.build_all.mk 513 514# Build massif-$(TARGET_ARCH)-linux 515vg_local_module := massif 516vg_local_module_class := SHARED_LIBRARIES 517vg_local_target := EXECUTABLE 518vg_local_no_crt := true 519vg_local_without_system_shared_libraries := true 520 521vg_local_src_files := \ 522 massif/ms_main.c 523 524vg_local_ldflags := $(tool_ldflags) 525vg_local_cflags := $(common_cflags) 526 527vg_local_static_libraries := libcoregrind libvex 528 529include $(LOCAL_PATH)/Android.build_all.mk 530 531# Build vgpreload_massif-$(TARGET_ARCH)-linux.so 532vg_local_module := vgpreload_massif 533vg_local_module_class := SHARED_LIBRARIES 534vg_local_target := SHARED_LIBRARY 535vg_local_no_crt := true 536 537vg_local_src_files := 538 539vg_local_ldflags := $(preload_ldflags) 540vg_local_cflags := $(common_cflags) 541vg_local_whole_static_libraries := libreplacemalloc_toolpreload 542 543include $(LOCAL_PATH)/Android.build_all.mk 544 545# Build none-$(TARGET_ARCH)-linux 546vg_local_module := none 547vg_local_module_class := SHARED_LIBRARIES 548vg_local_target := EXECUTABLE 549 550vg_local_no_crt := true 551vg_local_without_system_shared_libraries := true 552 553vg_local_src_files := \ 554 none/nl_main.c 555 556vg_local_ldflags := $(tool_ldflags) 557vg_local_cflags := $(common_cflags) 558vg_local_static_libraries := libcoregrind libvex 559 560include $(LOCAL_PATH)/Android.build_all.mk 561 562# Build valgrind 563include $(CLEAR_VARS) 564LOCAL_MODULE := valgrind 565LOCAL_ARM_MODE := arm 566LOCAL_SRC_FILES := \ 567 coregrind/launcher-linux.c \ 568 coregrind/m_debuglog.c 569 570LOCAL_C_INCLUDES := $(common_includes) 571LOCAL_CFLAGS := $(common_cflags) 572 573LOCAL_CFLAGS_$(TARGET_ARCH) = $(target_arch_cflags) 574 575include $(BUILD_EXECUTABLE) 576 577# Build valgrind for linux host 578ifeq ($(HOST_OS), linux) 579include $(CLEAR_VARS) 580LOCAL_MODULE := valgrind 581LOCAL_SRC_FILES := \ 582 coregrind/launcher-linux.c \ 583 coregrind/m_debuglog.c 584 585LOCAL_C_INCLUDES := $(common_includes) 586LOCAL_CFLAGS := $(common_cflags) $(host_arch_cflags) 587LOCAL_MULTILIB := 64 588 589include $(BUILD_HOST_EXECUTABLE) 590endif 591 592#vg_build_tests := true 593# Build tests (some of them)... 594# TODO: tests need separate build framework it terms of 2ND_ARCH 595ifeq ($(vg_build_tests),true) 596ifeq ($(TARGET_ARCH),arm) 597test := v6intThumb 598include $(LOCAL_PATH)/Android.test.mk 599test := vfp 600include $(LOCAL_PATH)/Android.test.mk 601endif 602 603ifeq ($(TARGET_ARCH),arm64) 604test := integer 605include $(LOCAL_PATH)/Android.test.mk 606test := fp_and_simd 607include $(LOCAL_PATH)/Android.test.mk 608test := memory 609include $(LOCAL_PATH)/Android.test.mk 610endif 611endif 612 613# Copy prebuilt suppressions 614include $(CLEAR_VARS) 615LOCAL_MODULE := default.supp 616LOCAL_MODULE_CLASS := SHARED_LIBRARIES 617LOCAL_MODULE_PATH := $(PRODUCT_OUT)$(vg_target_module_path) 618LOCAL_STRIP_MODULE := false 619LOCAL_SRC_FILES := bionic.supp 620 621include $(BUILD_PREBUILT) 622 623ifeq ($(HOST_OS), linux) 624include $(CLEAR_VARS) 625LOCAL_IS_HOST_MODULE := true 626LOCAL_MODULE := default.supp 627LOCAL_MODULE_CLASS := SHARED_LIBRARIES 628LOCAL_MODULE_PATH := $(HOST_OUT_SHARED_LIBRARIES)/valgrind 629LOCAL_STRIP_MODULE := false 630LOCAL_SRC_FILES := bionic.supp 631 632include $(BUILD_PREBUILT) 633endif 634 635endif 636