Files
jungle/pkgs/papi/default.nix
Aleix Boné 4f51ebe607
All checks were successful
CI / build:cross (push) Successful in 8s
CI / build:cross (pull_request) Successful in 8s
CI / build:all (push) Successful in 32s
CI / build:all (pull_request) Successful in 32s
Add papi and nosv to cross-compilation CI
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2026-03-19 14:50:10 +01:00

32 lines
1.1 KiB
Nix

{
stdenv,
papi,
}:
if stdenv.hostPlatform == stdenv.buildPlatform then
papi
else
papi.overrideAttrs (old: {
configureFlags = (old.configureFlags or [ ]) ++ [
# Only perf-events works when cross compiling, since for the rest, papi's
# configure.in uses `test -f` which is not allowed when cross-compiling.
# FIXME: patch configure.in to skip the faulty checks when cross-compiling
"--disable-perf-event-uncore"
"--with-sysdetect=no"
# Flags below are adapted from "cross compile sample" in papi's
# src/configure.in. (--host is already set by nix). Verified to
# cross-compile in both riscv64 and aarch64-multiplatform targets.
"--with-ffsll"
"--with-tls=__thread"
"--with-virtualtimer=clock_thread_cputime_id"
"--with-walltimer=clock_realtime"
"--with-perf-events"
"--with-CPU=${stdenv.hostPlatform.uname.processor}"
"--with-arch=${stdenv.hostPlatform.uname.processor}"
];
patches = (old.patches or [ ]) ++ [ ./fix-ar-cross.patch ];
meta = old.meta // { cross = true; };
})