[PATCH] D106972: [gn build] Add support for Win/x86 compiler-rt

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 28 09:40:15 PDT 2021


aeubanks created this revision.
aeubanks added a reviewer: thakis.
Herald added subscribers: pengfei, dberris.
aeubanks requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This allows us to build the x86 profile runtime.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106972

Files:
  llvm/utils/gn/build/toolchain/BUILD.gn
  llvm/utils/gn/secondary/compiler-rt/BUILD.gn
  llvm/utils/gn/secondary/llvm/triples.gni


Index: llvm/utils/gn/secondary/llvm/triples.gni
===================================================================
--- llvm/utils/gn/secondary/llvm/triples.gni
+++ llvm/utils/gn/secondary/llvm/triples.gni
@@ -1,6 +1,8 @@
 if (current_cpu == "x86") {
   if (current_os == "linux") {
     llvm_current_triple = "i386-unknown-linux-gnu"
+  } else if (current_os == "win") {
+    llvm_current_triple = "i386-pc-windows-msvc"
   }
 } else if (current_cpu == "x64") {
   if (current_os == "freebsd") {
Index: llvm/utils/gn/secondary/compiler-rt/BUILD.gn
===================================================================
--- llvm/utils/gn/secondary/compiler-rt/BUILD.gn
+++ llvm/utils/gn/secondary/compiler-rt/BUILD.gn
@@ -7,6 +7,7 @@
 # toolchains and then lipo them together for the final output.
 if (current_os == "win") {
   supported_toolchains = [ "//llvm/utils/gn/build/toolchain:stage2_win" ]
+  supported_toolchains += [ "//llvm/utils/gn/build/toolchain:stage2_win_x86" ]
 } else {
   supported_toolchains = [ "//llvm/utils/gn/build/toolchain:stage2_unix" ]
 }
Index: llvm/utils/gn/build/toolchain/BUILD.gn
===================================================================
--- llvm/utils/gn/build/toolchain/BUILD.gn
+++ llvm/utils/gn/build/toolchain/BUILD.gn
@@ -373,3 +373,17 @@
     "//:lld($host_toolchain)",
   ]
 }
+
+win_toolchain("stage2_win_x86") {
+  toolchain_args = {
+    current_os = host_os
+    current_cpu = "x86"
+
+    clang_base_path = root_build_dir
+    use_goma = false
+  }
+  deps = [
+    "//:clang($host_toolchain)",
+    "//:lld($host_toolchain)",
+  ]
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106972.362429.patch
Type: text/x-patch
Size: 1591 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210728/fb10c485/attachment.bin>


More information about the llvm-commits mailing list