From b1104ad7e5f0e410bf4b03ca53a39d8affb6c41c Mon Sep 17 00:00:00 2001 From: Hennadii Zabula Date: Thu, 25 May 2017 17:09:13 +0300 Subject: [PATCH 1/2] Fix pcre arm uwp build --- ports/pcre/fix-arm-config-define.patch | 54 ++++++++++++++++++++++++++ ports/pcre/fix-option.patch | 19 +++++++-- ports/pcre/portfile.cmake | 3 +- 3 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 ports/pcre/fix-arm-config-define.patch diff --git a/ports/pcre/fix-arm-config-define.patch b/ports/pcre/fix-arm-config-define.patch new file mode 100644 index 0000000000..94ca808c33 --- /dev/null +++ b/ports/pcre/fix-arm-config-define.patch @@ -0,0 +1,54 @@ +diff --git a/sljit/sljitConfigInternal.h b/sljit/sljitConfigInternal.h +index 4dc452f..5a9827d 100644 +--- "a/sljit/sljitConfigInternal.h" ++++ "b/sljit/sljitConfigInternal.h" +@@ -149,7 +149,7 @@ + + #if defined(_M_X64) || defined(__x86_64__) + #define SLJIT_CONFIG_X86_64 1 +-#elif defined(_ARM_) ++#elif defined(_M_ARM) + #define SLJIT_CONFIG_ARM_V5 1 + #else + #define SLJIT_CONFIG_X86_32 1 +@@ -332,9 +332,16 @@ + + #else + ++#if defined(__linux__) + /* Calls __ARM_NR_cacheflush on ARM-Linux. */ + #define SLJIT_CACHE_FLUSH(from, to) \ + __clear_cache((char*)(from), (char*)(to)) ++#elif(_WIN32) ++#pragma comment(lib, "kernel32.lib") ++uint32_t FlushInstructionCache(void *hProcess, void *lpBaseAddress, uintptr_t dwSize); ++#define SLJIT_CACHE_FLUSH(from, to) \ ++ FlushInstructionCache(GetCurrentProcess(), (void*)(from), (uintptr_t)(to - from)); ++#endif + + #endif + +diff --git "a/sljit/sljitNativeARM_32.c" "b/sljit/sljitNativeARM_32.c" +index a756f82..86bdcbb 100644 +--- "a/sljit/sljitNativeARM_32.c" ++++ "b/sljit/sljitNativeARM_32.c" +@@ -1798,7 +1798,8 @@ extern "C" { + extern unsigned int __aeabi_uidivmod(unsigned int numerator, unsigned int denominator); + extern int __aeabi_idivmod(int numerator, int denominator); + #else +-#error "Software divmod functions are needed" ++extern unsigned int __aeabi_uidivmod(unsigned int numerator, unsigned int denominator); ++extern int __aeabi_idivmod(int numerator, int denominator); + #endif + + #ifdef __cplusplus +@@ -1852,7 +1853,8 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile + FAIL_IF(sljit_emit_ijump(compiler, SLJIT_FAST_CALL, SLJIT_IMM, + ((op | 0x2) == SLJIT_DIV_UW ? SLJIT_FUNC_OFFSET(__aeabi_uidivmod) : SLJIT_FUNC_OFFSET(__aeabi_idivmod)))); + #else +-#error "Software divmod functions are needed" ++ FAIL_IF(sljit_emit_ijump(compiler, SLJIT_FAST_CALL, SLJIT_IMM, ++ ((op | 0x2) == SLJIT_DIV_UW ? SLJIT_FUNC_OFFSET(__aeabi_uidivmod) : SLJIT_FUNC_OFFSET(__aeabi_idivmod)))); + #endif + + if ((op >= SLJIT_DIV_UW) && (compiler->scratches >= 3)) { diff --git a/ports/pcre/fix-option.patch b/ports/pcre/fix-option.patch index d1a2b13eb8..bbaf4df917 100644 --- a/ports/pcre/fix-option.patch +++ b/ports/pcre/fix-option.patch @@ -2,12 +2,23 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 42451ad..858a34b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -191,7 +191,7 @@ IF (MINGW) +@@ -74,7 +74,6 @@ PROJECT(PCRE C CXX) + # CMP0026 to avoid warnings for the use of LOCATION in GET_TARGET_PROPERTY. + + CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) +-CMAKE_POLICY(SET CMP0026 OLD) + + SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake + +@@ -191,9 +190,8 @@ IF (MINGW) ENDIF(MINGW) IF(MSVC) - OPTION(PCRE_STATIC_RUNTIME OFF CACHE BOOL -+ OPTION(PCRE_STATIC_RUNTIME - "ON=Compile against the static runtime (/MT)." - OFF) +- "ON=Compile against the static runtime (/MT)." +- OFF) ++ add_definitions(/wd4703) ++ OPTION(PCRE_STATIC_RUNTIME "ON=Compile against the static runtime (/MT)." OFF) OPTION(INSTALL_MSVC_PDB + "ON=Install .pdb files built by MSVC, if generated" + OFF) diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake index 3b310b7ea2..9e5a933ffc 100644 --- a/ports/pcre/portfile.cmake +++ b/ports/pcre/portfile.cmake @@ -18,7 +18,8 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH} - PATCHES ${CMAKE_CURRENT_LIST_DIR}/fix-option.patch) + PATCHES ${CMAKE_CURRENT_LIST_DIR}/fix-option.patch + ${CMAKE_CURRENT_LIST_DIR}/fix-arm-config-define.patch) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} From e6b5e1d7916feaf95dc47765e77b2f0732164b9b Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sun, 28 May 2017 12:51:57 -0700 Subject: [PATCH 2/2] [pcre] Bump version and split fix-option.patch into two to preserve compat with previous port versions --- ports/pcre/CONTROL | 2 +- ports/pcre/fix-option-2.patch | 24 ++++++++++++++++++++++++ ports/pcre/fix-option.patch | 19 ++++--------------- ports/pcre/portfile.cmake | 3 ++- 4 files changed, 31 insertions(+), 17 deletions(-) create mode 100644 ports/pcre/fix-option-2.patch diff --git a/ports/pcre/CONTROL b/ports/pcre/CONTROL index f1b583592b..aeabb20123 100644 --- a/ports/pcre/CONTROL +++ b/ports/pcre/CONTROL @@ -1,3 +1,3 @@ Source: pcre -Version: 8.40 +Version: 8.40-1 Description: Perl Compatible Regular Expresions diff --git a/ports/pcre/fix-option-2.patch b/ports/pcre/fix-option-2.patch new file mode 100644 index 0000000000..f9d8e0e5eb --- /dev/null +++ b/ports/pcre/fix-option-2.patch @@ -0,0 +1,24 @@ +diff --git b/CMakeLists.txt a/CMakeLists.txt +index 858a34bd..d1a64570 100644 +--- b/CMakeLists.txt ++++ a/CMakeLists.txt +@@ -74,7 +74,6 @@ PROJECT(PCRE C CXX) + # CMP0026 to avoid warnings for the use of LOCATION in GET_TARGET_PROPERTY. + + CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) +-CMAKE_POLICY(SET CMP0026 OLD) + + SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake + +@@ -191,9 +190,8 @@ IF (MINGW) + ENDIF(MINGW) + + IF(MSVC) +- OPTION(PCRE_STATIC_RUNTIME +- "ON=Compile against the static runtime (/MT)." +- OFF) ++ add_definitions(/wd4703) ++ OPTION(PCRE_STATIC_RUNTIME "ON=Compile against the static runtime (/MT)." OFF) + OPTION(INSTALL_MSVC_PDB + "ON=Install .pdb files built by MSVC, if generated" + OFF) diff --git a/ports/pcre/fix-option.patch b/ports/pcre/fix-option.patch index bbaf4df917..d1a2b13eb8 100644 --- a/ports/pcre/fix-option.patch +++ b/ports/pcre/fix-option.patch @@ -2,23 +2,12 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 42451ad..858a34b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -74,7 +74,6 @@ PROJECT(PCRE C CXX) - # CMP0026 to avoid warnings for the use of LOCATION in GET_TARGET_PROPERTY. - - CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0) --CMAKE_POLICY(SET CMP0026 OLD) - - SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) # for FindReadline.cmake - -@@ -191,9 +190,8 @@ IF (MINGW) +@@ -191,7 +191,7 @@ IF (MINGW) ENDIF(MINGW) IF(MSVC) - OPTION(PCRE_STATIC_RUNTIME OFF CACHE BOOL -- "ON=Compile against the static runtime (/MT)." -- OFF) -+ add_definitions(/wd4703) -+ OPTION(PCRE_STATIC_RUNTIME "ON=Compile against the static runtime (/MT)." OFF) ++ OPTION(PCRE_STATIC_RUNTIME + "ON=Compile against the static runtime (/MT)." + OFF) OPTION(INSTALL_MSVC_PDB - "ON=Install .pdb files built by MSVC, if generated" - OFF) diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake index 9e5a933ffc..f2088ef69d 100644 --- a/ports/pcre/portfile.cmake +++ b/ports/pcre/portfile.cmake @@ -19,7 +19,8 @@ vcpkg_extract_source_archive(${ARCHIVE}) vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH} PATCHES ${CMAKE_CURRENT_LIST_DIR}/fix-option.patch - ${CMAKE_CURRENT_LIST_DIR}/fix-arm-config-define.patch) + ${CMAKE_CURRENT_LIST_DIR}/fix-option-2.patch + ${CMAKE_CURRENT_LIST_DIR}/fix-arm-config-define.patch) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH}