mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2026-12-03 06:23:30 +01:00
nxp: imx93-evk: fix cross-build of mkimage host tools
When building the imx93 SD image from x86_64, imx93-boot used target pkgs for the imx-mkimage derivation and its native tools (git, dtc, xxd). mkimage runs on the build machine, but Nix tried to cross-compile git for aarch64 and failed with "linker `cc` not found" while building libgitcore, blocking flash.bin and the SD image. Build mkimage with buildPackages (host tools) while keeping firmware inputs (ATF, U-Boot, OP-TEE, etc.) from target pkgs.
This commit is contained in:
1 parent
e678820fd5
commit
d66213a72e
1 file changed
+12
-17
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
}:
|
}:
|
||||||
with pkgs;
|
|
||||||
let
|
let
|
||||||
|
bp = pkgs.buildPackages;
|
||||||
|
|
||||||
imx93-atf = pkgs.callPackage ./imx93-atf.nix { };
|
imx93-atf = pkgs.callPackage ./imx93-atf.nix { };
|
||||||
imx93-firmware = pkgs.callPackage ./imx93-firmware.nix { };
|
imx93-firmware = pkgs.callPackage ./imx93-firmware.nix { };
|
||||||
@@ -17,7 +17,8 @@ let
|
|||||||
shortRev = builtins.substring 0 8 src.rev;
|
shortRev = builtins.substring 0 8 src.rev;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imx93-boot = pkgs.stdenv.mkDerivation rec {
|
# mkimage runs on the build machine; use buildPackages when cross-compiling.
|
||||||
|
imx93-boot = bp.stdenv.mkDerivation {
|
||||||
inherit src;
|
inherit src;
|
||||||
name = "imx93-mkimage";
|
name = "imx93-mkimage";
|
||||||
version = "lf-6.12.3";
|
version = "lf-6.12.3";
|
||||||
@@ -25,28 +26,22 @@ in
|
|||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace Makefile \
|
substituteInPlace Makefile \
|
||||||
--replace 'git rev-parse --short=8 HEAD' 'echo ${shortRev}'
|
--replace 'git rev-parse --short=8 HEAD' 'echo ${shortRev}'
|
||||||
substituteInPlace Makefile \
|
|
||||||
--replace 'CC = gcc' 'CC = clang'
|
|
||||||
substituteInPlace iMX93/soc.mak \
|
substituteInPlace iMX93/soc.mak \
|
||||||
--replace 'xxd' "${pkgs.vim.xxd}/bin/xxd"
|
--replace 'xxd' "${bp.vim.xxd}/bin/xxd"
|
||||||
substituteInPlace scripts/fspi_fcb_gen.sh \
|
substituteInPlace scripts/fspi_fcb_gen.sh \
|
||||||
--replace 'xxd' "${pkgs.vim.xxd}/bin/xxd"
|
--replace 'xxd' "${bp.vim.xxd}/bin/xxd"
|
||||||
substituteInPlace scripts/fspi_packer.sh \
|
substituteInPlace scripts/fspi_packer.sh \
|
||||||
--replace 'xxd' "${pkgs.vim.xxd}/bin/xxd"
|
--replace 'xxd' "${bp.vim.xxd}/bin/xxd"
|
||||||
patchShebangs scripts
|
patchShebangs scripts
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
clang
|
bp.stdenv.cc
|
||||||
git
|
bp.git
|
||||||
dtc
|
bp.dtc
|
||||||
];
|
bp.glibc.static
|
||||||
|
bp.zlib
|
||||||
buildInputs = [
|
bp.zlib.static
|
||||||
git
|
|
||||||
glibc.static
|
|
||||||
zlib
|
|
||||||
zlib.static
|
|
||||||
];
|
];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
|
|||||||
Reference in new issue
Block a user