diff --git a/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn --- a/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn +++ b/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn @@ -6,6 +6,50 @@ compiler_rt_exclude_atomic_builtin = true } +lse_targets = [] + +if (current_cpu == "arm64") { + foreach(pat, + [ + "cas", + "swp", + "ldadd", + "ldclr", + "ldeor", + "ldset", + ]) { + foreach(size, + [ + "1", + "2", + "4", + "8", + "16", + ]) { + foreach(model, + [ + "1", + "2", + "3", + "4", + ]) { + if (pat == "cas" || size != "16") { + source_set("lse_${pat}_${size}_${model}") { + sources = [ "aarch64/lse.S" ] + include_dirs = [ "." ] + defines = [ + "L_$pat", + "SIZE=$size", + "MODEL=$model", + ] + } + lse_targets += [ ":lse_${pat}_${size}_${model}" ] + } + } + } + } +} + static_library("builtins") { output_dir = crt_current_out_dir if (current_os == "mac") { @@ -518,6 +562,8 @@ if (!compiler_rt_exclude_atomic_builtin) { sources += [ "atomic.c" ] } + + deps = lse_targets } # Currently unused but necessary to make sync_source_lists_from_cmake.py happy.