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,boost-modular-build-helper] initial ppc64le community support #15572

Merged
merged 7 commits into from
Jan 22, 2021
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
2 changes: 2 additions & 0 deletions ports/boost-modular-build-helper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "s390x")
list(APPEND B2_OPTIONS architecture=s390x)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
list(APPEND B2_OPTIONS architecture=arm)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "ppc64le")
list(APPEND B2_OPTIONS architecture=power)
else()
list(APPEND B2_OPTIONS architecture=x86)
endif()
Expand Down
2 changes: 2 additions & 0 deletions ports/boost-modular-build-helper/boost-modular-build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ function(boost_modular_build)
list(APPEND B2_OPTIONS address-model=64 architecture=arm)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "s390x")
list(APPEND B2_OPTIONS address-model=64 architecture=s390x)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "ppc64le")
list(APPEND B2_OPTIONS address-model=64 architecture=power)
else()
list(APPEND B2_OPTIONS address-model=32 architecture=x86)
endif()
Expand Down
2 changes: 1 addition & 1 deletion ports/boost-modular-build-helper/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "boost-modular-build-helper",
"version-string": "1.75.0",
"port-version": 2,
"port-version": 3,
"dependencies": [
"boost-uninstall"
]
Expand Down
4 changes: 2 additions & 2 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ selectCXX()
UNAME="$(uname)"
ARCH="$(uname -m)"

# 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
# Force using system utilities for building vcpkg if host arch is arm, arm64, s390x, or ppc64le.
if [ "$ARCH" = "armv7l" -o "$ARCH" = "aarch64" -o "$ARCH" = "s390x" -o "$ARCH" = "ppc64le" ]; then
vcpkgUseSystem=true
fi

Expand Down
2 changes: 2 additions & 0 deletions scripts/buildsystems/vcpkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ else()
set(_VCPKG_TARGET_TRIPLET_ARCH x64)
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "s390x")
set(_VCPKG_TARGET_TRIPLET_ARCH s390x)
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "ppc64le")
set(_VCPKG_TARGET_TRIPLET_ARCH ppc64le)
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "armv7l")
set(_VCPKG_TARGET_TRIPLET_ARCH arm)
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
Expand Down
1 change: 1 addition & 0 deletions toolsrc/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 toolsrc/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 toolsrc/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 toolsrc/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
5 changes: 5 additions & 0 deletions triplets/community/ppc64le-linux.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(VCPKG_TARGET_ARCHITECTURE ppc64le)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)

set(VCPKG_CMAKE_SYSTEM_NAME Linux)
5 changes: 5 additions & 0 deletions versions/b-/boost-modular-build-helper.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "39acb181b681e8ac20ff594d3ac1782bfbb37ba2",
"version-string": "1.75.0",
"port-version": 3
},
{
"git-tree": "1b4dda192c485153b97512519e48a06202fd6930",
"version-string": "1.75.0",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@
},
"boost-modular-build-helper": {
"baseline": "1.75.0",
"port-version": 2
"port-version": 3
},
"boost-move": {
"baseline": "1.75.0",
Expand Down