From 67ce2eda82f8bc27b9abf9a63882532264f6bd3d Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Mon, 26 Dec 2022 14:45:00 +0000 Subject: [PATCH] tcb: fix cross-compilation of tcb Without the change build fails to find `gcc`: $ nix build --no-link -f. pkgsCross.riscv64.shadow > make[1]: Entering directory '/build/source/libs' > gcc -O2 -I../include -Wall -Wextra -fPIC -c libtcb.c -o libtcb.o > /nix/store/b9jxsncywlygxjjyql0z5bq6z29m6j4r-bash-5.1-p16/bin/bash: line 1: gcc: command not found --- pkgs/tools/security/tcb/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/tools/security/tcb/default.nix b/pkgs/tools/security/tcb/default.nix index 63b252be9521..b49f7767dcbd 100644 --- a/pkgs/tools/security/tcb/default.nix +++ b/pkgs/tools/security/tcb/default.nix @@ -26,6 +26,9 @@ stdenv.mkDerivation rec { --replace "PREFIX = /usr" "PREFIX = $out" \ --replace "SBINDIR = /sbin" "SBINDIR = $bin/bin" \ --replace "INCLUDEDIR = \$(PREFIX)/include" "INCLUDEDIR = $dev/include" + + # Override default 'CC=gcc' + makeFlagsArray+=("CC=$CC") ''; meta = with lib; {