From: David L. Jones Date: Mon, 13 May 2019 04:07:54 +0000 (+0000) Subject: gn build: support host build on ppc64 (a.k.a. powerpc64le) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1bfbf864518ce34ead3a1b0755a427a6fdb5d56b;p=llvm gn build: support host build on ppc64 (a.k.a. powerpc64le) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360553 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/gn/secondary/clang/test/BUILD.gn b/utils/gn/secondary/clang/test/BUILD.gn index b5c5ec058b9..8af8f42030b 100644 --- a/utils/gn/secondary/clang/test/BUILD.gn +++ b/utils/gn/secondary/clang/test/BUILD.gn @@ -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) } diff --git a/utils/gn/secondary/compiler-rt/target.gni b/utils/gn/secondary/compiler-rt/target.gni index 50e581f5c9e..0d55e0da0f6 100644 --- a/utils/gn/secondary/compiler-rt/target.gni +++ b/utils/gn/secondary/compiler-rt/target.gni @@ -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) } diff --git a/utils/gn/secondary/lld/test/BUILD.gn b/utils/gn/secondary/lld/test/BUILD.gn index 6af53eb37e1..f8c90ede40c 100644 --- a/utils/gn/secondary/lld/test/BUILD.gn +++ b/utils/gn/secondary/lld/test/BUILD.gn @@ -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" ] diff --git a/utils/gn/secondary/llvm/lib/Target/targets.gni b/utils/gn/secondary/llvm/lib/Target/targets.gni index dc17b505a8e..39d08c07f8d 100644 --- a/utils/gn/secondary/llvm/lib/Target/targets.gni +++ b/utils/gn/secondary/llvm/lib/Target/targets.gni @@ -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 { diff --git a/utils/gn/secondary/llvm/test/BUILD.gn b/utils/gn/secondary/llvm/test/BUILD.gn index c8871e0400b..941ce971fe9 100644 --- a/utils/gn/secondary/llvm/test/BUILD.gn +++ b/utils/gn/secondary/llvm/test/BUILD.gn @@ -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) } diff --git a/utils/gn/secondary/llvm/triples.gni b/utils/gn/secondary/llvm/triples.gni index 988ad59893e..efe8be28513 100644 --- a/utils/gn/secondary/llvm/triples.gni +++ b/utils/gn/secondary/llvm/triples.gni @@ -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)) {