Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2012 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 | # |
| 17 | |
| 18 | LOCAL_PATH := $(call my-dir) |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 19 | |
Stephen Hines | 3069461 | 2014-05-14 00:00:32 -0700 | [diff] [blame] | 20 | |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 21 | # The following list contains platform-independent functionalities. |
| 22 | # |
Shih-wei Liao | cec0726 | 2013-01-26 22:12:04 -0800 | [diff] [blame] | 23 | # Skip apple_versioning.c since it is unused. |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 24 | # Skip atomic.c since it needs to be built separately according to the docs. |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 25 | libcompiler_rt_common_SRC_FILES := \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 26 | lib/builtins/absvdi2.c \ |
| 27 | lib/builtins/absvsi2.c \ |
| 28 | lib/builtins/absvti2.c \ |
| 29 | lib/builtins/adddf3.c \ |
| 30 | lib/builtins/addsf3.c \ |
Dan Albert | 5c072a6 | 2014-06-19 16:03:10 -0700 | [diff] [blame] | 31 | lib/builtins/addtf3.c \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 32 | lib/builtins/addvdi3.c \ |
| 33 | lib/builtins/addvsi3.c \ |
| 34 | lib/builtins/addvti3.c \ |
| 35 | lib/builtins/ashldi3.c \ |
| 36 | lib/builtins/ashlti3.c \ |
| 37 | lib/builtins/ashrdi3.c \ |
| 38 | lib/builtins/ashrti3.c \ |
| 39 | lib/builtins/clear_cache.c \ |
| 40 | lib/builtins/clzdi2.c \ |
| 41 | lib/builtins/clzsi2.c \ |
| 42 | lib/builtins/clzti2.c \ |
| 43 | lib/builtins/cmpdi2.c \ |
| 44 | lib/builtins/cmpti2.c \ |
| 45 | lib/builtins/comparedf2.c \ |
| 46 | lib/builtins/comparesf2.c \ |
Dan Albert | 5148f96 | 2014-06-18 19:32:53 -0700 | [diff] [blame] | 47 | lib/builtins/comparetf2.c \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 48 | lib/builtins/ctzdi2.c \ |
| 49 | lib/builtins/ctzsi2.c \ |
| 50 | lib/builtins/ctzti2.c \ |
| 51 | lib/builtins/divdc3.c \ |
| 52 | lib/builtins/divdf3.c \ |
| 53 | lib/builtins/divdi3.c \ |
| 54 | lib/builtins/divmoddi4.c \ |
| 55 | lib/builtins/divmodsi4.c \ |
| 56 | lib/builtins/divsc3.c \ |
| 57 | lib/builtins/divsf3.c \ |
| 58 | lib/builtins/divsi3.c \ |
Stephen Hines | 3ce6da3 | 2015-07-01 18:17:28 -0700 | [diff] [blame] | 59 | lib/builtins/divtf3.c \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 60 | lib/builtins/divti3.c \ |
| 61 | lib/builtins/divxc3.c \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 62 | lib/builtins/eprintf.c \ |
Dan Albert | 9f64790 | 2014-10-14 14:28:39 -0700 | [diff] [blame] | 63 | lib/builtins/extenddftf2.c \ |
Pirama Arumuga Nainar | 403e558 | 2015-05-20 13:03:23 -0700 | [diff] [blame] | 64 | lib/builtins/extendhfsf2.c \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 65 | lib/builtins/extendsfdf2.c \ |
Dan Albert | 9f64790 | 2014-10-14 14:28:39 -0700 | [diff] [blame] | 66 | lib/builtins/extendsftf2.c \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 67 | lib/builtins/ffsdi2.c \ |
| 68 | lib/builtins/ffsti2.c \ |
| 69 | lib/builtins/fixdfdi.c \ |
| 70 | lib/builtins/fixdfsi.c \ |
| 71 | lib/builtins/fixdfti.c \ |
| 72 | lib/builtins/fixsfdi.c \ |
| 73 | lib/builtins/fixsfsi.c \ |
| 74 | lib/builtins/fixsfti.c \ |
Stephen Hines | 3ce6da3 | 2015-07-01 18:17:28 -0700 | [diff] [blame] | 75 | lib/builtins/fixtfdi.c \ |
| 76 | lib/builtins/fixtfsi.c \ |
| 77 | lib/builtins/fixtfti.c \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 78 | lib/builtins/fixunsdfdi.c \ |
| 79 | lib/builtins/fixunsdfsi.c \ |
| 80 | lib/builtins/fixunsdfti.c \ |
| 81 | lib/builtins/fixunssfdi.c \ |
| 82 | lib/builtins/fixunssfsi.c \ |
| 83 | lib/builtins/fixunssfti.c \ |
Stephen Hines | 3ce6da3 | 2015-07-01 18:17:28 -0700 | [diff] [blame] | 84 | lib/builtins/fixunstfdi.c \ |
| 85 | lib/builtins/fixunstfsi.c \ |
| 86 | lib/builtins/fixunstfti.c \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 87 | lib/builtins/fixunsxfdi.c \ |
| 88 | lib/builtins/fixunsxfsi.c \ |
| 89 | lib/builtins/fixunsxfti.c \ |
| 90 | lib/builtins/fixxfdi.c \ |
| 91 | lib/builtins/fixxfti.c \ |
| 92 | lib/builtins/floatdidf.c \ |
| 93 | lib/builtins/floatdisf.c \ |
| 94 | lib/builtins/floatdixf.c \ |
| 95 | lib/builtins/floatsidf.c \ |
| 96 | lib/builtins/floatsisf.c \ |
Dan Albert | 9f64790 | 2014-10-14 14:28:39 -0700 | [diff] [blame] | 97 | lib/builtins/floatsitf.c \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 98 | lib/builtins/floattidf.c \ |
| 99 | lib/builtins/floattisf.c \ |
| 100 | lib/builtins/floattixf.c \ |
| 101 | lib/builtins/floatundidf.c \ |
| 102 | lib/builtins/floatundisf.c \ |
| 103 | lib/builtins/floatundixf.c \ |
| 104 | lib/builtins/floatunsidf.c \ |
| 105 | lib/builtins/floatunsisf.c \ |
Dan Albert | 9f64790 | 2014-10-14 14:28:39 -0700 | [diff] [blame] | 106 | lib/builtins/floatunsitf.c \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 107 | lib/builtins/floatuntidf.c \ |
| 108 | lib/builtins/floatuntisf.c \ |
| 109 | lib/builtins/floatuntixf.c \ |
Dan Albert | b6c4825 | 2014-10-13 11:14:36 -0700 | [diff] [blame] | 110 | lib/builtins/gcc_personality_v0.c \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 111 | lib/builtins/int_util.c \ |
| 112 | lib/builtins/lshrdi3.c \ |
| 113 | lib/builtins/lshrti3.c \ |
| 114 | lib/builtins/moddi3.c \ |
| 115 | lib/builtins/modsi3.c \ |
| 116 | lib/builtins/modti3.c \ |
| 117 | lib/builtins/muldc3.c \ |
| 118 | lib/builtins/muldf3.c \ |
| 119 | lib/builtins/muldi3.c \ |
| 120 | lib/builtins/mulodi4.c \ |
| 121 | lib/builtins/mulosi4.c \ |
| 122 | lib/builtins/muloti4.c \ |
| 123 | lib/builtins/mulsc3.c \ |
| 124 | lib/builtins/mulsf3.c \ |
Dan Albert | 5c072a6 | 2014-06-19 16:03:10 -0700 | [diff] [blame] | 125 | lib/builtins/multf3.c \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 126 | lib/builtins/multi3.c \ |
| 127 | lib/builtins/mulvdi3.c \ |
| 128 | lib/builtins/mulvsi3.c \ |
| 129 | lib/builtins/mulvti3.c \ |
| 130 | lib/builtins/mulxc3.c \ |
| 131 | lib/builtins/negdf2.c \ |
| 132 | lib/builtins/negdi2.c \ |
| 133 | lib/builtins/negsf2.c \ |
| 134 | lib/builtins/negti2.c \ |
| 135 | lib/builtins/negvdi2.c \ |
| 136 | lib/builtins/negvsi2.c \ |
| 137 | lib/builtins/negvti2.c \ |
| 138 | lib/builtins/paritydi2.c \ |
| 139 | lib/builtins/paritysi2.c \ |
| 140 | lib/builtins/parityti2.c \ |
| 141 | lib/builtins/popcountdi2.c \ |
| 142 | lib/builtins/popcountsi2.c \ |
| 143 | lib/builtins/popcountti2.c \ |
| 144 | lib/builtins/powidf2.c \ |
| 145 | lib/builtins/powisf2.c \ |
| 146 | lib/builtins/powitf2.c \ |
| 147 | lib/builtins/powixf2.c \ |
| 148 | lib/builtins/subdf3.c \ |
| 149 | lib/builtins/subsf3.c \ |
Dan Albert | 5c072a6 | 2014-06-19 16:03:10 -0700 | [diff] [blame] | 150 | lib/builtins/subtf3.c \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 151 | lib/builtins/subvdi3.c \ |
| 152 | lib/builtins/subvsi3.c \ |
| 153 | lib/builtins/subvti3.c \ |
| 154 | lib/builtins/trampoline_setup.c \ |
Pirama Arumuga Nainar | 403e558 | 2015-05-20 13:03:23 -0700 | [diff] [blame] | 155 | lib/builtins/truncdfhf2.c \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 156 | lib/builtins/truncdfsf2.c \ |
Pirama Arumuga Nainar | 403e558 | 2015-05-20 13:03:23 -0700 | [diff] [blame] | 157 | lib/builtins/truncsfhf2.c \ |
Dan Albert | 9f64790 | 2014-10-14 14:28:39 -0700 | [diff] [blame] | 158 | lib/builtins/trunctfdf2.c \ |
| 159 | lib/builtins/trunctfsf2.c \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 160 | lib/builtins/ucmpdi2.c \ |
| 161 | lib/builtins/ucmpti2.c \ |
| 162 | lib/builtins/udivdi3.c \ |
| 163 | lib/builtins/udivmoddi4.c \ |
| 164 | lib/builtins/udivmodsi4.c \ |
| 165 | lib/builtins/udivmodti4.c \ |
| 166 | lib/builtins/udivsi3.c \ |
| 167 | lib/builtins/udivti3.c \ |
| 168 | lib/builtins/umoddi3.c \ |
| 169 | lib/builtins/umodsi3.c \ |
| 170 | lib/builtins/umodti3.c |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 171 | |
Stephen Hines | 11f8ffe | 2014-09-30 02:33:12 -0700 | [diff] [blame] | 172 | # Only build enable_execute_stack.c on non-Windows hosts. |
| 173 | ifneq ($(HOST_OS),windows) |
| 174 | libcompiler_rt_common_SRC_FILES += \ |
| 175 | lib/builtins/enable_execute_stack.c |
| 176 | endif |
| 177 | |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 178 | # ARM-specific runtimes |
| 179 | libcompiler_rt_arm_SRC_FILES := \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 180 | lib/builtins/arm/aeabi_dcmp.S \ |
Dan Albert | efae861 | 2014-10-10 15:32:41 -0700 | [diff] [blame] | 181 | lib/builtins/arm/aeabi_div0.c \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 182 | lib/builtins/arm/aeabi_fcmp.S \ |
| 183 | lib/builtins/arm/aeabi_idivmod.S \ |
| 184 | lib/builtins/arm/aeabi_ldivmod.S \ |
| 185 | lib/builtins/arm/aeabi_memcmp.S \ |
| 186 | lib/builtins/arm/aeabi_memcpy.S \ |
| 187 | lib/builtins/arm/aeabi_memmove.S \ |
| 188 | lib/builtins/arm/aeabi_memset.S \ |
| 189 | lib/builtins/arm/aeabi_uidivmod.S \ |
| 190 | lib/builtins/arm/aeabi_uldivmod.S \ |
| 191 | lib/builtins/arm/comparesf2.S \ |
| 192 | lib/builtins/arm/divmodsi4.S \ |
| 193 | lib/builtins/arm/divsi3.S \ |
| 194 | lib/builtins/arm/modsi3.S \ |
| 195 | lib/builtins/arm/udivmodsi4.S \ |
| 196 | lib/builtins/arm/udivsi3.S \ |
Stephen Hines | 3b1a2d5 | 2015-07-16 13:33:30 -0700 | [diff] [blame] | 197 | lib/builtins/arm/umodsi3.S \ |
| 198 | lib/builtins/arm/adddf3vfp.S \ |
| 199 | lib/builtins/arm/addsf3vfp.S \ |
| 200 | lib/builtins/arm/divdf3vfp.S \ |
| 201 | lib/builtins/arm/divsf3vfp.S \ |
| 202 | lib/builtins/arm/eqdf2vfp.S \ |
| 203 | lib/builtins/arm/eqsf2vfp.S \ |
| 204 | lib/builtins/arm/extendsfdf2vfp.S \ |
| 205 | lib/builtins/arm/fixdfsivfp.S \ |
| 206 | lib/builtins/arm/fixsfsivfp.S \ |
| 207 | lib/builtins/arm/fixunsdfsivfp.S \ |
| 208 | lib/builtins/arm/fixunssfsivfp.S \ |
| 209 | lib/builtins/arm/floatsidfvfp.S \ |
| 210 | lib/builtins/arm/floatsisfvfp.S \ |
| 211 | lib/builtins/arm/floatunssidfvfp.S \ |
| 212 | lib/builtins/arm/floatunssisfvfp.S \ |
| 213 | lib/builtins/arm/gedf2vfp.S \ |
| 214 | lib/builtins/arm/gesf2vfp.S \ |
| 215 | lib/builtins/arm/gtdf2vfp.S \ |
| 216 | lib/builtins/arm/gtsf2vfp.S \ |
| 217 | lib/builtins/arm/ledf2vfp.S \ |
| 218 | lib/builtins/arm/lesf2vfp.S \ |
| 219 | lib/builtins/arm/ltdf2vfp.S \ |
| 220 | lib/builtins/arm/ltsf2vfp.S \ |
| 221 | lib/builtins/arm/muldf3vfp.S \ |
| 222 | lib/builtins/arm/mulsf3vfp.S \ |
| 223 | lib/builtins/arm/nedf2vfp.S \ |
| 224 | lib/builtins/arm/negdf2vfp.S \ |
| 225 | lib/builtins/arm/negsf2vfp.S \ |
| 226 | lib/builtins/arm/nesf2vfp.S \ |
| 227 | lib/builtins/arm/subdf3vfp.S \ |
| 228 | lib/builtins/arm/subsf3vfp.S \ |
| 229 | lib/builtins/arm/truncdfsf2vfp.S \ |
| 230 | lib/builtins/arm/unorddf2vfp.S \ |
| 231 | lib/builtins/arm/unordsf2vfp.S |
| 232 | |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 233 | |
Tim Murray | 6731c55 | 2014-03-10 11:10:47 -0700 | [diff] [blame] | 234 | # ARM64-specific runtimes |
| 235 | libcompiler_rt_arm64_SRC_FILES := |
| 236 | |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 237 | # MIPS-specific runtimes |
| 238 | libcompiler_rt_mips_SRC_FILES := # nothing to add |
Duane Sand | 5b87b3d | 2014-05-20 11:06:29 -0700 | [diff] [blame] | 239 | libcompiler_rt_mips64_SRC_FILES := # nothing to add |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 240 | |
| 241 | # X86-specific runtimes |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 242 | libcompiler_rt_x86_SRC_FILES := \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 243 | lib/builtins/i386/ashldi3.S \ |
| 244 | lib/builtins/i386/ashrdi3.S \ |
| 245 | lib/builtins/i386/divdi3.S \ |
| 246 | lib/builtins/i386/floatdidf.S \ |
| 247 | lib/builtins/i386/floatdisf.S \ |
| 248 | lib/builtins/i386/floatdixf.S \ |
| 249 | lib/builtins/i386/floatundidf.S \ |
| 250 | lib/builtins/i386/floatundisf.S \ |
| 251 | lib/builtins/i386/floatundixf.S \ |
| 252 | lib/builtins/i386/lshrdi3.S \ |
| 253 | lib/builtins/i386/moddi3.S \ |
| 254 | lib/builtins/i386/muldi3.S \ |
| 255 | lib/builtins/i386/udivdi3.S \ |
| 256 | lib/builtins/i386/umoddi3.S |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 257 | |
Alexey Volkov | 9939506 | 2014-01-17 17:44:56 +0400 | [diff] [blame] | 258 | # X86_64-specific runtimes |
| 259 | libcompiler_rt_x86_64_SRC_FILES := \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 260 | lib/builtins/x86_64/floatundixf.S \ |
| 261 | lib/builtins/x86_64/floatdisf.c \ |
| 262 | lib/builtins/x86_64/floatdidf.c \ |
| 263 | lib/builtins/x86_64/floatdixf.c \ |
| 264 | lib/builtins/x86_64/floatundisf.S \ |
| 265 | lib/builtins/x86_64/floatundidf.S |
Alexey Volkov | 9939506 | 2014-01-17 17:44:56 +0400 | [diff] [blame] | 266 | |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 267 | # The following list contains functions that are not available in libgcc.a, so |
| 268 | # we potentially need them when using a Clang-built component (e.g., -ftrapv |
| 269 | # with 64-bit integer multiplies. See http://llvm.org/bugs/show_bug.cgi?id=14469.) |
| 270 | libcompiler_rt_extras_SRC_FILES := \ |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 271 | lib/builtins/mulodi4.c |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 272 | |
| 273 | # $(1): arch |
| 274 | define get-libcompiler-rt-source-files |
| 275 | $(if $(findstring $(1),arm),$(call get-libcompiler-rt-arm-source-files), |
| 276 | $(if $(findstring $(1),mips),$(call get-libcompiler-rt-mips-source-files), |
| 277 | $(if $(findstring $(1),x86),$(call get-libcompiler-rt-x86-source-files), |
Alexey Volkov | 9939506 | 2014-01-17 17:44:56 +0400 | [diff] [blame] | 278 | $(if $(findstring $(1),x86_64),$(call get-libcompiler-rt-x86_64-source-files), |
Pavel Chupin | 5534fc3 | 2013-07-25 20:31:56 +0400 | [diff] [blame] | 279 | $(if $(findstring $(1),x32),$(call get-libcompiler-rt-x86-source-files), |
Tim Murray | 6731c55 | 2014-03-10 11:10:47 -0700 | [diff] [blame] | 280 | $(if $(findstring $(1),arm64),$(call get-libcompiler-rt-arm64-source-files), |
Duane Sand | 5b87b3d | 2014-05-20 11:06:29 -0700 | [diff] [blame] | 281 | $(if $(findstring $(1),mips64),$(call get-libcompiler-rt-mips64-source-files), |
| 282 | $(error Unsupported ARCH $(1))))))))) |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 283 | endef |
| 284 | |
| 285 | # $(1): source list |
| 286 | # $(2): arch |
| 287 | # |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 288 | # If lib/builtins/<arch>/X.[cS] is included in the source list, we should filter out lib/builtins/X.c |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 289 | # in the result source list (i.e., use the one optimized for the arch.) Otherwise |
| 290 | # there'll be multiple definitions for one symbol. |
| 291 | define filter-libcompiler-rt-common-source-files |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 292 | $(filter-out $(patsubst lib/builtins/$(strip $(2))/%.S,lib/builtins/%.c,\ |
| 293 | $(filter lib/builtins/$(strip $(2))/%.S,$(1))) \ |
| 294 | $(patsubst lib/builtins/$(strip $(2))/%.c,lib/builtins/%.c,\ |
| 295 | $(filter lib/builtins/$(strip $(2))/%.c,$(1))),$(1)) |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 296 | endef |
| 297 | |
Shih-wei Liao | ece6264 | 2013-02-07 07:49:51 -0800 | [diff] [blame] | 298 | define get-libcompiler-rt-arm-common-source-files |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 299 | $(call filter-libcompiler-rt-common-source-files, |
Shih-wei Liao | c8f5519 | 2013-02-07 22:00:08 -0800 | [diff] [blame] | 300 | $(libcompiler_rt_common_SRC_FILES) \ |
Shih-wei Liao | ece6264 | 2013-02-07 07:49:51 -0800 | [diff] [blame] | 301 | $(libcompiler_rt_arm_SRC_FILES), arm) |
| 302 | endef |
| 303 | |
| 304 | # $(1): common runtime list |
| 305 | # |
| 306 | # Add ARM runtimes implemented in VFP |
| 307 | define add-libcompiler-rt-arm-vfp-source-files |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 308 | $(filter-out $(addprefix lib/builtins/,adddf3.c addsf3.c comparedf2.c comparesf2.c \ |
| 309 | arm/comparesf2.S divdf3.c divsf3.c extendsfdf2.c \ |
| 310 | fixdfsi.c fixsfsi.c fixunsdfsi.c fixunssfsi.c \ |
| 311 | floatsidf.c floatsisf.c floatunsidf.c floatunsisf.c \ |
| 312 | muldf3.c mulsf3.c negdf2.c negsf2.c subdf3.c \ |
Stephen Hines | 3b1a2d5 | 2015-07-16 13:33:30 -0700 | [diff] [blame] | 313 | subsf3.c truncdfsf2.c),$(1)) |
Shih-wei Liao | ece6264 | 2013-02-07 07:49:51 -0800 | [diff] [blame] | 314 | endef |
| 315 | |
| 316 | define get-libcompiler-rt-arm-source-files |
| 317 | $(if $(findstring $(ARCH_ARM_HAVE_VFP),true), |
| 318 | $(call add-libcompiler-rt-arm-vfp-source-files, |
| 319 | $(call get-libcompiler-rt-arm-common-source-files)), |
| 320 | $(call get-libcompiler-rt-arm-common-source-files)) |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 321 | endef |
| 322 | |
Tim Murray | 6731c55 | 2014-03-10 11:10:47 -0700 | [diff] [blame] | 323 | define get-libcompiler-rt-arm64-source-files |
| 324 | $(call filter-libcompiler-rt-common-source-files, |
| 325 | $(libcompiler_rt_common_SRC_FILES) \ |
| 326 | $(libcompiler_rt_arm64_SRC_FILES),arm64) |
| 327 | endef |
| 328 | |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 329 | define get-libcompiler-rt-mips-source-files |
| 330 | $(call filter-libcompiler-rt-common-source-files, |
Shih-wei Liao | c8f5519 | 2013-02-07 22:00:08 -0800 | [diff] [blame] | 331 | $(libcompiler_rt_common_SRC_FILES) \ |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 332 | $(libcompiler_rt_mips_SRC_FILES),mips) |
| 333 | endef |
| 334 | |
Duane Sand | 5b87b3d | 2014-05-20 11:06:29 -0700 | [diff] [blame] | 335 | define get-libcompiler-rt-mips64-source-files |
| 336 | $(call filter-libcompiler-rt-common-source-files, |
| 337 | $(libcompiler_rt_common_SRC_FILES) \ |
| 338 | $(libcompiler_rt_mips64_SRC_FILES),mips64) |
| 339 | endef |
| 340 | |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 341 | define get-libcompiler-rt-x86-source-files |
| 342 | $(call filter-libcompiler-rt-common-source-files, |
Shih-wei Liao | c8f5519 | 2013-02-07 22:00:08 -0800 | [diff] [blame] | 343 | $(libcompiler_rt_common_SRC_FILES) \ |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 344 | $(libcompiler_rt_x86_SRC_FILES),i386) |
| 345 | endef |
| 346 | |
Alexey Volkov | 9939506 | 2014-01-17 17:44:56 +0400 | [diff] [blame] | 347 | define get-libcompiler-rt-x86_64-source-files |
| 348 | $(call filter-libcompiler-rt-common-source-files, |
| 349 | $(libcompiler_rt_common_SRC_FILES) \ |
| 350 | $(libcompiler_rt_x86_64_SRC_FILES),x86_64) |
| 351 | endef |
| 352 | |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 353 | #===================================================================== |
Shih-wei Liao | 7f489a3 | 2013-02-07 03:34:40 -0800 | [diff] [blame] | 354 | # Device Static Library: libcompiler_rt-extras |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 355 | #===================================================================== |
| 356 | |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 357 | include $(CLEAR_VARS) |
| 358 | |
Shih-wei Liao | 7f489a3 | 2013-02-07 03:34:40 -0800 | [diff] [blame] | 359 | LOCAL_MODULE := libcompiler_rt-extras |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 360 | LOCAL_MODULE_TAGS := optional |
| 361 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 362 | LOCAL_CLANG := true |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 363 | LOCAL_SRC_FILES := $(libcompiler_rt_extras_SRC_FILES) |
Stephen Hines | 97ac43c | 2013-01-18 17:46:14 -0800 | [diff] [blame] | 364 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Dan Albert | d92fd09 | 2014-10-16 23:10:08 -0700 | [diff] [blame] | 365 | LOCAL_ADDRESS_SANITIZER := false |
Dan Albert | 99141a6 | 2015-04-30 16:51:20 -0700 | [diff] [blame] | 366 | LOCAL_CXX_STL := none |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 367 | |
Evgeniy Stepanov | dc3865b | 2012-03-13 15:38:23 +0400 | [diff] [blame] | 368 | include $(BUILD_STATIC_LIBRARY) |
| 369 | |
Dan Albert | 06e4b40 | 2015-04-09 16:34:35 -0700 | [diff] [blame] | 370 | #===================================================================== |
| 371 | # Host Static Library: libcompiler_rt-extras |
| 372 | #===================================================================== |
| 373 | |
| 374 | include $(CLEAR_VARS) |
| 375 | |
| 376 | LOCAL_MODULE := libcompiler_rt-extras |
| 377 | LOCAL_CLANG := true |
| 378 | LOCAL_SRC_FILES := $(libcompiler_rt_extras_SRC_FILES) |
| 379 | LOCAL_ADDRESS_SANITIZER := false |
| 380 | LOCAL_MULTILIB := both |
Dan Albert | 99141a6 | 2015-04-30 16:51:20 -0700 | [diff] [blame] | 381 | LOCAL_CXX_STL := none |
Dan Albert | 06e4b40 | 2015-04-09 16:34:35 -0700 | [diff] [blame] | 382 | |
| 383 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 384 | |
Colin Cross | 47ca89c | 2014-03-14 20:12:30 -0700 | [diff] [blame] | 385 | # Don't build compiler-rt without clang |
| 386 | ifneq ($(WITHOUT_TARGET_CLANG), true) |
| 387 | |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 388 | #===================================================================== |
Shih-wei Liao | 7f489a3 | 2013-02-07 03:34:40 -0800 | [diff] [blame] | 389 | # Device Static Library: libcompiler_rt |
Shih-wei Liao | 139a106 | 2013-01-26 11:29:30 -0800 | [diff] [blame] | 390 | #===================================================================== |
Colin Cross | 75d873d | 2014-02-04 16:24:23 -0800 | [diff] [blame] | 391 | |
| 392 | include $(CLEAR_VARS) |
| 393 | |
Colin Cross | 75d873d | 2014-02-04 16:24:23 -0800 | [diff] [blame] | 394 | LOCAL_MODULE := libcompiler_rt |
| 395 | LOCAL_CFLAGS_arm += -D__ARM_EABI__ |
Stephen Hines | a6a2732 | 2015-07-02 14:44:23 -0700 | [diff] [blame] | 396 | LOCAL_CFLAGS_mips64 += -DCRT_HAS_128BIT -DCRT_LDBL_128BIT |
Colin Cross | 75d873d | 2014-02-04 16:24:23 -0800 | [diff] [blame] | 397 | LOCAL_ASFLAGS := -integrated-as |
| 398 | LOCAL_CLANG := true |
| 399 | LOCAL_SRC_FILES_arm := $(call get-libcompiler-rt-source-files,arm) |
Tim Murray | 6731c55 | 2014-03-10 11:10:47 -0700 | [diff] [blame] | 400 | LOCAL_SRC_FILES_arm64 := $(call get-libcompiler-rt-source-files,arm64) |
Colin Cross | 75d873d | 2014-02-04 16:24:23 -0800 | [diff] [blame] | 401 | LOCAL_SRC_FILES_mips := $(call get-libcompiler-rt-source-files,mips) |
Duane Sand | 5b87b3d | 2014-05-20 11:06:29 -0700 | [diff] [blame] | 402 | LOCAL_SRC_FILES_mips64 := $(call get-libcompiler-rt-source-files,mips64) |
Colin Cross | 75d873d | 2014-02-04 16:24:23 -0800 | [diff] [blame] | 403 | LOCAL_SRC_FILES_x86 := $(call get-libcompiler-rt-source-files,x86) |
| 404 | LOCAL_SRC_FILES_x86_64 := $(call get-libcompiler-rt-source-files,x86_64) |
Stephen Hines | a6a2732 | 2015-07-02 14:44:23 -0700 | [diff] [blame] | 405 | LOCAL_SRC_FILES_x86_64 += lib/builtins/ppc/floatditf.c |
Duane Sand | 5b87b3d | 2014-05-20 11:06:29 -0700 | [diff] [blame] | 406 | LOCAL_MODULE_TARGET_ARCH := arm arm64 mips mips64 x86 x86_64 |
Colin Cross | 75d873d | 2014-02-04 16:24:23 -0800 | [diff] [blame] | 407 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Dan Albert | d92fd09 | 2014-10-16 23:10:08 -0700 | [diff] [blame] | 408 | LOCAL_ADDRESS_SANITIZER := false |
Dan Albert | 99141a6 | 2015-04-30 16:51:20 -0700 | [diff] [blame] | 409 | LOCAL_CXX_STL := none |
Colin Cross | 75d873d | 2014-02-04 16:24:23 -0800 | [diff] [blame] | 410 | |
| 411 | include $(BUILD_STATIC_LIBRARY) |
| 412 | |
Shih-wei Liao | fba7691 | 2013-01-27 00:56:26 -0800 | [diff] [blame] | 413 | #===================================================================== |
Dan Albert | 95b6e9a | 2014-05-01 17:40:29 -0700 | [diff] [blame] | 414 | # Host Static Library: libcompiler_rt |
| 415 | #===================================================================== |
| 416 | |
| 417 | include $(CLEAR_VARS) |
| 418 | |
| 419 | LOCAL_MODULE := libcompiler_rt |
| 420 | LOCAL_ASFLAGS := -integrated-as |
| 421 | LOCAL_CLANG := true |
| 422 | LOCAL_SRC_FILES := $(call get-libcompiler-rt-source-files,x86_64) |
Dan Albert | a7f893a | 2014-10-31 16:18:55 -0700 | [diff] [blame] | 423 | LOCAL_ADDRESS_SANITIZER := false |
Dan Albert | 95b6e9a | 2014-05-01 17:40:29 -0700 | [diff] [blame] | 424 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Ian Rogers | a217f3e | 2014-06-05 11:44:01 -0700 | [diff] [blame] | 425 | LOCAL_MULTILIB := both |
Dan Albert | 99141a6 | 2015-04-30 16:51:20 -0700 | [diff] [blame] | 426 | LOCAL_CXX_STL := none |
Dan Albert | 95b6e9a | 2014-05-01 17:40:29 -0700 | [diff] [blame] | 427 | |
| 428 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 429 | |
| 430 | #===================================================================== |
Dan Albert | bbb3f7a | 2015-01-24 15:18:48 -0800 | [diff] [blame] | 431 | # Host Static Library: libprofile_rt |
| 432 | #===================================================================== |
| 433 | |
| 434 | include $(CLEAR_VARS) |
| 435 | |
| 436 | LOCAL_MODULE = libprofile_rt |
| 437 | LOCAL_SRC_FILES = lib/profile/GCDAProfiling.c |
| 438 | LOCAL_ADDRESS_SANITIZER := false |
Dan Albert | 85c672a | 2015-01-29 16:50:29 -0800 | [diff] [blame] | 439 | LOCAL_MULTILIB := both |
Dan Albert | 99141a6 | 2015-04-30 16:51:20 -0700 | [diff] [blame] | 440 | LOCAL_CXX_STL := none |
Dan Albert | bbb3f7a | 2015-01-24 15:18:48 -0800 | [diff] [blame] | 441 | |
| 442 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 443 | |
| 444 | #===================================================================== |
Dmitriy Ivanov | ba9a7b3 | 2014-03-10 18:00:09 -0700 | [diff] [blame] | 445 | # Device Static Library: libprofile_rt |
| 446 | #===================================================================== |
| 447 | |
| 448 | include $(CLEAR_VARS) |
| 449 | |
| 450 | LOCAL_MODULE = libprofile_rt |
Dan Albert | bbb3f7a | 2015-01-24 15:18:48 -0800 | [diff] [blame] | 451 | LOCAL_CLANG := true |
Dmitriy Ivanov | ba9a7b3 | 2014-03-10 18:00:09 -0700 | [diff] [blame] | 452 | LOCAL_SRC_FILES = lib/profile/GCDAProfiling.c |
Dan Albert | a7f893a | 2014-10-31 16:18:55 -0700 | [diff] [blame] | 453 | LOCAL_ADDRESS_SANITIZER := false |
Dan Albert | 85c672a | 2015-01-29 16:50:29 -0800 | [diff] [blame] | 454 | LOCAL_MULTILIB := both |
Dan Albert | 99141a6 | 2015-04-30 16:51:20 -0700 | [diff] [blame] | 455 | LOCAL_CXX_STL := none |
Dmitriy Ivanov | ba9a7b3 | 2014-03-10 18:00:09 -0700 | [diff] [blame] | 456 | |
| 457 | include $(BUILD_STATIC_LIBRARY) |
| 458 | |
| 459 | #===================================================================== |
Shih-wei Liao | fba7691 | 2013-01-27 00:56:26 -0800 | [diff] [blame] | 460 | # Device Shared Library: libcompiler_rt |
| 461 | #===================================================================== |
Serban Constantinescu | e3c30bf | 2013-10-20 15:36:30 +0100 | [diff] [blame] | 462 | |
Colin Cross | 75d873d | 2014-02-04 16:24:23 -0800 | [diff] [blame] | 463 | include $(CLEAR_VARS) |
| 464 | |
| 465 | LOCAL_MODULE := libcompiler_rt |
| 466 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 467 | LOCAL_WHOLE_STATIC_LIBRARIES := libcompiler_rt |
Dan Albert | b6c4825 | 2014-10-13 11:14:36 -0700 | [diff] [blame] | 468 | LOCAL_SHARED_LIBRARIES := libdl |
| 469 | LOCAL_STATIC_LIBRARIES_arm := libunwind_llvm |
| 470 | LOCAL_STATIC_LIBRARIES_arm64 := libunwindbacktrace |
| 471 | LOCAL_STATIC_LIBRARIES_mips := libunwindbacktrace |
| 472 | LOCAL_STATIC_LIBRARIES_mips64 := libunwindbacktrace |
| 473 | LOCAL_STATIC_LIBRARIES_x86 := libunwindbacktrace |
| 474 | LOCAL_STATIC_LIBRARIES_x86_64 := libunwindbacktrace |
Duane Sand | 5b87b3d | 2014-05-20 11:06:29 -0700 | [diff] [blame] | 475 | LOCAL_MODULE_TARGET_ARCH := arm arm64 mips mips64 x86 x86_64 |
Dan Albert | d92fd09 | 2014-10-16 23:10:08 -0700 | [diff] [blame] | 476 | LOCAL_ADDRESS_SANITIZER := false |
Dan Albert | 99141a6 | 2015-04-30 16:51:20 -0700 | [diff] [blame] | 477 | LOCAL_CXX_STL := none |
Stephen Hines | a71c53e | 2015-07-01 18:40:51 -0700 | [diff] [blame] | 478 | LOCAL_NO_LIBGCC := true |
Colin Cross | 75d873d | 2014-02-04 16:24:23 -0800 | [diff] [blame] | 479 | |
| 480 | include $(BUILD_SHARED_LIBRARY) |
Shih-wei Liao | fba7691 | 2013-01-27 00:56:26 -0800 | [diff] [blame] | 481 | |
Dan Albert | 95b6e9a | 2014-05-01 17:40:29 -0700 | [diff] [blame] | 482 | #===================================================================== |
| 483 | # Host Shared Library: libcompiler_rt |
| 484 | #===================================================================== |
| 485 | |
| 486 | include $(CLEAR_VARS) |
| 487 | |
| 488 | LOCAL_MODULE := libcompiler_rt |
| 489 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 490 | LOCAL_WHOLE_STATIC_LIBRARIES := libcompiler_rt |
Dan Albert | b05bdf0 | 2014-10-14 17:10:57 -0700 | [diff] [blame] | 491 | ifneq ($(HOST_OS),darwin) |
Dan Albert | b6c4825 | 2014-10-13 11:14:36 -0700 | [diff] [blame] | 492 | LOCAL_STATIC_LIBRARIES := libunwindbacktrace |
Dan Albert | b05bdf0 | 2014-10-14 17:10:57 -0700 | [diff] [blame] | 493 | endif |
Dan Albert | 95b6e9a | 2014-05-01 17:40:29 -0700 | [diff] [blame] | 494 | LOCAL_CPPFLAGS := -nostdinc++ |
Stephen Hines | 11f8ffe | 2014-09-30 02:33:12 -0700 | [diff] [blame] | 495 | ifneq ($(HOST_OS),windows) |
Dan Albert | 95b6e9a | 2014-05-01 17:40:29 -0700 | [diff] [blame] | 496 | LOCAL_LDFLAGS := -nodefaultlibs |
Dan Albert | b6c4825 | 2014-10-13 11:14:36 -0700 | [diff] [blame] | 497 | LOCAL_LDLIBS := -lpthread -lc -lm |
Stephen Hines | 11f8ffe | 2014-09-30 02:33:12 -0700 | [diff] [blame] | 498 | endif |
Ian Rogers | a217f3e | 2014-06-05 11:44:01 -0700 | [diff] [blame] | 499 | LOCAL_MULTILIB := both |
Dan Albert | d92fd09 | 2014-10-16 23:10:08 -0700 | [diff] [blame] | 500 | LOCAL_ADDRESS_SANITIZER := false |
Dan Albert | 99141a6 | 2015-04-30 16:51:20 -0700 | [diff] [blame] | 501 | LOCAL_CXX_STL := none |
Stephen Hines | a71c53e | 2015-07-01 18:40:51 -0700 | [diff] [blame] | 502 | LOCAL_NO_LIBGCC := true |
Dan Albert | 95b6e9a | 2014-05-01 17:40:29 -0700 | [diff] [blame] | 503 | |
| 504 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 505 | |
Dan Albert | 93f64d9 | 2014-10-18 17:25:26 -0700 | [diff] [blame] | 506 | # Build asan, lsan, etc. |
| 507 | include $(call all-makefiles-under,$(LOCAL_PATH)/lib) |
| 508 | |
Colin Cross | 47ca89c | 2014-03-14 20:12:30 -0700 | [diff] [blame] | 509 | endif |