Files
nixpkgs/pkgs/development/compilers/ghc/ghc-8.10-9.2-rts-package-db-libnuma-dirs.patch
sternenseemann 4657535e2e haskell.compiler: (make built) also patch rts.cabal.in in numa patch
This is the part of the autoconf/make logic that may be relevant to us
which wasn't replicated from Libdw. For completeness' sake, do this
here. The extra logic in distrib/configure.ac.in is not relevant to us
since we don't build bindists for make built GHCs.
2025-07-22 21:00:24 +02:00

101 lines
3.6 KiB
Diff

From 3d17e6fa39fb18d4300fbf2a0c4b9ddb4adf746b Mon Sep 17 00:00:00 2001
From: sterni <sternenseemann@systemli.org>
Date: Thu, 17 Jul 2025 21:21:29 +0200
Subject: [PATCH] rts: record libnuma include and lib dirs in package conf
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The --with-libnuma-libraries and --with-libnuma-includes flags were
originally introduced for hadrian in def486c90ef6f37d81d0d9c6df7544
and curiously never supported by the make build system — even though
the addition was made in the 9.0 series and even backported to the
8.10 series.
While the make build system knows when to link against libnuma, it won't
enforce its specific directories by adding them to rts.conf in the
package db. This commit implements this retroactively for the make build
system, modeled after how make does the same sort of thing for Libdw.
The Libdw logic also affects the bindist configure file in
distrib/configure.ac which isn't replicate since we don't need it.
---
mk/config.mk.in | 4 ++++
rts/ghc.mk | 8 ++++++++
rts/package.conf.in | 5 +++--
rts/rts.cabal.in | 1 +
4 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/mk/config.mk.in b/mk/config.mk.in
index 35f6e2d087..d2b1329eb5 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -333,6 +333,10 @@ LibdwIncludeDir=@LibdwIncludeDir@
# rts/Libdw.c:set_initial_registers()
GhcRtsWithLibdw=$(strip $(if $(filter $(TargetArch_CPP),i386 x86_64 s390x),@UseLibdw@,NO))
+UseLibNuma=@UseLibNuma@
+LibNumaLibDir=@LibNumaLibDir@
+LibNumaIncludeDir=@LibNumaIncludeDir@
+
################################################################################
#
# Paths (see paths.mk)
diff --git a/rts/ghc.mk b/rts/ghc.mk
index 9c535def5a..7782c4b768 100644
--- a/rts/ghc.mk
+++ b/rts/ghc.mk
@@ -576,6 +576,14 @@ rts_PACKAGE_CPP_OPTS += -DLIBDW_INCLUDE_DIR=
rts_PACKAGE_CPP_OPTS += -DLIBDW_LIB_DIR=
endif
+ifeq "$(UseLibNuma)" "YES"
+rts_PACKAGE_CPP_OPTS += -DLIBNUMA_INCLUDE_DIR=$(LibNumaIncludeDir)
+rts_PACKAGE_CPP_OPTS += -DLIBNUMA_LIB_DIR=$(LibNumaLibDir)
+else
+rts_PACKAGE_CPP_OPTS += -DLIBNUMA_INCLUDE_DIR=
+rts_PACKAGE_CPP_OPTS += -DLIBNUMA_LIB_DIR=
+endif
+
# -----------------------------------------------------------------------------
# dependencies
diff --git a/rts/package.conf.in b/rts/package.conf.in
index 9bdbf3659a..46f728b09a 100644
--- a/rts/package.conf.in
+++ b/rts/package.conf.in
@@ -18,9 +18,9 @@ hidden-modules:
import-dirs:
#if defined(INSTALLING)
-library-dirs: LIB_DIR"/rts" FFI_LIB_DIR LIBDW_LIB_DIR
+library-dirs: LIB_DIR"/rts" FFI_LIB_DIR LIBDW_LIB_DIR LIBNUMA_LIB_DIR
#else /* !INSTALLING */
-library-dirs: TOP"/rts/dist/build" FFI_LIB_DIR LIBDW_LIB_DIR
+library-dirs: TOP"/rts/dist/build" FFI_LIB_DIR LIBDW_LIB_DIR LIBNUMA_LIB_DIR
#endif
hs-libraries: "HSrts" FFI_LIB
@@ -76,6 +76,7 @@ include-dirs: TOP"/rts/dist/build"
FFI_INCLUDE_DIR
LIBDW_INCLUDE_DIR
TOP"/includes/dist-install/build"
+ LIBNUMA_INCLUDE_DIR
#endif
includes: Stg.h
diff --git a/rts/rts.cabal.in b/rts/rts.cabal.in
index 0a06414d95..f71fb079ec 100644
--- a/rts/rts.cabal.in
+++ b/rts/rts.cabal.in
@@ -150,6 +150,7 @@ library
include-dirs: build ../includes includes
includes/dist-derivedconstants/header @FFIIncludeDir@
@LibdwIncludeDir@
+ @LibNumaIncludeDir@
includes: Stg.h
install-includes: Cmm.h HsFFI.h MachDeps.h Rts.h RtsAPI.h Stg.h
ghcautoconf.h ghcconfig.h ghcplatform.h ghcversion.h
--
2.50.0