From 8f8a4f8aeed0a2eec0cc16137f1641cbd69fe15b Mon Sep 17 00:00:00 2001 From: pastdue <30942300+past-due@users.noreply.github.com> Date: Mon, 24 May 2021 18:14:14 -0400 Subject: [PATCH] [libsodium] Fix mingw builds (#18025) * [libsodium] Fix mingw builds * Run x-add-version libsodium --- ports/libsodium/CMakeLists.txt | 31 +++++++++++++++++++++++++------ ports/libsodium/vcpkg.json | 4 ++-- versions/baseline.json | 2 +- versions/l-/libsodium.json | 5 +++++ 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/ports/libsodium/CMakeLists.txt b/ports/libsodium/CMakeLists.txt index 88836cc2fb..429ab4c294 100644 --- a/ports/libsodium/CMakeLists.txt +++ b/ports/libsodium/CMakeLists.txt @@ -132,7 +132,6 @@ else () INTERFACE -flax-vector-conversions -fvisibility=hidden - -fPIC -fwrapv -Wall -Wextra @@ -162,11 +161,31 @@ else () -Wswitch-enum #-Wvariable-decl -Wwrite-strings - -Wl,-z,relro - -Wl,-z,now - -Wl,-z,noexecstack ) + if (NOT MINGW) + target_compile_options(${PROJECT_NAME}_config_private + INTERFACE + -fPIC + -Wl,-z,relro + -Wl,-z,now + -Wl,-z,noexecstack + ) + endif() + + if (MINGW) + target_compile_options(${PROJECT_NAME}_config_private + INTERFACE + -fno-asynchronous-unwind-tables + ) + target_link_options(${PROJECT_NAME}_config_private + INTERFACE + -Wl,--dynamicbase + -Wl,--high-entropy-va + -Wl,--nxcompat + ) + endif() + if (CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang") target_compile_options(${PROJECT_NAME}_config_private @@ -187,11 +206,11 @@ else () target_compile_options(${PROJECT_NAME}_config_public INTERFACE -pthread) endif () - if (ENABLE_SSP) + if (ENABLE_SSP AND NOT MINGW) target_compile_options(${PROJECT_NAME}_config_private INTERFACE -fstack-protector-all) endif () - if (ENABLE_PIE) + if (ENABLE_PIE AND NOT MINGW) target_compile_options(${PROJECT_NAME}_config_private INTERFACE -fPIE) endif () diff --git a/ports/libsodium/vcpkg.json b/ports/libsodium/vcpkg.json index 7c12a7fed2..522e476d31 100644 --- a/ports/libsodium/vcpkg.json +++ b/ports/libsodium/vcpkg.json @@ -1,7 +1,7 @@ { "name": "libsodium", - "version-string": "1.0.18", - "port-version": 4, + "version": "1.0.18", + "port-version": 5, "description": "A modern and easy-to-use crypto library", "homepage": "https://github.com/jedisct1/libsodium", "dependencies": [ diff --git a/versions/baseline.json b/versions/baseline.json index 0c670e09b2..7a35b7e00a 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3506,7 +3506,7 @@ }, "libsodium": { "baseline": "1.0.18", - "port-version": 4 + "port-version": 5 }, "libsoundio": { "baseline": "2.0.0", diff --git a/versions/l-/libsodium.json b/versions/l-/libsodium.json index a32fb9901f..248e4f7237 100644 --- a/versions/l-/libsodium.json +++ b/versions/l-/libsodium.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "8b1c2632e8f7c23408a655d6c97b6d51ad354a19", + "version": "1.0.18", + "port-version": 5 + }, { "git-tree": "6ec1ee39e69052d50e773857064d2d06968ee8c3", "version-string": "1.0.18",