libsodium: Don't fortify on mingw

This commit is contained in:
Shea Levy 2021-08-11 08:13:13 -04:00
parent 9ecfbe0c5b
commit 5f073a669d
No known key found for this signature in database
GPG Key ID: 5C0BD6957D86FE27
2 changed files with 21 additions and 1 deletions

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl }:
{ lib, stdenv, fetchurl, autoreconfHook }:
stdenv.mkDerivation rec {
pname = "libsodium";
@ -10,6 +10,11 @@ stdenv.mkDerivation rec {
};
outputs = [ "out" "dev" ];
patches = lib.optional stdenv.targetPlatform.isMinGW ./mingw-no-fortify.patch;
nativeBuildInputs = lib.optional stdenv.targetPlatform.isMinGW autoreconfHook;
separateDebugInfo = stdenv.isLinux && stdenv.hostPlatform.libc != "musl";
enableParallelBuilding = true;

View File

@ -0,0 +1,15 @@
diff -Naur libsodium-1.0.18-orig/configure.ac libsodium-1.0.18/configure.ac
--- libsodium-1.0.18-orig/configure.ac 2019-05-30 16:20:24.000000000 -0400
+++ libsodium-1.0.18/configure.ac 2021-08-11 08:09:54.653907245 -0400
@@ -217,11 +217,6 @@
AC_CHECK_DEFINE([__wasi__], [WASI="yes"], [])
-AC_CHECK_DEFINE([_FORTIFY_SOURCE], [], [
- AX_CHECK_COMPILE_FLAG([-D_FORTIFY_SOURCE=2],
- [CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"])
-])
-
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],
[CFLAGS="$CFLAGS -fvisibility=hidden"])