p4c: fix gcc-13 build failure

Without the change build fails on `master` as
https://hydra.nixos.org/build/247605854:

    In file included from /build/source/lib/hex.cpp:17:
    /build/source/lib/hex.h:25:5: error: 'intmax_t' does not name a type; did you mean 'int8_t'?
       25 |     intmax_t val;
          |     ^~~~~~~~
          |     int8_t
This commit is contained in:
Sergei Trofimovich 2024-02-10 20:39:46 +00:00
parent ef6206934d
commit bdaeae3fba

View File

@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, cmake
, boehmgc
, bison
@ -37,6 +38,16 @@ stdenv.mkDerivation (finalAttrs: {
fetchSubmodules = true;
};
patches = [
# Fix gcc-13 build:
# https://github.com/p4lang/p4c/pull/4084
(fetchpatch {
name = "gcc-13.patch";
url = "https://github.com/p4lang/p4c/commit/6756816100b7c51e3bf717ec55114a8e8575ba1d.patch";
hash = "sha256-wWM1qjgQCNMPdrhQF38jzFgODUsAcaHTajdbV7L3y8o=";
})
];
postFetch = ''
rm -rf backends/ebpf/runtime/contrib/libbpf
rm -rf control-plane/p4runtime