lang/ghc96: Fix some linkage issues

This commit is contained in:
pho 2023-10-23 17:00:08 +00:00
parent 996f8e2269
commit 0951c87669
5 changed files with 44 additions and 5 deletions

View file

@ -1,9 +1,10 @@
# $NetBSD: Makefile,v 1.1 2023/10/23 08:06:48 pho Exp $
# $NetBSD: Makefile,v 1.2 2023/10/23 17:00:08 pho Exp $
# -----------------------------------------------------------------------------
# Package metadata
#
DISTNAME= ghc-9.6.3-src
PKGNAME= ${DISTNAME:S/-src$//}
PKGREVISION= 1
CATEGORIES= lang
MASTER_SITES= https://downloads.haskell.org/~ghc/${PKGVERSION_NOREV}/
EXTRACT_SUFX= .tar.xz

View file

@ -1,12 +1,12 @@
# $NetBSD: buildlink3.mk,v 1.1 2023/10/23 08:06:48 pho Exp $
# $NetBSD: buildlink3.mk,v 1.2 2023/10/23 17:00:08 pho Exp $
BUILDLINK_TREE+= ghc
.if !defined(GHC_BUILDLINK3_MK)
GHC_BUILDLINK3_MK:=
BUILDLINK_API_DEPENDS.ghc+= ghc>=9.6.3
BUILDLINK_ABI_DEPENDS.ghc+= ghc>=9.6.3
BUILDLINK_API_DEPENDS.ghc+= ghc>=9.6.3nb1
BUILDLINK_ABI_DEPENDS.ghc+= ghc>=9.6.3nb1
BUILDLINK_PKGSRCDIR.ghc?= ../../lang/ghc96
.include "../../converters/libiconv/buildlink3.mk"

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.1 2023/10/23 08:06:48 pho Exp $
$NetBSD: distinfo,v 1.2 2023/10/23 17:00:08 pho Exp $
BLAKE2s (ghc-9.2.1-boot-hadrian.tar.gz) = 363fea08f46524eab654b3225650be4938bd0404e8c44145381f97a0c4489dca
SHA512 (ghc-9.2.1-boot-hadrian.tar.gz) = a006ab38df77bc22e51ee75808065ad75781f85eb52cae54ed8995942ba16e70f4d68d4097f2597bca09e8b7890858d0a28a0f66216e6a4b21a3c68bb8082c59
@ -52,7 +52,9 @@ SHA1 (patch-libraries_time_lib_Data_Time_Clock_Internal_CTimespec.hsc) = 5882707
SHA1 (patch-libraries_time_lib_Data_Time_Clock_Internal_CTimeval.hs) = 68914d012a98cc4a4a245efeabcb9143dba0246a
SHA1 (patch-libraries_unix_System_Posix_Env.hsc) = 414f0310793bf184cdac7546e3f81fee4821a05f
SHA1 (patch-libraries_unix_System_Posix_Env_ByteString.hsc) = a579c00d7d5d7ffbb73f6499e09588d6417be123
SHA1 (patch-libraries_unix_System_Posix_Env_PosixString.hsc) = 40d464638eb11cb832f93d9892818655f4d70e00
SHA1 (patch-libraries_unix_System_Posix_Signals.hsc) = ee59a04571881382bcfd9fc82bf196ff86a40ed5
SHA1 (patch-libraries_unix_System_Posix_User.hsc) = b583f591838fe2d7f42241787e02c5385d336939
SHA1 (patch-m4_fptools__set__haskell__platform__vars.m4) = 8c7a7ab965f4df8a68bedb35c32ee32c59ac2c94
SHA1 (patch-rts_linker_MMap.c) = c2abd34b8d39bb8f508a54bf3db25f53e113e45b
SHA1 (patch-rts_linker_MMap.h) = 8228fabcdaeb1511191da9fc614ff94d3eee8fbd

View file

@ -0,0 +1,16 @@
$NetBSD: patch-libraries_unix_System_Posix_Env_PosixString.hsc,v 1.1 2023/10/23 17:00:08 pho Exp $
Suppress linker warnings about compatibility symbols by using "capi"
instead of "ccall".
--- libraries/unix/System/Posix/Env/PosixString.hsc.orig 2023-10-23 10:24:23.010158238 +0000
+++ libraries/unix/System/Posix/Env/PosixString.hsc
@@ -146,7 +146,7 @@ putEnv (PS sbs) = do
where l = B.length sbs
-foreign import ccall unsafe "putenv"
+foreign import capi unsafe "HsUnix.h putenv"
c_putenv :: CString -> IO CInt
{- |The 'setEnv' function inserts or resets the environment variable name in

View file

@ -0,0 +1,20 @@
$NetBSD: patch-libraries_unix_System_Posix_User.hsc,v 1.1 2023/10/23 17:00:08 pho Exp $
Suppress linker warnings about compatibility symbols by using "capi"
instead of "ccall".
--- libraries/unix/System/Posix/User.hsc.orig 2023-10-23 10:26:54.941601450 +0000
+++ libraries/unix/System/Posix/User.hsc
@@ -605,9 +605,9 @@ getAllUserEntries = lockpw GETALL $ brac
else do thisentry <- unpackUserEntry ppw
worker (thisentry : accum)
-foreign import ccall safe "getpwent" c_getpwent :: IO (Ptr CPasswd)
-foreign import ccall safe "setpwent" c_setpwent :: IO ()
-foreign import ccall safe "endpwent" c_endpwent :: IO ()
+foreign import capi safe "HsUnix.h getpwent" c_getpwent :: IO (Ptr CPasswd)
+foreign import capi safe "HsUnix.h setpwent" c_setpwent :: IO ()
+foreign import capi safe "HsUnix.h endpwent" c_endpwent :: IO ()
#else
{-# WARNING getAllUserEntries "System.Posix.User.getAllUserEntries: not supported" #-}
getAllUserEntries = error "System.Posix.User.getAllUserEntries: not supported"