brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · 1bd8125 Raw
107 lines · plain
1import("//compiler-rt/lib/builtins/sources.gni")2import("//compiler-rt/target.gni")3import("//llvm/utils/gn/build/buildflags.gni")4 5lse_targets = []6 7if (current_cpu == "arm64") {8  foreach(pat,9          [10            "cas",11            "swp",12            "ldadd",13            "ldclr",14            "ldeor",15            "ldset",16          ]) {17    foreach(size,18            [19              "1",20              "2",21              "4",22              "8",23              "16",24            ]) {25      foreach(model,26              [27                "1",28                "2",29                "3",30                "4",31              ]) {32        if (pat == "cas" || size != "16") {33          source_set("lse_${pat}_${size}_${model}") {34            # Assign to sources like this to hide from35            # sync_source_lists_from_cmake.py which won't find the source file36            # on the CMake side.37            lse_file = "aarch64/lse.S"38            sources = [ lse_file ]39            include_dirs = [ "." ]40            defines = [41              "L_$pat",42              "SIZE=$size",43              "MODEL=$model",44            ]45          }46          lse_targets += [ ":lse_${pat}_${size}_${model}" ]47        }48      }49    }50  }51}52 53static_library("builtins") {54  output_dir = crt_current_out_dir55  if (current_os == "mac") {56    output_name = "clang_rt.osx"57  } else if (current_os == "ios" && current_cpu == "arm64") {58    output_name = "clang_rt.ios"59  } else if (current_os == "ios" && current_cpu == "x64") {60    output_name = "clang_rt.iossim"61  } else {62    output_name = "clang_rt.builtins$crt_current_target_suffix"63  }64 65  complete_static_lib = true66  configs -= [ "//llvm/utils/gn/build:thin_archive" ]67 68  cflags = []69  if (current_os != "win") {70    cflags = [71      "-fPIC",72      "-fno-builtin",73    ]74    if (current_os != "android") {75      cflags += [ "-fvisibility=hidden" ]76    }77    if (!is_debug) {78      cflags += [ "-fomit-frame-pointer" ]79    }80    cflags_c = [ "-std=c11" ]81    cflags_cc = [ "-nostdinc++" ]82  }83 84  defines = builtins_defines85  sources = builtins_sources86 87  deps = lse_targets88  include_dirs = [ "//third-party/siphash/include" ]89}90 91# Currently unused but necessary to make sync_source_lists_from_cmake.py happy.92source_set("_unused") {93  sources = [94    # Thumb195    "arm/addsf3.S",96    "arm/comparesf2.S",97    "arm/divsi3.S",98    "arm/udivsi3.S",99    "arm/fnan2.c",100    "arm/fnorm2.c",101    "arm/funder.c",102    "arm/mulsf3.S",103    "arm/divsf3.S",104    "arm/thumb1/mulsf3.S",105  ]106}107