Skip to content

Commit

Permalink
gn build: Add 32-bit Linux support.
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D58839

llvm-svn: 355467
  • Loading branch information
pcc committed Mar 6, 2019
1 parent 61f1b70 commit dbdfd43
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions llvm/utils/gn/build/toolchain/target_flags.gni
Expand Up @@ -12,3 +12,7 @@ if (current_os == "android") {
]
target_ldflags += [ "-static-libstdc++" ]
}

if (current_cpu == "x86") {
target_flags = [ "-m32" ]
}
4 changes: 3 additions & 1 deletion llvm/utils/gn/secondary/compiler-rt/target.gni
Expand Up @@ -6,7 +6,9 @@ if (current_os == "linux" || current_os == "android") {
assert(false, "unimplemented current_os " + current_os)
}

if (current_cpu == "x64") {
if (current_cpu == "x86") {
crt_current_target_arch = "i386"
} else if (current_cpu == "x64") {
crt_current_target_arch = "x86_64"
} else if (current_cpu == "arm64") {
crt_current_target_arch = "aarch64"
Expand Down
6 changes: 5 additions & 1 deletion llvm/utils/gn/secondary/llvm/triples.gni
@@ -1,4 +1,8 @@
if (current_cpu == "x64") {
if (current_cpu == "x86") {
if (current_os == "linux") {
llvm_current_triple = "i386-unknown-linux-gnu"
}
} else if (current_cpu == "x64") {
if (current_os == "freebsd") {
llvm_current_triple = "x86_64-unknown-freebsd"
} else if (current_os == "linux") {
Expand Down

0 comments on commit dbdfd43

Please sign in to comment.