[PATCH] D58839: gn build: Add 32-bit Linux support.
Peter Collingbourne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 1 10:41:48 PST 2019
pcc created this revision.
pcc added a reviewer: thakis.
Herald added a project: LLVM.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D58839
Files:
llvm/utils/gn/build/toolchain/target_flags.gni
llvm/utils/gn/secondary/compiler-rt/target.gni
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,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") {
Index: llvm/utils/gn/secondary/compiler-rt/target.gni
===================================================================
--- llvm/utils/gn/secondary/compiler-rt/target.gni
+++ llvm/utils/gn/secondary/compiler-rt/target.gni
@@ -6,7 +6,9 @@
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"
Index: llvm/utils/gn/build/toolchain/target_flags.gni
===================================================================
--- llvm/utils/gn/build/toolchain/target_flags.gni
+++ llvm/utils/gn/build/toolchain/target_flags.gni
@@ -12,3 +12,7 @@
]
target_ldflags += [ "-static-libstdc++" ]
}
+
+if (current_cpu == "x86") {
+ target_flags = [ "-m32" ]
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58839.188942.patch
Type: text/x-patch
Size: 1437 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190301/831fc874/attachment.bin>
More information about the llvm-commits
mailing list