HOST_linux-x86_64.mk revision 6feb6d5607ce86a446645564212043964628f540
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
20HOST_IS_64_BIT := true
21
22ifeq ($(strip $(HOST_TOOLCHAIN_PREFIX)),)
23HOST_TOOLCHAIN_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/x86_64-linux-
24endif
25# Don't do anything if the toolchain is not there
26ifneq (,$(strip $(wildcard $(HOST_TOOLCHAIN_PREFIX)gcc)))
27HOST_CC  := $(HOST_TOOLCHAIN_PREFIX)gcc
28HOST_CXX := $(HOST_TOOLCHAIN_PREFIX)g++
29HOST_AR  := $(HOST_TOOLCHAIN_PREFIX)ar
30endif # $(HOST_TOOLCHAIN_PREFIX)gcc exists
31
32# gcc location for clang; to be updated when clang is updated
33HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/
34
35HOST_GLOBAL_CFLAGS += -m64 -Wa,--noexecstack
36HOST_GLOBAL_LDFLAGS += -m64 -Wl,-z,noexecstack
37
38ifneq ($(strip $(BUILD_HOST_static)),)
39# Statically-linked binaries are desirable for sandboxed environment
40HOST_GLOBAL_LDFLAGS += -static
41endif # BUILD_HOST_static
42
43# TODO: Add AndroidConfig.h for linux-x86_64
44HOST_GLOBAL_CFLAGS += -fPIC \
45  -no-canonical-prefixes \
46  -include $(call select-android-config-h,linux-x86)
47
48# Disable new longjmp in glibc 2.11 and later. See bug 2967937.
49HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
50
51# Workaround differences in inttypes.h between host and target.
52# See bug 12708004.
53HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
54
55HOST_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined
56