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