Cross compile for ARMv7, Aarch64 and RISC-V 64

Adds CI cross-compilation tests for those architectures. Requires the
host to be able to run thos binaries via binfmt.

See: https://docs.kernel.org/admin-guide/binfmt-misc.html
This commit is contained in:
Rodrigo Arias 2024-06-21 11:30:29 +02:00 committed by Rodrigo Arias
parent 391d695144
commit 42feb53c86
2 changed files with 48 additions and 0 deletions

View File

@ -55,3 +55,24 @@ build:compilers:
- nix - nix
script: script:
- nix build -L --no-link .#ovniPackages.compilers - nix build -L --no-link .#ovniPackages.compilers
build:armv7:
stage: build
tags:
- nix
script:
- nix build -L --no-link .#ovniPackages.armv7
build:aarch64:
stage: build
tags:
- nix
script:
- nix build -L --no-link .#ovniPackages.aarch64
build:riscv64:
stage: build
tags:
- nix
script:
- nix build -L --no-link .#ovniPackages.riscv64

View File

@ -135,6 +135,33 @@
export ASAN_OPTIONS=detect_leaks=0 export ASAN_OPTIONS=detect_leaks=0
''; '';
}); });
armv7 = (pkgs.pkgsCross.armv7l-hf-multiplatform.ovniLocal.overrideAttrs (old: {
pname = "ovni-armv7";
buildInputs = [];
nativeBuildInputs = [ pkgs.pkgsCross.armv7l-hf-multiplatform.buildPackages.cmake ];
cmakeFlags = old.cmakeFlags ++ [ "-DUSE_MPI=OFF" ];
})).overrideDerivation (old: {
doCheck = true;
});
aarch64 = (pkgs.pkgsCross.aarch64-multiplatform.ovniLocal.overrideAttrs (old: {
pname = "ovni-aarch64";
buildInputs = [];
nativeBuildInputs = [ pkgs.pkgsCross.aarch64-multiplatform.buildPackages.cmake ];
cmakeFlags = old.cmakeFlags ++ [ "-DUSE_MPI=OFF" ];
})).overrideDerivation (old: {
doCheck = true;
});
riscv64 = (pkgs.pkgsCross.riscv64.ovniLocal.overrideAttrs (old: {
pname = "ovni-riscv64";
buildInputs = [];
nativeBuildInputs = [ pkgs.pkgsCross.riscv64.buildPackages.cmake ];
cmakeFlags = old.cmakeFlags ++ [ "-DUSE_MPI=OFF" ];
})).overrideDerivation (old: {
doCheck = true;
});
}; };
}; };
} }