aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Lebedev <lebdron@gmail.com>2020-09-09 22:28:38 +0300
committerGitHub <noreply@github.com>2020-09-09 12:28:38 -0700
commit645f3168249c5bf3ccf51d6515c0e3cf550589b0 (patch)
treeb2e814438a57a7f9ba93b4cc96581f2759a545b4
parentc4e3da7c5f2fa1e3b477877cbf56418dbf35afc0 (diff)
downloadvcpkg-645f3168249c5bf3ccf51d6515c0e3cf550589b0.tar.gz
vcpkg-645f3168249c5bf3ccf51d6515c0e3cf550589b0.zip
[vcpkg] improve s390x support (#13386)
Signed-off-by: Andrei Lebedev <lebdron@gmail.com>
-rw-r--r--scripts/bootstrap.sh4
-rw-r--r--toolsrc/src/vcpkg.cpp8
-rw-r--r--toolsrc/src/vcpkg/triplet.cpp6
3 files changed, 13 insertions, 5 deletions
diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh
index 46f695864..0ab46249f 100644
--- a/scripts/bootstrap.sh
+++ b/scripts/bootstrap.sh
@@ -238,8 +238,8 @@ selectCXX()
UNAME="$(uname)"
ARCH="$(uname -m)"
-# Force using system utilities for building vcpkg if host arch is arm or arm64.
-if [ "$ARCH" = "armv7l" -o "$ARCH" = "aarch64" ]; then
+# Force using system utilities for building vcpkg if host arch is arm, arm64, or s390x.
+if [ "$ARCH" = "armv7l" -o "$ARCH" = "aarch64" -o "$ARCH" = "s390x" ]; then
vcpkgUseSystem=true
fi
diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp
index 6c30f7ced..7e9b5a044 100644
--- a/toolsrc/src/vcpkg.cpp
+++ b/toolsrc/src/vcpkg.cpp
@@ -235,11 +235,13 @@ int main(const int argc, const char* const* const argv)
load_config(fs);
-#if (defined(__aarch64__) || defined(__arm__) || defined(_M_ARM) || defined(_M_ARM64)) && !defined(_WIN32)
+#if (defined(__aarch64__) || defined(__arm__) || defined(__s390x__) || defined(_M_ARM) || defined(_M_ARM64)) && \
+ !defined(_WIN32)
if (!System::get_environment_variable("VCPKG_FORCE_SYSTEM_BINARIES").has_value())
{
- Checks::exit_with_message(VCPKG_LINE_INFO,
- "Environment variable VCPKG_FORCE_SYSTEM_BINARIES must be set on arm platform.");
+ Checks::exit_with_message(
+ VCPKG_LINE_INFO,
+ "Environment variable VCPKG_FORCE_SYSTEM_BINARIES must be set on arm and s390x platforms.");
}
#endif
diff --git a/toolsrc/src/vcpkg/triplet.cpp b/toolsrc/src/vcpkg/triplet.cpp
index 1d325fb65..45dbf1f33 100644
--- a/toolsrc/src/vcpkg/triplet.cpp
+++ b/toolsrc/src/vcpkg/triplet.cpp
@@ -61,6 +61,10 @@ namespace vcpkg
{
return CPUArchitecture::ARM64;
}
+ if (Strings::starts_with(this->canonical_name(), "s390x-"))
+ {
+ return CPUArchitecture::S390X;
+ }
return nullopt;
}
@@ -91,6 +95,8 @@ namespace vcpkg
return Triplet::from_canonical_name("arm64-linux");
#elif defined(__arm__)
return Triplet::from_canonical_name("arm-linux");
+#elif defined(__s390x__)
+ return Triplet::from_canonical_name("s390x-linux");
#else
return Triplet::from_canonical_name("x64-linux");
#endif