blob: 7ea9e9453c72b07c8101d7417ac424f298eeeb7a [file] [log] [blame]
Evgeniy Stepanovdc3865b2012-03-13 15:38:23 +04001#
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
18LOCAL_PATH := $(call my-dir)
Shih-wei Liao139a1062013-01-26 11:29:30 -080019
Stephen Hines30694612014-05-14 00:00:32 -070020
Shih-wei Liao139a1062013-01-26 11:29:30 -080021# The following list contains platform-independent functionalities.
22#
Shih-wei Liaocec07262013-01-26 22:12:04 -080023# Skip apple_versioning.c since it is unused.
Shih-wei Liao139a1062013-01-26 11:29:30 -080024# Skip atomic.c since it needs to be built separately according to the docs.
Shih-wei Liao139a1062013-01-26 11:29:30 -080025libcompiler_rt_common_SRC_FILES := \
Stephen Hines2d1fdb22014-05-28 23:58:16 -070026 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 Albert5c072a62014-06-19 16:03:10 -070031 lib/builtins/addtf3.c \
Stephen Hines2d1fdb22014-05-28 23:58:16 -070032 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 Albert5148f962014-06-18 19:32:53 -070047 lib/builtins/comparetf2.c \
Stephen Hines2d1fdb22014-05-28 23:58:16 -070048 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 Hines3ce6da32015-07-01 18:17:28 -070059 lib/builtins/divtf3.c \
Stephen Hines2d1fdb22014-05-28 23:58:16 -070060 lib/builtins/divti3.c \
61 lib/builtins/divxc3.c \
Stephen Hines2d1fdb22014-05-28 23:58:16 -070062 lib/builtins/eprintf.c \
Dan Albert9f647902014-10-14 14:28:39 -070063 lib/builtins/extenddftf2.c \
Pirama Arumuga Nainar403e5582015-05-20 13:03:23 -070064 lib/builtins/extendhfsf2.c \
Stephen Hines2d1fdb22014-05-28 23:58:16 -070065 lib/builtins/extendsfdf2.c \
Dan Albert9f647902014-10-14 14:28:39 -070066 lib/builtins/extendsftf2.c \
Stephen Hines2d1fdb22014-05-28 23:58:16 -070067 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 Hines3ce6da32015-07-01 18:17:28 -070075 lib/builtins/fixtfdi.c \
76 lib/builtins/fixtfsi.c \
77 lib/builtins/fixtfti.c \
Stephen Hines2d1fdb22014-05-28 23:58:16 -070078 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 Hines3ce6da32015-07-01 18:17:28 -070084 lib/builtins/fixunstfdi.c \
85 lib/builtins/fixunstfsi.c \
86 lib/builtins/fixunstfti.c \
Stephen Hines2d1fdb22014-05-28 23:58:16 -070087 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 Albert9f647902014-10-14 14:28:39 -070097 lib/builtins/floatsitf.c \
Stephen Hines2d1fdb22014-05-28 23:58:16 -070098 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 Albert9f647902014-10-14 14:28:39 -0700106 lib/builtins/floatunsitf.c \
Stephen Hines2d1fdb22014-05-28 23:58:16 -0700107 lib/builtins/floatuntidf.c \
108 lib/builtins/floatuntisf.c \
109 lib/builtins/floatuntixf.c \
Dan Albertb6c48252014-10-13 11:14:36 -0700110 lib/builtins/gcc_personality_v0.c \
Stephen Hines2d1fdb22014-05-28 23:58:16 -0700111 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 Albert5c072a62014-06-19 16:03:10 -0700125 lib/builtins/multf3.c \
Stephen Hines2d1fdb22014-05-28 23:58:16 -0700126 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 Albert5c072a62014-06-19 16:03:10 -0700150 lib/builtins/subtf3.c \
Stephen Hines2d1fdb22014-05-28 23:58:16 -0700151 lib/builtins/subvdi3.c \
152 lib/builtins/subvsi3.c \
153 lib/builtins/subvti3.c \
154 lib/builtins/trampoline_setup.c \
Pirama Arumuga Nainar403e5582015-05-20 13:03:23 -0700155 lib/builtins/truncdfhf2.c \
Stephen Hines2d1fdb22014-05-28 23:58:16 -0700156 lib/builtins/truncdfsf2.c \
Pirama Arumuga Nainar403e5582015-05-20 13:03:23 -0700157 lib/builtins/truncsfhf2.c \
Dan Albert9f647902014-10-14 14:28:39 -0700158 lib/builtins/trunctfdf2.c \
159 lib/builtins/trunctfsf2.c \
Stephen Hines2d1fdb22014-05-28 23:58:16 -0700160 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 Liao139a1062013-01-26 11:29:30 -0800171
Stephen Hines11f8ffe2014-09-30 02:33:12 -0700172# Only build enable_execute_stack.c on non-Windows hosts.
173ifneq ($(HOST_OS),windows)
174libcompiler_rt_common_SRC_FILES += \
175 lib/builtins/enable_execute_stack.c
176endif
177
Shih-wei Liao139a1062013-01-26 11:29:30 -0800178# ARM-specific runtimes
179libcompiler_rt_arm_SRC_FILES := \
Stephen Hines2d1fdb22014-05-28 23:58:16 -0700180 lib/builtins/arm/aeabi_dcmp.S \
Dan Albertefae8612014-10-10 15:32:41 -0700181 lib/builtins/arm/aeabi_div0.c \
Stephen Hines2d1fdb22014-05-28 23:58:16 -0700182 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 Hines3b1a2d52015-07-16 13:33:30 -0700197 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 Liao139a1062013-01-26 11:29:30 -0800233
Tim Murray6731c552014-03-10 11:10:47 -0700234# ARM64-specific runtimes
235libcompiler_rt_arm64_SRC_FILES :=
236
Shih-wei Liao139a1062013-01-26 11:29:30 -0800237# MIPS-specific runtimes
238libcompiler_rt_mips_SRC_FILES := # nothing to add
Duane Sand5b87b3d2014-05-20 11:06:29 -0700239libcompiler_rt_mips64_SRC_FILES := # nothing to add
Shih-wei Liao139a1062013-01-26 11:29:30 -0800240
241# X86-specific runtimes
Shih-wei Liao139a1062013-01-26 11:29:30 -0800242libcompiler_rt_x86_SRC_FILES := \
Stephen Hines2d1fdb22014-05-28 23:58:16 -0700243 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 Liao139a1062013-01-26 11:29:30 -0800257
Alexey Volkov99395062014-01-17 17:44:56 +0400258# X86_64-specific runtimes
259libcompiler_rt_x86_64_SRC_FILES := \
Stephen Hines2d1fdb22014-05-28 23:58:16 -0700260 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 Volkov99395062014-01-17 17:44:56 +0400266
Shih-wei Liao139a1062013-01-26 11:29:30 -0800267# 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.)
270libcompiler_rt_extras_SRC_FILES := \
Stephen Hines2d1fdb22014-05-28 23:58:16 -0700271 lib/builtins/mulodi4.c
Shih-wei Liao139a1062013-01-26 11:29:30 -0800272
273# $(1): arch
274define 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 Volkov99395062014-01-17 17:44:56 +0400278 $(if $(findstring $(1),x86_64),$(call get-libcompiler-rt-x86_64-source-files),
Pavel Chupin5534fc32013-07-25 20:31:56 +0400279 $(if $(findstring $(1),x32),$(call get-libcompiler-rt-x86-source-files),
Tim Murray6731c552014-03-10 11:10:47 -0700280 $(if $(findstring $(1),arm64),$(call get-libcompiler-rt-arm64-source-files),
Duane Sand5b87b3d2014-05-20 11:06:29 -0700281 $(if $(findstring $(1),mips64),$(call get-libcompiler-rt-mips64-source-files),
282 $(error Unsupported ARCH $(1)))))))))
Shih-wei Liao139a1062013-01-26 11:29:30 -0800283endef
284
285# $(1): source list
286# $(2): arch
287#
Stephen Hines2d1fdb22014-05-28 23:58:16 -0700288# If lib/builtins/<arch>/X.[cS] is included in the source list, we should filter out lib/builtins/X.c
Shih-wei Liao139a1062013-01-26 11:29:30 -0800289# in the result source list (i.e., use the one optimized for the arch.) Otherwise
290# there'll be multiple definitions for one symbol.
291define filter-libcompiler-rt-common-source-files
Stephen Hines2d1fdb22014-05-28 23:58:16 -0700292 $(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 Liao139a1062013-01-26 11:29:30 -0800296endef
297
Shih-wei Liaoece62642013-02-07 07:49:51 -0800298define get-libcompiler-rt-arm-common-source-files
Shih-wei Liao139a1062013-01-26 11:29:30 -0800299 $(call filter-libcompiler-rt-common-source-files,
Shih-wei Liaoc8f55192013-02-07 22:00:08 -0800300 $(libcompiler_rt_common_SRC_FILES) \
Shih-wei Liaoece62642013-02-07 07:49:51 -0800301 $(libcompiler_rt_arm_SRC_FILES), arm)
302endef
303
304# $(1): common runtime list
305#
306# Add ARM runtimes implemented in VFP
307define add-libcompiler-rt-arm-vfp-source-files
Stephen Hines2d1fdb22014-05-28 23:58:16 -0700308 $(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 Hines3b1a2d52015-07-16 13:33:30 -0700313 subsf3.c truncdfsf2.c),$(1))
Shih-wei Liaoece62642013-02-07 07:49:51 -0800314endef
315
316define 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 Liao139a1062013-01-26 11:29:30 -0800321endef
322
Tim Murray6731c552014-03-10 11:10:47 -0700323define 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)
327endef
328
Shih-wei Liao139a1062013-01-26 11:29:30 -0800329define get-libcompiler-rt-mips-source-files
330 $(call filter-libcompiler-rt-common-source-files,
Shih-wei Liaoc8f55192013-02-07 22:00:08 -0800331 $(libcompiler_rt_common_SRC_FILES) \
Shih-wei Liao139a1062013-01-26 11:29:30 -0800332 $(libcompiler_rt_mips_SRC_FILES),mips)
333endef
334
Duane Sand5b87b3d2014-05-20 11:06:29 -0700335define 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)
339endef
340
Shih-wei Liao139a1062013-01-26 11:29:30 -0800341define get-libcompiler-rt-x86-source-files
342 $(call filter-libcompiler-rt-common-source-files,
Shih-wei Liaoc8f55192013-02-07 22:00:08 -0800343 $(libcompiler_rt_common_SRC_FILES) \
Shih-wei Liao139a1062013-01-26 11:29:30 -0800344 $(libcompiler_rt_x86_SRC_FILES),i386)
345endef
346
Alexey Volkov99395062014-01-17 17:44:56 +0400347define 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)
351endef
352
Evgeniy Stepanovdc3865b2012-03-13 15:38:23 +0400353#=====================================================================
Shih-wei Liao7f489a32013-02-07 03:34:40 -0800354# Device Static Library: libcompiler_rt-extras
Evgeniy Stepanovdc3865b2012-03-13 15:38:23 +0400355#=====================================================================
356
Evgeniy Stepanovdc3865b2012-03-13 15:38:23 +0400357include $(CLEAR_VARS)
358
Shih-wei Liao7f489a32013-02-07 03:34:40 -0800359LOCAL_MODULE := libcompiler_rt-extras
Evgeniy Stepanovdc3865b2012-03-13 15:38:23 +0400360LOCAL_MODULE_TAGS := optional
361LOCAL_MODULE_CLASS := STATIC_LIBRARIES
362LOCAL_CLANG := true
Shih-wei Liao139a1062013-01-26 11:29:30 -0800363LOCAL_SRC_FILES := $(libcompiler_rt_extras_SRC_FILES)
Stephen Hines97ac43c2013-01-18 17:46:14 -0800364LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Dan Albertd92fd092014-10-16 23:10:08 -0700365LOCAL_ADDRESS_SANITIZER := false
Dan Albert99141a62015-04-30 16:51:20 -0700366LOCAL_CXX_STL := none
Evgeniy Stepanovdc3865b2012-03-13 15:38:23 +0400367
Evgeniy Stepanovdc3865b2012-03-13 15:38:23 +0400368include $(BUILD_STATIC_LIBRARY)
369
Dan Albert06e4b402015-04-09 16:34:35 -0700370#=====================================================================
371# Host Static Library: libcompiler_rt-extras
372#=====================================================================
373
374include $(CLEAR_VARS)
375
376LOCAL_MODULE := libcompiler_rt-extras
377LOCAL_CLANG := true
378LOCAL_SRC_FILES := $(libcompiler_rt_extras_SRC_FILES)
379LOCAL_ADDRESS_SANITIZER := false
380LOCAL_MULTILIB := both
Dan Albert99141a62015-04-30 16:51:20 -0700381LOCAL_CXX_STL := none
Dan Albert06e4b402015-04-09 16:34:35 -0700382
383include $(BUILD_HOST_STATIC_LIBRARY)
384
Colin Cross47ca89c2014-03-14 20:12:30 -0700385# Don't build compiler-rt without clang
386ifneq ($(WITHOUT_TARGET_CLANG), true)
387
Shih-wei Liao139a1062013-01-26 11:29:30 -0800388#=====================================================================
Shih-wei Liao7f489a32013-02-07 03:34:40 -0800389# Device Static Library: libcompiler_rt
Shih-wei Liao139a1062013-01-26 11:29:30 -0800390#=====================================================================
Colin Cross75d873d2014-02-04 16:24:23 -0800391
392include $(CLEAR_VARS)
393
Colin Cross75d873d2014-02-04 16:24:23 -0800394LOCAL_MODULE := libcompiler_rt
395LOCAL_CFLAGS_arm += -D__ARM_EABI__
Stephen Hinesa6a27322015-07-02 14:44:23 -0700396LOCAL_CFLAGS_mips64 += -DCRT_HAS_128BIT -DCRT_LDBL_128BIT
Colin Cross75d873d2014-02-04 16:24:23 -0800397LOCAL_ASFLAGS := -integrated-as
398LOCAL_CLANG := true
399LOCAL_SRC_FILES_arm := $(call get-libcompiler-rt-source-files,arm)
Tim Murray6731c552014-03-10 11:10:47 -0700400LOCAL_SRC_FILES_arm64 := $(call get-libcompiler-rt-source-files,arm64)
Colin Cross75d873d2014-02-04 16:24:23 -0800401LOCAL_SRC_FILES_mips := $(call get-libcompiler-rt-source-files,mips)
Duane Sand5b87b3d2014-05-20 11:06:29 -0700402LOCAL_SRC_FILES_mips64 := $(call get-libcompiler-rt-source-files,mips64)
Colin Cross75d873d2014-02-04 16:24:23 -0800403LOCAL_SRC_FILES_x86 := $(call get-libcompiler-rt-source-files,x86)
404LOCAL_SRC_FILES_x86_64 := $(call get-libcompiler-rt-source-files,x86_64)
Stephen Hinesa6a27322015-07-02 14:44:23 -0700405LOCAL_SRC_FILES_x86_64 += lib/builtins/ppc/floatditf.c
Duane Sand5b87b3d2014-05-20 11:06:29 -0700406LOCAL_MODULE_TARGET_ARCH := arm arm64 mips mips64 x86 x86_64
Colin Cross75d873d2014-02-04 16:24:23 -0800407LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Dan Albertd92fd092014-10-16 23:10:08 -0700408LOCAL_ADDRESS_SANITIZER := false
Dan Albert99141a62015-04-30 16:51:20 -0700409LOCAL_CXX_STL := none
Colin Cross75d873d2014-02-04 16:24:23 -0800410
411include $(BUILD_STATIC_LIBRARY)
412
Shih-wei Liaofba76912013-01-27 00:56:26 -0800413#=====================================================================
Dan Albert95b6e9a2014-05-01 17:40:29 -0700414# Host Static Library: libcompiler_rt
415#=====================================================================
416
417include $(CLEAR_VARS)
418
419LOCAL_MODULE := libcompiler_rt
420LOCAL_ASFLAGS := -integrated-as
421LOCAL_CLANG := true
422LOCAL_SRC_FILES := $(call get-libcompiler-rt-source-files,x86_64)
Dan Alberta7f893a2014-10-31 16:18:55 -0700423LOCAL_ADDRESS_SANITIZER := false
Dan Albert95b6e9a2014-05-01 17:40:29 -0700424LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
Ian Rogersa217f3e2014-06-05 11:44:01 -0700425LOCAL_MULTILIB := both
Dan Albert99141a62015-04-30 16:51:20 -0700426LOCAL_CXX_STL := none
Dan Albert95b6e9a2014-05-01 17:40:29 -0700427
428include $(BUILD_HOST_STATIC_LIBRARY)
429
430#=====================================================================
Dan Albertbbb3f7a2015-01-24 15:18:48 -0800431# Host Static Library: libprofile_rt
432#=====================================================================
433
434include $(CLEAR_VARS)
435
436LOCAL_MODULE = libprofile_rt
437LOCAL_SRC_FILES = lib/profile/GCDAProfiling.c
438LOCAL_ADDRESS_SANITIZER := false
Dan Albert85c672a2015-01-29 16:50:29 -0800439LOCAL_MULTILIB := both
Dan Albert99141a62015-04-30 16:51:20 -0700440LOCAL_CXX_STL := none
Dan Albertbbb3f7a2015-01-24 15:18:48 -0800441
442include $(BUILD_HOST_STATIC_LIBRARY)
443
444#=====================================================================
Dmitriy Ivanovba9a7b32014-03-10 18:00:09 -0700445# Device Static Library: libprofile_rt
446#=====================================================================
447
448include $(CLEAR_VARS)
449
450LOCAL_MODULE = libprofile_rt
Dan Albertbbb3f7a2015-01-24 15:18:48 -0800451LOCAL_CLANG := true
Dmitriy Ivanovba9a7b32014-03-10 18:00:09 -0700452LOCAL_SRC_FILES = lib/profile/GCDAProfiling.c
Dan Alberta7f893a2014-10-31 16:18:55 -0700453LOCAL_ADDRESS_SANITIZER := false
Dan Albert85c672a2015-01-29 16:50:29 -0800454LOCAL_MULTILIB := both
Dan Albert99141a62015-04-30 16:51:20 -0700455LOCAL_CXX_STL := none
Dmitriy Ivanovba9a7b32014-03-10 18:00:09 -0700456
457include $(BUILD_STATIC_LIBRARY)
458
459#=====================================================================
Shih-wei Liaofba76912013-01-27 00:56:26 -0800460# Device Shared Library: libcompiler_rt
461#=====================================================================
Serban Constantinescue3c30bf2013-10-20 15:36:30 +0100462
Colin Cross75d873d2014-02-04 16:24:23 -0800463include $(CLEAR_VARS)
464
465LOCAL_MODULE := libcompiler_rt
466LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
467LOCAL_WHOLE_STATIC_LIBRARIES := libcompiler_rt
Dan Albertb6c48252014-10-13 11:14:36 -0700468LOCAL_SHARED_LIBRARIES := libdl
469LOCAL_STATIC_LIBRARIES_arm := libunwind_llvm
470LOCAL_STATIC_LIBRARIES_arm64 := libunwindbacktrace
471LOCAL_STATIC_LIBRARIES_mips := libunwindbacktrace
472LOCAL_STATIC_LIBRARIES_mips64 := libunwindbacktrace
473LOCAL_STATIC_LIBRARIES_x86 := libunwindbacktrace
474LOCAL_STATIC_LIBRARIES_x86_64 := libunwindbacktrace
Duane Sand5b87b3d2014-05-20 11:06:29 -0700475LOCAL_MODULE_TARGET_ARCH := arm arm64 mips mips64 x86 x86_64
Dan Albertd92fd092014-10-16 23:10:08 -0700476LOCAL_ADDRESS_SANITIZER := false
Dan Albert99141a62015-04-30 16:51:20 -0700477LOCAL_CXX_STL := none
Stephen Hinesa71c53e2015-07-01 18:40:51 -0700478LOCAL_NO_LIBGCC := true
Colin Cross75d873d2014-02-04 16:24:23 -0800479
480include $(BUILD_SHARED_LIBRARY)
Shih-wei Liaofba76912013-01-27 00:56:26 -0800481
Dan Albert95b6e9a2014-05-01 17:40:29 -0700482#=====================================================================
483# Host Shared Library: libcompiler_rt
484#=====================================================================
485
486include $(CLEAR_VARS)
487
488LOCAL_MODULE := libcompiler_rt
489LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
490LOCAL_WHOLE_STATIC_LIBRARIES := libcompiler_rt
Dan Albertb05bdf02014-10-14 17:10:57 -0700491ifneq ($(HOST_OS),darwin)
Dan Albertb6c48252014-10-13 11:14:36 -0700492LOCAL_STATIC_LIBRARIES := libunwindbacktrace
Dan Albertb05bdf02014-10-14 17:10:57 -0700493endif
Dan Albert95b6e9a2014-05-01 17:40:29 -0700494LOCAL_CPPFLAGS := -nostdinc++
Stephen Hines11f8ffe2014-09-30 02:33:12 -0700495ifneq ($(HOST_OS),windows)
Dan Albert95b6e9a2014-05-01 17:40:29 -0700496LOCAL_LDFLAGS := -nodefaultlibs
Dan Albertb6c48252014-10-13 11:14:36 -0700497LOCAL_LDLIBS := -lpthread -lc -lm
Stephen Hines11f8ffe2014-09-30 02:33:12 -0700498endif
Ian Rogersa217f3e2014-06-05 11:44:01 -0700499LOCAL_MULTILIB := both
Dan Albertd92fd092014-10-16 23:10:08 -0700500LOCAL_ADDRESS_SANITIZER := false
Dan Albert99141a62015-04-30 16:51:20 -0700501LOCAL_CXX_STL := none
Stephen Hinesa71c53e2015-07-01 18:40:51 -0700502LOCAL_NO_LIBGCC := true
Dan Albert95b6e9a2014-05-01 17:40:29 -0700503
504include $(BUILD_HOST_SHARED_LIBRARY)
505
Dan Albert93f64d92014-10-18 17:25:26 -0700506# Build asan, lsan, etc.
507include $(call all-makefiles-under,$(LOCAL_PATH)/lib)
508
Colin Cross47ca89c2014-03-14 20:12:30 -0700509endif