[llvm] d384f2b - Revert "gn build: Fix support for building the builtins for baremetal."

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 6 12:16:28 PDT 2022


Author: Peter Collingbourne
Date: 2022-04-06T12:16:06-07:00
New Revision: d384f2b253bf5150eda9e43ce4827f7b3f33da20

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

LOG: Revert "gn build: Fix support for building the builtins for baremetal."

This reverts commit b02b9b3dacc8a4afa96e8990f2dda8bc9b959f78.

Broke Mac build: http://45.33.8.238/macm1/32578/step_4.txt

Added: 
    

Modified: 
    llvm/utils/gn/build/toolchain/BUILD.gn
    llvm/utils/gn/build/toolchain/target_flags.gni
    llvm/utils/gn/secondary/compiler-rt/BUILD.gn
    llvm/utils/gn/secondary/compiler-rt/lib/BUILD.gn
    llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn
    llvm/utils/gn/secondary/compiler-rt/target.gni
    llvm/utils/gn/secondary/llvm/triples.gni

Removed: 
    


################################################################################
diff  --git a/llvm/utils/gn/build/toolchain/BUILD.gn b/llvm/utils/gn/build/toolchain/BUILD.gn
index 5933a2acfe24c..f48f25c4ca341 100644
--- a/llvm/utils/gn/build/toolchain/BUILD.gn
+++ b/llvm/utils/gn/build/toolchain/BUILD.gn
@@ -244,13 +244,6 @@ if (host_os == "mac") {
   }
 }
 
-stage2_unix_toolchain("stage2_baremetal_aarch64") {
-  toolchain_args = {
-    current_os = "baremetal"
-    current_cpu = "arm64"
-  }
-}
-
 template("win_toolchain") {
   toolchain(target_name) {
     # https://groups.google.com/a/chromium.org/d/msg/gn-dev/F_lv5T-tNDM

diff  --git a/llvm/utils/gn/build/toolchain/target_flags.gni b/llvm/utils/gn/build/toolchain/target_flags.gni
index 0e59aba6c2a44..573e758a6d6f6 100644
--- a/llvm/utils/gn/build/toolchain/target_flags.gni
+++ b/llvm/utils/gn/build/toolchain/target_flags.gni
@@ -42,8 +42,6 @@ if (current_os == "android") {
       "x86_64",
     ]
   }
-} else if (current_os == "baremetal") {
-  target_flags += [ "--target=$llvm_current_triple" ]
 }
 
 if (current_cpu == "x86") {

diff  --git a/llvm/utils/gn/secondary/compiler-rt/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/BUILD.gn
index 05053e770e0d5..b4933bd80d7b1 100644
--- a/llvm/utils/gn/secondary/compiler-rt/BUILD.gn
+++ b/llvm/utils/gn/secondary/compiler-rt/BUILD.gn
@@ -12,9 +12,6 @@ if (current_os == "win") {
   supported_toolchains = [ "//llvm/utils/gn/build/toolchain:stage2_unix" ]
 }
 supported_toolchains += supported_android_toolchains
-if (llvm_build_AArch64) {
-  supported_toolchains += [ "//llvm/utils/gn/build/toolchain:stage2_baremetal_aarch64" ]
-}
 group("compiler-rt") {
   deps = [ "//compiler-rt/include($host_toolchain)" ]
   foreach(toolchain, supported_toolchains) {

diff  --git a/llvm/utils/gn/secondary/compiler-rt/lib/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/lib/BUILD.gn
index 52c6431f1f67b..92930337518d8 100644
--- a/llvm/utils/gn/secondary/compiler-rt/lib/BUILD.gn
+++ b/llvm/utils/gn/secondary/compiler-rt/lib/BUILD.gn
@@ -2,6 +2,7 @@ group("lib") {
   deps = [
     "//compiler-rt/lib/asan:ignorelist($host_toolchain)",
     "//compiler-rt/lib/cfi:ignorelist($host_toolchain)",
+    "//compiler-rt/lib/profile",
   ]
   if (current_os == "linux") {
     deps += [ "//compiler-rt/lib/msan" ]
@@ -9,16 +10,13 @@ group("lib") {
   if (current_os == "linux" || current_os == "android") {
     deps += [ "//compiler-rt/lib/ubsan_minimal" ]
   }
-  if (current_os != "win" && current_os != "baremetal") {
-    deps += [ "//compiler-rt/lib/asan" ]
+  if (current_os != "win") {
+    deps += [
+      "//compiler-rt/lib/asan",
+      "//compiler-rt/lib/builtins",
+    ]
     if (current_cpu == "x64" || current_cpu == "arm64") {
       deps += [ "//compiler-rt/lib/tsan/rtl" ]
     }
   }
-  if (current_os != "win") {
-    deps += [ "//compiler-rt/lib/builtins" ]
-  }
-  if (current_os != "baremetal") {
-    deps += [ "//compiler-rt/lib/profile" ]
-  }
 }

diff  --git a/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn
index d595bef112164..ba733ad90f64b 100644
--- a/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn
+++ b/llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn
@@ -4,6 +4,9 @@ import("//llvm/utils/gn/build/buildflags.gni")
 declare_args() {
   # Skip the atomic builtin (should normally be provided by a shared library).
   compiler_rt_exclude_atomic_builtin = true
+
+  # Compile builtins for baremetal.
+  compiler_rt_baremetal_build = false
 }
 
 static_library("builtins") {
@@ -167,10 +170,6 @@ static_library("builtins") {
   ]
 
   if (current_os != "fuchsia") {
-    sources += [ "clear_cache.c" ]
-  }
-
-  if (current_os != "fuchsia" && current_os != "baremetal") {
     sources += [
       "emutls.c",
       "enable_execute_stack.c",
@@ -178,6 +177,10 @@ static_library("builtins") {
     ]
   }
 
+  if (current_os != "fuchsia" && !compiler_rt_baremetal_build) {
+    sources += [ "clear_cache.c" ]
+  }
+
   if (current_os == "mac" || current_os == "ios") {
     sources += [
       "atomic_flag_clear.c",

diff  --git a/llvm/utils/gn/secondary/compiler-rt/target.gni b/llvm/utils/gn/secondary/compiler-rt/target.gni
index 44e8343170b0c..ac273372cee60 100644
--- a/llvm/utils/gn/secondary/compiler-rt/target.gni
+++ b/llvm/utils/gn/secondary/compiler-rt/target.gni
@@ -28,9 +28,6 @@ if (clang_enable_per_target_runtime_dir) {
   }
 } else if (current_os == "ios" || current_os == "mac") {
   crt_current_out_dir = "$clang_resource_dir/lib/darwin"
-} else if (current_os == "baremetal") {
-  crt_current_out_dir = "$clang_resource_dir/lib/baremetal"
-  crt_current_target_suffix = "-$crt_current_target_arch"
 } else if (current_os == "win") {
   crt_current_out_dir = "$clang_resource_dir/lib/windows"
   crt_current_target_suffix = "-$crt_current_target_arch"

diff  --git a/llvm/utils/gn/secondary/llvm/triples.gni b/llvm/utils/gn/secondary/llvm/triples.gni
index e39e1dd8089e2..fc061650e6350 100644
--- a/llvm/utils/gn/secondary/llvm/triples.gni
+++ b/llvm/utils/gn/secondary/llvm/triples.gni
@@ -23,8 +23,6 @@ if (current_cpu == "x86") {
     llvm_current_triple = "aarch64-linux-android29"
   } else if (current_os == "ios" || current_os == "mac") {
     llvm_current_triple = "arm64-apple-darwin"
-  } else if (current_os == "baremetal") {
-    llvm_current_triple = "aarch64-elf"
   } else if (current_os == "linux") {
     llvm_current_triple = "aarch64-unknown-linux-gnu"
   }


        


More information about the llvm-commits mailing list