Skip to content

Commit

Permalink
Build OPTEE firmware with enableParallelBuilding
Browse files Browse the repository at this point in the history
OPTEE and related projects should build in seconds, not minutes.
  • Loading branch information
jmbaur committed Mar 27, 2024
1 parent 6f6fc3b commit 92d2896
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkgs/optee/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ let
];
nativeBuildInputs = [ pkg-config ];
buildInputs = [ libuuid ];
enableParallelBuilding = true;
makeFlags = [
"-C optee/optee_client"
"DESTDIR=$(out)"
Expand Down Expand Up @@ -82,6 +83,7 @@ let
(buildPackages.python3.withPackages (p: with p; [ pyelftools cryptography ]))
];
inherit makeFlags;
enableParallelBuilding = true;
# NOTE: EARLY_TA_PATHS needs to be added outside of `makeFlags` since it is a
# space separated list of paths. See
# https://nixos.org/manual/nixpkgs/stable/#build-phase for more details.
Expand All @@ -103,6 +105,7 @@ let
src = nvopteeSrc;
patches = [ ./0001-nvoptee-no-install-makefile.patch ./0002-Exit-with-non-zero-status-code-on-TEEC_InvokeCommand.patch ];
nativeBuildInputs = [ (buildPackages.python3.withPackages (p: [ p.cryptography ])) ];
enableParallelBuilding = true;
makeFlags = [
"-C optee/samples/luks-srv"
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
Expand All @@ -127,6 +130,7 @@ let
src = nvopteeSrc;
patches = [ ./0001-nvoptee-no-install-makefile.patch ];
nativeBuildInputs = [ (buildPackages.python3.withPackages (p: [ p.cryptography ])) ];
enableParallelBuilding = true;
makeFlags = [
"-C optee/samples/hwkey-agent"
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
Expand Down Expand Up @@ -177,6 +181,8 @@ let
"LDFLAGS=-no-warn-rwx-segments"
];

enableParallelBuilding = true;

installPhase = ''
runHook preInstall
Expand Down

0 comments on commit 92d2896

Please sign in to comment.