blob: adf3fdc30dd43dc1d28790379042d68d7cec37a3 [file] [log] [blame]
Dmitriy Ivanov82fb91c2014-12-05 14:37:56 -08001# Copyright (C) 2014 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
15include $(CLEAR_VARS)
16
17ifeq ($(vg_build_second_arch),true)
18 LOCAL_MULTILIB := 32
19 vg_local_arch := x86
20else
21 LOCAL_MULTILIB := first
22 vg_local_arch := amd64
23endif
24
25# TODO: This workaround is to avoid calling memset from VG(memset)
26# wrapper because of invalid clang optimization; This seems to be
27# limited to amd64/x86 codegen(?);
28LOCAL_CLANG := false
29
30LOCAL_MODULE := $(vg_local_module)-$(vg_local_arch)-linux
31
32LOCAL_SRC_FILES := $(vg_local_src_files)
33
34LOCAL_C_INCLUDES := $(common_includes) $(vg_local_c_includes)
35
36LOCAL_CFLAGS := $(vg_local_cflags) $(vg_local_host_arch_cflags)
37
38LOCAL_ASFLAGS := $(common_cflags) $(vg_local_host_arch_cflags)
39
40LOCAL_LDFLAGS := $(vg_local_ldflags) -lpthread
41
42LOCAL_MODULE_CLASS := $(vg_local_module_class)
43
44LOCAL_STATIC_LIBRARIES := \
45 $(foreach l,$(vg_local_static_libraries),$l-$(vg_local_arch)-linux)
46LOCAL_WHOLE_STATIC_LIBRARIES := \
47 $(foreach l,$(vg_local_whole_static_libraries),$l-$(vg_local_arch)-linux)
48
49ifeq ($(vg_local_target),EXECUTABLE)
50 LOCAL_FORCE_STATIC_EXECUTABLE := true
51 LOCAL_NO_FPIE := true
52endif
53
54ifneq ($(vg_local_target),STATIC_LIBRARY)
55 LOCAL_MODULE_PATH=$(HOST_OUT)/lib64/valgrind
56endif
57
58ifeq ($(vg_local_without_system_shared_libraries),true)
59 LOCAL_SYSTEM_SHARED_LIBRARIES :=
60 # for host 32 bit we need -static-libgcc
61 LOCAL_LDFLAGS += -lgcc
62endif
63
64ifeq ($(vg_local_no_crt),true)
65 LOCAL_NO_CRT := true
66endif
67
68LOCAL_CXX_STL := none
69LOCAL_ADDRESS_SANITIZER := false
70
71include $(BUILD_HOST_$(vg_local_target))