]> granicus.if.org Git - llvm/commitdiff
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355467 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 3ad02a969fd446fb4ebaa286b3e17b5049be9083..e1c045f625c62efe3c21d72aee64183a15b8fa84 100644 (file)
@@ -12,3 +12,7 @@ if (current_os == "android") {
   ]
   target_ldflags += [ "-static-libstdc++" ]
 }
+
+if (current_cpu == "x86") {
+  target_flags = [ "-m32" ]
+}
index 7ea73b12ea1ebc092409788f2c2050dce0ea5d0a..c511bed82046bf32f13eb8148e0c03994fe36705 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 a82bd9b921bf7c5e8d18faf5eeda9f18fe829384..988ad59893eae5d24c9d71a54beba8c9db44de8b 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") {