OSDN Git Service

gn build: support host build on ppc64 (a.k.a. powerpc64le)
authorDavid L. Jones <dlj@google.com>
Mon, 13 May 2019 04:07:54 +0000 (04:07 +0000)
committerDavid L. Jones <dlj@google.com>
Mon, 13 May 2019 04:07:54 +0000 (04:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360553 91177308-0d34-0410-b5e6-96231b3b80d8

utils/gn/secondary/clang/test/BUILD.gn
utils/gn/secondary/compiler-rt/target.gni
utils/gn/secondary/lld/test/BUILD.gn
utils/gn/secondary/llvm/lib/Target/targets.gni
utils/gn/secondary/llvm/test/BUILD.gn
utils/gn/secondary/llvm/triples.gni

index b5c5ec0..8af8f42 100644 (file)
@@ -79,6 +79,8 @@ write_lit_config("lit_site_cfg") {
 
   if (host_cpu == "x64") {
     extra_values += [ "HOST_ARCH=x86_64" ]
+  } else if (host_cpu == "ppc64") {
+    extra_values += [ "HOST_ARCH=powerpc64le" ]
   } else {
     assert(false, "unimplemented host_cpu " + host_cpu)
   }
index 50e581f..0d55e0d 100644 (file)
@@ -7,6 +7,8 @@ if (current_cpu == "x86") {
   crt_current_target_arch = "x86_64"
 } else if (current_cpu == "arm64") {
   crt_current_target_arch = "aarch64"
+} else if (current_cpu == "ppc64") {
+  crt_current_target_arch = "powerpc64le"
 } else {
   assert(false, "unimplemented current_cpu " + current_cpu)
 }
index 6af53eb..f8c90ed 100644 (file)
@@ -54,7 +54,8 @@ write_lit_cfg("lit_site_cfg") {
     extra_values += [ "HAVE_LIBZ=0" ]  # Must be 0.
   }
 
-  if (current_cpu == "x64" || current_cpu == "arm64") {
+  if (current_cpu == "x64" || current_cpu == "arm64" ||
+      current_cpu == "ppc64") {
     extra_values += [ "CMAKE_SIZEOF_VOID_P=8" ]
   } else {
     extra_values += [ "CMAKE_SIZEOF_VOID_P=4" ]
index dc17b50..39d08c0 100644 (file)
@@ -10,7 +10,7 @@ if (llvm_targets_to_build == "host") {
     llvm_targets_to_build = [ "AArch64" ]
   } else if (host_cpu == "arm") {
     llvm_targets_to_build = [ "ARM" ]
-  } else if (host_cpu == "pcc" || host_cpu == "pcc64") {
+  } else if (host_cpu == "ppc" || host_cpu == "ppc64") {
     llvm_targets_to_build = [ "PowerPC" ]
   } else if (host_cpu == "x86" || host_cpu == "x64") {
     llvm_targets_to_build = [ "X86" ]
@@ -61,8 +61,8 @@ if (host_cpu == "arm64") {
   native_target = "AArch64"
 } else if (host_cpu == "arm") {
   native_target = "ARM"
-} else if (host_cpu == "pcc" || host_cpu == "pcc64") {
-  native_target = [ "PowerPC" ]
+} else if (host_cpu == "ppc" || host_cpu == "ppc64") {
+  native_target = "PowerPC"
 } else if (host_cpu == "x86" || host_cpu == "x64") {
   native_target = "X86"
 } else {
index c8871e0..941ce97 100644 (file)
@@ -80,6 +80,8 @@ write_lit_config("lit_site_cfg") {
 
   if (host_cpu == "x64") {
     extra_values += [ "HOST_ARCH=x86_64" ]
+  } else if (host_cpu == "ppc64") {
+    extra_values += [ "HOST_ARCH=powerpc64le" ]
   } else {
     assert(false, "unimplemented host_cpu " + host_cpu)
   }
index 988ad59..efe8be2 100644 (file)
@@ -16,6 +16,10 @@ if (current_cpu == "x86") {
   if (current_os == "android") {
     llvm_current_triple = "aarch64-linux-android21"
   }
+} else if (current_cpu == "ppc64") {
+  if (current_os == "linux") {
+    llvm_current_triple = "powerpc64le-unknown-linux-gnu"
+  }
 }
 
 if (!defined(llvm_current_triple)) {