19b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru#
29b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru# Copyright (C) 2006 The Android Open Source Project
39b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru#
49b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru# Licensed under the Apache License, Version 2.0 (the "License");
59b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru# you may not use this file except in compliance with the License.
69b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru# You may obtain a copy of the License at
79b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru#
89b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru#      http://www.apache.org/licenses/LICENSE-2.0
99b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru#
109b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru# Unless required by applicable law or agreed to in writing, software
119b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru# distributed under the License is distributed on an "AS IS" BASIS,
129b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
139b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru# See the License for the specific language governing permissions and
149b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru# limitations under the License.
159b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru#
169b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru
179b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru# Configuration for builds hosted on linux-x86.
189b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru# Included by combo/select.mk
199b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru
206feb6d5607ce86a446645564212043964628f540Ying Wangifeq ($(strip $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)),)
216feb6d5607ce86a446645564212043964628f540Ying Wang$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/bin/x86_64-linux-
2279e3f7799648f6de27087f17b2b50cc79870805eYing Wangendif
230960ca748804b772453ebe50d212a691c1a6c066David 'Digit' Turner# Don't do anything if the toolchain is not there
246feb6d5607ce86a446645564212043964628f540Ying Wangifneq (,$(strip $(wildcard $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)gcc)))
256feb6d5607ce86a446645564212043964628f540Ying Wang$(combo_2nd_arch_prefix)HOST_CC  := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)gcc
266feb6d5607ce86a446645564212043964628f540Ying Wang$(combo_2nd_arch_prefix)HOST_CXX := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)g++
276feb6d5607ce86a446645564212043964628f540Ying Wang$(combo_2nd_arch_prefix)HOST_AR  := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)ar
286feb6d5607ce86a446645564212043964628f540Ying Wangendif # $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)gcc exists
296feb6d5607ce86a446645564212043964628f540Ying Wang
306feb6d5607ce86a446645564212043964628f540Ying Wang# gcc location for clang; to be updated when clang is updated
316feb6d5607ce86a446645564212043964628f540Ying Wang$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/
320960ca748804b772453ebe50d212a691c1a6c066David 'Digit' Turner
3335a6b4fb65b17fbc698fbd0796eee89b7a06c5e9Ian Rogers# We expect SSE3 floating point math.
3476bd60b7dadda4f0f1f1e88afbe2e9dd551a6ef7Stephen Hines$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -mstackrealign -msse3 -mfpmath=sse -m32 -Wa,--noexecstack -march=prescott
356feb6d5607ce86a446645564212043964628f540Ying Wang$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -m32 -Wl,-z,noexecstack
369b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru
37f9613a4f730b8a385971f95150582b9a543302aeAndrew Hsiehifneq ($(strip $(BUILD_HOST_static)),)
38f9613a4f730b8a385971f95150582b9a543302aeAndrew Hsieh# Statically-linked binaries are desirable for sandboxed environment
396feb6d5607ce86a446645564212043964628f540Ying Wang$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -static
40f9613a4f730b8a385971f95150582b9a543302aeAndrew Hsiehendif # BUILD_HOST_static
41f9613a4f730b8a385971f95150582b9a543302aeAndrew Hsieh
426feb6d5607ce86a446645564212043964628f540Ying Wang$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -fPIC \
4348f239c94faca140427afc9aa06cf356b1b6b0deAndrew Hsieh  -no-canonical-prefixes \
4448f239c94faca140427afc9aa06cf356b1b6b0deAndrew Hsieh  -include $(call select-android-config-h,linux-x86)
459b4a81237be29b0aae50d1e370b63a07ea2b88b9Jean-Baptiste Queru
46fb644881b6083aa0d9d15e7aad8bfa5a429b1c37Ying Wang# Disable new longjmp in glibc 2.11 and later. See bug 2967937.
476feb6d5607ce86a446645564212043964628f540Ying Wang$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
48fb644881b6083aa0d9d15e7aad8bfa5a429b1c37Ying Wang
4961e5059ef768388db01232c61879d2ba3e0c1d47Ian Rogers# Workaround differences in inttypes.h between host and target.
5061e5059ef768388db01232c61879d2ba3e0c1d47Ian Rogers# See bug 12708004.
516feb6d5607ce86a446645564212043964628f540Ying Wang$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
526feb6d5607ce86a446645564212043964628f540Ying Wang
536feb6d5607ce86a446645564212043964628f540Ying Wang$(combo_2nd_arch_prefix)HOST_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined
5461e5059ef768388db01232c61879d2ba3e0c1d47Ian Rogers
556feb6d5607ce86a446645564212043964628f540Ying Wang
566feb6d5607ce86a446645564212043964628f540Ying Wang############################################################
576feb6d5607ce86a446645564212043964628f540Ying Wang## Macros after this line are shared by the 64-bit config.
586feb6d5607ce86a446645564212043964628f540Ying Wang
596feb6d5607ce86a446645564212043964628f540Ying Wang# $(1): The file to check
606feb6d5607ce86a446645564212043964628f540Ying Wangdefine get-file-size
616feb6d5607ce86a446645564212043964628f540Ying Wangstat --format "%s" "$(1)" | tr -d '\n'
626feb6d5607ce86a446645564212043964628f540Ying Wangendef
63