[llvm] 0e3c8bd - Revert "gn build: Add support for building the standalone ubsan runtime."

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 13 14:06:40 PDT 2022


Author: Peter Collingbourne
Date: 2022-06-13T14:06:14-07:00
New Revision: 0e3c8bdd4b3c020baf00c32974675d7f67bf553e

URL: https://github.com/llvm/llvm-project/commit/0e3c8bdd4b3c020baf00c32974675d7f67bf553e
DIFF: https://github.com/llvm/llvm-project/commit/0e3c8bdd4b3c020baf00c32974675d7f67bf553e.diff

LOG: Revert "gn build: Add support for building the standalone ubsan runtime."

As well as followup commits.
Build is still failing on mac. I'll debug it locally.
http://45.33.8.238/macm1/37269/step_4.txt

This reverts commit ee21411107aa18e191a25380b9e4679f3909a0c7.
This reverts commit 6ef9af6386fe7cd9d5d93342c430528baa8d1026.
This reverts commit b49bd8e07faf0f4d04e6cdfe33d901a2cd8b2346.

Added: 
    

Modified: 
    llvm/utils/gn/secondary/compiler-rt/lib/BUILD.gn
    llvm/utils/gn/secondary/compiler-rt/lib/hwasan/BUILD.gn
    llvm/utils/gn/secondary/compiler-rt/lib/ubsan/BUILD.gn

Removed: 
    llvm/utils/gn/secondary/compiler-rt/gen_version_script.gni


################################################################################
diff  --git a/llvm/utils/gn/secondary/compiler-rt/gen_version_script.gni b/llvm/utils/gn/secondary/compiler-rt/gen_version_script.gni
deleted file mode 100644
index 5b5ffe3318c51..0000000000000
--- a/llvm/utils/gn/secondary/compiler-rt/gen_version_script.gni
+++ /dev/null
@@ -1,28 +0,0 @@
-import("//compiler-rt/target.gni")
-
-template("gen_version_script") {
-  if (current_os != "mac" && current_os != "win") {
-    action(target_name) {
-      script = "//compiler-rt/lib/sanitizer_common/scripts/gen_dynamic_list.py"
-      sources = [ invoker.extra ]
-      deps = invoker.libs
-      outputs = [ invoker.output ]
-      args = [
-        "--version-list",
-        "--extra",
-        rebase_path(invoker.extra, root_build_dir),
-      ]
-      foreach(lib_name, invoker.lib_names) {
-        args += [ rebase_path(
-                "$crt_current_out_dir/libclang_rt.$lib_name$crt_current_target_suffix.a",
-                root_build_dir) ]
-      }
-      args += [
-        "--nm-executable",
-        "nm",
-        "-o",
-        rebase_path(invoker.output, root_build_dir),
-      ]
-    }
-  }
-}

diff  --git a/llvm/utils/gn/secondary/compiler-rt/lib/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/lib/BUILD.gn
index 92bd37f5495df..52c6431f1f67b 100644
--- a/llvm/utils/gn/secondary/compiler-rt/lib/BUILD.gn
+++ b/llvm/utils/gn/secondary/compiler-rt/lib/BUILD.gn
@@ -21,7 +21,4 @@ group("lib") {
   if (current_os != "baremetal") {
     deps += [ "//compiler-rt/lib/profile" ]
   }
-  if (current_os != "win" && current_os != "mac" && current_os != "baremetal") {
-    deps += [ "//compiler-rt/lib/ubsan:ubsan_shared" ]
-  }
 }

diff  --git a/llvm/utils/gn/secondary/compiler-rt/lib/hwasan/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/lib/hwasan/BUILD.gn
index f14c41bfc00c4..f95aec83fe2cc 100644
--- a/llvm/utils/gn/secondary/compiler-rt/lib/hwasan/BUILD.gn
+++ b/llvm/utils/gn/secondary/compiler-rt/lib/hwasan/BUILD.gn
@@ -1,4 +1,3 @@
-import("//compiler-rt/gen_version_script.gni")
 import("//compiler-rt/target.gni")
 
 if (current_cpu == "x64") {
@@ -7,16 +6,28 @@ if (current_cpu == "x64") {
   hwasan_name = "hwasan"
 }
 
-gen_version_script("version_script") {
-  extra = "hwasan.syms.extra"
-  output = "$target_gen_dir/hwasan.vers"
-  libs = [
+action("version_script") {
+  script = "//compiler-rt/lib/sanitizer_common/scripts/gen_dynamic_list.py"
+  sources = [ "hwasan.syms.extra" ]
+  deps = [
     ":hwasan",
     ":hwasan_cxx",
   ]
-  lib_names = [
-    "$hwasan_name",
-    "${hwasan_name}_cxx",
+  outputs = [ "$target_gen_dir/hwasan.vers" ]
+  args = [
+    "--version-list",
+    "--extra",
+    rebase_path(sources[0], root_build_dir),
+    rebase_path(
+        "$crt_current_out_dir/libclang_rt.$hwasan_name$crt_current_target_suffix.a",
+        root_build_dir),
+    rebase_path(
+        "$crt_current_out_dir/libclang_rt.${hwasan_name}_cxx$crt_current_target_suffix.a",
+        root_build_dir),
+    "--nm-executable",
+    "nm",
+    "-o",
+    rebase_path(outputs[0], root_build_dir),
   ]
 }
 

diff  --git a/llvm/utils/gn/secondary/compiler-rt/lib/ubsan/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/lib/ubsan/BUILD.gn
index af47149074d55..35b4c20315753 100644
--- a/llvm/utils/gn/secondary/compiler-rt/lib/ubsan/BUILD.gn
+++ b/llvm/utils/gn/secondary/compiler-rt/lib/ubsan/BUILD.gn
@@ -1,19 +1,3 @@
-import("//compiler-rt/gen_version_script.gni")
-import("//compiler-rt/target.gni")
-
-gen_version_script("version_script") {
-  extra = "ubsan.syms.extra"
-  output = "$target_gen_dir/ubsan.vers"
-  libs = [
-    ":ubsan",
-    ":ubsan_cxx",
-  ]
-  lib_names = [
-    "ubsan_standalone",
-    "ubsan_standalone_cxx",
-  ]
-}
-
 source_set("sources") {
   configs -= [ "//llvm/utils/gn/build:llvm_code" ]
   configs += [ "//llvm/utils/gn/build:crt_code" ]
@@ -62,6 +46,7 @@ source_set("dynamic_runtime_thunk") {
   sources = [ "ubsan_win_dynamic_runtime_thunk.cpp" ]
 }
 
+# Unreferenced; at the moment exists to make sync_source_lists_from_cmake happy.
 source_set("standalone_sources") {
   configs -= [ "//llvm/utils/gn/build:llvm_code" ]
   configs -= [ "//llvm/utils/gn/build:no_rtti" ]
@@ -87,45 +72,3 @@ source_set("cxx_sources") {
     "ubsan_type_hash_win.cpp",
   ]
 }
-
-static_library("ubsan") {
-  output_dir = crt_current_out_dir
-  output_name = "clang_rt.ubsan_standalone$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" ]
-  deps = [
-    ":sources",
-    ":standalone_sources",
-  ]
-}
-
-static_library("ubsan_cxx") {
-  output_dir = crt_current_out_dir
-  output_name = "clang_rt.ubsan_standalone_cxx$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" ]
-  deps = [ ":cxx_sources" ]
-}
-
-shared_library("ubsan_shared") {
-  output_dir = crt_current_out_dir
-  output_name = "clang_rt.ubsan_standalone$crt_current_target_suffix"
-  configs -= [ "//llvm/utils/gn/build:llvm_code" ]
-  configs += [ "//llvm/utils/gn/build:crt_code" ]
-  deps = [
-    ":cxx_sources",
-    ":sources",
-    ":standalone_sources",
-    ":version_script",
-  ]
-  inputs = [ "$target_gen_dir/ubsan.vers" ]
-  ldflags = [ "-Wl,--version-script," + rebase_path(inputs[0], root_build_dir) ]
-}


        


More information about the llvm-commits mailing list