From 9a913b512543ade40eeb937f4bba85a0db9a0fee Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 28 Sep 2020 23:04:26 +0200 Subject: [PATCH] compcert: build with Coq 8.11 And fix installation of development files (use upstream Makefile rules instead of ad-hoc commands). --- .../compilers/compcert/default.nix | 22 ++++++++++++------- pkgs/top-level/all-packages.nix | 4 +--- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/pkgs/development/compilers/compcert/default.nix b/pkgs/development/compilers/compcert/default.nix index 1665061125d..8c8a56d8e28 100644 --- a/pkgs/development/compilers/compcert/default.nix +++ b/pkgs/development/compilers/compcert/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchFromGitHub, makeWrapper +{ stdenv, lib, fetchFromGitHub, fetchpatch, makeWrapper , coq, ocamlPackages, coq2html , tools ? stdenv.cc }: @@ -21,11 +21,22 @@ stdenv.mkDerivation rec { sha256 = "1h4zhk9rrqki193nxs9vjvya7nl9yxjcf07hfqb6g77riy1vd2jr"; }; + patches = [ + (fetchpatch { + url = "https://github.com/AbsInt/CompCert/commit/0a2db0269809539ccc66f8ec73637c37fbd23580.patch"; + sha256 = "0n8qrba70x8f422jdvq9ddgsx6avf2dkg892g4ldh3jiiidyhspy"; + }) + (fetchpatch { + url = "https://github.com/AbsInt/CompCert/commit/5e29f8b5ba9582ecf2a1d0baeaef195873640607.patch"; + sha256 = "184nfdgxrkci880lkaj5pgnify3plka7xfgqrgv16275sqppc5hc"; + }) + ]; + nativeBuildInputs = [ makeWrapper ]; buildInputs = ocaml-pkgs ++ [ coq coq2html ]; enableParallelBuilding = true; - patchPhase = '' + postPatch = '' substituteInPlace ./configure \ --replace '{toolprefix}gcc' '{toolprefix}cc' ''; @@ -33,6 +44,7 @@ stdenv.mkDerivation rec { configurePhase = '' ./configure -clightgen \ -prefix $out \ + -coqdevdir $lib/lib/coq/${coq.coq-version}/user-contrib/compcert/ \ -toolprefix ${tools}/bin/ \ ${ccomp-platform} ''; @@ -47,12 +59,6 @@ stdenv.mkDerivation rec { mkdir -p $doc/share/doc/compcert mv doc/html $doc/share/doc/compcert/ - # install compcert lib files; remove copy from $out, too - mkdir -p $lib/lib/coq/${coq.coq-version}/user-contrib/compcert/ - mv backend cfrontend common cparser driver flocq x86 x86_64 lib \ - $lib/lib/coq/${coq.coq-version}/user-contrib/compcert/ - rm -rf $out/lib/compcert/coq - # wrap ccomp to undefine _FORTIFY_SOURCE; ccomp invokes cc1 which sets # _FORTIFY_SOURCE=2 by default, but undefines __GNUC__ (as it should), # which causes a warning in libc. this suppresses it. diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 365bdfccb24..567d4d08d21 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8560,9 +8560,7 @@ in cmucl_binary = pkgsi686Linux.callPackage ../development/compilers/cmucl/binary.nix { }; - compcert = callPackage ../development/compilers/compcert { - inherit (coqPackages_8_10) coq; - }; + compcert = callPackage ../development/compilers/compcert {}; computecpp-unwrapped = callPackage ../development/compilers/computecpp {}; computecpp = wrapCCWith rec {