Fix papi cross compilation

This commit is contained in:
Aleix Boné 2025-12-02 15:03:46 +01:00
parent fad79643fa
commit 881a08dd37
No known key found for this signature in database
3 changed files with 42 additions and 0 deletions

View File

@ -49,6 +49,7 @@ let
osumb = callPackage ./pkgs/osu/default.nix { };
ovni = callPackage ./pkgs/ovni/default.nix { };
ovniGit = final.ovni.override { useGit = true; };
papi = callPackage ./pkgs/papi/default.nix { papi = prev.papi; };
paraverKernel = callPackage ./pkgs/paraver/kernel.nix { };
prometheus-slurm-exporter = prev.callPackage ./pkgs/slurm-exporter/default.nix { };
#pscom = callPackage ./pkgs/parastation/pscom.nix { }; # Unmaintaned

22
pkgs/papi/default.nix Normal file
View File

@ -0,0 +1,22 @@
{
stdenv,
papi,
}:
if stdenv.hostPlatform == stdenv.buildPlatform then
papi
else
papi.overrideAttrs (old: {
configureFlags = (old.configureFlags or [ ]) ++ [
"--enable-perf_event_uncore=no"
"--with-sysdetect=no"
"--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 ];
})

View File

@ -0,0 +1,19 @@
diff --git a/sde_lib/Makefile b/sde_lib/Makefile
index 8518f92..90a9953 100644
--- a/sde_lib/Makefile
+++ b/sde_lib/Makefile
@@ -1,4 +1,5 @@
CC ?= gcc
+AR ?= ar
SDE_INC = -I. -I..
SDE_LD = -ldl -pthread
CFLAGS += -Wextra -Wall -O2
@@ -18,7 +19,7 @@ dynamic: $(DOBJS)
rm -f *_d.o
static: $(SOBJS)
- ar rs libsde.a $(SOBJS)
+ $(AR) rs libsde.a $(SOBJS)
rm -f *_s.o
clean: