From 6e962fcc3d671a12407b7885682c907a0bfc69cd Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Tue, 23 Jun 2020 19:31:23 -0700 Subject: [PATCH] gn build: Add support for building ubsan_minimal. Differential Revision: https://reviews.llvm.org/D104754 --- .../gn/secondary/compiler-rt/lib/BUILD.gn | 1 + .../compiler-rt/lib/ubsan_minimal/BUILD.gn | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 llvm/utils/gn/secondary/compiler-rt/lib/ubsan_minimal/BUILD.gn diff --git a/llvm/utils/gn/secondary/compiler-rt/lib/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/lib/BUILD.gn index 45ba4837160e..5e1e9bec01a0 100644 --- a/llvm/utils/gn/secondary/compiler-rt/lib/BUILD.gn +++ b/llvm/utils/gn/secondary/compiler-rt/lib/BUILD.gn @@ -8,6 +8,7 @@ group("lib") { "//compiler-rt/lib/asan", "//compiler-rt/lib/builtins", "//compiler-rt/lib/tsan", + "//compiler-rt/lib/ubsan_minimal", ] } } diff --git a/llvm/utils/gn/secondary/compiler-rt/lib/ubsan_minimal/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/lib/ubsan_minimal/BUILD.gn new file mode 100644 index 000000000000..afea502e570e --- /dev/null +++ b/llvm/utils/gn/secondary/compiler-rt/lib/ubsan_minimal/BUILD.gn @@ -0,0 +1,18 @@ +import("//compiler-rt/target.gni") + +source_set("sources") { + configs -= [ "//llvm/utils/gn/build:llvm_code" ] + configs += [ "//llvm/utils/gn/build:crt_code" ] +} + +static_library("ubsan_minimal") { + output_dir = crt_current_out_dir + output_name = "clang_rt.ubsan_minimal$crt_current_target_suffix" + complete_static_lib = true + configs -= [ + "//llvm/utils/gn/build:llvm_code", + "//llvm/utils/gn/build:thin_archive", + ] + configs += [ "//llvm/utils/gn/build:crt_code" ] + sources = [ "ubsan_minimal_handlers.cpp" ] +}