xref: /aosp_15_r20/external/compiler-rt/make/platform/darwin_bni.mk (revision 7c3d14c8b49c529e04be81a3ce6f5cc23712e4c6)
1*7c3d14c8STreehugger Robot
2*7c3d14c8STreehugger RobotDescription := Target for Darwin using an Apple-style build.
3*7c3d14c8STreehugger Robot
4*7c3d14c8STreehugger RobotConfigs := Debug Release Profile Static
5*7c3d14c8STreehugger Robot
6*7c3d14c8STreehugger Robot# We override this with RC_ARCHS because B&I may want to build on an ARCH we
7*7c3d14c8STreehugger Robot# haven't explicitly defined support for. If all goes well, this will just work
8*7c3d14c8STreehugger Robot# and the resulting lib will just have generic versions for anything unknown.
9*7c3d14c8STreehugger RobotUniversalArchs := $(RC_ARCHS)
10*7c3d14c8STreehugger Robot
11*7c3d14c8STreehugger Robotifneq (,$(SDKROOT))
12*7c3d14c8STreehugger Robot	override CC := $(shell xcrun -sdk $(SDKROOT) -find clang || echo "false")
13*7c3d14c8STreehugger Robot	AR := $(shell xcrun -sdk $(SDKROOT) -find ar || echo "false")
14*7c3d14c8STreehugger Robot	RANLIB := $(shell xcrun -sdk $(SDKROOT) -find ranlib || echo "false")
15*7c3d14c8STreehugger Robot	STRIP := $(shell xcrun -sdk $(SDKROOT) -find strip || echo "false")
16*7c3d14c8STreehugger Robot	LIPO := $(shell xcrun -sdk $(SDKROOT) -find lipo || echo "false")
17*7c3d14c8STreehugger Robot	DSYMUTIL := $(shell xcrun -sdk $(SDKROOT) -find dsymutil || echo "false")
18*7c3d14c8STreehugger Robotendif
19*7c3d14c8STreehugger Robot
20*7c3d14c8STreehugger Robotifneq ($(IPHONEOS_DEPLOYMENT_TARGET),)
21*7c3d14c8STreehugger Robot	DEPLOYMENT_FLAGS := -miphoneos-version-min=$(IPHONEOS_DEPLOYMENT_TARGET)
22*7c3d14c8STreehugger Robotelse
23*7c3d14c8STreehugger Robot	ifneq ($(MACOSX_DEPLOYMENT_TARGET),)
24*7c3d14c8STreehugger Robot		DEPLOYMENT_FLAGS := -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET)
25*7c3d14c8STreehugger Robot	endif
26*7c3d14c8STreehugger Robotendif
27*7c3d14c8STreehugger Robot
28*7c3d14c8STreehugger Robotifneq (,$(SDKROOT))
29*7c3d14c8STreehugger Robot	DEPLOYMENT_FLAGS += -isysroot $(SDKROOT)
30*7c3d14c8STreehugger Robotendif
31*7c3d14c8STreehugger Robot
32*7c3d14c8STreehugger RobotCFLAGS := -Wall -Os -fomit-frame-pointer -g $(DEPLOYMENT_FLAGS)
33*7c3d14c8STreehugger RobotCFLAGS.Static := $(CFLAGS) -static
34*7c3d14c8STreehugger RobotDYLIB_FLAGS := $(DEPLOYMENT_FLAGS) \
35*7c3d14c8STreehugger Robot		-Xarch_arm -Wl,-alias_list,$(SRCROOT)/lib/builtins/arm/softfloat-alias.list
36*7c3d14c8STreehugger Robot
37*7c3d14c8STreehugger RobotVISIBILITY_HIDDEN := 0
38*7c3d14c8STreehugger RobotVISIBILITY_HIDDEN.Static  := 1
39*7c3d14c8STreehugger Robot
40*7c3d14c8STreehugger Robot
41*7c3d14c8STreehugger RobotFUNCTIONS := absvdi2 absvsi2 addvdi3 addvsi3 ashldi3 ashrdi3 \
42*7c3d14c8STreehugger Robot             clzdi2 clzsi2 cmpdi2 ctzdi2 ctzsi2 \
43*7c3d14c8STreehugger Robot             divdc3 divdi3 divsc3 ffsdi2 \
44*7c3d14c8STreehugger Robot             fixdfdi fixsfdi fixunsdfdi fixunsdfsi fixunssfdi \
45*7c3d14c8STreehugger Robot             fixunssfsi floatdidf floatdisf floatundidf floatundisf \
46*7c3d14c8STreehugger Robot             gcc_personality_v0 lshrdi3 moddi3 muldc3 muldi3 mulosi4 \
47*7c3d14c8STreehugger Robot             mulodi4 muloti4 mulsc3 mulvdi3 mulvsi3 negdi2 negvdi2 negvsi2 \
48*7c3d14c8STreehugger Robot             paritydi2 paritysi2 popcountdi2 popcountsi2 powidf2 \
49*7c3d14c8STreehugger Robot             powisf2 subvdi3 subvsi3 ucmpdi2 udivdi3 \
50*7c3d14c8STreehugger Robot             udivmoddi4 umoddi3 apple_versioning eprintf atomic \
51*7c3d14c8STreehugger Robot             atomic_flag_clear atomic_flag_clear_explicit \
52*7c3d14c8STreehugger Robot             atomic_flag_test_and_set atomic_flag_test_and_set_explicit \
53*7c3d14c8STreehugger Robot             atomic_signal_fence atomic_thread_fence \
54*7c3d14c8STreehugger Robot             extendhfsf2 truncdfhf2 truncsfhf2
55*7c3d14c8STreehugger Robot
56*7c3d14c8STreehugger RobotFUNCTIONS.i386 := $(FUNCTIONS) \
57*7c3d14c8STreehugger Robot                divxc3 fixunsxfdi fixunsxfsi fixxfdi floatdixf \
58*7c3d14c8STreehugger Robot                floatundixf mulxc3 powixf2 clear_cache \
59*7c3d14c8STreehugger Robot                enable_execute_stack
60*7c3d14c8STreehugger RobotFUNCTIONS.ppc := $(FUNCTIONS) \
61*7c3d14c8STreehugger Robot                divtc3 fixtfdi fixunstfdi floatditf floatunditf \
62*7c3d14c8STreehugger Robot                gcc_qadd gcc_qdiv gcc_qmul gcc_qsub multc3 \
63*7c3d14c8STreehugger Robot                powitf2 restFP saveFP trampoline_setup \
64*7c3d14c8STreehugger Robot                clear_cache enable_execute_stack
65*7c3d14c8STreehugger RobotFUNCTIONS.x86_64 := $(FUNCTIONS) \
66*7c3d14c8STreehugger Robot                absvti2 addvti3 ashlti3 ashrti3 clzti2 cmpti2 \
67*7c3d14c8STreehugger Robot                ctzti2 divti3 divxc3 ffsti2 fixdfti fixsfti \
68*7c3d14c8STreehugger Robot                fixunsdfti fixunssfti fixunsxfdi fixunsxfsi \
69*7c3d14c8STreehugger Robot                fixunsxfti fixxfdi fixxfti floatdixf floattidf \
70*7c3d14c8STreehugger Robot                floattisf floattixf floatundixf floatuntidf \
71*7c3d14c8STreehugger Robot                floatuntisf floatuntixf lshrti3 modti3 multi3 \
72*7c3d14c8STreehugger Robot                muloti4 mulvti3 mulxc3 negti2 negvti2 parityti2 \
73*7c3d14c8STreehugger Robot                popcountti2 powixf2 subvti3 ucmpti2 udivmodti4 \
74*7c3d14c8STreehugger Robot                udivti3 umodti3 clear_cache enable_execute_stack
75*7c3d14c8STreehugger Robot
76*7c3d14c8STreehugger RobotFUNCTIONS.armv4t := $(FUNCTIONS)
77*7c3d14c8STreehugger Robot
78*7c3d14c8STreehugger RobotFUNCTIONS.armv5 := $(FUNCTIONS) \
79*7c3d14c8STreehugger Robot                adddf3 addsf3 bswapdi2 bswapsi2  \
80*7c3d14c8STreehugger Robot                comparedf2 comparesf2 extendsfdf2 \
81*7c3d14c8STreehugger Robot                divdf3 divsf3 \
82*7c3d14c8STreehugger Robot                fixdfsi fixsfsi fixunsdfsi fixunssfsi \
83*7c3d14c8STreehugger Robot                floatsidf floatsisf floatunsidf floatunsisf \
84*7c3d14c8STreehugger Robot                muldf3 mulsf3 \
85*7c3d14c8STreehugger Robot                negdf2 negsf2 \
86*7c3d14c8STreehugger Robot                truncdfsf2  \
87*7c3d14c8STreehugger Robot                modsi3 umodsi3 udivsi3 divsi3 udivmodsi4 divmodsi4 \
88*7c3d14c8STreehugger Robot                switch8 switchu8 switch16 switch32 \
89*7c3d14c8STreehugger Robot                sync_synchronize
90*7c3d14c8STreehugger Robot
91*7c3d14c8STreehugger RobotFUNCTIONS.armv6 := $(FUNCTIONS) \
92*7c3d14c8STreehugger Robot				comparedf2 comparesf2 \
93*7c3d14c8STreehugger Robot                adddf3vfp addsf3vfp bswapdi2 bswapsi2 divdf3vfp \
94*7c3d14c8STreehugger Robot                divsf3vfp eqdf2vfp eqsf2vfp extendsfdf2vfp \
95*7c3d14c8STreehugger Robot                fixdfsivfp fixsfsivfp fixunsdfsivfp fixunssfsivfp \
96*7c3d14c8STreehugger Robot                floatsidfvfp floatsisfvfp floatunssidfvfp floatunssisfvfp \
97*7c3d14c8STreehugger Robot                gedf2vfp gesf2vfp gtdf2vfp gtsf2vfp \
98*7c3d14c8STreehugger Robot                ledf2vfp lesf2vfp ltdf2vfp ltsf2vfp \
99*7c3d14c8STreehugger Robot                muldf3vfp mulsf3vfp \
100*7c3d14c8STreehugger Robot                nedf2vfp nesf2vfp \
101*7c3d14c8STreehugger Robot                subdf3vfp subsf3vfp truncdfsf2vfp unorddf2vfp unordsf2vfp \
102*7c3d14c8STreehugger Robot                modsi3 umodsi3 udivsi3 divsi3 udivmodsi4 divmodsi4 \
103*7c3d14c8STreehugger Robot                switch8 switchu8 switch16 switch32 \
104*7c3d14c8STreehugger Robot                restore_vfp_d8_d15_regs save_vfp_d8_d15_regs \
105*7c3d14c8STreehugger Robot                sync_synchronize
106*7c3d14c8STreehugger Robot
107*7c3d14c8STreehugger RobotFUNCTIONS.armv7 := $(FUNCTIONS) \
108*7c3d14c8STreehugger Robot				comparedf2 comparesf2 \
109*7c3d14c8STreehugger Robot                adddf3vfp addsf3vfp bswapdi2 bswapsi2 divdf3vfp \
110*7c3d14c8STreehugger Robot                divsf3vfp eqdf2vfp eqsf2vfp extendsfdf2vfp \
111*7c3d14c8STreehugger Robot                fixdfsivfp fixsfsivfp fixunsdfsivfp fixunssfsivfp \
112*7c3d14c8STreehugger Robot                floatsidfvfp floatsisfvfp floatunssidfvfp floatunssisfvfp \
113*7c3d14c8STreehugger Robot                gedf2vfp gesf2vfp gtdf2vfp gtsf2vfp \
114*7c3d14c8STreehugger Robot                ledf2vfp lesf2vfp ltdf2vfp ltsf2vfp \
115*7c3d14c8STreehugger Robot                muldf3vfp mulsf3vfp \
116*7c3d14c8STreehugger Robot                nedf2vfp nesf2vfp \
117*7c3d14c8STreehugger Robot                subdf3vfp subsf3vfp truncdfsf2vfp unorddf2vfp unordsf2vfp \
118*7c3d14c8STreehugger Robot                modsi3 umodsi3 udivsi3 divsi3 udivmodsi4 divmodsi4
119*7c3d14c8STreehugger Robot
120*7c3d14c8STreehugger RobotFUNCTIONS.armv7s := $(FUNCTIONS.armv7)
121*7c3d14c8STreehugger Robot
122*7c3d14c8STreehugger RobotFUNCTIONS.arm64 :=  divti3 modti3 \
123*7c3d14c8STreehugger Robot					udivmodti4 \
124*7c3d14c8STreehugger Robot					udivti3 umodti3 \
125*7c3d14c8STreehugger Robot					mulsc3 muldc3 \
126*7c3d14c8STreehugger Robot					powisf2 powidf2 \
127*7c3d14c8STreehugger Robot					clzti2 \
128*7c3d14c8STreehugger Robot					fixdfti fixsfti \
129*7c3d14c8STreehugger Robot					fixunsdfti fixunssfti fixunssfti \
130*7c3d14c8STreehugger Robot					floattidf floattisf floatuntidf floatuntisf \
131*7c3d14c8STreehugger Robot					gcc_personality_v0 atomic \
132*7c3d14c8STreehugger Robot					atomic_flag_clear atomic_flag_clear_explicit \
133*7c3d14c8STreehugger Robot					atomic_flag_test_and_set \
134*7c3d14c8STreehugger Robot					atomic_flag_test_and_set_explicit \
135*7c3d14c8STreehugger Robot					atomic_signal_fence atomic_thread_fence
136