Merge "Use goma when USE_GOMA=true is set"
diff --git a/core/base_rules.mk b/core/base_rules.mk
index 41e808b..b936859 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -565,8 +565,25 @@
$(copy-file-to-target-with-cp)
endif
-endif # !LOCAL_UNINSTALLABLE_MODULE
+# Rule to install the module's companion init.rc.
+my_init_rc := $(LOCAL_INIT_RC_$(my_32_64_bit_suffix))
+my_init_rc_src :=
+my_init_rc_installed :=
+ifndef my_init_rc
+my_init_rc := $(LOCAL_INIT_RC)
+# Make sure we don't define the rule twice in multilib module.
+LOCAL_INIT_RC :=
+endif
+ifdef my_init_rc
+my_init_rc_src := $(LOCAL_PATH)/$(my_init_rc)
+my_init_rc_installed := $(TARGET_OUT$(partition_tag)_ETC)/init/$(notdir $(my_init_rc_src))
+$(my_init_rc_installed) : $(my_init_rc_src) | $(ACP)
+ @echo "Install: $@"
+ $(copy-file-to-new-target)
+$(my_register_name) : $(my_init_rc_installed)
+endif # my_init_rc
+endif # !LOCAL_UNINSTALLABLE_MODULE
###########################################################
## CHECK_BUILD goals
@@ -615,9 +632,12 @@
$(ALL_MODULES.$(my_register_name).BUILT) $(LOCAL_BUILT_MODULE)
ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
ALL_MODULES.$(my_register_name).INSTALLED := \
- $(strip $(ALL_MODULES.$(my_register_name).INSTALLED) $(LOCAL_INSTALLED_MODULE))
+ $(strip $(ALL_MODULES.$(my_register_name).INSTALLED) \
+ $(LOCAL_INSTALLED_MODULE) $(my_init_rc_installed))
ALL_MODULES.$(my_register_name).BUILT_INSTALLED := \
- $(strip $(ALL_MODULES.$(my_register_name).BUILT_INSTALLED) $(LOCAL_BUILT_MODULE):$(LOCAL_INSTALLED_MODULE))
+ $(strip $(ALL_MODULES.$(my_register_name).BUILT_INSTALLED) \
+ $(LOCAL_BUILT_MODULE):$(LOCAL_INSTALLED_MODULE) \
+ $(addprefix $(my_init_rc_src):,$(my_init_rc_installed)))
endif
ifdef LOCAL_PICKUP_FILES
# Files or directories ready to pick up by the build system
diff --git a/core/clear_vars.mk b/core/clear_vars.mk
index 431c688..c42a8e0 100644
--- a/core/clear_vars.mk
+++ b/core/clear_vars.mk
@@ -181,6 +181,7 @@
LOCAL_SANITIZE:=
LOCAL_SANITIZE_RECOVER:=
LOCAL_DBUS_PROXY_PREFIX:=
+LOCAL_INIT_RC:=
# arch specific variables
LOCAL_SRC_FILES_$(TARGET_ARCH):=
@@ -288,6 +289,8 @@
LOCAL_MODULE_STEM_64:=
LOCAL_CLANG_32:=
LOCAL_CLANG_64:=
+LOCAL_INIT_RC_32:=
+LOCAL_INIT_RC_64:=
# Trim MAKEFILE_LIST so that $(call my-dir) doesn't need to
# iterate over thousands of entries every time.
diff --git a/core/combo/HOST_linux-x86.mk b/core/combo/HOST_linux-x86.mk
index 3acf795..6ea526c 100644
--- a/core/combo/HOST_linux-x86.mk
+++ b/core/combo/HOST_linux-x86.mk
@@ -38,7 +38,6 @@
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -fPIC \
-no-canonical-prefixes \
- -include $(call select-android-config-h,linux-x86)
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector
@@ -46,6 +45,10 @@
# See bug 12708004.
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
+# We build a 32-bit host art, and right now that also means building *all* host libraries
+# both 32- and 64-bit (whether art uses them or not --- 9d59f417767991246848c3e101cb27d2dfea5988).
+$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1
+
$(combo_2nd_arch_prefix)HOST_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined
############################################################
diff --git a/core/combo/HOST_linux-x86_64.mk b/core/combo/HOST_linux-x86_64.mk
index b74990b..13e1e8a 100644
--- a/core/combo/HOST_linux-x86_64.mk
+++ b/core/combo/HOST_linux-x86_64.mk
@@ -35,10 +35,8 @@
HOST_GLOBAL_LDFLAGS += -static
endif # BUILD_HOST_static
-# TODO: Add AndroidConfig.h for linux-x86_64
HOST_GLOBAL_CFLAGS += -fPIC \
-no-canonical-prefixes \
- -include $(call select-android-config-h,linux-x86)
HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector
diff --git a/core/combo/HOST_windows-x86.mk b/core/combo/HOST_windows-x86.mk
index eb1c49c..30c1c75 100644
--- a/core/combo/HOST_windows-x86.mk
+++ b/core/combo/HOST_windows-x86.mk
@@ -33,13 +33,15 @@
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
# Use C99-compliant printf functions (%zd).
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -D__USE_MINGW_ANSI_STDIO=1
+# Admit to using >= Win2K.
+$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -D_WIN32_WINNT=0x0500
+# Get 64-bit off_t and related functions.
+$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -D_FILE_OFFSET_BITS=64
$(combo_2nd_arch_prefix)HOST_CC := $(TOOLS_PREFIX)gcc$(TOOLS_EXE_SUFFIX)
$(combo_2nd_arch_prefix)HOST_CXX := $(TOOLS_PREFIX)g++$(TOOLS_EXE_SUFFIX)
$(combo_2nd_arch_prefix)HOST_AR := $(TOOLS_PREFIX)ar$(TOOLS_EXE_SUFFIX)
-$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += \
- -include $(call select-android-config-h,windows)
$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += \
--enable-stdcall-fixup
diff --git a/core/combo/HOST_windows-x86_64.mk b/core/combo/HOST_windows-x86_64.mk
index b38c74c..49b74e2 100644
--- a/core/combo/HOST_windows-x86_64.mk
+++ b/core/combo/HOST_windows-x86_64.mk
@@ -31,12 +31,13 @@
HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
# Use C99-compliant printf functions (%zd).
HOST_GLOBAL_CFLAGS += -D__USE_MINGW_ANSI_STDIO=1
+# Admit to using >= Win2K.
+HOST_GLOBAL_CFLAGS += -D_WIN32_WINNT=0x0500
HOST_CC := $(TOOLS_PREFIX)gcc$(TOOLS_EXE_SUFFIX)
HOST_CXX := $(TOOLS_PREFIX)g++$(TOOLS_EXE_SUFFIX)
HOST_AR := $(TOOLS_PREFIX)ar$(TOOLS_EXE_SUFFIX)
-HOST_GLOBAL_CFLAGS += -include $(call select-android-config-h,windows)
HOST_GLOBAL_LDFLAGS += --enable-stdcall-fixup
ifneq ($(strip $(BUILD_HOST_static)),)
# Statically-linked binaries are desirable for sandboxed environment
diff --git a/core/combo/include/arch/linux-x86/AndroidConfig.h b/core/combo/include/arch/linux-x86/AndroidConfig.h
deleted file mode 100644
index b8e4217..0000000
--- a/core/combo/include/arch/linux-x86/AndroidConfig.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2005 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * Android config -- "Linux". Used for desktop x86 Linux.
- */
-#ifndef _ANDROID_CONFIG_H
-#define _ANDROID_CONFIG_H
-
-/*
- * ===========================================================================
- * !!! IMPORTANT !!!
- * ===========================================================================
- *
- * This file is included by ALL C/C++ source files. Don't put anything in
- * here unless you are absolutely certain it can't go anywhere else.
- *
- * Any C++ stuff must be wrapped with "#ifdef __cplusplus". Do not use "//"
- * comments.
- */
-
-/*
- * We need to choose between 32-bit and 64-bit off_t. All of our code should
- * agree on the same size. For desktop systems, use 64-bit values,
- * because some of our libraries (e.g. wxWidgets) expect to be built that way.
- */
-#define _FILE_OFFSET_BITS 64
-#define _LARGEFILE_SOURCE 1
-
-#endif /*_ANDROID_CONFIG_H*/
diff --git a/core/combo/include/arch/windows/AndroidConfig.h b/core/combo/include/arch/windows/AndroidConfig.h
deleted file mode 100644
index 9ed61e9..0000000
--- a/core/combo/include/arch/windows/AndroidConfig.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2005 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _ANDROID_CONFIG_H
-#define _ANDROID_CONFIG_H
-
-/*
- * ===========================================================================
- * !!! IMPORTANT !!!
- * ===========================================================================
- *
- * This file is included by ALL C/C++ source files. Don't put anything in
- * here unless you are absolutely certain it can't go anywhere else.
- *
- * Any C++ stuff must be wrapped with "#ifdef __cplusplus". Do not use "//"
- * comments.
- */
-
-#ifdef __CYGWIN__
-#error "CYGWIN is unsupported for platform builds"
-#endif
-
-/*
- * We need to choose between 32-bit and 64-bit off_t. All of our code should
- * agree on the same size. For desktop systems, use 64-bit values,
- * because some of our libraries (e.g. wxWidgets) expect to be built that way.
- */
-#define _FILE_OFFSET_BITS 64
-#define _LARGEFILE_SOURCE 1
-
-/*
- * Add any extra platform-specific defines here.
- */
-#define WIN32 1 /* stock Cygwin doesn't define these */
-#define _WIN32 1
-#define _WIN32_WINNT 0x0500 /* admit to using >= Win2K */
-
-#endif /*_ANDROID_CONFIG_H*/