diff options
author | 2016-10-11 09:59:27 +0000 | |
---|---|---|
committer | 2016-10-11 13:26:24 +0000 | |
commit | 155bd6457c7426faa84b5acba991a1c80cdcf920 (patch) | |
tree | 3f4db04a5f52722548cd3b0d6f45fce20d5df5bd /src | |
parent | 22d36737aa2a37edecf6c855e61f82df3c79596b (diff) |
Adding support for Linux s390x
We have added support for Linux s390x platform in Bazel.
Closes #1891.
--
Reviewed-on: https://github.com/bazelbuild/bazel/pull/1891
MOS_MIGRATED_REVID=135777047
Diffstat (limited to 'src')
3 files changed, 16 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java index 18f6b93087..2ca328033e 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java @@ -400,6 +400,8 @@ public final class BuildConfiguration { return "ppc"; case ARM: return "arm"; + case S390X: + return "s390x"; default: return "unknown"; } diff --git a/src/main/java/com/google/devtools/build/lib/util/CPU.java b/src/main/java/com/google/devtools/build/lib/util/CPU.java index 41af4b1d65..7a85c290b9 100644 --- a/src/main/java/com/google/devtools/build/lib/util/CPU.java +++ b/src/main/java/com/google/devtools/build/lib/util/CPU.java @@ -16,7 +16,6 @@ package com.google.devtools.build.lib.util; import static com.google.common.base.StandardSystemProperty.OS_ARCH; import com.google.common.collect.ImmutableSet; - import java.util.Set; /** @@ -27,6 +26,7 @@ public enum CPU { X86_64("x86_64", ImmutableSet.of("amd64", "x86_64", "x64")), PPC("ppc", ImmutableSet.of("ppc", "ppc64", "ppc64le")), ARM("arm", ImmutableSet.of("arm", "armv7l")), + S390X("s390x", ImmutableSet.of("s390x", "s390")), UNKNOWN("unknown", ImmutableSet.<String>of()); private final String canonicalName; diff --git a/src/test/shell/bazel/testenv.sh b/src/test/shell/bazel/testenv.sh index e66e5fca4b..2f5a247086 100755 --- a/src/test/shell/bazel/testenv.sh +++ b/src/test/shell/bazel/testenv.sh @@ -99,9 +99,15 @@ python_server="${BAZEL_RUNFILES}/src/test/shell/bazel/testing_server.py" # Third-party MACHINE_TYPE="$(uname -m)" MACHINE_IS_64BIT='no' -if [ "${MACHINE_TYPE}" = 'amd64' -o "${MACHINE_TYPE}" = 'x86_64' ]; then +if [ "${MACHINE_TYPE}" = 'amd64' -o "${MACHINE_TYPE}" = 'x86_64' -o "${MACHINE_TYPE}" = 's390x' ]; then MACHINE_IS_64BIT='yes' fi + +MACHINE_IS_Z='no' +if [ "${MACHINE_TYPE}" = 's390x' ]; then + MACHINE_IS_Z='yes' +fi + case "${PLATFORM}" in darwin) if [ "${MACHINE_IS_64BIT}" = 'yes' ]; then @@ -112,9 +118,13 @@ case "${PLATFORM}" in ;; *) if [ "${MACHINE_IS_64BIT}" = 'yes' ]; then - protoc_compiler="${BAZEL_RUNFILES}/third_party/protobuf/protoc-linux-x86_64.exe" + if [ "${MACHINE_IS_Z}" = 'yes' ]; then + protoc_compiler="${BAZEL_RUNFILES}//third_party/protobuf/protoc-linux-s390x_64.exe" + else + protoc_compiler="${BAZEL_RUNFILES}/third_party/protobuf/protoc-linux-x86_64.exe" + fi else - protoc_compiler="${BAZEL_RUNFILES}/third_party/protobuf/protoc-linux-x86_32.exe" + protoc_compiler="${BAZEL_RUNFILES}/third_party/protobuf/protoc-linux-x86_32.exe" fi ;; esac |