1*6b8783caSjsg# $OpenBSD: Makefile,v 1.2 2020/08/11 03:23:47 jsg Exp $ 26f4c386aSpatrick 36f4c386aSpatrick.include <bsd.own.mk> 46f4c386aSpatrick 56f4c386aSpatrick.if ${COMPILER_VERSION:L} != "clang" 66f4c386aSpatrickCC= clang 76f4c386aSpatrickCXX= clang++ 86f4c386aSpatrick.endif 96f4c386aSpatrick 106f4c386aSpatrick.if ${BUILD_CLANG:L} == "yes" 116f4c386aSpatrick 126f4c386aSpatrickLIB= compiler_rt 136f4c386aSpatrickNOPIC= 146f4c386aSpatrickNOPROFILE= 156f4c386aSpatrick 166f4c386aSpatrickCFLAGS+= -fPIC -std=gnu99 -fvisibility=hidden -fno-stack-protector 176f4c386aSpatrickCPPFLAGS+= -DVISIBILITY_HIDDEN 186f4c386aSpatrick 196f4c386aSpatrick.if ${MACHINE_ARCH} == "amd64" 206f4c386aSpatrickRTARCH= x86_64 216f4c386aSpatrick.elif ${MACHINE_ARCH} == "powerpc" 226f4c386aSpatrickRTARCH= ppc 236f4c386aSpatrick.else 246f4c386aSpatrickRTARCH= ${MACHINE_ARCH} 256f4c386aSpatrick.endif 266f4c386aSpatrick 276f4c386aSpatrick.PATH: ${.CURDIR}/../../llvm/compiler-rt/lib/builtins/${RTARCH} 286f4c386aSpatrick.PATH: ${.CURDIR}/../../llvm/compiler-rt/lib/builtins 296f4c386aSpatrick 306f4c386aSpatrickGEN_SRCS= absvdi2 \ 316f4c386aSpatrick absvsi2 \ 326f4c386aSpatrick absvti2 \ 336f4c386aSpatrick addtf3 \ 346f4c386aSpatrick addvdi3 \ 356f4c386aSpatrick addvsi3 \ 366f4c386aSpatrick addvti3 \ 376f4c386aSpatrick apple_versioning \ 386f4c386aSpatrick ashldi3 \ 396f4c386aSpatrick ashlti3 \ 406f4c386aSpatrick ashrdi3 \ 416f4c386aSpatrick ashrti3 \ 426f4c386aSpatrick atomic \ 436f4c386aSpatrick bswapdi2 \ 446f4c386aSpatrick bswapsi2 \ 456f4c386aSpatrick clear_cache \ 466f4c386aSpatrick clzdi2 \ 476f4c386aSpatrick clzsi2 \ 486f4c386aSpatrick clzti2 \ 496f4c386aSpatrick cmpdi2 \ 506f4c386aSpatrick cmpti2 \ 516f4c386aSpatrick comparedf2 \ 526f4c386aSpatrick comparesf2 \ 536f4c386aSpatrick cpu_model \ 546f4c386aSpatrick ctzdi2 \ 556f4c386aSpatrick ctzsi2 \ 566f4c386aSpatrick ctzti2 \ 576f4c386aSpatrick divdc3 \ 586f4c386aSpatrick divdi3 \ 596f4c386aSpatrick divmoddi4 \ 606f4c386aSpatrick divmodsi4 \ 616f4c386aSpatrick divsc3 \ 626f4c386aSpatrick divtc3 \ 636f4c386aSpatrick divti3 \ 646f4c386aSpatrick divtf3 \ 656f4c386aSpatrick divxc3 \ 666f4c386aSpatrick emutls \ 676f4c386aSpatrick enable_execute_stack \ 686f4c386aSpatrick eprintf \ 696f4c386aSpatrick extendhfsf2 \ 706f4c386aSpatrick ffsdi2 \ 716f4c386aSpatrick ffssi2 \ 726f4c386aSpatrick ffsti2 \ 736f4c386aSpatrick fixdfti \ 746f4c386aSpatrick fixsfti \ 756f4c386aSpatrick fixunsdfsi \ 766f4c386aSpatrick fixunsdfti \ 776f4c386aSpatrick fixunssfsi \ 786f4c386aSpatrick fixunssfti \ 796f4c386aSpatrick fixunsxfdi \ 806f4c386aSpatrick fixunsxfsi \ 816f4c386aSpatrick fixunsxfti \ 826f4c386aSpatrick fixxfdi \ 836f4c386aSpatrick fixxfti \ 846f4c386aSpatrick floattidf \ 856f4c386aSpatrick floattisf \ 866f4c386aSpatrick floattixf \ 876f4c386aSpatrick floatunsidf \ 886f4c386aSpatrick floatunsisf \ 896f4c386aSpatrick floatuntidf \ 906f4c386aSpatrick floatuntisf \ 916f4c386aSpatrick floatuntixf \ 926f4c386aSpatrick fp_mode \ 936f4c386aSpatrick gcc_personality_v0 \ 946f4c386aSpatrick int_util \ 956f4c386aSpatrick lshrdi3 \ 966f4c386aSpatrick lshrti3 \ 976f4c386aSpatrick moddi3 \ 986f4c386aSpatrick modsi3 \ 996f4c386aSpatrick modti3 \ 1006f4c386aSpatrick muldc3 \ 1016f4c386aSpatrick muldi3 \ 1026f4c386aSpatrick mulodi4 \ 1036f4c386aSpatrick mulosi4 \ 1046f4c386aSpatrick muloti4 \ 1056f4c386aSpatrick mulsc3 \ 1066f4c386aSpatrick multi3 \ 1076f4c386aSpatrick multf3 \ 1086f4c386aSpatrick mulvdi3 \ 1096f4c386aSpatrick mulvsi3 \ 1106f4c386aSpatrick mulvti3 \ 1116f4c386aSpatrick mulxc3 \ 1126f4c386aSpatrick negdf2 \ 1136f4c386aSpatrick negdi2 \ 1146f4c386aSpatrick negsf2 \ 1156f4c386aSpatrick negti2 \ 1166f4c386aSpatrick negvdi2 \ 1176f4c386aSpatrick negvsi2 \ 1186f4c386aSpatrick negvti2 \ 1196f4c386aSpatrick paritydi2 \ 1206f4c386aSpatrick paritysi2 \ 1216f4c386aSpatrick parityti2 \ 1226f4c386aSpatrick popcountdi2 \ 1236f4c386aSpatrick popcountsi2 \ 1246f4c386aSpatrick popcountti2 \ 1256f4c386aSpatrick powidf2 \ 1266f4c386aSpatrick powisf2 \ 1276f4c386aSpatrick powitf2 \ 1286f4c386aSpatrick powixf2 \ 1296f4c386aSpatrick subvdi3 \ 1306f4c386aSpatrick subvsi3 \ 1316f4c386aSpatrick subvti3 \ 1326f4c386aSpatrick subtf3 \ 1336f4c386aSpatrick trampoline_setup \ 1346f4c386aSpatrick truncdfhf2 \ 1356f4c386aSpatrick truncsfhf2 \ 1366f4c386aSpatrick ucmpdi2 \ 1376f4c386aSpatrick ucmpti2 \ 1386f4c386aSpatrick udivdi3 \ 1396f4c386aSpatrick udivmoddi4 \ 1406f4c386aSpatrick udivmodsi4 \ 1416f4c386aSpatrick udivmodti4 \ 1426f4c386aSpatrick udivti3 \ 1436f4c386aSpatrick umoddi3 \ 1446f4c386aSpatrick umodsi3 \ 1456f4c386aSpatrick umodti3 1466f4c386aSpatrick 1476f4c386aSpatrick.if ${RTARCH} != "arm" 1486f4c386aSpatrickGEN_SRCS+= adddf3 \ 1496f4c386aSpatrick addsf3 \ 1506f4c386aSpatrick divdf3 \ 1516f4c386aSpatrick divsf3 \ 1526f4c386aSpatrick divsi3 \ 1536f4c386aSpatrick extendsfdf2 \ 1546f4c386aSpatrick fixdfdi \ 1556f4c386aSpatrick fixdfsi \ 1566f4c386aSpatrick fixsfdi \ 1576f4c386aSpatrick fixsfsi \ 1586f4c386aSpatrick fixunsdfdi \ 1596f4c386aSpatrick fixunssfdi \ 1606f4c386aSpatrick floatsidf \ 1616f4c386aSpatrick floatsisf \ 1626f4c386aSpatrick muldf3 \ 1636f4c386aSpatrick mulsf3 \ 1646f4c386aSpatrick subdf3 \ 1656f4c386aSpatrick subsf3 \ 1666f4c386aSpatrick truncdfsf2 \ 1676f4c386aSpatrick udivsi3 1686f4c386aSpatrick.endif 1696f4c386aSpatrick 1706f4c386aSpatrick.if ${RTARCH} == "i386" 1716f4c386aSpatrickSRCS+= floatdidf.c \ 1726f4c386aSpatrick floatdisf.c \ 1736f4c386aSpatrick floatdixf.c \ 1746f4c386aSpatrick floatundidf.c \ 1756f4c386aSpatrick floatundisf.c \ 1766f4c386aSpatrick floatundixf.c 1776f4c386aSpatrick.else 1786f4c386aSpatrickGEN_SRCS+= floatdidf \ 1796f4c386aSpatrick floatdisf \ 1806f4c386aSpatrick floatdixf \ 1816f4c386aSpatrick floatundidf \ 1826f4c386aSpatrick floatundisf \ 1836f4c386aSpatrick floatundixf 1846f4c386aSpatrick.endif 1856f4c386aSpatrick 1866f4c386aSpatrick.for file in ${GEN_SRCS} 187*6b8783caSjsg. if exists(${.CURDIR}/../../llvm/compiler-rt/lib/builtins/${RTARCH}/${file}.S) 1886f4c386aSpatrickSRCS+= ${file}.S 1896f4c386aSpatrick. else 1906f4c386aSpatrickSRCS+= ${file}.c 1916f4c386aSpatrick. endif 1926f4c386aSpatrick.endfor 1936f4c386aSpatrick 1946f4c386aSpatrick.if ${RTARCH} == "aarch64" 1956f4c386aSpatrickSRCS+= comparetf2.c \ 1966f4c386aSpatrick extenddftf2.c \ 1976f4c386aSpatrick extendsftf2.c \ 1986f4c386aSpatrick fixtfdi.c \ 1996f4c386aSpatrick fixtfsi.c \ 2006f4c386aSpatrick fixtfti.c \ 2016f4c386aSpatrick fixunstfdi.c \ 2026f4c386aSpatrick fixunstfsi.c \ 2036f4c386aSpatrick fixunstfti.c \ 2046f4c386aSpatrick floatditf.c \ 2056f4c386aSpatrick floatsitf.c \ 2066f4c386aSpatrick floattitf.c \ 2076f4c386aSpatrick floatunditf.c \ 2086f4c386aSpatrick floatunsitf.c \ 2096f4c386aSpatrick floatuntitf.c \ 2106f4c386aSpatrick multc3.c \ 2116f4c386aSpatrick trunctfdf2.c \ 2126f4c386aSpatrick trunctfsf2.c 2136f4c386aSpatrick.endif 2146f4c386aSpatrick 2156f4c386aSpatrick.if ${RTARCH} == "arm" 2166f4c386aSpatrickSRCS+= aeabi_cdcmp.S \ 2176f4c386aSpatrick aeabi_cdcmpeq_check_nan.c \ 2186f4c386aSpatrick aeabi_cfcmp.S \ 2196f4c386aSpatrick aeabi_cfcmpeq_check_nan.c \ 2206f4c386aSpatrick aeabi_dcmp.S \ 2216f4c386aSpatrick aeabi_div0.c \ 2226f4c386aSpatrick aeabi_drsub.c \ 2236f4c386aSpatrick aeabi_fcmp.S \ 2246f4c386aSpatrick aeabi_frsub.c \ 2256f4c386aSpatrick aeabi_ldivmod.S \ 2266f4c386aSpatrick aeabi_memcmp.S \ 2276f4c386aSpatrick aeabi_memcpy.S \ 2286f4c386aSpatrick aeabi_memmove.S \ 2296f4c386aSpatrick aeabi_memset.S \ 2306f4c386aSpatrick aeabi_uldivmod.S \ 2316f4c386aSpatrick switch16.S \ 2326f4c386aSpatrick switch32.S \ 2336f4c386aSpatrick switch8.S \ 2346f4c386aSpatrick switchu8.S \ 2356f4c386aSpatrick sync_fetch_and_add_4.S \ 2366f4c386aSpatrick sync_fetch_and_add_8.S \ 2376f4c386aSpatrick sync_fetch_and_and_4.S \ 2386f4c386aSpatrick sync_fetch_and_and_8.S \ 2396f4c386aSpatrick sync_fetch_and_max_4.S \ 2406f4c386aSpatrick sync_fetch_and_max_8.S \ 2416f4c386aSpatrick sync_fetch_and_min_4.S \ 2426f4c386aSpatrick sync_fetch_and_min_8.S \ 2436f4c386aSpatrick sync_fetch_and_nand_4.S \ 2446f4c386aSpatrick sync_fetch_and_nand_8.S \ 2456f4c386aSpatrick sync_fetch_and_or_4.S \ 2466f4c386aSpatrick sync_fetch_and_or_8.S \ 2476f4c386aSpatrick sync_fetch_and_sub_4.S \ 2486f4c386aSpatrick sync_fetch_and_sub_8.S \ 2496f4c386aSpatrick sync_fetch_and_umax_4.S \ 2506f4c386aSpatrick sync_fetch_and_umax_8.S \ 2516f4c386aSpatrick sync_fetch_and_umin_4.S \ 2526f4c386aSpatrick sync_fetch_and_umin_8.S \ 2536f4c386aSpatrick sync_fetch_and_xor_4.S \ 2546f4c386aSpatrick sync_fetch_and_xor_8.S \ 2556f4c386aSpatrick sync_synchronize.S 2566f4c386aSpatrick.endif 2576f4c386aSpatrick 2586f4c386aSpatrick.if ${RTARCH} == "mips64" || ${RTARCH} == "mips64el" 2596f4c386aSpatrickSRCS+= comparetf2.c \ 2606f4c386aSpatrick extenddftf2.c \ 2616f4c386aSpatrick extendsftf2.c \ 2626f4c386aSpatrick fixtfdi.c \ 2636f4c386aSpatrick fixtfsi.c \ 2646f4c386aSpatrick fixtfti.c \ 2656f4c386aSpatrick fixunstfdi.c \ 2666f4c386aSpatrick fixunstfsi.c \ 2676f4c386aSpatrick fixunstfti.c \ 2686f4c386aSpatrick floatditf.c \ 2696f4c386aSpatrick floatsitf.c \ 2706f4c386aSpatrick floattitf.c \ 2716f4c386aSpatrick floatunditf.c \ 2726f4c386aSpatrick floatunsitf.c \ 2736f4c386aSpatrick floatuntitf.c \ 2746f4c386aSpatrick multc3.c \ 2756f4c386aSpatrick trunctfdf2.c \ 2766f4c386aSpatrick trunctfsf2.c 2776f4c386aSpatrick.endif 2786f4c386aSpatrick 2796f4c386aSpatrick.if ${RTARCH} == "ppc" 2806f4c386aSpatrickSRCS+= atomic_lock_free.c \ 2816f4c386aSpatrick divtc3.c \ 2826f4c386aSpatrick fixtfdi.c \ 2836f4c386aSpatrick fixtfti.c \ 2846f4c386aSpatrick fixunstfdi.c \ 2856f4c386aSpatrick floatditf.c \ 2866f4c386aSpatrick floatunditf.c \ 2876f4c386aSpatrick gcc_qadd.c \ 2886f4c386aSpatrick gcc_qdiv.c \ 2896f4c386aSpatrick gcc_qmul.c \ 2906f4c386aSpatrick gcc_qsub.c \ 2916f4c386aSpatrick multc3.c 2926f4c386aSpatrick.endif 2936f4c386aSpatrick 2946f4c386aSpatrick.if ${RTARCH} == "sparc64" 2956f4c386aSpatrickSRCS+= comparetf2.c \ 2966f4c386aSpatrick extenddftf2.c \ 2976f4c386aSpatrick extendsftf2.c \ 2986f4c386aSpatrick fixtfdi.c \ 2996f4c386aSpatrick fixtfsi.c \ 3006f4c386aSpatrick fixtfti.c \ 3016f4c386aSpatrick fixunstfdi.c \ 3026f4c386aSpatrick fixunstfsi.c \ 3036f4c386aSpatrick fixunstfti.c \ 3046f4c386aSpatrick floatditf.c \ 3056f4c386aSpatrick floatsitf.c \ 3066f4c386aSpatrick floattitf.c \ 3076f4c386aSpatrick floatunditf.c \ 3086f4c386aSpatrick floatunsitf.c \ 3096f4c386aSpatrick floatuntitf.c \ 3106f4c386aSpatrick multc3.c \ 3116f4c386aSpatrick trunctfdf2.c \ 3126f4c386aSpatrick trunctfsf2.c 3136f4c386aSpatrick.endif 3146f4c386aSpatrick 3156f4c386aSpatrick.include <bsd.lib.mk> 3166f4c386aSpatrick 3176f4c386aSpatrick.else 3186f4c386aSpatrickNOPROG= 3196f4c386aSpatrick.include <bsd.prog.mk> 3206f4c386aSpatrick.endif 321