Skip to content

Commit 43a44f1

Browse files
committed
[gn build] Add support for Win/x86 compiler-rt
This allows us to build the x86 profile runtime. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D106972
1 parent ef2627e commit 43a44f1

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

llvm/utils/gn/build/toolchain/BUILD.gn

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,3 +373,17 @@ win_toolchain("stage2_win") {
373373
"//:lld($host_toolchain)",
374374
]
375375
}
376+
377+
win_toolchain("stage2_win_x86") {
378+
toolchain_args = {
379+
current_os = host_os
380+
current_cpu = "x86"
381+
382+
clang_base_path = root_build_dir
383+
use_goma = false
384+
}
385+
deps = [
386+
"//:clang($host_toolchain)",
387+
"//:lld($host_toolchain)",
388+
]
389+
}

llvm/utils/gn/secondary/compiler-rt/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import("//llvm/utils/gn/build/toolchain/compiler.gni")
77
# toolchains and then lipo them together for the final output.
88
if (current_os == "win") {
99
supported_toolchains = [ "//llvm/utils/gn/build/toolchain:stage2_win" ]
10+
supported_toolchains += [ "//llvm/utils/gn/build/toolchain:stage2_win_x86" ]
1011
} else {
1112
supported_toolchains = [ "//llvm/utils/gn/build/toolchain:stage2_unix" ]
1213
}

llvm/utils/gn/secondary/llvm/triples.gni

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
if (current_cpu == "x86") {
22
if (current_os == "linux") {
33
llvm_current_triple = "i386-unknown-linux-gnu"
4+
} else if (current_os == "win") {
5+
llvm_current_triple = "i386-pc-windows-msvc"
46
}
57
} else if (current_cpu == "x64") {
68
if (current_os == "freebsd") {

0 commit comments

Comments
 (0)