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