Skip to content

Commit

Permalink
[vcpkg,boost-modular-build-helper] initial ppc64le community support (m…
Browse files Browse the repository at this point in the history
…icrosoft#15572)

* [vcpkg] initial ppc64le community support

Signed-off-by: Andrei Lebedev <lebdron@gmail.com>

* [boost-modular-build-helper] ppc64le support

Signed-off-by: Andrei Lebedev <lebdron@gmail.com>

* Merge from master

Co-authored-by: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com>
Co-authored-by: dan-shaw <51385773+dan-shaw@users.noreply.github.com>
Co-authored-by: Nicole Mazzuca <mazzucan@outlook.com>
  • Loading branch information
4 people committed Jan 22, 2021
1 parent e6ae60c commit e4290c8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions include/vcpkg/base/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace vcpkg::System
ARM,
ARM64,
S390X,
PPC64LE,
};

Optional<CPUArchitecture> to_cpu_architecture(StringView arch);
Expand Down
7 changes: 5 additions & 2 deletions src/vcpkg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,16 @@ int main(const int argc, const char* const* const argv)

load_config(fs);

#if (defined(__aarch64__) || defined(__arm__) || defined(__s390x__) || defined(_M_ARM) || defined(_M_ARM64)) && \
#if (defined(__aarch64__) || defined(__arm__) || defined(__s390x__) || \
((defined(__ppc64__) || defined(__PPC64__) || defined(__ppc64le__) || defined(__PPC64LE__)) && \
defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) || \
defined(_M_ARM) || defined(_M_ARM64)) && \
!defined(_WIN32) && !defined(__APPLE__)
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 and s390x platforms.");
"Environment variable VCPKG_FORCE_SYSTEM_BINARIES must be set on arm, s390x, and ppc64le platforms.");
}
#endif

Expand Down
7 changes: 6 additions & 1 deletion src/vcpkg/base/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace vcpkg
if (Strings::case_insensitive_ascii_equals(arch, "arm")) return CPUArchitecture::ARM;
if (Strings::case_insensitive_ascii_equals(arch, "arm64")) return CPUArchitecture::ARM64;
if (Strings::case_insensitive_ascii_equals(arch, "s390x")) return CPUArchitecture::S390X;
if (Strings::case_insensitive_ascii_equals(arch, "ppc64le")) return CPUArchitecture::PPC64LE;
return nullopt;
}

Expand All @@ -39,7 +40,8 @@ namespace vcpkg
case CPUArchitecture::ARM: return "arm";
case CPUArchitecture::ARM64: return "arm64";
case CPUArchitecture::S390X: return "s390x";
default: Checks::unreachable(VCPKG_LINE_INFO);
case CPUArchitecture::PPC64LE: return "ppc64le";
default: Checks::exit_with_message(VCPKG_LINE_INFO, "unexpected vcpkg::System::CPUArchitecture");
}
}

Expand All @@ -62,6 +64,9 @@ namespace vcpkg
return CPUArchitecture::ARM64;
#elif defined(__s390x__)
return CPUArchitecture::S390X;
#elif (defined(__ppc64__) || defined(__PPC64__) || defined(__ppc64le__) || defined(__PPC64LE__)) && \
defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
return CPUArchitecture::PPC64LE;
#else // choose architecture
#error "Unknown host architecture"
#endif // choose architecture
Expand Down
7 changes: 7 additions & 0 deletions src/vcpkg/triplet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ namespace vcpkg
{
return CPUArchitecture::S390X;
}
if (Strings::starts_with(this->canonical_name(), "ppc64le-"))
{
return CPUArchitecture::PPC64LE;
}

return nullopt;
}
Expand Down Expand Up @@ -99,6 +103,9 @@ namespace vcpkg
return Triplet::from_canonical_name("arm-linux");
#elif defined(__s390x__)
return Triplet::from_canonical_name("s390x-linux");
#elif (defined(__ppc64__) || defined(__PPC64__) || defined(__ppc64le__) || defined(__PPC64LE__)) && \
defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
return Triplet::from_canonical_name("ppc64le-linux");
#else
return Triplet::from_canonical_name("x64-linux");
#endif
Expand Down

0 comments on commit e4290c8

Please sign in to comment.