mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-29 09:02:46 +00:00
aff1f4ab94
The following parameters are now available: * hardeningDisable To disable specific hardening flags * hardeningEnable To enable specific hardening flags Only the cc-wrapper supports this right now, but these may be reused by other wrappers, builders or setup hooks. cc-wrapper supports the following flags: * fortify * stackprotector * pie (disabled by default) * pic * strictoverflow * format * relro * bindnow
41 lines
1,021 B
Nix
41 lines
1,021 B
Nix
{ stdenv, fetchurl }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
name = "memtest86+-5.01";
|
|
|
|
src = fetchurl {
|
|
url = "http://www.memtest.org/download/5.01/${name}.tar.gz";
|
|
sha256 = "0fch1l55753y6jkk0hj8f6vw4h1kinkn9ysp22dq5g9zjnvjf88l";
|
|
};
|
|
|
|
# Patch incompatiblity with GCC. Source: http://koji.fedoraproject.org/koji/buildinfo?buildID=586907
|
|
patches = [ ./compile-fix.patch ./crash-fix.patch ./no-optimization.patch ];
|
|
|
|
preBuild = ''
|
|
# Really dirty hack to get Memtest to build without needing a Glibc
|
|
# with 32-bit libraries and headers.
|
|
if test "$system" = x86_64-linux; then
|
|
mkdir gnu
|
|
touch gnu/stubs-32.h
|
|
fi
|
|
'';
|
|
|
|
NIX_CFLAGS_COMPILE = "-I. -std=gnu90";
|
|
|
|
hardeningDisable = [ "stackprotector" "pic" ];
|
|
|
|
buildFlags = "memtest.bin";
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
chmod -x memtest.bin
|
|
cp memtest.bin $out/
|
|
'';
|
|
|
|
meta = {
|
|
homepage = http://www.memtest.org/;
|
|
description = "A tool to detect memory errors";
|
|
license = stdenv.lib.licenses.gpl2;
|
|
};
|
|
}
|