Browse Source

Support PPC64 LE Linux (#290)

* Support PPC Linux

* Support only PPC64 LE
Trung Lê 3 years ago
parent
commit
8d276a1d28
1 changed files with 21 additions and 0 deletions
  1. 21 0
      scripts/toolchain.lua

+ 21 - 0
scripts/toolchain.lua

@@ -77,6 +77,7 @@ function toolchain(_buildDir, _libDir)
 			{ "linux-clang-afl", "Linux (Clang + AFL fuzzer)" },
 			{ "linux-mips-gcc",  "Linux (MIPS, GCC compiler)" },
 			{ "linux-arm-gcc",   "Linux (ARM, GCC compiler)"  },
+			{ "linux-ppc64le-gcc",  "Linux (PPC, GCC compiler)"  },
 			{ "ios-arm",         "iOS - ARM"                  },
 			{ "ios-arm64",       "iOS - ARM64"                },
 			{ "ios-simulator",   "iOS - Simulator"            },
@@ -305,6 +306,9 @@ function toolchain(_buildDir, _libDir)
 		elseif "linux-arm-gcc" == _OPTIONS["gcc"] then
 			location (path.join(_buildDir, "projects", _ACTION .. "-linux-arm-gcc"))
 
+		elseif "linux-ppc64le-gcc" == _OPTIONS["gcc"] then
+ 			location (path.join(_buildDir, "projects", _ACTION .. "-linux-ppc64le-gcc"))
+
 		elseif "mingw-gcc" == _OPTIONS["gcc"] then
 			if not os.getenv("MINGW") then
 				print("Set MINGW environment variable.")
@@ -844,6 +848,23 @@ function toolchain(_buildDir, _libDir)
 			"-s MAX_WEBGL_VERSION=2",
 		}
 
+	configuration { "linux-ppc64le-gcc" }
+ 		targetdir (path.join(_buildDir, "linux_ppc64le_gcc/bin"))
+ 		objdir (path.join(_buildDir, "linux_ppc64le_gcc/obj"))
+ 		libdirs { path.join(_libDir, "lib/linux_ppc64le_gcc") }
+ 		buildoptions {
+ 			"-Wunused-value",
+ 			"-Wundef",
+			"-mcpu=power8",
+ 		}
+ 		links {
+ 			"rt",
+ 			"dl",
+ 		}
+ 		linkoptions {
+ 			"-Wl,--gc-sections",
+ 		}
+
 	configuration { "wasm2js" }
 		targetdir (path.join(_buildDir, "wasm2js/bin"))
 		objdir (path.join(_buildDir, "wasm2js/obj"))