xref: /aosp_15_r20/external/compiler-rt/make/platform/clang_darwin.mk (revision 7c3d14c8b49c529e04be81a3ce6f5cc23712e4c6)
1*7c3d14c8STreehugger Robot# These are the functions which clang needs when it is targeting a previous
2*7c3d14c8STreehugger Robot# version of the OS. The issue is that the backend may use functions which were
3*7c3d14c8STreehugger Robot# not present in the libgcc that shipped on the platform. In such cases, we link
4*7c3d14c8STreehugger Robot# with a version of the library which contains private_extern definitions of all
5*7c3d14c8STreehugger Robot# the extra functions which might be referenced.
6*7c3d14c8STreehugger Robot
7*7c3d14c8STreehugger RobotDescription := Static runtime libraries for clang/Darwin.
8*7c3d14c8STreehugger Robot
9*7c3d14c8STreehugger Robot# A function that ensures we don't try to build for architectures and SDKs
10*7c3d14c8STreehugger Robot# that we don't have working toolchains for. Arguments:
11*7c3d14c8STreehugger Robot# (1): List of architectures
12*7c3d14c8STreehugger Robot# (2): Library name
13*7c3d14c8STreehugger Robot# (3): SDK path
14*7c3d14c8STreehugger Robot# The result is a possibly empty subset of the architectures from argument 1.
15*7c3d14c8STreehugger RobotCheckArches = \
16*7c3d14c8STreehugger Robot  $(shell \
17*7c3d14c8STreehugger Robot    result=""; \
18*7c3d14c8STreehugger Robot    if [ "X$(3)" != X ]; then \
19*7c3d14c8STreehugger Robot      for arch in $(1); do \
20*7c3d14c8STreehugger Robot        if $(LD) -v 2>&1 | grep "configured to support" \
21*7c3d14c8STreehugger Robot             | tr ' ' '\n' | grep "^$$arch$$" >/dev/null 2>/dev/null; then \
22*7c3d14c8STreehugger Robot          if $(CC) -arch $$arch \
23*7c3d14c8STreehugger Robot            -integrated-as \
24*7c3d14c8STreehugger Robot            $(ProjSrcRoot)/make/platform/clang_darwin_test_input.c \
25*7c3d14c8STreehugger Robot            -isysroot $(3) \
26*7c3d14c8STreehugger Robot            -o /dev/null > /dev/null 2> /dev/null; then \
27*7c3d14c8STreehugger Robot              result="$$result$$arch "; \
28*7c3d14c8STreehugger Robot          else \
29*7c3d14c8STreehugger Robot            printf 1>&2 \
30*7c3d14c8STreehugger Robot             "warning: clang_darwin.mk: dropping arch '$$arch' from lib '$(2)'"; \
31*7c3d14c8STreehugger Robot            printf 1>&2 " (clang or system libraries do not support it)\n"; \
32*7c3d14c8STreehugger Robot          fi; \
33*7c3d14c8STreehugger Robot        else \
34*7c3d14c8STreehugger Robot          printf 1>&2 \
35*7c3d14c8STreehugger Robot            "warning: clang_darwin.mk: dropping arch '$$arch' from lib '$(2)'";\
36*7c3d14c8STreehugger Robot          printf 1>&2 " (ld does not support it)\n"; \
37*7c3d14c8STreehugger Robot        fi; \
38*7c3d14c8STreehugger Robot      done; \
39*7c3d14c8STreehugger Robot    fi; \
40*7c3d14c8STreehugger Robot    echo $$result)
41*7c3d14c8STreehugger Robot
42*7c3d14c8STreehugger RobotXCRun = \
43*7c3d14c8STreehugger Robot  $(shell \
44*7c3d14c8STreehugger Robot    result=`xcrun -find $(1) 2> /dev/null`; \
45*7c3d14c8STreehugger Robot    if [ "$$?" != "0" ]; then result=$(1); fi; \
46*7c3d14c8STreehugger Robot    echo $$result)
47*7c3d14c8STreehugger Robot# Prefer building with the internal SDKs.
48*7c3d14c8STreehugger RobotXCRunSdkPath = \
49*7c3d14c8STreehugger Robot  $(shell \
50*7c3d14c8STreehugger Robot    result=`xcrun --sdk $(1).internal --show-sdk-path 2> /dev/null`; \
51*7c3d14c8STreehugger Robot    if [ "$$?" != "0" ]; then \
52*7c3d14c8STreehugger Robot      result=`xcrun --sdk $(1) --show-sdk-path 2> /dev/null`; \
53*7c3d14c8STreehugger Robot      if [ "$$?" != "0" ]; then result=""; fi; \
54*7c3d14c8STreehugger Robot    fi; \
55*7c3d14c8STreehugger Robot    echo $$result)
56*7c3d14c8STreehugger Robot###
57*7c3d14c8STreehugger Robot
58*7c3d14c8STreehugger RobotCC       := $(call XCRun,clang)
59*7c3d14c8STreehugger RobotLD       := $(shell $(CC) -print-prog-name=ld)
60*7c3d14c8STreehugger RobotAR       := $(call XCRun,ar)
61*7c3d14c8STreehugger RobotRANLIB   := $(call XCRun,ranlib)
62*7c3d14c8STreehugger RobotSTRIP    := $(call XCRun,strip)
63*7c3d14c8STreehugger RobotLIPO     := $(call XCRun,lipo)
64*7c3d14c8STreehugger RobotDSYMUTIL := $(call XCRun,dsymutil)
65*7c3d14c8STreehugger Robot
66*7c3d14c8STreehugger RobotOSX_SDK := $(call XCRunSdkPath,macosx)
67*7c3d14c8STreehugger RobotIOS_SDK := $(call XCRunSdkPath,iphoneos)
68*7c3d14c8STreehugger RobotIOSSIM_SDK := $(call XCRunSdkPath,iphonesimulator)
69*7c3d14c8STreehugger Robot
70*7c3d14c8STreehugger RobotConfigs :=
71*7c3d14c8STreehugger RobotUniversalArchs :=
72*7c3d14c8STreehugger Robot
73*7c3d14c8STreehugger Robot# Configuration solely for providing access to an eprintf symbol, which may
74*7c3d14c8STreehugger Robot# still be referenced from Darwin system headers. This symbol is only ever
75*7c3d14c8STreehugger Robot# needed on i386.
76*7c3d14c8STreehugger RobotConfigs += eprintf
77*7c3d14c8STreehugger RobotUniversalArchs.eprintf := $(call CheckArches,i386,eprintf,$(OSX_SDK))
78*7c3d14c8STreehugger Robot
79*7c3d14c8STreehugger Robot# Configuration for targeting 10.4. We need a few functions missing from
80*7c3d14c8STreehugger Robot# libgcc_s.10.4.dylib. We only build x86 slices since clang doesn't really
81*7c3d14c8STreehugger Robot# support targeting PowerPC.
82*7c3d14c8STreehugger RobotConfigs += 10.4
83*7c3d14c8STreehugger RobotUniversalArchs.10.4 := $(call CheckArches,i386 x86_64,10.4,$(OSX_SDK))
84*7c3d14c8STreehugger Robot
85*7c3d14c8STreehugger Robot# Configuration for targeting iOS for a couple of functions that didn't
86*7c3d14c8STreehugger Robot# make it into libSystem.
87*7c3d14c8STreehugger RobotConfigs += ios
88*7c3d14c8STreehugger RobotUniversalArchs.ios := $(call CheckArches,i386 x86_64,ios,$(IOSSIM_SDK))
89*7c3d14c8STreehugger RobotUniversalArchs.ios += $(call CheckArches,armv7 arm64,ios,$(IOS_SDK))
90*7c3d14c8STreehugger Robot
91*7c3d14c8STreehugger Robot# Configuration for targeting OSX. These functions may not be in libSystem
92*7c3d14c8STreehugger Robot# so we should provide our own.
93*7c3d14c8STreehugger RobotConfigs += osx
94*7c3d14c8STreehugger RobotUniversalArchs.osx := $(call CheckArches,i386 x86_64 x86_64h,osx,$(OSX_SDK))
95*7c3d14c8STreehugger Robot
96*7c3d14c8STreehugger Robot# Configuration for use with kernel/kexts.
97*7c3d14c8STreehugger RobotConfigs += cc_kext
98*7c3d14c8STreehugger RobotUniversalArchs.cc_kext := $(call CheckArches,i386 x86_64 x86_64h,cc_kext,$(OSX_SDK))
99*7c3d14c8STreehugger Robot
100*7c3d14c8STreehugger Robot# Configuration for use with iOS kernel/kexts
101*7c3d14c8STreehugger RobotConfigs += cc_kext_ios
102*7c3d14c8STreehugger RobotUniversalArchs.cc_kext_ios += $(call CheckArches,armv7,cc_kext_ios,$(IOS_SDK))
103*7c3d14c8STreehugger Robot
104*7c3d14c8STreehugger Robot# Darwin 10.6 has a bug in cctools that makes it unable to use ranlib on our ARM
105*7c3d14c8STreehugger Robot# object files. If we are on that platform, strip out all ARM archs. We still
106*7c3d14c8STreehugger Robot# build the libraries themselves so that Clang can find them where it expects
107*7c3d14c8STreehugger Robot# them, even though they might not have an expected slice.
108*7c3d14c8STreehugger Robotifneq ($(shell test -x /usr/bin/sw_vers && sw_vers -productVersion | grep 10.6),)
109*7c3d14c8STreehugger RobotUniversalArchs.ios := $(filter-out armv7, $(UniversalArchs.ios))
110*7c3d14c8STreehugger RobotUniversalArchs.cc_kext_ios := $(filter-out armv7, $(UniversalArchs.cc_kext_ios))
111*7c3d14c8STreehugger Robotendif
112*7c3d14c8STreehugger Robot
113*7c3d14c8STreehugger Robot# If RC_SUPPORTED_ARCHS is defined, treat it as a list of the architectures we
114*7c3d14c8STreehugger Robot# are intended to support and limit what we try to build to that.
115*7c3d14c8STreehugger Robotifneq ($(RC_SUPPORTED_ARCHS),)
116*7c3d14c8STreehugger Robot$(foreach config,$(Configs),\
117*7c3d14c8STreehugger Robot  $(call Set,UniversalArchs.$(config),\
118*7c3d14c8STreehugger Robot	$(filter $(RC_SUPPORTED_ARCHS),$(UniversalArchs.$(config)))))
119*7c3d14c8STreehugger Robotendif
120*7c3d14c8STreehugger Robot
121*7c3d14c8STreehugger Robot# Remove empty configs if we end up dropping all the requested
122*7c3d14c8STreehugger Robot# archs for a particular config.
123*7c3d14c8STreehugger Robot$(foreach config,$(Configs),\
124*7c3d14c8STreehugger Robot  $(if $(strip $(UniversalArchs.$(config))),,\
125*7c3d14c8STreehugger Robot	$(call Set,Configs,$(filter-out $(config),$(Configs)))))
126*7c3d14c8STreehugger Robot
127*7c3d14c8STreehugger Robot###
128*7c3d14c8STreehugger Robot
129*7c3d14c8STreehugger Robot# Forcibly strip off any -arch, as that totally breaks our universal support.
130*7c3d14c8STreehugger Robotoverride CC := $(subst -arch ,-arch_,$(CC))
131*7c3d14c8STreehugger Robotoverride CC := $(patsubst -arch_%,,$(CC))
132*7c3d14c8STreehugger Robot
133*7c3d14c8STreehugger RobotCFLAGS := -Wall -Werror -O3 -fomit-frame-pointer
134*7c3d14c8STreehugger Robot
135*7c3d14c8STreehugger Robot# Always set deployment target arguments for every build, these libraries should
136*7c3d14c8STreehugger Robot# never depend on the environmental overrides. We simply set them to minimum
137*7c3d14c8STreehugger Robot# supported deployment target -- nothing in the compiler-rt libraries should
138*7c3d14c8STreehugger Robot# actually depend on the deployment target.
139*7c3d14c8STreehugger RobotOSX_DEPLOYMENT_ARGS := -mmacosx-version-min=10.4
140*7c3d14c8STreehugger RobotIOS_DEPLOYMENT_ARGS := -mios-version-min=1.0
141*7c3d14c8STreehugger RobotIOS6_DEPLOYMENT_ARGS := -mios-version-min=6.0
142*7c3d14c8STreehugger RobotIOSSIM_DEPLOYMENT_ARGS := -mios-simulator-version-min=1.0
143*7c3d14c8STreehugger Robot
144*7c3d14c8STreehugger RobotOSX_DEPLOYMENT_ARGS += -isysroot $(OSX_SDK)
145*7c3d14c8STreehugger RobotIOS_DEPLOYMENT_ARGS += -isysroot $(IOS_SDK)
146*7c3d14c8STreehugger RobotIOS6_DEPLOYMENT_ARGS += -isysroot $(IOS_SDK)
147*7c3d14c8STreehugger RobotIOSSIM_DEPLOYMENT_ARGS += -isysroot $(IOSSIM_SDK)
148*7c3d14c8STreehugger Robot
149*7c3d14c8STreehugger RobotCFLAGS.eprintf		:= $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
150*7c3d14c8STreehugger RobotCFLAGS.10.4		:= $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
151*7c3d14c8STreehugger Robot
152*7c3d14c8STreehugger RobotSANITIZER_MACOSX_DEPLOYMENT_ARGS := -mmacosx-version-min=10.7
153*7c3d14c8STreehugger RobotSANITIZER_IOSSIM_DEPLOYMENT_ARGS := -mios-simulator-version-min=7.0 \
154*7c3d14c8STreehugger Robot  -isysroot $(IOSSIM_SDK)
155*7c3d14c8STreehugger RobotSANITIZER_CFLAGS := -fno-builtin -gline-tables-only -stdlib=libc++
156*7c3d14c8STreehugger Robot
157*7c3d14c8STreehugger Robot
158*7c3d14c8STreehugger RobotCFLAGS.ios.i386		:= $(CFLAGS) $(IOSSIM_DEPLOYMENT_ARGS)
159*7c3d14c8STreehugger RobotCFLAGS.ios.x86_64	:= $(CFLAGS) $(IOSSIM_DEPLOYMENT_ARGS)
160*7c3d14c8STreehugger RobotCFLAGS.ios.armv7	:= $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
161*7c3d14c8STreehugger RobotCFLAGS.ios.armv7k	:= $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
162*7c3d14c8STreehugger RobotCFLAGS.ios.armv7s	:= $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
163*7c3d14c8STreehugger RobotCFLAGS.ios.arm64	:= $(CFLAGS) $(IOS6_DEPLOYMENT_ARGS)
164*7c3d14c8STreehugger RobotCFLAGS.osx.i386		:= $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
165*7c3d14c8STreehugger RobotCFLAGS.osx.x86_64	:= $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
166*7c3d14c8STreehugger RobotCFLAGS.osx.x86_64h	:= $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
167*7c3d14c8STreehugger RobotCFLAGS.cc_kext.i386	:= $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
168*7c3d14c8STreehugger RobotCFLAGS.cc_kext.x86_64	:= $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
169*7c3d14c8STreehugger RobotCFLAGS.cc_kext.x86_64h	:= $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
170*7c3d14c8STreehugger RobotCFLAGS.cc_kext_ios.armv7	:= $(CFLAGS) $(IOS6_DEPLOYMENT_ARGS)
171*7c3d14c8STreehugger RobotCFLAGS.cc_kext_ios.armv7k	:= $(CFLAGS) $(IOS6_DEPLOYMENT_ARGS)
172*7c3d14c8STreehugger RobotCFLAGS.cc_kext_ios.armv7s	:= $(CFLAGS) $(IOS6_DEPLOYMENT_ARGS)
173*7c3d14c8STreehugger RobotCFLAGS.cc_kext_ios.arm64	:= $(CFLAGS) $(IOS6_DEPLOYMENT_ARGS)
174*7c3d14c8STreehugger Robot
175*7c3d14c8STreehugger RobotSANITIZER_LDFLAGS := -stdlib=libc++ -lc++ -lc++abi
176*7c3d14c8STreehugger Robot
177*7c3d14c8STreehugger RobotATOMIC_FUNCTIONS := \
178*7c3d14c8STreehugger Robot	atomic_flag_clear \
179*7c3d14c8STreehugger Robot	atomic_flag_clear_explicit \
180*7c3d14c8STreehugger Robot	atomic_flag_test_and_set \
181*7c3d14c8STreehugger Robot	atomic_flag_test_and_set_explicit \
182*7c3d14c8STreehugger Robot	atomic_signal_fence \
183*7c3d14c8STreehugger Robot	atomic_thread_fence
184*7c3d14c8STreehugger Robot
185*7c3d14c8STreehugger RobotFP16_FUNCTIONS := \
186*7c3d14c8STreehugger Robot	extendhfsf2 \
187*7c3d14c8STreehugger Robot	truncdfhf2 \
188*7c3d14c8STreehugger Robot	truncsfhf2
189*7c3d14c8STreehugger Robot
190*7c3d14c8STreehugger RobotFUNCTIONS.eprintf := eprintf
191*7c3d14c8STreehugger RobotFUNCTIONS.10.4 := eprintf floatundidf floatundisf floatundixf
192*7c3d14c8STreehugger Robot
193*7c3d14c8STreehugger RobotFUNCTIONS.ios	    := divmodsi4 udivmodsi4 mulosi4 mulodi4 muloti4 \
194*7c3d14c8STreehugger Robot                       $(ATOMIC_FUNCTIONS) $(FP16_FUNCTIONS)
195*7c3d14c8STreehugger Robot# On x86, the divmod functions reference divsi.
196*7c3d14c8STreehugger RobotFUNCTIONS.ios.i386    := $(FUNCTIONS.ios) \
197*7c3d14c8STreehugger Robot                         divsi3 udivsi3
198*7c3d14c8STreehugger RobotFUNCTIONS.ios.x86_64  := $(FUNCTIONS.ios.i386)
199*7c3d14c8STreehugger RobotFUNCTIONS.ios.arm64   := mulsc3 muldc3 divsc3 divdc3 udivti3 umodti3 \
200*7c3d14c8STreehugger Robot                         $(ATOMIC_FUNCTIONS)
201*7c3d14c8STreehugger Robot
202*7c3d14c8STreehugger RobotFUNCTIONS.osx	:= mulosi4 mulodi4 muloti4 $(ATOMIC_FUNCTIONS) $(FP16_FUNCTIONS)
203*7c3d14c8STreehugger Robot
204*7c3d14c8STreehugger RobotCCKEXT_PROFILE_FUNCTIONS := \
205*7c3d14c8STreehugger Robot	InstrProfiling \
206*7c3d14c8STreehugger Robot	InstrProfilingBuffer \
207*7c3d14c8STreehugger Robot	InstrProfilingPlatformDarwin
208*7c3d14c8STreehugger Robot
209*7c3d14c8STreehugger RobotCCKEXT_COMMON_FUNCTIONS := \
210*7c3d14c8STreehugger Robot	$(CCKEXT_PROFILE_FUNCTIONS) \
211*7c3d14c8STreehugger Robot	absvdi2 \
212*7c3d14c8STreehugger Robot	absvsi2 \
213*7c3d14c8STreehugger Robot	addvdi3 \
214*7c3d14c8STreehugger Robot	addvsi3 \
215*7c3d14c8STreehugger Robot	ashldi3 \
216*7c3d14c8STreehugger Robot	ashrdi3 \
217*7c3d14c8STreehugger Robot	bswapdi2 \
218*7c3d14c8STreehugger Robot	bswapsi2 \
219*7c3d14c8STreehugger Robot	clzdi2 \
220*7c3d14c8STreehugger Robot	clzsi2 \
221*7c3d14c8STreehugger Robot	cmpdi2 \
222*7c3d14c8STreehugger Robot	ctzdi2 \
223*7c3d14c8STreehugger Robot	ctzsi2 \
224*7c3d14c8STreehugger Robot	divdc3 \
225*7c3d14c8STreehugger Robot	divdi3 \
226*7c3d14c8STreehugger Robot	divsc3 \
227*7c3d14c8STreehugger Robot	divmodsi4 \
228*7c3d14c8STreehugger Robot	udivmodsi4 \
229*7c3d14c8STreehugger Robot	do_global_dtors \
230*7c3d14c8STreehugger Robot	eprintf \
231*7c3d14c8STreehugger Robot	extendhfsf2 \
232*7c3d14c8STreehugger Robot	ffsdi2 \
233*7c3d14c8STreehugger Robot	fixdfdi \
234*7c3d14c8STreehugger Robot	fixsfdi \
235*7c3d14c8STreehugger Robot	fixunsdfdi \
236*7c3d14c8STreehugger Robot	fixunsdfsi \
237*7c3d14c8STreehugger Robot	fixunssfdi \
238*7c3d14c8STreehugger Robot	fixunssfsi \
239*7c3d14c8STreehugger Robot	floatdidf \
240*7c3d14c8STreehugger Robot	floatdisf \
241*7c3d14c8STreehugger Robot	floatundidf \
242*7c3d14c8STreehugger Robot	floatundisf \
243*7c3d14c8STreehugger Robot	gcc_bcmp \
244*7c3d14c8STreehugger Robot	lshrdi3 \
245*7c3d14c8STreehugger Robot	moddi3 \
246*7c3d14c8STreehugger Robot	muldc3 \
247*7c3d14c8STreehugger Robot	muldi3 \
248*7c3d14c8STreehugger Robot	mulsc3 \
249*7c3d14c8STreehugger Robot	mulvdi3 \
250*7c3d14c8STreehugger Robot	mulvsi3 \
251*7c3d14c8STreehugger Robot	negdi2 \
252*7c3d14c8STreehugger Robot	negvdi2 \
253*7c3d14c8STreehugger Robot	negvsi2 \
254*7c3d14c8STreehugger Robot	paritydi2 \
255*7c3d14c8STreehugger Robot	paritysi2 \
256*7c3d14c8STreehugger Robot	popcountdi2 \
257*7c3d14c8STreehugger Robot	popcountsi2 \
258*7c3d14c8STreehugger Robot	powidf2 \
259*7c3d14c8STreehugger Robot	powisf2 \
260*7c3d14c8STreehugger Robot	subvdi3 \
261*7c3d14c8STreehugger Robot	subvsi3 \
262*7c3d14c8STreehugger Robot	truncdfhf2 \
263*7c3d14c8STreehugger Robot	truncsfhf2 \
264*7c3d14c8STreehugger Robot	ucmpdi2 \
265*7c3d14c8STreehugger Robot	udiv_w_sdiv \
266*7c3d14c8STreehugger Robot	udivdi3 \
267*7c3d14c8STreehugger Robot	udivmoddi4 \
268*7c3d14c8STreehugger Robot	umoddi3
269*7c3d14c8STreehugger Robot
270*7c3d14c8STreehugger RobotCCKEXT_ARM_FUNCTIONS := $(CCKEXT_COMMON_FUNCTIONS) \
271*7c3d14c8STreehugger Robot	adddf3 \
272*7c3d14c8STreehugger Robot	addsf3 \
273*7c3d14c8STreehugger Robot	aeabi_cdcmpeq \
274*7c3d14c8STreehugger Robot	aeabi_cdrcmple \
275*7c3d14c8STreehugger Robot	aeabi_cfcmpeq \
276*7c3d14c8STreehugger Robot	aeabi_cfrcmple \
277*7c3d14c8STreehugger Robot	aeabi_dcmpeq \
278*7c3d14c8STreehugger Robot	aeabi_dcmpge \
279*7c3d14c8STreehugger Robot	aeabi_dcmpgt \
280*7c3d14c8STreehugger Robot	aeabi_dcmple \
281*7c3d14c8STreehugger Robot	aeabi_dcmplt \
282*7c3d14c8STreehugger Robot	aeabi_drsub \
283*7c3d14c8STreehugger Robot	aeabi_fcmpeq \
284*7c3d14c8STreehugger Robot	aeabi_fcmpge \
285*7c3d14c8STreehugger Robot	aeabi_fcmpgt \
286*7c3d14c8STreehugger Robot	aeabi_fcmple \
287*7c3d14c8STreehugger Robot	aeabi_fcmplt \
288*7c3d14c8STreehugger Robot	aeabi_frsub \
289*7c3d14c8STreehugger Robot	aeabi_idivmod \
290*7c3d14c8STreehugger Robot	aeabi_uidivmod \
291*7c3d14c8STreehugger Robot	cmpdf2 \
292*7c3d14c8STreehugger Robot	cmpsf2 \
293*7c3d14c8STreehugger Robot	div0 \
294*7c3d14c8STreehugger Robot	divdf3 \
295*7c3d14c8STreehugger Robot	divsf3 \
296*7c3d14c8STreehugger Robot	divsi3 \
297*7c3d14c8STreehugger Robot	extendsfdf2 \
298*7c3d14c8STreehugger Robot	ffssi2 \
299*7c3d14c8STreehugger Robot	fixdfsi \
300*7c3d14c8STreehugger Robot	fixsfsi \
301*7c3d14c8STreehugger Robot	floatsidf \
302*7c3d14c8STreehugger Robot	floatsisf \
303*7c3d14c8STreehugger Robot	floatunsidf \
304*7c3d14c8STreehugger Robot	floatunsisf \
305*7c3d14c8STreehugger Robot	comparedf2 \
306*7c3d14c8STreehugger Robot	comparesf2 \
307*7c3d14c8STreehugger Robot	modsi3 \
308*7c3d14c8STreehugger Robot	muldf3 \
309*7c3d14c8STreehugger Robot	mulsf3 \
310*7c3d14c8STreehugger Robot	mulodi4 \
311*7c3d14c8STreehugger Robot	negdf2 \
312*7c3d14c8STreehugger Robot	negsf2 \
313*7c3d14c8STreehugger Robot	subdf3 \
314*7c3d14c8STreehugger Robot	subsf3 \
315*7c3d14c8STreehugger Robot	switch16 \
316*7c3d14c8STreehugger Robot	switch32 \
317*7c3d14c8STreehugger Robot	switch8 \
318*7c3d14c8STreehugger Robot	switchu8 \
319*7c3d14c8STreehugger Robot	truncdfsf2 \
320*7c3d14c8STreehugger Robot	udivsi3 \
321*7c3d14c8STreehugger Robot	umodsi3 \
322*7c3d14c8STreehugger Robot	unorddf2 \
323*7c3d14c8STreehugger Robot	unordsf2
324*7c3d14c8STreehugger Robot
325*7c3d14c8STreehugger RobotCCKEXT_ARMVFP_FUNCTIONS := $(CCKEXT_ARM_FUNCTIONS) \
326*7c3d14c8STreehugger Robot	adddf3vfp \
327*7c3d14c8STreehugger Robot	addsf3vfp \
328*7c3d14c8STreehugger Robot	divdf3vfp \
329*7c3d14c8STreehugger Robot	divsf3vfp \
330*7c3d14c8STreehugger Robot	eqdf2vfp \
331*7c3d14c8STreehugger Robot	eqsf2vfp \
332*7c3d14c8STreehugger Robot	extendsfdf2vfp \
333*7c3d14c8STreehugger Robot	fixdfsivfp \
334*7c3d14c8STreehugger Robot	fixsfsivfp \
335*7c3d14c8STreehugger Robot	fixunsdfsivfp \
336*7c3d14c8STreehugger Robot	fixunssfsivfp \
337*7c3d14c8STreehugger Robot	floatsidfvfp \
338*7c3d14c8STreehugger Robot	floatsisfvfp \
339*7c3d14c8STreehugger Robot	floatunssidfvfp \
340*7c3d14c8STreehugger Robot	floatunssisfvfp \
341*7c3d14c8STreehugger Robot	gedf2vfp \
342*7c3d14c8STreehugger Robot	gesf2vfp \
343*7c3d14c8STreehugger Robot	gtdf2vfp \
344*7c3d14c8STreehugger Robot	gtsf2vfp \
345*7c3d14c8STreehugger Robot	ledf2vfp \
346*7c3d14c8STreehugger Robot	lesf2vfp \
347*7c3d14c8STreehugger Robot	ltdf2vfp \
348*7c3d14c8STreehugger Robot	ltsf2vfp \
349*7c3d14c8STreehugger Robot	muldf3vfp \
350*7c3d14c8STreehugger Robot	mulsf3vfp \
351*7c3d14c8STreehugger Robot	nedf2vfp \
352*7c3d14c8STreehugger Robot	nesf2vfp \
353*7c3d14c8STreehugger Robot	subdf3vfp \
354*7c3d14c8STreehugger Robot	subsf3vfp \
355*7c3d14c8STreehugger Robot	truncdfsf2vfp \
356*7c3d14c8STreehugger Robot	unorddf2vfp \
357*7c3d14c8STreehugger Robot	unordsf2vfp
358*7c3d14c8STreehugger Robot
359*7c3d14c8STreehugger RobotCCKEXT_ARM64_FUNCTIONS := \
360*7c3d14c8STreehugger Robot	$(CCKEXT_PROFILE_FUNCTIONS) \
361*7c3d14c8STreehugger Robot	divdc3 \
362*7c3d14c8STreehugger Robot	divsc3 \
363*7c3d14c8STreehugger Robot	muldc3 \
364*7c3d14c8STreehugger Robot	mulsc3 \
365*7c3d14c8STreehugger Robot	udivti3 \
366*7c3d14c8STreehugger Robot	umodti3
367*7c3d14c8STreehugger Robot
368*7c3d14c8STreehugger RobotFUNCTIONS.cc_kext_ios.armv7 := $(CCKEXT_ARMVFP_FUNCTIONS)
369*7c3d14c8STreehugger RobotFUNCTIONS.cc_kext_ios.armv7k := $(CCKEXT_ARMVFP_FUNCTIONS)
370*7c3d14c8STreehugger RobotFUNCTIONS.cc_kext_ios.armv7s := $(CCKEXT_ARMVFP_FUNCTIONS)
371*7c3d14c8STreehugger RobotFUNCTIONS.cc_kext_ios.arm64 := $(CCKEXT_ARM64_FUNCTIONS)
372*7c3d14c8STreehugger Robot
373*7c3d14c8STreehugger RobotCCKEXT_X86_FUNCTIONS := $(CCKEXT_COMMON_FUNCTIONS) \
374*7c3d14c8STreehugger Robot	divxc3 \
375*7c3d14c8STreehugger Robot	fixunsxfdi \
376*7c3d14c8STreehugger Robot	fixunsxfsi \
377*7c3d14c8STreehugger Robot	fixxfdi \
378*7c3d14c8STreehugger Robot	floatdixf \
379*7c3d14c8STreehugger Robot	floatundixf \
380*7c3d14c8STreehugger Robot	mulxc3 \
381*7c3d14c8STreehugger Robot	powixf2
382*7c3d14c8STreehugger Robot
383*7c3d14c8STreehugger RobotFUNCTIONS.cc_kext.i386 := $(CCKEXT_X86_FUNCTIONS) \
384*7c3d14c8STreehugger Robot	ffssi2 \
385*7c3d14c8STreehugger Robot	i686.get_pc_thunk.eax \
386*7c3d14c8STreehugger Robot	i686.get_pc_thunk.ebp \
387*7c3d14c8STreehugger Robot	i686.get_pc_thunk.ebx \
388*7c3d14c8STreehugger Robot	i686.get_pc_thunk.ecx \
389*7c3d14c8STreehugger Robot	i686.get_pc_thunk.edi \
390*7c3d14c8STreehugger Robot	i686.get_pc_thunk.edx \
391*7c3d14c8STreehugger Robot	i686.get_pc_thunk.esi
392*7c3d14c8STreehugger Robot
393*7c3d14c8STreehugger RobotFUNCTIONS.cc_kext.x86_64 := $(CCKEXT_X86_FUNCTIONS) \
394*7c3d14c8STreehugger Robot	absvti2 \
395*7c3d14c8STreehugger Robot	addvti3 \
396*7c3d14c8STreehugger Robot	ashlti3 \
397*7c3d14c8STreehugger Robot	ashrti3 \
398*7c3d14c8STreehugger Robot	clzti2 \
399*7c3d14c8STreehugger Robot	cmpti2 \
400*7c3d14c8STreehugger Robot	ctzti2 \
401*7c3d14c8STreehugger Robot	divti3 \
402*7c3d14c8STreehugger Robot	ffsti2 \
403*7c3d14c8STreehugger Robot	fixdfti \
404*7c3d14c8STreehugger Robot	fixsfti \
405*7c3d14c8STreehugger Robot	fixunsdfti \
406*7c3d14c8STreehugger Robot	fixunssfti \
407*7c3d14c8STreehugger Robot	fixunsxfti \
408*7c3d14c8STreehugger Robot	fixxfti \
409*7c3d14c8STreehugger Robot	floattidf \
410*7c3d14c8STreehugger Robot	floattisf \
411*7c3d14c8STreehugger Robot	floattixf \
412*7c3d14c8STreehugger Robot	floatuntidf \
413*7c3d14c8STreehugger Robot	floatuntisf \
414*7c3d14c8STreehugger Robot	floatuntixf \
415*7c3d14c8STreehugger Robot	lshrti3 \
416*7c3d14c8STreehugger Robot	modti3 \
417*7c3d14c8STreehugger Robot	multi3 \
418*7c3d14c8STreehugger Robot	mulvti3 \
419*7c3d14c8STreehugger Robot	negti2 \
420*7c3d14c8STreehugger Robot	negvti2 \
421*7c3d14c8STreehugger Robot	parityti2 \
422*7c3d14c8STreehugger Robot	popcountti2 \
423*7c3d14c8STreehugger Robot	subvti3 \
424*7c3d14c8STreehugger Robot	ucmpti2 \
425*7c3d14c8STreehugger Robot	udivmodti4 \
426*7c3d14c8STreehugger Robot	udivti3 \
427*7c3d14c8STreehugger Robot	umodti3
428*7c3d14c8STreehugger Robot
429*7c3d14c8STreehugger RobotFUNCTIONS.cc_kext.x86_64h := $(FUNCTIONS.cc_kext.x86_64)
430*7c3d14c8STreehugger Robot
431*7c3d14c8STreehugger Robot# FIXME: Currently, compiler-rt is missing implementations for a number of the
432*7c3d14c8STreehugger Robot# functions that need to go into libcc_kext.a. Filter them out for now.
433*7c3d14c8STreehugger RobotCCKEXT_MISSING_FUNCTIONS := \
434*7c3d14c8STreehugger Robot	cmpdf2 cmpsf2 div0 \
435*7c3d14c8STreehugger Robot	ffssi2 \
436*7c3d14c8STreehugger Robot	udiv_w_sdiv unorddf2 unordsf2 bswapdi2 \
437*7c3d14c8STreehugger Robot	bswapsi2 \
438*7c3d14c8STreehugger Robot	gcc_bcmp \
439*7c3d14c8STreehugger Robot	do_global_dtors \
440*7c3d14c8STreehugger Robot	i686.get_pc_thunk.eax i686.get_pc_thunk.ebp i686.get_pc_thunk.ebx \
441*7c3d14c8STreehugger Robot	i686.get_pc_thunk.ecx i686.get_pc_thunk.edi i686.get_pc_thunk.edx \
442*7c3d14c8STreehugger Robot	i686.get_pc_thunk.esi \
443*7c3d14c8STreehugger Robot	aeabi_cdcmpeq aeabi_cdrcmple aeabi_cfcmpeq aeabi_cfrcmple aeabi_dcmpeq \
444*7c3d14c8STreehugger Robot	aeabi_dcmpge aeabi_dcmpgt aeabi_dcmple aeabi_dcmplt aeabi_drsub aeabi_fcmpeq \
445*7c3d14c8STreehugger Robot	aeabi_fcmpge aeabi_fcmpgt aeabi_fcmple aeabi_fcmplt aeabi_frsub aeabi_idivmod \
446*7c3d14c8STreehugger Robot	aeabi_uidivmod
447*7c3d14c8STreehugger Robot
448*7c3d14c8STreehugger RobotFUNCTIONS.cc_kext_ios.armv7 := \
449*7c3d14c8STreehugger Robot	$(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext_ios.armv7))
450*7c3d14c8STreehugger RobotFUNCTIONS.cc_kext_ios.armv7k := \
451*7c3d14c8STreehugger Robot	$(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext_ios.armv7k))
452*7c3d14c8STreehugger RobotFUNCTIONS.cc_kext_ios.armv7s := \
453*7c3d14c8STreehugger Robot	$(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext_ios.armv7s))
454*7c3d14c8STreehugger RobotFUNCTIONS.cc_kext_ios.arm64 := \
455*7c3d14c8STreehugger Robot	$(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext_ios.arm64))
456*7c3d14c8STreehugger RobotFUNCTIONS.cc_kext.i386 := \
457*7c3d14c8STreehugger Robot	$(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext.i386))
458*7c3d14c8STreehugger RobotFUNCTIONS.cc_kext.x86_64 := \
459*7c3d14c8STreehugger Robot	$(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext.x86_64))
460*7c3d14c8STreehugger RobotFUNCTIONS.cc_kext.x86_64h := \
461*7c3d14c8STreehugger Robot	$(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext.x86_64h))
462*7c3d14c8STreehugger Robot
463*7c3d14c8STreehugger RobotKERNEL_USE.cc_kext := 1
464*7c3d14c8STreehugger RobotKERNEL_USE.cc_kext_ios := 1
465*7c3d14c8STreehugger Robot
466*7c3d14c8STreehugger RobotVISIBILITY_HIDDEN := 1
467*7c3d14c8STreehugger Robot
468*7c3d14c8STreehugger RobotSHARED_LIBRARY_SUFFIX := dylib
469