2 # Copyright (C) 2006 The Android Open Source Project
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 # Configuration for builds hosted on linux-x86.
18 # Included by combo/select.mk
20 # $(1): The file to check
22 stat --format "%s" "$(1)" | tr -d '\n'
25 # Special case for the Linux SDK: We need to use a special cross-toolchain
26 # that generates machine code that will run properly on Ubuntu 8.04 (Hardy)
27 # By default, the code generated by the Lucid host toolchain will not run
28 # on previous versions of the platform, due to GLibc ABI mistmatches
29 # (Lucid is 2.11, Hardy is 2.7)
31 # Note that components that need to be built as 64-bit (e.g. clearsilver
32 # which is loaded by the 64-bit JVM through JNI), will have to use
33 # LOCAL_CC and LOCAL_CXX to override this.
35 ifeq ($(TARGET_PRODUCT),sdk)
36 HOST_SDK_TOOLCHAIN_PREFIX := prebuilt/linux-x86/toolchain/i686-linux-glibc2.7-4.4.3/bin/i686-linux
37 # Don't do anything if the toolchain is not there
38 ifneq (,$(strip $(wildcard $(HOST_SDK_TOOLCHAIN_PREFIX)-gcc)))
39 HOST_CC := $(HOST_SDK_TOOLCHAIN_PREFIX)-gcc
40 HOST_CXX := $(HOST_SDK_TOOLCHAIN_PREFIX)-g++
41 HOST_AR := $(HOST_SDK_TOOLCHAIN_PREFIX)-ar
42 endif # $(HOST_SDK_TOOLCHAIN_PREFIX)-gcc exists
43 endif # TARGET_PRODUCT == sdk
45 # We build everything in 32-bit, because some host tools are
46 # 32-bit-only anyway (emulator, acc), and because it gives us
47 # more consistency between the host tools and the target.
48 # The exception is the host side of the simulator, which
49 # requires to use the default size, as wxWidgets code otherwise
51 ifneq ($(TARGET_SIMULATOR),true)
52 HOST_GLOBAL_CFLAGS += -m32
53 HOST_GLOBAL_LDFLAGS += -m32
56 HOST_GLOBAL_CFLAGS += -fPIC
57 HOST_GLOBAL_CFLAGS += \
58 -include $(call select-android-config-h,linux-x86)
60 # Disable new longjmp in glibc 2.11 and later. See bug 2967937.
61 HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
63 HOST_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined