HOST_linux-x86_64.mk revision da9c00da5f7b2c6985f99bf922e4b3148d2f8f37
1#
2# Copyright (C) 2006 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17# Configuration for builds hosted on linux-x86_64.
18# Included by combo/select.mk
19
20ifeq ($(strip $(HOST_TOOLCHAIN_PREFIX)),)
21HOST_TOOLCHAIN_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/bin/x86_64-linux-
22endif
23HOST_CC  := $(HOST_TOOLCHAIN_PREFIX)gcc
24HOST_CXX := $(HOST_TOOLCHAIN_PREFIX)g++
25HOST_AR  := $(HOST_TOOLCHAIN_PREFIX)ar
26HOST_READELF  := $(HOST_TOOLCHAIN_PREFIX)readelf
27HOST_NM  := $(HOST_TOOLCHAIN_PREFIX)nm
28
29define $(combo_var_prefix)transform-shared-lib-to-toc
30$(call _gen_toc_command_for_elf,$(1),$(2))
31endef
32
33# gcc location for clang; to be updated when clang is updated
34HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8
35
36HOST_GLOBAL_CFLAGS += -m64 -Wa,--noexecstack
37HOST_GLOBAL_LDFLAGS += -m64 -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--no-undefined-version
38
39ifneq ($(strip $(BUILD_HOST_static)),)
40# Statically-linked binaries are desirable for sandboxed environment
41HOST_GLOBAL_LDFLAGS += -static
42endif # BUILD_HOST_static
43
44HOST_GLOBAL_CFLAGS += -fPIC \
45  -no-canonical-prefixes \
46
47HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector
48
49# Workaround differences in inttypes.h between host and target.
50# See bug 12708004.
51HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
52
53HOST_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined
54