From 67726c1d44e64a7accbc7bee8f2c086fc3ef3a96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Bon=C3=A9?= Date: Mon, 29 Sep 2025 15:41:45 +0200 Subject: [PATCH] Fix nanos6 cross-compilation for riscv Reviewed-by: Rodrigo Arias Mallo Tested-by: Rodrigo Arias Mallo --- pkgs/nanos6/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/nanos6/default.nix b/pkgs/nanos6/default.nix index c419f2d9..ea84ccea 100644 --- a/pkgs/nanos6/default.nix +++ b/pkgs/nanos6/default.nix @@ -48,6 +48,8 @@ let }; source = if (useGit) then git else release; + + isCross = stdenv.hostPlatform != stdenv.buildPlatform; in stdenv.mkDerivation (source // { pname = "nanos6"; @@ -72,9 +74,13 @@ in "--disable-all-instrumentations" "--enable-ovni-instrumentation" "--with-ovni=${ovni}" + "--with-boost=${boost.dev}" ] ++ (optional enableJemalloc "--with-jemalloc=${jemallocNanos6}") ++ - (optional enableGlibcxxDebug "CXXFLAGS=-D_GLIBCXX_DEBUG"); + (optional enableGlibcxxDebug "CXXFLAGS=-D_GLIBCXX_DEBUG") ++ + # Most nanos6 api symbols are resolved at runtime, so prefer + # ifunc by default + (optional isCross "--with-symbol-resolution=ifunc"); postConfigure = lib.optionalString (!enableDebug) '' # Disable debug