blob: e268e41eb38186d252862cd0525e6716cf0e6ceb [file] [log] [blame]
Ying Wang6feb6d52014-04-17 10:03:35 -07001#
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
Ying Wang6feb6d52014-04-17 10:03:35 -070020ifeq ($(strip $(HOST_TOOLCHAIN_PREFIX)),)
Chih-Hung Hsieh3be11c62014-11-05 10:45:11 -080021HOST_TOOLCHAIN_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/bin/x86_64-linux-
Ying Wang6feb6d52014-04-17 10:03:35 -070022endif
Ying Wang6feb6d52014-04-17 10:03:35 -070023HOST_CC := $(HOST_TOOLCHAIN_PREFIX)gcc
24HOST_CXX := $(HOST_TOOLCHAIN_PREFIX)g++
25HOST_AR := $(HOST_TOOLCHAIN_PREFIX)ar
Ying Wang6feb6d52014-04-17 10:03:35 -070026
27# gcc location for clang; to be updated when clang is updated
Chih-Hung Hsieh3be11c62014-11-05 10:45:11 -080028HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/
Ying Wang6feb6d52014-04-17 10:03:35 -070029
30HOST_GLOBAL_CFLAGS += -m64 -Wa,--noexecstack
Nick Kralevich100acd12015-04-24 21:26:08 -070031HOST_GLOBAL_LDFLAGS += -m64 -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now
Ying Wang6feb6d52014-04-17 10:03:35 -070032
33ifneq ($(strip $(BUILD_HOST_static)),)
34# Statically-linked binaries are desirable for sandboxed environment
35HOST_GLOBAL_LDFLAGS += -static
36endif # BUILD_HOST_static
37
38# TODO: Add AndroidConfig.h for linux-x86_64
39HOST_GLOBAL_CFLAGS += -fPIC \
40 -no-canonical-prefixes \
41 -include $(call select-android-config-h,linux-x86)
42
Nick Kralevich100acd12015-04-24 21:26:08 -070043# TODO: Set _FORTIFY_SOURCE=2. Bug 20558757.
44HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -fstack-protector
Ying Wang6feb6d52014-04-17 10:03:35 -070045
46# Workaround differences in inttypes.h between host and target.
47# See bug 12708004.
48HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
49
50HOST_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined