From 49618f030c1b7af175f34ee9d57a86b7cfc968e2 Mon Sep 17 00:00:00 2001 From: Roland Coeurjoly Date: Wed, 22 May 2024 20:23:01 +0200 Subject: [PATCH] WIP --- flake.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 342abe8c6c4..c0f962f0478 100644 --- a/flake.nix +++ b/flake.nix @@ -62,22 +62,23 @@ yosysWithSanitizers = sanitizer: pkgs.clangStdenv.mkDerivation (commonAttrs { doCheck = true; sanitizer = sanitizer; - sanitizerFlags = sanitizer == "memory" ? "-fsanitize-memory-track-origins=2" : ""; + sanitizerFlags = if sanitizer == "memory" then "-fsanitize-memory-track-origins=2" else ""; } // { name = "yosys-with-${sanitizer}"; - buildInputs = with pkgs; [ clang bison flex libffi tcl readline python3 llvmPackages.libcxxClang zlib git pkg-configUpstream gcc ]; + buildInputs = with pkgs; [ clang bison flex libffi tcl readline python3 llvmPackages.libcxxClang llvmPackages.libstdcxxClang zlib git pkg-configUpstream ]; preConfigure = "make config-clang"; checkTarget = "test"; buildPhase = '' - export CXXFLAGS="$CXXFLAGS -g -fsanitize=${sanitizer} ${sanitizerFlags}" # Enable debug symbols and sanitizer flags + export CXXFLAGS="$CXXFLAGS -g -fsanitize=${sanitizer} ${if sanitizer == "memory" then "-fsanitize-memory-track-origins=2" else ""}" # Enable debug symbols and sanitizer flags export LDFLAGS="-L${pkgs.gcc.libc}/lib" make -j$(nproc) ABCEXTERNAL=yosys-abc SANITIZER=${sanitizer} ''; checkPhase = '' - export CXXFLAGS="$CXXFLAGS -g -fsanitize=${sanitizer} ${sanitizerFlags}" # Enable debug symbols and sanitizer flags + export CXXFLAGS="$CXXFLAGS -g -fsanitize=${sanitizer} ${if sanitizer == "memory" then "-fsanitize-memory-track-origins=2" else ""}" # Enable debug symbols and sanitizer flags export LDFLAGS="-L${pkgs.gcc.libc}/lib" make test SANITIZER=${sanitizer} ''; + doCheck = false; }); yosysWithMultipleSanitizers = pkgs.clangStdenv.mkDerivation (commonAttrs { @@ -118,6 +119,7 @@ LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive"; }; }; + checks = { makeTest = pkgs.runCommand "make-test" { buildInputs = [ pkgs.makeWrapper ];