Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 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. |
| 18 | # Included by combo/select.mk |
| 19 | |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 20 | ifeq ($(strip $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)),) |
Chih-Hung Hsieh | 3be11c6 | 2014-11-05 10:45:11 -0800 | [diff] [blame] | 21 | $(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/bin/x86_64-linux- |
Ying Wang | 79e3f77 | 2013-02-12 11:48:37 -0800 | [diff] [blame] | 22 | endif |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 23 | $(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 |
Shinichiro Hamaji | 0e7587a | 2015-10-09 14:36:04 +0900 | [diff] [blame^] | 26 | $(combo_2nd_arch_prefix)HOST_READELF := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)readelf |
| 27 | $(combo_2nd_arch_prefix)HOST_NM := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)nm |
| 28 | |
| 29 | define $(combo_var_prefix)transform-shared-lib-to-toc |
| 30 | $(call _gen_toc_command_for_elf,$(1),$(2)) |
| 31 | endef |
David 'Digit' Turner | 0960ca7 | 2010-12-10 22:24:06 +0100 | [diff] [blame] | 32 | |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 33 | # gcc location for clang; to be updated when clang is updated |
Dan Willemsen | c339398 | 2015-09-22 16:52:18 -0700 | [diff] [blame] | 34 | $(combo_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG := prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8 |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 35 | |
Ian Rogers | 35a6b4f | 2013-02-26 15:10:22 -0800 | [diff] [blame] | 36 | # We expect SSE3 floating point math. |
Alexander Ivchenko | ae2d47a | 2014-09-16 16:30:41 +0400 | [diff] [blame] | 37 | $(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -msse3 -mfpmath=sse -m32 -Wa,--noexecstack -march=prescott |
Nick Kralevich | 100acd1 | 2015-04-24 21:26:08 -0700 | [diff] [blame] | 38 | $(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -m32 -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now |
Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 39 | |
Andrew Hsieh | f9613a4 | 2012-04-28 00:35:19 +0800 | [diff] [blame] | 40 | ifneq ($(strip $(BUILD_HOST_static)),) |
| 41 | # Statically-linked binaries are desirable for sandboxed environment |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 42 | $(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -static |
Andrew Hsieh | f9613a4 | 2012-04-28 00:35:19 +0800 | [diff] [blame] | 43 | endif # BUILD_HOST_static |
| 44 | |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 45 | $(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -fPIC \ |
Andrew Hsieh | 48f239c | 2014-05-09 14:13:13 +0800 | [diff] [blame] | 46 | -no-canonical-prefixes \ |
Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 47 | |
Elliott Hughes | 7dd8ec1 | 2015-05-13 20:15:19 +0000 | [diff] [blame] | 48 | $(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector |
Ying Wang | fb64488 | 2010-09-01 16:39:11 -0700 | [diff] [blame] | 49 | |
Ian Rogers | 61e5059 | 2014-01-29 13:09:30 -0800 | [diff] [blame] | 50 | # Workaround differences in inttypes.h between host and target. |
| 51 | # See bug 12708004. |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 52 | $(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS |
Ian Rogers | 61e5059 | 2014-01-29 13:09:30 -0800 | [diff] [blame] | 53 | |
Elliott Hughes | ac9eea9 | 2015-08-20 16:52:47 -0700 | [diff] [blame] | 54 | # We build a 32-bit host art, and right now that also means building *all* host libraries |
| 55 | # both 32- and 64-bit (whether art uses them or not --- 9d59f417767991246848c3e101cb27d2dfea5988). |
| 56 | $(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 |
| 57 | |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 58 | $(combo_2nd_arch_prefix)HOST_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined |
| 59 | |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 60 | ############################################################ |
| 61 | ## Macros after this line are shared by the 64-bit config. |
| 62 | |
| 63 | # $(1): The file to check |
| 64 | define get-file-size |
| 65 | stat --format "%s" "$(1)" | tr -d '\n' |
| 66 | endef |