forked from rarias/jungle
Fix papi cross compilation
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
This commit is contained in:
29
pkgs/papi/default.nix
Normal file
29
pkgs/papi/default.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
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 ];
|
||||
})
|
||||
Reference in New Issue
Block a user