blob: 8cfdaf5ed0023130a64cc109b62d40f0563a9812 [file] [log] [blame]
Jean-Baptiste Queru9b4a8122010-02-23 12:36:56 -08001#
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.
18# Included by combo/select.mk
19
Ying Wang6feb6d52014-04-17 10:03:35 -070020ifeq ($(strip $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)),)
Chih-Hung Hsieh3be11c62014-11-05 10:45:11 -080021$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/bin/x86_64-linux-
Ying Wang79e3f772013-02-12 11:48:37 -080022endif
Ying Wang6feb6d52014-04-17 10:03:35 -070023$(combo_2nd_arch_prefix)HOST_CC := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)gcc
24$(combo_2nd_arch_prefix)HOST_CXX := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)g++
25$(combo_2nd_arch_prefix)HOST_AR := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)ar
David 'Digit' Turner0960ca72010-12-10 22:24:06 +010026
Ying Wang6feb6d52014-04-17 10:03:35 -070027# gcc location for clang; to be updated when clang is updated
Chih-Hung Hsieh3be11c62014-11-05 10:45:11 -080028$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/
Ying Wang6feb6d52014-04-17 10:03:35 -070029
Ian Rogers35a6b4f2013-02-26 15:10:22 -080030# We expect SSE3 floating point math.
Alexander Ivchenkoae2d47a2014-09-16 16:30:41 +040031$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -msse3 -mfpmath=sse -m32 -Wa,--noexecstack -march=prescott
Nick Kralevich100acd12015-04-24 21:26:08 -070032$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -m32 -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now
Jean-Baptiste Queru9b4a8122010-02-23 12:36:56 -080033
Andrew Hsiehf9613a42012-04-28 00:35:19 +080034ifneq ($(strip $(BUILD_HOST_static)),)
35# Statically-linked binaries are desirable for sandboxed environment
Ying Wang6feb6d52014-04-17 10:03:35 -070036$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -static
Andrew Hsiehf9613a42012-04-28 00:35:19 +080037endif # BUILD_HOST_static
38
Ying Wang6feb6d52014-04-17 10:03:35 -070039$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -fPIC \
Andrew Hsieh48f239c2014-05-09 14:13:13 +080040 -no-canonical-prefixes \
41 -include $(call select-android-config-h,linux-x86)
Jean-Baptiste Queru9b4a8122010-02-23 12:36:56 -080042
Elliott Hughes7dd8ec12015-05-13 20:15:19 +000043$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector
Ying Wangfb644882010-09-01 16:39:11 -070044
Ian Rogers61e50592014-01-29 13:09:30 -080045# Workaround differences in inttypes.h between host and target.
46# See bug 12708004.
Ying Wang6feb6d52014-04-17 10:03:35 -070047$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
Ian Rogers61e50592014-01-29 13:09:30 -080048
Elliott Hughesac9eea92015-08-20 16:52:47 -070049# We build a 32-bit host art, and right now that also means building *all* host libraries
50# both 32- and 64-bit (whether art uses them or not --- 9d59f417767991246848c3e101cb27d2dfea5988).
51$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1
52
Ying Wang6feb6d52014-04-17 10:03:35 -070053$(combo_2nd_arch_prefix)HOST_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined
54
Ying Wang6feb6d52014-04-17 10:03:35 -070055############################################################
56## Macros after this line are shared by the 64-bit config.
57
58# $(1): The file to check
59define get-file-size
60stat --format "%s" "$(1)" | tr -d '\n'
61endef