@@ -13,7 +13,15 @@ let
1313
1414 nativeBuildInputs = [ cmake ];
1515
16− cmakeFlags = [ "-DENABLE_NC=ON" "-DBUILD_SHARED_LIBS=ON" ];
16+ cmakeFlags = [
17+ "-DENABLE_NC=ON"
18+ "-DBUILD_SHARED_LIBS=ON"
19+ # Ensure that the output libraries do not require an executable stack.
20+ # Without this define, assembly files in libcrypto do not include a
21+ # .note.GNU-stack section, and if that section is missing from any object,
22+ # the linker will make the stack executable.
23+ "-DCMAKE_C_FLAGS=-DHAVE_GNU_STACK"
24+ ];
1725
1826 # The autoconf build is broken as of 2.9.1, resulting in the following error:
1927 # libressl-2.9.1/tls/.libs/libtls.a', needed by 'handshake_table'.
@@ -23,15 +31,6 @@ let
2331 rm configure
2432 '';
2533
26− # Ensure that the output libraries do not require an executable stack.
27− # Without this, libcrypto would be built with the executable stack flag set.
28− # For GCC the flag is '-z noexecstack'. Clang, which is used on Darwin,
29− # expects '--noexecstack'. Execstack is an ELF thing, so it is not needed
30− # on Darwin.
31− NIX_LDFLAGS = if stdenv.isDarwin
32− then []
33− else ["-z" "noexecstack"];
34−
3534 enableParallelBuilding = true;
3635
3736 outputs = [ "bin" "dev" "out" "man" "nc" ];