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 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 17 | # Configuration for Linux on x86 as a target. |
Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 18 | # Included by combo/select.mk |
| 19 | |
Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 20 | # Provide a default variant. |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 21 | ifeq ($(strip $(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT)),) |
| 22 | TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT := x86 |
Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 23 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 24 | |
Ben Cheng | 4de6fa4 | 2014-04-10 22:46:26 -0700 | [diff] [blame^] | 25 | # Decouple NDK library selection with platform compiler version |
| 26 | $(combo_2nd_arch_prefix)TARGET_NDK_GCC_VERSION := 4.8 |
| 27 | |
Ben Cheng | 914f7fd | 2012-12-12 16:22:54 -0800 | [diff] [blame] | 28 | ifeq ($(strip $(TARGET_GCC_VERSION_EXP)),) |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 29 | $(combo_2nd_arch_prefix)TARGET_GCC_VERSION := 4.8 |
Ben Cheng | 914f7fd | 2012-12-12 16:22:54 -0800 | [diff] [blame] | 30 | else |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 31 | $(combo_2nd_arch_prefix)TARGET_GCC_VERSION := $(TARGET_GCC_VERSION_EXP) |
Ben Cheng | 054ffd2 | 2012-12-11 14:01:10 -0800 | [diff] [blame] | 32 | endif |
| 33 | |
David 'Digit' Turner | 6371da1 | 2011-12-13 17:21:56 +0100 | [diff] [blame] | 34 | # Include the arch-variant-specific configuration file. |
| 35 | # Its role is to define various ARCH_X86_HAVE_XXX feature macros, |
| 36 | # plus initial values for TARGET_GLOBAL_CFLAGS |
| 37 | # |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 38 | TARGET_ARCH_SPECIFIC_MAKEFILE := $(BUILD_COMBOS)/arch/$(TARGET_$(combo_2nd_arch_prefix)ARCH)/$(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT).mk |
David 'Digit' Turner | 6371da1 | 2011-12-13 17:21:56 +0100 | [diff] [blame] | 39 | ifeq ($(strip $(wildcard $(TARGET_ARCH_SPECIFIC_MAKEFILE))),) |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 40 | $(error Unknown $(TARGET_$(combo_2nd_arch_prefix)ARCH) architecture version: $(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT)) |
David 'Digit' Turner | 6371da1 | 2011-12-13 17:21:56 +0100 | [diff] [blame] | 41 | endif |
| 42 | |
| 43 | include $(TARGET_ARCH_SPECIFIC_MAKEFILE) |
| 44 | |
| 45 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 46 | # You can set TARGET_TOOLS_PREFIX to get gcc from somewhere else |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 47 | ifeq ($(strip $($(combo_2nd_arch_prefix)TARGET_TOOLS_PREFIX)),) |
| 48 | $(combo_2nd_arch_prefix)TARGET_TOOLCHAIN_ROOT := prebuilts/gcc/$(HOST_PREBUILT_TAG)/x86/x86_64-linux-android-$($(combo_2nd_arch_prefix)TARGET_GCC_VERSION) |
| 49 | $(combo_2nd_arch_prefix)TARGET_TOOLS_PREFIX := $($(combo_2nd_arch_prefix)TARGET_TOOLCHAIN_ROOT)/bin/x86_64-linux-android- |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 50 | endif |
| 51 | |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 52 | $(combo_2nd_arch_prefix)TARGET_CC := $($(combo_2nd_arch_prefix)TARGET_TOOLS_PREFIX)gcc$(HOST_EXECUTABLE_SUFFIX) |
| 53 | $(combo_2nd_arch_prefix)TARGET_CXX := $($(combo_2nd_arch_prefix)TARGET_TOOLS_PREFIX)g++$(HOST_EXECUTABLE_SUFFIX) |
| 54 | $(combo_2nd_arch_prefix)TARGET_AR := $($(combo_2nd_arch_prefix)TARGET_TOOLS_PREFIX)ar$(HOST_EXECUTABLE_SUFFIX) |
| 55 | $(combo_2nd_arch_prefix)TARGET_OBJCOPY := $($(combo_2nd_arch_prefix)TARGET_TOOLS_PREFIX)objcopy$(HOST_EXECUTABLE_SUFFIX) |
| 56 | $(combo_2nd_arch_prefix)TARGET_LD := $($(combo_2nd_arch_prefix)TARGET_TOOLS_PREFIX)ld$(HOST_EXECUTABLE_SUFFIX) |
Christopher Ferris | a6e2f93 | 2014-03-18 14:50:09 -0700 | [diff] [blame] | 57 | $(combo_2nd_arch_prefix)TARGET_READELF := $($(combo_2nd_arch_prefix)TARGET_TOOLS_PREFIX)readelf$(HOST_EXECUTABLE_SUFFIX) |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 58 | $(combo_2nd_arch_prefix)TARGET_STRIP := $($(combo_2nd_arch_prefix)TARGET_TOOLS_PREFIX)strip$(HOST_EXECUTABLE_SUFFIX) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 59 | |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 60 | ifneq ($(wildcard $($(combo_2nd_arch_prefix)TARGET_CC)),) |
| 61 | $(combo_2nd_arch_prefix)TARGET_LIBGCC := \ |
| 62 | $(shell $($(combo_2nd_arch_prefix)TARGET_CC) -m32 -print-file-name=libgcc.a) |
| 63 | target_libgcov := $(shell $($(combo_2nd_arch_prefix)TARGET_CC) $($(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS) \ |
synergydev | 6ecf0ef | 2013-08-08 13:08:26 -0700 | [diff] [blame] | 64 | -print-file-name=libgcov.a) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 65 | endif |
| 66 | |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 67 | $(combo_2nd_arch_prefix)TARGET_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 68 | |
| 69 | libc_root := bionic/libc |
| 70 | libm_root := bionic/libm |
| 71 | libstdc++_root := bionic/libstdc++ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 72 | |
synergydev | 6ecf0ef | 2013-08-08 13:08:26 -0700 | [diff] [blame] | 73 | # Define FDO (Feedback Directed Optimization) options. |
| 74 | |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 75 | $(combo_2nd_arch_prefix)TARGET_FDO_CFLAGS:= |
| 76 | $(combo_2nd_arch_prefix)TARGET_FDO_LIB:= |
synergydev | 6ecf0ef | 2013-08-08 13:08:26 -0700 | [diff] [blame] | 77 | |
| 78 | ifneq ($(strip $(BUILD_FDO_INSTRUMENT)),) |
| 79 | # Set BUILD_FDO_INSTRUMENT=true to turn on FDO instrumentation. |
| 80 | # The profile will be generated on /data/local/tmp/profile on the device. |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 81 | $(combo_2nd_arch_prefix)TARGET_FDO_CFLAGS := -fprofile-generate=/data/local/tmp/profile -DANDROID_FDO |
| 82 | $(combo_2nd_arch_prefix)TARGET_FDO_LIB := $(target_libgcov) |
synergydev | 6ecf0ef | 2013-08-08 13:08:26 -0700 | [diff] [blame] | 83 | else |
| 84 | # If BUILD_FDO_INSTRUMENT is turned off, then consider doing the FDO optimizations. |
| 85 | # Set TARGET_FDO_PROFILE_PATH to set a custom profile directory for your build. |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 86 | ifeq ($(strip $($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH)),) |
| 87 | $(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH := fdo/profiles/$(TARGET_$(combo_2nd_arch_prefix)ARCH)/$(TARGET_$(combo_2nd_arch_prefix)ARCH_VARIANT) |
synergydev | 6ecf0ef | 2013-08-08 13:08:26 -0700 | [diff] [blame] | 88 | else |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 89 | ifeq ($(strip $(wildcard $($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH))),) |
| 90 | $(warning Custom $(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH supplied, but directory does not exist. Turn off FDO.) |
synergydev | 6ecf0ef | 2013-08-08 13:08:26 -0700 | [diff] [blame] | 91 | endif |
| 92 | endif |
| 93 | |
| 94 | # If the FDO profile directory can't be found, then FDO is off. |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 95 | ifneq ($(strip $(wildcard $($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH))),) |
| 96 | $(combo_2nd_arch_prefix)TARGET_FDO_CFLAGS := -fprofile-use=$($(combo_2nd_arch_prefix)TARGET_FDO_PROFILE_PATH) -DANDROID_FDO |
| 97 | $(combo_2nd_arch_prefix)TARGET_FDO_LIB := $(target_libgcov) |
synergydev | 6ecf0ef | 2013-08-08 13:08:26 -0700 | [diff] [blame] | 98 | endif |
| 99 | endif |
| 100 | |
Elliott Hughes | dddb566 | 2014-01-10 16:35:08 -0800 | [diff] [blame] | 101 | KERNEL_HEADERS_COMMON := $(libc_root)/kernel/uapi |
Elliott Hughes | 171e940 | 2014-01-28 13:07:55 -0800 | [diff] [blame] | 102 | KERNEL_HEADERS_ARCH := $(libc_root)/kernel/uapi/asm-x86 # x86 covers both x86 and x86_64. |
Elliott Hughes | e5df095 | 2013-11-25 16:38:47 -0800 | [diff] [blame] | 103 | KERNEL_HEADERS := $(KERNEL_HEADERS_COMMON) $(KERNEL_HEADERS_ARCH) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 104 | |
Ying Wang | f4723fa | 2013-08-15 11:01:10 -0700 | [diff] [blame] | 105 | android_config_h := $(call select-android-config-h,target_linux-x86) |
| 106 | |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 107 | $(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += \ |
Mark D Horn | 5812d7b | 2011-04-26 14:15:26 -0700 | [diff] [blame] | 108 | -O2 \ |
Bruce Beare | ccec9c4 | 2010-10-14 14:12:46 -0700 | [diff] [blame] | 109 | -Ulinux \ |
Mark D Horn | 5812d7b | 2011-04-26 14:15:26 -0700 | [diff] [blame] | 110 | -Wa,--noexecstack \ |
| 111 | -Werror=format-security \ |
Nick Kralevich | fb45baa | 2013-04-29 12:41:53 -0700 | [diff] [blame] | 112 | -D_FORTIFY_SOURCE=2 \ |
Mark D Horn | 5812d7b | 2011-04-26 14:15:26 -0700 | [diff] [blame] | 113 | -Wstrict-aliasing=2 \ |
Nick Kralevich | d9d2e7a | 2011-11-04 13:07:26 -0700 | [diff] [blame] | 114 | -fPIC -fPIE \ |
Mark D Horn | 5812d7b | 2011-04-26 14:15:26 -0700 | [diff] [blame] | 115 | -ffunction-sections \ |
| 116 | -finline-functions \ |
| 117 | -finline-limit=300 \ |
| 118 | -fno-inline-functions-called-once \ |
| 119 | -fno-short-enums \ |
| 120 | -fstrict-aliasing \ |
| 121 | -funswitch-loops \ |
| 122 | -funwind-tables \ |
Negreanu Marius Adrian | ae5c0ab | 2011-09-28 17:47:50 +0300 | [diff] [blame] | 123 | -fstack-protector \ |
Ying Wang | 4a712bf | 2013-09-19 10:15:38 -0700 | [diff] [blame] | 124 | -m32 \ |
Colin Cross | 4aa263f | 2014-02-18 15:49:48 -0800 | [diff] [blame] | 125 | -msse2 \ |
Ying Wang | f4723fa | 2013-08-15 11:01:10 -0700 | [diff] [blame] | 126 | -include $(android_config_h) \ |
| 127 | -I $(dir $(android_config_h)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 128 | |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 129 | $(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += $(arch_variant_cflags) |
Bruce Beare | 3343b27 | 2011-12-09 13:27:08 -0800 | [diff] [blame] | 130 | |
David 'Digit' Turner | 6371da1 | 2011-12-13 17:21:56 +0100 | [diff] [blame] | 131 | ifeq ($(ARCH_X86_HAVE_SSSE3),true) # yes, really SSSE3, not SSE3! |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 132 | $(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += -DUSE_SSSE3 -mssse3 |
Negreanu Marius Adrian | ae5c0ab | 2011-09-28 17:47:50 +0300 | [diff] [blame] | 133 | endif |
| 134 | ifeq ($(ARCH_X86_HAVE_SSE4),true) |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 135 | $(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += -msse4 |
Negreanu Marius Adrian | ae5c0ab | 2011-09-28 17:47:50 +0300 | [diff] [blame] | 136 | endif |
| 137 | ifeq ($(ARCH_X86_HAVE_SSE4_1),true) |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 138 | $(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += -msse4.1 |
Negreanu Marius Adrian | ae5c0ab | 2011-09-28 17:47:50 +0300 | [diff] [blame] | 139 | endif |
| 140 | ifeq ($(ARCH_X86_HAVE_SSE4_2),true) |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 141 | $(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += -msse4.2 |
Negreanu Marius Adrian | ae5c0ab | 2011-09-28 17:47:50 +0300 | [diff] [blame] | 142 | endif |
| 143 | ifeq ($(ARCH_X86_HAVE_AVX),true) |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 144 | $(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += -mavx |
Negreanu Marius Adrian | ae5c0ab | 2011-09-28 17:47:50 +0300 | [diff] [blame] | 145 | endif |
| 146 | ifeq ($(ARCH_X86_HAVE_AES_NI),true) |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 147 | $(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += -maes |
David 'Digit' Turner | 6371da1 | 2011-12-13 17:21:56 +0100 | [diff] [blame] | 148 | endif |
| 149 | |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 150 | $(combo_2nd_arch_prefix)TARGET_GLOBAL_LDFLAGS += -m32 |
David 'Digit' Turner | 6371da1 | 2011-12-13 17:21:56 +0100 | [diff] [blame] | 151 | |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 152 | $(combo_2nd_arch_prefix)TARGET_GLOBAL_LDFLAGS += -Wl,-z,noexecstack |
| 153 | $(combo_2nd_arch_prefix)TARGET_GLOBAL_LDFLAGS += -Wl,-z,relro -Wl,-z,now |
| 154 | $(combo_2nd_arch_prefix)TARGET_GLOBAL_LDFLAGS += -Wl,--warn-shared-textrel |
| 155 | $(combo_2nd_arch_prefix)TARGET_GLOBAL_LDFLAGS += -Wl,--fatal-warnings |
| 156 | $(combo_2nd_arch_prefix)TARGET_GLOBAL_LDFLAGS += -Wl,--gc-sections |
Bruce Beare | ccec9c4 | 2010-10-14 14:12:46 -0700 | [diff] [blame] | 157 | |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 158 | $(combo_2nd_arch_prefix)TARGET_C_INCLUDES := \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 159 | $(libc_root)/arch-x86/include \ |
| 160 | $(libc_root)/include \ |
| 161 | $(libstdc++_root)/include \ |
| 162 | $(KERNEL_HEADERS) \ |
| 163 | $(libm_root)/include \ |
| 164 | $(libm_root)/include/i387 \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 165 | |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 166 | $(combo_2nd_arch_prefix)TARGET_CRTBEGIN_STATIC_O := $($(combo_2nd_arch_prefix)TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_static.o |
| 167 | $(combo_2nd_arch_prefix)TARGET_CRTBEGIN_DYNAMIC_O := $($(combo_2nd_arch_prefix)TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_dynamic.o |
| 168 | $(combo_2nd_arch_prefix)TARGET_CRTEND_O := $($(combo_2nd_arch_prefix)TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_android.o |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 169 | |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 170 | $(combo_2nd_arch_prefix)TARGET_CRTBEGIN_SO_O := $($(combo_2nd_arch_prefix)TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtbegin_so.o |
| 171 | $(combo_2nd_arch_prefix)TARGET_CRTEND_SO_O := $($(combo_2nd_arch_prefix)TARGET_OUT_INTERMEDIATE_LIBRARIES)/crtend_so.o |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 172 | |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 173 | $(combo_2nd_arch_prefix)TARGET_STRIP_MODULE:=true |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 174 | |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 175 | $(combo_2nd_arch_prefix)TARGET_DEFAULT_SYSTEM_SHARED_LIBRARIES := libc libstdc++ libm |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 176 | |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 177 | $(combo_2nd_arch_prefix)TARGET_CUSTOM_LD_COMMAND := true |
| 178 | define $(combo_2nd_arch_prefix)transform-o-to-shared-lib-inner |
Ying Wang | 3a7e4cc | 2011-01-28 14:14:47 -0800 | [diff] [blame] | 179 | $(hide) $(PRIVATE_CXX) \ |
Ying Wang | 1a08100 | 2010-07-13 14:55:47 -0700 | [diff] [blame] | 180 | $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 181 | -nostdlib -Wl,-soname,$(notdir $@) \ |
| 182 | -shared -Bsymbolic \ |
Ying Wang | 1a08100 | 2010-07-13 14:55:47 -0700 | [diff] [blame] | 183 | $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \ |
Jeff Brown | 703e7c6 | 2011-02-04 20:15:00 -0800 | [diff] [blame] | 184 | $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTBEGIN_SO_O)) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 185 | $(PRIVATE_ALL_OBJECTS) \ |
| 186 | -Wl,--whole-archive \ |
Ying Wang | 80e6cce | 2011-01-24 23:25:36 -0800 | [diff] [blame] | 187 | $(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 188 | -Wl,--no-whole-archive \ |
Ying Wang | fcdabd4 | 2011-04-25 14:22:41 -0700 | [diff] [blame] | 189 | $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 190 | $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ |
Ying Wang | fcdabd4 | 2011-04-25 14:22:41 -0700 | [diff] [blame] | 191 | $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \ |
Andrew Hsieh | 8725b94 | 2013-03-07 20:52:17 +0800 | [diff] [blame] | 192 | $(PRIVATE_TARGET_LIBGCC) \ |
synergydev | 6ecf0ef | 2013-08-08 13:08:26 -0700 | [diff] [blame] | 193 | $(PRIVATE_TARGET_FDO_LIB) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 194 | $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ |
| 195 | -o $@ \ |
| 196 | $(PRIVATE_LDFLAGS) \ |
Ying Wang | 1a08100 | 2010-07-13 14:55:47 -0700 | [diff] [blame] | 197 | $(PRIVATE_TARGET_LIBGCC) \ |
Jeff Brown | 703e7c6 | 2011-02-04 20:15:00 -0800 | [diff] [blame] | 198 | $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_SO_O)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 199 | endef |
| 200 | |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 201 | define $(combo_2nd_arch_prefix)transform-o-to-executable-inner |
Ying Wang | 3a7e4cc | 2011-01-28 14:14:47 -0800 | [diff] [blame] | 202 | $(hide) $(PRIVATE_CXX) \ |
Ying Wang | 91fd123 | 2012-09-25 17:52:10 -0700 | [diff] [blame] | 203 | $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 204 | -nostdlib -Bdynamic \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 205 | -Wl,-z,nocopyreloc \ |
Nick Kralevich | d9d2e7a | 2011-11-04 13:07:26 -0700 | [diff] [blame] | 206 | -fPIE -pie \ |
Ying Wang | 91fd123 | 2012-09-25 17:52:10 -0700 | [diff] [blame] | 207 | $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \ |
Ying Wang | 9fb3526 | 2014-02-21 16:17:05 -0800 | [diff] [blame] | 208 | -Wl,-rpath-link=$(PRIVATE_TARGET_OUT_INTERMEDIATE_LIBRARIES) \ |
Ying Wang | 91fd123 | 2012-09-25 17:52:10 -0700 | [diff] [blame] | 209 | $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTBEGIN_DYNAMIC_O)) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 210 | $(PRIVATE_ALL_OBJECTS) \ |
Kito Cheng | 61c37e7 | 2012-01-20 19:21:46 +0800 | [diff] [blame] | 211 | -Wl,--whole-archive \ |
| 212 | $(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ |
| 213 | -Wl,--no-whole-archive \ |
Ying Wang | fcdabd4 | 2011-04-25 14:22:41 -0700 | [diff] [blame] | 214 | $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 215 | $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ |
Ying Wang | fcdabd4 | 2011-04-25 14:22:41 -0700 | [diff] [blame] | 216 | $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \ |
Andrew Hsieh | 8725b94 | 2013-03-07 20:52:17 +0800 | [diff] [blame] | 217 | $(PRIVATE_TARGET_LIBGCC) \ |
synergydev | 6ecf0ef | 2013-08-08 13:08:26 -0700 | [diff] [blame] | 218 | $(PRIVATE_TARGET_FDO_LIB) \ |
Andrew Hsieh | 8725b94 | 2013-03-07 20:52:17 +0800 | [diff] [blame] | 219 | $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ |
| 220 | -o $@ \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 221 | $(PRIVATE_LDFLAGS) \ |
Ying Wang | 91fd123 | 2012-09-25 17:52:10 -0700 | [diff] [blame] | 222 | $(PRIVATE_TARGET_LIBGCC) \ |
| 223 | $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 224 | endef |
| 225 | |
Qiming Shi | 310324d | 2014-02-17 15:13:48 +0800 | [diff] [blame] | 226 | define $(combo_2nd_arch_prefix)transform-o-to-static-executable-inner |
Ying Wang | 3a7e4cc | 2011-01-28 14:14:47 -0800 | [diff] [blame] | 227 | $(hide) $(PRIVATE_CXX) \ |
Ying Wang | 91fd123 | 2012-09-25 17:52:10 -0700 | [diff] [blame] | 228 | $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 229 | -nostdlib -Bstatic \ |
| 230 | -o $@ \ |
Ying Wang | 91fd123 | 2012-09-25 17:52:10 -0700 | [diff] [blame] | 231 | $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \ |
| 232 | $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTBEGIN_STATIC_O)) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 233 | $(PRIVATE_LDFLAGS) \ |
| 234 | $(PRIVATE_ALL_OBJECTS) \ |
Kito Cheng | 61c37e7 | 2012-01-20 19:21:46 +0800 | [diff] [blame] | 235 | -Wl,--whole-archive \ |
| 236 | $(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ |
| 237 | -Wl,--no-whole-archive \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 238 | -Wl,--start-group \ |
| 239 | $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ |
synergydev | 6ecf0ef | 2013-08-08 13:08:26 -0700 | [diff] [blame] | 240 | $(PRIVATE_TARGET_FDO_LIB) \ |
Ying Wang | 91fd123 | 2012-09-25 17:52:10 -0700 | [diff] [blame] | 241 | $(PRIVATE_TARGET_LIBGCC) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 242 | -Wl,--end-group \ |
Ying Wang | 91fd123 | 2012-09-25 17:52:10 -0700 | [diff] [blame] | 243 | $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 244 | endef |