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