gn build: Add 32-bit Linux support.
authorPeter Collingbourne <peter@pcc.me.uk>
Wed, 6 Mar 2019 01:28:32 +0000 (01:28 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Wed, 6 Mar 2019 01:28:32 +0000 (01:28 +0000)
Differential Revision: https://reviews.llvm.org/D58839

llvm-svn: 355467

llvm/utils/gn/build/toolchain/target_flags.gni
llvm/utils/gn/secondary/compiler-rt/target.gni
llvm/utils/gn/secondary/llvm/triples.gni

index 3ad02a9..e1c045f 100644 (file)
@@ -12,3 +12,7 @@ if (current_os == "android") {
   ]
   target_ldflags += [ "-static-libstdc++" ]
 }
+
+if (current_cpu == "x86") {
+  target_flags = [ "-m32" ]
+}
index 7ea73b1..c511bed 100644 (file)
@@ -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"
index a82bd9b..988ad59 100644 (file)
@@ -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") {