Add community triple arm64-linux and arm-linux. (#11880)

Verify the following command on both 32 bits and 64 bits OS on Raspberry pi 3.

    ./bootstrap-vcpkg.sh
    ./vcpkg install boost
This commit is contained in:
xyb 2020-09-05 10:45:48 -07:00 committed by GitHub
parent bd8af07898
commit fdac1fc5aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 91 additions and 15 deletions

View File

@ -1,6 +1,6 @@
Source: boost-build
Version: 1.73.0
Port-Version: 3
Port-Version: 4
Homepage: https://github.com/boostorg/build
Description: Boost.Build
Build-Depends: boost-uninstall

View File

@ -2,9 +2,7 @@ include(vcpkg_common_functions)
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "s390x")
return()
elseif(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW")
if(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW")
return()
endif()

View File

@ -37,6 +37,8 @@ endif()
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)
else()
list(APPEND B2_OPTIONS architecture=x86)
endif()

View File

@ -1,4 +1,4 @@
Source: boost-modular-build-helper
Version: 1.73.0
Port-Version: 4
Port-Version: 5
Build-Depends: boost-uninstall

View File

@ -18,7 +18,13 @@ function(boost_modular_build)
# Todo: this serves too similar a purpose as vcpkg_find_acquire_program()
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/../x64-linux/tools/boost-build")
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/../arm64-linux/tools/boost-build")
else()
set(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/../x64-linux/tools/boost-build")
endif()
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "armv7l")
set(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/../arm-linux/tools/boost-build")
elseif(CMAKE_HOST_WIN32 AND VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "MinGW")
get_filename_component(BOOST_BUILD_PATH "${CURRENT_INSTALLED_DIR}/../x86-windows/tools/boost-build" ABSOLUTE)
elseif(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x64" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" AND NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "s390x")
@ -29,9 +35,17 @@ function(boost_modular_build)
if(NOT EXISTS "${BOOST_BUILD_PATH}")
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
message(FATAL_ERROR "The x64 boost-build tools must be installed to build arm64 for Linux. Please run `vcpkg install boost-build:x64-linux`.")
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
message(FATAL_ERROR "The arm64 boost-build tools must be installed to build arm64 for Linux. Please run `vcpkg install boost-build:arm64-linux`.")
else()
message(FATAL_ERROR "The x64 boost-build tools must be installed to build arm64 for Linux. Please run `vcpkg install boost-build:x64-linux`.")
endif()
else()
message(FATAL_ERROR "The x86 boost-build tools must be installed to build for non-x86/x64 platforms. Please run `vcpkg install boost-build:x86-windows`.")
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "armv7l")
message(FATAL_ERROR "The arm boost-build tools must be installed to build arm64 for Linux. Please run `vcpkg install boost-build:arm-linux`.")
else()
message(FATAL_ERROR "The x86 boost-build tools must be installed to build for non-x86/x64 platforms. Please run `vcpkg install boost-build:x86-windows`.")
endif()
endif()
endif()

View File

@ -11,7 +11,7 @@ endif()
# config variables for ffi.h.in
set(VERSION 3.3)
set(KNOWN_PROCESSORS x86 x86_64 AMD64 ARM ARM64 i386)
set(KNOWN_PROCESSORS x86 x86_64 AMD64 ARM ARM64 i386 armv7l aarch64)
if(NOT CMAKE_SYSTEM_PROCESSOR IN_LIST KNOWN_PROCESSORS)
message(FATAL_ERROR "Unknown processor: ${CMAKE_SYSTEM_PROCESSOR}")
@ -19,6 +19,10 @@ endif()
if(CMAKE_SYSTEM_PROCESSOR MATCHES "ARM")
set(TARGET ARM)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "armv7l")
set(TARGET ARM)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
set(TARGET ARM64)
elseif(CMAKE_SYSTEM_NAME MATCHES "BSD" AND CMAKE_SIZEOF_VOID_P EQUAL 4)
set(TARGET X86_FREEBSD)
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
@ -50,9 +54,9 @@ set(FFI_EXEC_TRAMPOLINE_TABLE 0)
configure_file(include/ffi.h.in ${CMAKE_BINARY_DIR}/include/ffi.h)
file(COPY ${FFI_CONFIG_FILE} DESTINATION ${CMAKE_BINARY_DIR})
if ("${TARGET}" STREQUAL "ARM_WIN64")
if ("${TARGET}" STREQUAL "ARM_WIN64" OR "${TARGET}" STREQUAL "ARM64")
file(COPY src/aarch64/ffitarget.h DESTINATION ${CMAKE_BINARY_DIR}/include)
elseif ("${TARGET}" STREQUAL "ARM_WIN32")
elseif ("${TARGET}" STREQUAL "ARM_WIN32" OR "${TARGET}" STREQUAL "ARM")
file(COPY src/arm/ffitarget.h DESTINATION ${CMAKE_BINARY_DIR}/include)
else()
file(COPY src/x86/ffitarget.h DESTINATION ${CMAKE_BINARY_DIR}/include)
@ -72,11 +76,11 @@ set(FFI_SOURCES
src/prep_cif.c
src/types.c)
if ("${TARGET}" STREQUAL "ARM_WIN64")
if ("${TARGET}" STREQUAL "ARM_WIN64" OR "${TARGET}" STREQUAL "ARM64")
set(FFI_SOURCES
${FFI_SOURCES}
src/aarch64/ffi.c)
elseif("${TARGET}" STREQUAL "ARM_WIN32")
elseif("${TARGET}" STREQUAL "ARM_WIN32" OR "${TARGET}" STREQUAL "ARM")
set(FFI_SOURCES
${FFI_SOURCES}
src/arm/ffi.c)
@ -162,8 +166,12 @@ elseif("${TARGET}" STREQUAL "X86_WIN64")
add_assembly(src/x86/win64_intel.S)
elseif("${TARGET}" STREQUAL "ARM_WIN32")
add_assembly(src/arm/sysv_msvc_arm32.S)
elseif("${TARGET}" STREQUAL "ARM")
add_assembly(src/arm/sysv.S)
elseif("${TARGET}" STREQUAL "ARM_WIN64")
add_assembly(src/aarch64/win64_armasm.S)
elseif("${TARGET}" STREQUAL "ARM64")
add_assembly(src/aarch64/sysv.S)
else()
message(FATAL_ERROR "Target not implemented")
endif()

View File

@ -1,5 +1,5 @@
Source: libffi
Version: 3.3
Port-Version: 4
Port-Version: 5
Homepage: https://github.com/libffi/libffi
Description: Portable, high level programming interface to various calling conventions

View File

@ -79,6 +79,16 @@ vcpkgCheckRepoTool()
fi
}
vcpkgCheckBuildTool()
{
__tool=$1
if ! command -v "$__tool" >/dev/null 2>&1 ; then
echo "Could not find $__tool. Please install it (and other dependencies) with:"
echo "sudo apt-get install cmake ninja-build"
exit 1
fi
}
vcpkgCheckEqualFileHash()
{
url=$1; filePath=$2; expectedHash=$3
@ -226,10 +236,18 @@ selectCXX()
# Preparation
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
vcpkgUseSystem=true
fi
if $vcpkgUseSystem; then
cmakeExe="cmake"
ninjaExe="ninja"
vcpkgCheckBuildTool "$cmakeExe"
vcpkgCheckBuildTool "$ninjaExe"
else
fetchTool "cmake" "$UNAME" cmakeExe || exit 1
fetchTool "ninja" "$UNAME" ninjaExe || exit 1

View File

@ -172,6 +172,10 @@ 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 "armv7l")
set(_VCPKG_TARGET_TRIPLET_ARCH arm)
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(_VCPKG_TARGET_TRIPLET_ARCH arm64)
else()
if( _CMAKE_IN_TRY_COMPILE )
message(STATUS "Unable to determine target architecture, continuing without vcpkg.")

View File

@ -150,7 +150,7 @@ function(vcpkg_configure_cmake)
endif()
# If we use Ninja, make sure it's on PATH
if(GENERATOR STREQUAL "Ninja")
if(GENERATOR STREQUAL "Ninja" AND NOT DEFINED ENV{VCPKG_FORCE_SYSTEM_BINARIES})
vcpkg_find_acquire_program(NINJA)
get_filename_component(NINJA_PATH ${NINJA} DIRECTORY)
vcpkg_add_to_path("${NINJA_PATH}")

View File

@ -235,6 +235,14 @@ 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 (!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.");
}
#endif
VcpkgCmdArguments args = VcpkgCmdArguments::create_from_command_line(fs, argc, argv);
args.imbue_from_environment();
args.check_feature_flag_consistency();

View File

@ -87,7 +87,13 @@ namespace vcpkg
#elif defined(__FreeBSD__)
return Triplet::from_canonical_name("x64-freebsd");
#elif defined(__GLIBC__)
#if defined(__aarch64__)
return Triplet::from_canonical_name("arm64-linux");
#elif defined(__arm__)
return Triplet::from_canonical_name("arm-linux");
#else
return Triplet::from_canonical_name("x64-linux");
#endif
#else
return Triplet::from_canonical_name("x64-linux-musl");
#endif

View File

@ -0,0 +1,9 @@
set(VCPKG_TARGET_ARCHITECTURE arm)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
if(NOT CMAKE_HOST_SYSTEM_PROCESSOR)
execute_process(COMMAND "uname" "-m" OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()

View File

@ -0,0 +1,9 @@
set(VCPKG_TARGET_ARCHITECTURE arm64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
if(NOT CMAKE_HOST_SYSTEM_PROCESSOR)
execute_process(COMMAND "uname" "-m" OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()