Skip to content

Commit

Permalink
[simdjson] Fix error LNK2001 when compile with /fsanitize=address in …
Browse files Browse the repository at this point in the history
…MSVC (microsoft#11495)

* [simdjson] Fix error LNK2001 when compile with /fsanitize=address

* Update ports/simdjson/portfile.cmake

Co-authored-by: NancyLi1013 <[email protected]>

* Update ports/simdjson/portfile.cmake

Co-authored-by: NancyLi1013 <[email protected]>

* Update ports/simdjson/portfile.cmake

* Update ports/simdjson/portfile.cmake

* Update ports/simdjson/portfile.cmake

Co-authored-by: Cheney-Wang <[email protected]>
Co-authored-by: NancyLi1013 <[email protected]>
  • Loading branch information
3 people authored May 27, 2020
1 parent 4694b88 commit 9dde75b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ports/simdjson/CONTROL
Original file line number Diff line number Diff line change
@@ -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)
15 changes: 15 additions & 0 deletions ports/simdjson/Fix-error-LNK2001.patch
Original file line number Diff line number Diff line change
@@ -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()
4 changes: 3 additions & 1 deletion ports/simdjson/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9dde75b

Please sign in to comment.