[BACK]Return to patch-libraries_unix_System_Posix_Signals.hsc CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / lang / ghc7 / patches

File: [cvs.NetBSD.org] / pkgsrc / lang / ghc7 / patches / patch-libraries_unix_System_Posix_Signals.hsc (download)

Revision 1.2, Sun Dec 29 16:59:09 2019 UTC (6 months, 2 weeks ago) by pho
Branch: MAIN
CVS Tags: pkgsrc-2020Q2-base, pkgsrc-2020Q2, pkgsrc-2020Q1-base, pkgsrc-2020Q1, HEAD
Changes since 1.1: +4 -5 lines

Update to GHC 7.10.3

Changes from 7.6.3 are as follows:
* https://www.haskell.org/ghc/docs/7.8.1/html/users_guide/release-7-8-1.html
* https://www.haskell.org/ghc/docs/7.8.2/html/users_guide/release-7-8-2.html
* https://www.haskell.org/ghc/docs/7.8.3/html/users_guide/release-7-8-3.html
* https://www.haskell.org/ghc/docs/7.8.4/html/users_guide/release-7-8-4.html
* https://www.haskell.org/ghc/docs/7.10.1/html/users_guide/release-7-10-1.html
* https://downloads.haskell.org/~ghc/7.10.2/docs/html/users_guide/release-7-10-2.html
* https://downloads.haskell.org/~ghc/7.10.3/docs/html/users_guide/release-7-10-3.html

$NetBSD: patch-libraries_unix_System_Posix_Signals.hsc,v 1.2 2019/12/29 16:59:09 pho Exp $

Suppress linker warnings about compatibility syscall wrappers by using
"capi" instead of "ccall". In Haskell FFI, "ccall" is actually an
interface to C ABI rather than C API. That is, GHC generates direct
references to the symbol even if it's actually defined as a cpp macro
or something like that, because GHC knows nothing about those macros
in foreign headers. Hence the following warnings:

  .../libHSunix-2.6.0.1.a(Signals.o): In function `s4SG_info':
  (.text+0x3a3e): warning: warning: reference to compatibility
  sigsuspend(); include <signal.h> for correct reference
  .../libHSunix-2.6.0.1.a(Signals.o): In function `s5uV_info':
  (.text+0x6adb): warning: warning: reference to compatibility
  sigpending(); include <signal.h> for correct reference

In other words, you can safely use "ccall" only when you are sure the
symbol you want to import is actually a symbol in the ABI sense, which
is not always the case for the POSIX API.

--- libraries/unix/System/Posix/Signals.hsc.orig	2015-07-23 22:04:56.000000000 +0000
+++ libraries/unix/System/Posix/Signals.hsc
@@ -603,7 +603,7 @@ awaitSignal maybe_sigset = do
   -- XXX My manpage says it can also return EFAULT. And why is ignoring
   -- EINTR the right thing to do?
 
-foreign import ccall unsafe "sigsuspend"
+foreign import capi unsafe "signal.h sigsuspend"
   c_sigsuspend :: Ptr CSigset -> IO CInt
 #endif
 
@@ -638,5 +638,5 @@ foreign import capi unsafe "signal.h sig
   c_sigismember :: Ptr CSigset -> CInt -> IO CInt
 #endif /* __HUGS__ */
 
-foreign import ccall unsafe "sigpending"
+foreign import capi unsafe "signal.h sigpending"
   c_sigpending :: Ptr CSigset -> IO CInt