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