Home | History | Annotate | Download | only in lib
      1 # First, add the subdirectories which contain feature-based runtime libraries
      2 # and several convenience helper libraries.
      3 if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux")
      4   # AddressSanitizer is supported on Linux and Mac OS X.
      5   # Windows support is work in progress.
      6   add_subdirectory(asan)
      7   add_subdirectory(interception)
      8   add_subdirectory(sanitizer_common)
      9   if(NOT ANDROID)
     10     add_subdirectory(lsan)
     11     add_subdirectory(profile)
     12     add_subdirectory(ubsan)
     13   endif()
     14 endif()
     15 if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND NOT ANDROID)
     16   # ThreadSanitizer and MemorySanitizer are supported on Linux only.
     17   add_subdirectory(tsan)
     18   add_subdirectory(msan)
     19   add_subdirectory(msandr)
     20 endif()
     21 
     22 # The top-level lib directory contains a large amount of C code which provides
     23 # generic implementations of the core runtime library along with optimized
     24 # architecture-specific code in various subdirectories.
     25 
     26 set(GENERIC_SOURCES
     27   absvdi2.c
     28   absvsi2.c
     29   absvti2.c
     30   adddf3.c
     31   addsf3.c
     32   addvdi3.c
     33   addvsi3.c
     34   addvti3.c
     35   apple_versioning.c
     36   ashldi3.c
     37   ashlti3.c
     38   ashrdi3.c
     39   ashrti3.c
     40   # FIXME: atomic.c may only be compiled if host compiler understands _Atomic
     41   # atomic.c
     42   clear_cache.c
     43   clzdi2.c
     44   clzsi2.c
     45   clzti2.c
     46   cmpdi2.c
     47   cmpti2.c
     48   comparedf2.c
     49   comparesf2.c
     50   ctzdi2.c
     51   ctzsi2.c
     52   ctzti2.c
     53   divdc3.c
     54   divdf3.c
     55   divdi3.c
     56   divmoddi4.c
     57   divmodsi4.c
     58   divsc3.c
     59   divsf3.c
     60   divsi3.c
     61   divti3.c
     62   divxc3.c
     63   enable_execute_stack.c
     64   eprintf.c
     65   extendsfdf2.c
     66   ffsdi2.c
     67   ffsti2.c
     68   fixdfdi.c
     69   fixdfsi.c
     70   fixdfti.c
     71   fixsfdi.c
     72   fixsfsi.c
     73   fixsfti.c
     74   fixunsdfdi.c
     75   fixunsdfsi.c
     76   fixunsdfti.c
     77   fixunssfdi.c
     78   fixunssfsi.c
     79   fixunssfti.c
     80   fixunsxfdi.c
     81   fixunsxfsi.c
     82   fixunsxfti.c
     83   fixxfdi.c
     84   fixxfti.c
     85   floatdidf.c
     86   floatdisf.c
     87   floatdixf.c
     88   floatsidf.c
     89   floatsisf.c
     90   floattidf.c
     91   floattisf.c
     92   floattixf.c
     93   floatundidf.c
     94   floatundisf.c
     95   floatundixf.c
     96   floatunsidf.c
     97   floatunsisf.c
     98   floatuntidf.c
     99   floatuntisf.c
    100   floatuntixf.c
    101   gcc_personality_v0.c
    102   int_util.c
    103   lshrdi3.c
    104   lshrti3.c
    105   moddi3.c
    106   modsi3.c
    107   modti3.c
    108   muldc3.c
    109   muldf3.c
    110   muldi3.c
    111   mulodi4.c
    112   mulosi4.c
    113   muloti4.c
    114   mulsc3.c
    115   mulsf3.c
    116   multi3.c
    117   mulvdi3.c
    118   mulvsi3.c
    119   mulvti3.c
    120   mulxc3.c
    121   negdf2.c
    122   negdi2.c
    123   negsf2.c
    124   negti2.c
    125   negvdi2.c
    126   negvsi2.c
    127   negvti2.c
    128   paritydi2.c
    129   paritysi2.c
    130   parityti2.c
    131   popcountdi2.c
    132   popcountsi2.c
    133   popcountti2.c
    134   powidf2.c
    135   powisf2.c
    136   powitf2.c
    137   powixf2.c
    138   subdf3.c
    139   subsf3.c
    140   subvdi3.c
    141   subvsi3.c
    142   subvti3.c
    143   trampoline_setup.c
    144   truncdfsf2.c
    145   ucmpdi2.c
    146   ucmpti2.c
    147   udivdi3.c
    148   udivmoddi4.c
    149   udivmodsi4.c
    150   udivmodti4.c
    151   udivsi3.c
    152   udivti3.c
    153   umoddi3.c
    154   umodsi3.c
    155   umodti3.c
    156   )
    157 
    158 set(x86_64_SOURCES
    159   x86_64/floatdidf.c
    160   x86_64/floatdisf.c
    161   x86_64/floatdixf.c
    162   x86_64/floatundidf.S
    163   x86_64/floatundisf.S
    164   x86_64/floatundixf.S
    165   ${GENERIC_SOURCES})
    166 
    167 set(i386_SOURCES
    168   i386/ashldi3.S
    169   i386/ashrdi3.S
    170   i386/divdi3.S
    171   i386/floatdidf.S
    172   i386/floatdisf.S
    173   i386/floatdixf.S
    174   i386/floatundidf.S
    175   i386/floatundisf.S
    176   i386/floatundixf.S
    177   i386/lshrdi3.S
    178   i386/moddi3.S
    179   i386/muldi3.S
    180   i386/udivdi3.S
    181   i386/umoddi3.S
    182   ${GENERIC_SOURCES})
    183 
    184 foreach(arch x86_64 i386)
    185   if(CAN_TARGET_${arch})
    186     add_compiler_rt_static_runtime(clang_rt.${arch} ${arch}
    187       SOURCES ${${arch}_SOURCES}
    188       CFLAGS "-std=c99")
    189   endif()
    190 endforeach()
    191 
    192 # Generate configs for running lit and unit tests.
    193 configure_lit_site_cfg(
    194   ${CMAKE_CURRENT_SOURCE_DIR}/lit.common.configured.in
    195   ${CMAKE_CURRENT_BINARY_DIR}/lit.common.configured)
    196 
    197 configure_lit_site_cfg(
    198   ${CMAKE_CURRENT_SOURCE_DIR}/lit.common.unit.configured.in
    199   ${CMAKE_CURRENT_BINARY_DIR}/lit.common.unit.configured)
    200 
    201