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 | |
David 'Digit' Turner | 6371da1 | 2011-12-13 17:21:56 +0100 | [diff] [blame] | 25 | # Include the arch-variant-specific configuration file. |
| 26 | # Its role is to define various ARCH_X86_HAVE_XXX feature macros, |
| 27 | # plus initial values for TARGET_GLOBAL_CFLAGS |
| 28 | # |
| 29 | TARGET_ARCH_SPECIFIC_MAKEFILE := $(BUILD_COMBOS)/arch/$(TARGET_ARCH)/$(TARGET_ARCH_VARIANT).mk |
| 30 | ifeq ($(strip $(wildcard $(TARGET_ARCH_SPECIFIC_MAKEFILE))),) |
| 31 | $(error Unknown $(TARGET_ARCH) architecture version: $(TARGET_ARCH_VARIANT)) |
| 32 | endif |
| 33 | |
| 34 | include $(TARGET_ARCH_SPECIFIC_MAKEFILE) |
| 35 | |
| 36 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 37 | # 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] | 38 | ifeq ($(strip $(TARGET_TOOLS_PREFIX)),) |
Jean-Baptiste Queru | feec98b | 2012-05-16 13:18:39 -0700 | [diff] [blame] | 39 | TARGET_TOOLCHAIN_ROOT := prebuilts/gcc/$(HOST_PREBUILT_TAG)/x86/i686-linux-android-4.6 |
| 40 | TARGET_TOOLS_PREFIX := $(TARGET_TOOLCHAIN_ROOT)/bin/i686-linux-android- |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 41 | endif |
| 42 | |
Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 43 | TARGET_CC := $(TARGET_TOOLS_PREFIX)gcc$(HOST_EXECUTABLE_SUFFIX) |
| 44 | TARGET_CXX := $(TARGET_TOOLS_PREFIX)g++$(HOST_EXECUTABLE_SUFFIX) |
| 45 | TARGET_AR := $(TARGET_TOOLS_PREFIX)ar$(HOST_EXECUTABLE_SUFFIX) |
| 46 | TARGET_OBJCOPY := $(TARGET_TOOLS_PREFIX)objcopy$(HOST_EXECUTABLE_SUFFIX) |
| 47 | TARGET_LD := $(TARGET_TOOLS_PREFIX)ld$(HOST_EXECUTABLE_SUFFIX) |
Bruce Beare | 45ac434 | 2010-06-24 14:02:00 -0700 | [diff] [blame] | 48 | TARGET_STRIP := $(TARGET_TOOLS_PREFIX)strip$(HOST_EXECUTABLE_SUFFIX) |
Evgeniy Stepanov | 8f77c9d | 2011-06-21 17:08:49 +0400 | [diff] [blame] | 49 | |
| 50 | ifeq ($(TARGET_BUILD_VARIANT),user) |
Bruce Beare | 45ac434 | 2010-06-24 14:02:00 -0700 | [diff] [blame] | 51 | TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-debug $< -o $@ |
Evgeniy Stepanov | 8f77c9d | 2011-06-21 17:08:49 +0400 | [diff] [blame] | 52 | else |
| 53 | TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-debug $< -o $@ && \ |
| 54 | $(TARGET_OBJCOPY) --add-gnu-debuglink=$< $@ |
| 55 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 56 | |
Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 57 | ifneq ($(wildcard $(TARGET_CC)),) |
| 58 | TARGET_LIBGCC := \ |
Bruce Beare | a17b91f | 2011-01-26 18:43:15 -0800 | [diff] [blame] | 59 | $(shell $(TARGET_CC) -m32 -print-file-name=libgcc.a) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 60 | endif |
| 61 | |
Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 62 | TARGET_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 63 | |
| 64 | libc_root := bionic/libc |
| 65 | libm_root := bionic/libm |
| 66 | libstdc++_root := bionic/libstdc++ |
| 67 | libthread_db_root := bionic/libthread_db |
| 68 | |
| 69 | # unless CUSTOM_KERNEL_HEADERS is defined, we're going to use |
| 70 | # symlinks located in out/ to point to the appropriate kernel |
| 71 | # headers. see 'config/kernel_headers.make' for more details |
| 72 | # |
| 73 | ifneq ($(CUSTOM_KERNEL_HEADERS),) |
| 74 | KERNEL_HEADERS_COMMON := $(CUSTOM_KERNEL_HEADERS) |
| 75 | KERNEL_HEADERS_ARCH := $(CUSTOM_KERNEL_HEADERS) |
| 76 | else |
| 77 | KERNEL_HEADERS_COMMON := $(libc_root)/kernel/common |
| 78 | KERNEL_HEADERS_ARCH := $(libc_root)/kernel/arch-$(TARGET_ARCH) |
| 79 | endif |
| 80 | KERNEL_HEADERS := $(KERNEL_HEADERS_COMMON) $(KERNEL_HEADERS_ARCH) |
| 81 | |
Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 82 | TARGET_GLOBAL_CFLAGS += \ |
Mark D Horn | 5812d7b | 2011-04-26 14:15:26 -0700 | [diff] [blame] | 83 | -O2 \ |
Bruce Beare | ccec9c4 | 2010-10-14 14:12:46 -0700 | [diff] [blame] | 84 | -Ulinux \ |
Mark D Horn | 5812d7b | 2011-04-26 14:15:26 -0700 | [diff] [blame] | 85 | -Wa,--noexecstack \ |
| 86 | -Werror=format-security \ |
| 87 | -Wstrict-aliasing=2 \ |
Nick Kralevich | d9d2e7a | 2011-11-04 13:07:26 -0700 | [diff] [blame] | 88 | -fPIC -fPIE \ |
Mark D Horn | 5812d7b | 2011-04-26 14:15:26 -0700 | [diff] [blame] | 89 | -ffunction-sections \ |
| 90 | -finline-functions \ |
| 91 | -finline-limit=300 \ |
| 92 | -fno-inline-functions-called-once \ |
| 93 | -fno-short-enums \ |
| 94 | -fstrict-aliasing \ |
| 95 | -funswitch-loops \ |
| 96 | -funwind-tables \ |
Andrew Hsieh | c2fb239 | 2012-08-29 15:13:23 +0800 | [diff] [blame] | 97 | -fstack-protector \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 98 | -include $(call select-android-config-h,target_linux-x86) |
| 99 | |
David 'Digit' Turner | 6371da1 | 2011-12-13 17:21:56 +0100 | [diff] [blame] | 100 | # XXX: Not sure this is still needed. Must check with our toolchains. |
Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 101 | TARGET_GLOBAL_CPPFLAGS += \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 102 | -fno-use-cxa-atexit |
| 103 | |
David 'Digit' Turner | 6371da1 | 2011-12-13 17:21:56 +0100 | [diff] [blame] | 104 | # XXX: Our toolchain is normally configured to always set these flags by default |
| 105 | # however, there have been reports that this is sometimes not the case. So make |
| 106 | # them explicit here unless we have the time to carefully check it |
| 107 | # |
Jean-Baptiste Queru | 6e20782 | 2012-06-13 07:42:04 -0700 | [diff] [blame] | 108 | TARGET_GLOBAL_CFLAGS += -mstackrealign -msse3 -mfpmath=sse -m32 |
Bruce Beare | 3343b27 | 2011-12-09 13:27:08 -0800 | [diff] [blame] | 109 | |
David 'Digit' Turner | 6371da1 | 2011-12-13 17:21:56 +0100 | [diff] [blame] | 110 | # XXX: These flags should not be defined here anymore. Instead, the Android.mk |
| 111 | # of the modules that depend on these features should instead check the |
| 112 | # corresponding macros (e.g. ARCH_X86_HAVE_SSE2 and ARCH_X86_HAVE_SSSE3) |
| 113 | # Keep them here until this is all cleared up. |
| 114 | # |
| 115 | ifeq ($(ARCH_X86_HAVE_SSE2),true) |
| 116 | TARGET_GLOBAL_CFLAGS += -DUSE_SSE2 |
Bruce Beare | ccec9c4 | 2010-10-14 14:12:46 -0700 | [diff] [blame] | 117 | endif |
| 118 | |
David 'Digit' Turner | 6371da1 | 2011-12-13 17:21:56 +0100 | [diff] [blame] | 119 | ifeq ($(ARCH_X86_HAVE_SSSE3),true) # yes, really SSSE3, not SSE3! |
| 120 | TARGET_GLOBAL_CFLAGS += -DUSE_SSSE3 |
| 121 | endif |
| 122 | |
| 123 | # XXX: This flag is probably redundant. I believe our toolchain always sets |
| 124 | # it by default. Consider for removal. |
| 125 | # |
Bruce Beare | 2e8283d | 2011-02-01 08:00:09 -0800 | [diff] [blame] | 126 | TARGET_GLOBAL_CFLAGS += -mbionic |
David 'Digit' Turner | 6371da1 | 2011-12-13 17:21:56 +0100 | [diff] [blame] | 127 | |
| 128 | # XXX: This flag is probably redundant. The macro should be defined by our |
| 129 | # toolchain binaries automatically (as a compiler built-in). |
| 130 | # Check with: $BINPREFIX-gcc -dM -E < /dev/null |
| 131 | # |
| 132 | # Consider for removal. |
| 133 | # |
Bruce Beare | ccec9c4 | 2010-10-14 14:12:46 -0700 | [diff] [blame] | 134 | TARGET_GLOBAL_CFLAGS += -D__ANDROID__ |
Bruce Beare | ccec9c4 | 2010-10-14 14:12:46 -0700 | [diff] [blame] | 135 | |
David 'Digit' Turner | 6371da1 | 2011-12-13 17:21:56 +0100 | [diff] [blame] | 136 | # XXX: This flag is probably redundant since our toolchain binaries already |
| 137 | # generate 32-bit machine code. It probably dates back to the old days |
| 138 | # where we were using the host toolchain on Linux to build the platform |
| 139 | # images. Consider it for removal. |
Mark D Horn | 5812d7b | 2011-04-26 14:15:26 -0700 | [diff] [blame] | 140 | TARGET_GLOBAL_LDFLAGS += -m32 |
David 'Digit' Turner | 6371da1 | 2011-12-13 17:21:56 +0100 | [diff] [blame] | 141 | |
Mark D Horn | 5812d7b | 2011-04-26 14:15:26 -0700 | [diff] [blame] | 142 | TARGET_GLOBAL_LDFLAGS += -Wl,-z,noexecstack |
Nick Kralevich | ecb1a56 | 2012-05-09 14:49:04 -0700 | [diff] [blame] | 143 | TARGET_GLOBAL_LDFLAGS += -Wl,-z,relro -Wl,-z,now |
Nick Kralevich | 4f2f16d | 2012-10-19 13:36:49 -0700 | [diff] [blame^] | 144 | TARGET_GLOBAL_LDFLAGS += -Wl,--warn-shared-textrel |
Mark D Horn | 5812d7b | 2011-04-26 14:15:26 -0700 | [diff] [blame] | 145 | TARGET_GLOBAL_LDFLAGS += -Wl,--gc-sections |
Bruce Beare | ccec9c4 | 2010-10-14 14:12:46 -0700 | [diff] [blame] | 146 | |
Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 147 | TARGET_C_INCLUDES := \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 148 | $(libc_root)/arch-x86/include \ |
| 149 | $(libc_root)/include \ |
| 150 | $(libstdc++_root)/include \ |
| 151 | $(KERNEL_HEADERS) \ |
| 152 | $(libm_root)/include \ |
| 153 | $(libm_root)/include/i387 \ |
| 154 | $(libthread_db_root)/include |
| 155 | |
| 156 | TARGET_CRTBEGIN_STATIC_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_static.o |
| 157 | TARGET_CRTBEGIN_DYNAMIC_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_dynamic.o |
| 158 | TARGET_CRTEND_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_android.o |
| 159 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 160 | TARGET_CRTBEGIN_SO_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_so.o |
| 161 | TARGET_CRTEND_SO_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_so.o |
| 162 | |
Bruce Beare | 45ac434 | 2010-06-24 14:02:00 -0700 | [diff] [blame] | 163 | TARGET_STRIP_MODULE:=true |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 164 | |
Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 165 | TARGET_DEFAULT_SYSTEM_SHARED_LIBRARIES := libc libstdc++ libm |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 166 | |
Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 167 | TARGET_CUSTOM_LD_COMMAND := true |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 168 | define transform-o-to-shared-lib-inner |
Ying Wang | 3a7e4cc | 2011-01-28 14:14:47 -0800 | [diff] [blame] | 169 | $(hide) $(PRIVATE_CXX) \ |
Ying Wang | 1a08100 | 2010-07-13 14:55:47 -0700 | [diff] [blame] | 170 | $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 171 | -nostdlib -Wl,-soname,$(notdir $@) \ |
| 172 | -shared -Bsymbolic \ |
Bruce Beare | ccec9c4 | 2010-10-14 14:12:46 -0700 | [diff] [blame] | 173 | $(TARGET_GLOBAL_CFLAGS) \ |
Ying Wang | 1a08100 | 2010-07-13 14:55:47 -0700 | [diff] [blame] | 174 | $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \ |
Jeff Brown | 703e7c6 | 2011-02-04 20:15:00 -0800 | [diff] [blame] | 175 | $(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] | 176 | $(PRIVATE_ALL_OBJECTS) \ |
| 177 | -Wl,--whole-archive \ |
Ying Wang | 80e6cce | 2011-01-24 23:25:36 -0800 | [diff] [blame] | 178 | $(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 179 | -Wl,--no-whole-archive \ |
Ying Wang | fcdabd4 | 2011-04-25 14:22:41 -0700 | [diff] [blame] | 180 | $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 181 | $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ |
Ying Wang | fcdabd4 | 2011-04-25 14:22:41 -0700 | [diff] [blame] | 182 | $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 183 | $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ |
| 184 | -o $@ \ |
| 185 | $(PRIVATE_LDFLAGS) \ |
Ying Wang | 1a08100 | 2010-07-13 14:55:47 -0700 | [diff] [blame] | 186 | $(PRIVATE_TARGET_LIBGCC) \ |
Jeff Brown | 703e7c6 | 2011-02-04 20:15:00 -0800 | [diff] [blame] | 187 | $(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] | 188 | endef |
| 189 | |
| 190 | |
| 191 | define transform-o-to-executable-inner |
Ying Wang | 3a7e4cc | 2011-01-28 14:14:47 -0800 | [diff] [blame] | 192 | $(hide) $(PRIVATE_CXX) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 193 | $(TARGET_GLOBAL_LDFLAGS) \ |
| 194 | -nostdlib -Bdynamic \ |
| 195 | -Wl,-dynamic-linker,/system/bin/linker \ |
| 196 | -Wl,-z,nocopyreloc \ |
Nick Kralevich | d9d2e7a | 2011-11-04 13:07:26 -0700 | [diff] [blame] | 197 | -fPIE -pie \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 198 | -o $@ \ |
| 199 | $(TARGET_GLOBAL_LD_DIRS) \ |
| 200 | -Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \ |
| 201 | $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ |
Jeff Brown | 703e7c6 | 2011-02-04 20:15:00 -0800 | [diff] [blame] | 202 | $(if $(filter true,$(PRIVATE_NO_CRT)),,$(TARGET_CRTBEGIN_DYNAMIC_O)) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 203 | $(PRIVATE_ALL_OBJECTS) \ |
Kito Cheng | 61c37e7 | 2012-01-20 19:21:46 +0800 | [diff] [blame] | 204 | -Wl,--whole-archive \ |
| 205 | $(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ |
| 206 | -Wl,--no-whole-archive \ |
Ying Wang | fcdabd4 | 2011-04-25 14:22:41 -0700 | [diff] [blame] | 207 | $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--start-group) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 208 | $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ |
Ying Wang | fcdabd4 | 2011-04-25 14:22:41 -0700 | [diff] [blame] | 209 | $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 210 | $(PRIVATE_LDFLAGS) \ |
| 211 | $(TARGET_LIBGCC) \ |
Jeff Brown | 703e7c6 | 2011-02-04 20:15:00 -0800 | [diff] [blame] | 212 | $(if $(filter true,$(PRIVATE_NO_CRT)),,$(TARGET_CRTEND_O)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 213 | endef |
| 214 | |
| 215 | define transform-o-to-static-executable-inner |
Ying Wang | 3a7e4cc | 2011-01-28 14:14:47 -0800 | [diff] [blame] | 216 | $(hide) $(PRIVATE_CXX) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 217 | $(TARGET_GLOBAL_LDFLAGS) \ |
| 218 | -nostdlib -Bstatic \ |
| 219 | -o $@ \ |
| 220 | $(TARGET_GLOBAL_LD_DIRS) \ |
Jeff Brown | 703e7c6 | 2011-02-04 20:15:00 -0800 | [diff] [blame] | 221 | $(if $(filter true,$(PRIVATE_NO_CRT)),,$(TARGET_CRTBEGIN_STATIC_O)) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 222 | $(PRIVATE_LDFLAGS) \ |
| 223 | $(PRIVATE_ALL_OBJECTS) \ |
Kito Cheng | 61c37e7 | 2012-01-20 19:21:46 +0800 | [diff] [blame] | 224 | -Wl,--whole-archive \ |
| 225 | $(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ |
| 226 | -Wl,--no-whole-archive \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 227 | -Wl,--start-group \ |
| 228 | $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ |
| 229 | $(TARGET_LIBGCC) \ |
| 230 | -Wl,--end-group \ |
Jeff Brown | 703e7c6 | 2011-02-04 20:15:00 -0800 | [diff] [blame] | 231 | $(if $(filter true,$(PRIVATE_NO_CRT)),,$(TARGET_CRTEND_O)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 232 | endef |
David 'Digit' Turner | 6371da1 | 2011-12-13 17:21:56 +0100 | [diff] [blame] | 233 | |
| 234 | # Special check for x86 NDK ABI compatibility. |
| 235 | # The TARGET_CPU_ABI variable should be defined in BoardConfig.mk to 'x86' |
| 236 | # *only* if the platform image is compatible with the NDK x86 ABI. |
| 237 | # |
| 238 | # We perform a small check here to ensure that nothing bad can happen. |
| 239 | # |
| 240 | ifeq ($(TARGET_CPU_ABI),x86) |
| 241 | ifneq (true-true-true-true,$(ARCH_X86_HAVE_MMX)-$(ARCH_X86_HAVE_SSE)-$(ARCH_X86_HAVE_SSE2)-$(ARCH_X86_HAVE_SSE3)) |
| 242 | $(info ERROR: Your x86 platform image is not compatible with the NDK x86 ABI) |
| 243 | $(info As such, you should *not* define TARGET_CPU_ABI to 'x86' in your BoardConfig.mk) |
| 244 | $(info to ensure that your device will not be mistakenly listed as compatible by |
| 245 | $(info the Android Market. Also, it is likely that the image will fail the CTS tests) |
| 246 | $(info Please undefine TARGET_CPU_ABI in your BoardConfig.mk, or select the value 'none') |
| 247 | $(info The corresponding image will still be able to run Dalvik-based Android applications) |
| 248 | $(error Aborting build! Please fix your BoardConfig.mk) |
| 249 | endif |
| 250 | endif |