From 9dde75b92a95f100b9eb58844a44294d1be2797d Mon Sep 17 00:00:00 2001 From: Cheney Wang <38240633+Cheney-W@users.noreply.github.com> Date: Wed, 27 May 2020 13:15:05 +0800 Subject: [PATCH] [simdjson] Fix error LNK2001 when compile with /fsanitize=address in MSVC (#11495) * [simdjson] Fix error LNK2001 when compile with /fsanitize=address * Update ports/simdjson/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/simdjson/portfile.cmake Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> * Update ports/simdjson/portfile.cmake * Update ports/simdjson/portfile.cmake * Update ports/simdjson/portfile.cmake Co-authored-by: Cheney-Wang Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com> --- ports/simdjson/CONTROL | 2 +- ports/simdjson/Fix-error-LNK2001.patch | 15 +++++++++++++++ ports/simdjson/portfile.cmake | 4 +++- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 ports/simdjson/Fix-error-LNK2001.patch diff --git a/ports/simdjson/CONTROL b/ports/simdjson/CONTROL index fe34d9af319b23..1d48f1ae0784e5 100644 --- a/ports/simdjson/CONTROL +++ b/ports/simdjson/CONTROL @@ -1,5 +1,5 @@ Source: simdjson -Version: 2019-12-27 +Version: 2019-12-27-1 Description: A extremely fast JSON library that can parse gigabytes of JSON per second Homepage: https://github.com/lemire/simdjson Supports: !(x86|arm|arm64) \ No newline at end of file diff --git a/ports/simdjson/Fix-error-LNK2001.patch b/ports/simdjson/Fix-error-LNK2001.patch new file mode 100644 index 00000000000000..d7dd61a2d8e8b7 --- /dev/null +++ b/ports/simdjson/Fix-error-LNK2001.patch @@ -0,0 +1,15 @@ +diff --git a/tools/cmake/FindOptions.cmake b/tools/cmake/FindOptions.cmake +index f9854c1..0c4d331 100644 +--- a/tools/cmake/FindOptions.cmake ++++ b/tools/cmake/FindOptions.cmake +@@ -4,9 +4,9 @@ endmacro(append) + + set(SANITIZE_FLAGS "") + if(SIMDJSON_SANITIZE) +- set(SIMDJSON_SANITIZE_FLAGS "-fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=all") + if (CMAKE_COMPILER_IS_GNUCC) + # Ubuntu bug for GCC 5.0+ (safe for all versions) ++ set(SIMDJSON_SANITIZE_FLAGS "-fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=all") + append(CMAKE_EXE_LINKER_FLAGS "-fuse-ld=gold") + append(CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=gold") + endif() diff --git a/ports/simdjson/portfile.cmake b/ports/simdjson/portfile.cmake index c8f3b67ecd0d1a..837de698340a14 100644 --- a/ports/simdjson/portfile.cmake +++ b/ports/simdjson/portfile.cmake @@ -7,7 +7,9 @@ vcpkg_from_github( REF 4da06830f1389c8cd33171f5ab3558e79f0ece04 SHA512 ffb11ee91f97d975fba2946653c9c847565933380f94e334d15e627f77a7a750702c539ca55d17e077b2ed0a79006f56a3b9a202d888bb7e2e3f0484237cb537 HEAD_REF master - PATCHES ${CMAKE_CURRENT_LIST_DIR}/no_benchmark.patch + PATCHES + no_benchmark.patch + Fix-error-LNK2001.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SIMDJSON_BUILD_STATIC)