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(ubsan)
     11   endif()
     12 endif()
     13 if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND NOT ANDROID)
     14   # ThreadSanitizer and MemorySanitizer are supported on Linux only.
     15   add_subdirectory(tsan)
     16   add_subdirectory(msan)
     17   add_subdirectory(msandr)
     18 endif()
     19 
     20 # FIXME: Add support for the profile library.
     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   clear_cache.c
     41   clzdi2.c
     42   clzsi2.c
     43   clzti2.c
     44   cmpdi2.c
     45   cmpti2.c
     46   comparedf2.c
     47   comparesf2.c
     48   ctzdi2.c
     49   ctzsi2.c
     50   ctzti2.c
     51   divdc3.c
     52   divdf3.c
     53   divdi3.c
     54   divmoddi4.c
     55   divmodsi4.c
     56   divsc3.c
     57   divsf3.c
     58   divsi3.c
     59   divti3.c
     60   divxc3.c
     61   enable_execute_stack.c
     62   eprintf.c
     63   extendsfdf2.c
     64   ffsdi2.c
     65   ffsti2.c
     66   fixdfdi.c
     67   fixdfsi.c
     68   fixdfti.c
     69   fixsfdi.c
     70   fixsfsi.c
     71   fixsfti.c
     72   fixunsdfdi.c
     73   fixunsdfsi.c
     74   fixunsdfti.c
     75   fixunssfdi.c
     76   fixunssfsi.c
     77   fixunssfti.c
     78   fixunsxfdi.c
     79   fixunsxfsi.c
     80   fixunsxfti.c
     81   fixxfdi.c
     82   fixxfti.c
     83   floatdidf.c
     84   floatdisf.c
     85   floatdixf.c
     86   floatsidf.c
     87   floatsisf.c
     88   floattidf.c
     89   floattisf.c
     90   floattixf.c
     91   floatundidf.c
     92   floatundisf.c
     93   floatundixf.c
     94   floatunsidf.c
     95   floatunsisf.c
     96   floatuntidf.c
     97   floatuntisf.c
     98   floatuntixf.c
     99   gcc_personality_v0.c
    100   int_util.c
    101   lshrdi3.c
    102   lshrti3.c
    103   moddi3.c
    104   modsi3.c
    105   modti3.c
    106   muldc3.c
    107   muldf3.c
    108   muldi3.c
    109   mulodi4.c
    110   mulosi4.c
    111   muloti4.c
    112   mulsc3.c
    113   mulsf3.c
    114   multi3.c
    115   mulvdi3.c
    116   mulvsi3.c
    117   mulvti3.c
    118   mulxc3.c
    119   negdf2.c
    120   negdi2.c
    121   negsf2.c
    122   negti2.c
    123   negvdi2.c
    124   negvsi2.c
    125   negvti2.c
    126   paritydi2.c
    127   paritysi2.c
    128   parityti2.c
    129   popcountdi2.c
    130   popcountsi2.c
    131   popcountti2.c
    132   powidf2.c
    133   powisf2.c
    134   powitf2.c
    135   powixf2.c
    136   subdf3.c
    137   subsf3.c
    138   subvdi3.c
    139   subvsi3.c
    140   subvti3.c
    141   trampoline_setup.c
    142   truncdfsf2.c
    143   ucmpdi2.c
    144   ucmpti2.c
    145   udivdi3.c
    146   udivmoddi4.c
    147   udivmodsi4.c
    148   udivmodti4.c
    149   udivsi3.c
    150   udivti3.c
    151   umoddi3.c
    152   umodsi3.c
    153   umodti3.c
    154   )
    155 
    156 set(x86_64_SOURCES
    157   x86_64/floatdidf.c
    158   x86_64/floatdisf.c
    159   x86_64/floatdixf.c
    160   x86_64/floatundidf.S
    161   x86_64/floatundisf.S
    162   x86_64/floatundixf.S
    163   ${GENERIC_SOURCES})
    164 
    165 set(i386_SOURCES
    166   i386/ashldi3.S
    167   i386/ashrdi3.S
    168   i386/divdi3.S
    169   i386/floatdidf.S
    170   i386/floatdisf.S
    171   i386/floatdixf.S
    172   i386/floatundidf.S
    173   i386/floatundisf.S
    174   i386/floatundixf.S
    175   i386/lshrdi3.S
    176   i386/moddi3.S
    177   i386/muldi3.S
    178   i386/udivdi3.S
    179   i386/umoddi3.S
    180   ${GENERIC_SOURCES})
    181 
    182 foreach(arch x86_64 i386)
    183   if(CAN_TARGET_${arch})
    184     add_compiler_rt_static_runtime(clang_rt.${arch} ${arch}
    185       SOURCES ${${arch}_SOURCES}
    186       CFLAGS "-std=c99")
    187   endif()
    188 endforeach()
    189