Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vcpkg] improve s390x support #13386

Merged
merged 1 commit into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 5 additions & 3 deletions toolsrc/src/vcpkg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions toolsrc/src/vcpkg/triplet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ namespace vcpkg
{
return CPUArchitecture::ARM64;
}
if (Strings::starts_with(this->canonical_name(), "s390x-"))
{
return CPUArchitecture::S390X;
}

return nullopt;
}
Expand Down Expand Up @@ -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
Expand Down