[commit: ghc] master: Solaris: do not use timer_create (bb39e04)

Simon Marlow marlowsd at gmail.com
Thu Jan 24 10:57:47 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/bb39e04d1ce6157268adfd9a3a8ec17d557deca8

>---------------------------------------------------------------

commit bb39e04d1ce6157268adfd9a3a8ec17d557deca8
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Wed Jan 23 10:22:47 2013 +0000

    Solaris: do not use timer_create
    
    Submitted by: Karel Gardas <karel.gardas at centrum.cz>

>---------------------------------------------------------------

 rts/posix/Itimer.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/rts/posix/Itimer.c b/rts/posix/Itimer.c
index 80b3b56..b99ff89 100644
--- a/rts/posix/Itimer.c
+++ b/rts/posix/Itimer.c
@@ -73,6 +73,24 @@
  * etc.).
  */
 
+#if defined(solaris2_HOST_OS)
+/* USE_TIMER_CREATE is usually disabled for Solaris. In fact it is
+   supported well on this OS, but requires additional privilege. When
+   user does not have it, then the testing configure program fails
+   which results in USE_TIMER_CREATE not defined.
+   On the other hand when we cross-compile, then we optimistically
+   assume usage of timer_create function. The problem is that if we
+   cross compile for example from i386-solaris2 to x86_64-solaris2,
+   then the build fails with error like this:
+
+ghc-stage2: timer_create: Not owner
+
+   which happens on first ghc-stage2 invocation. So to support
+   cross-compilation to Solaris we manually undefine USE_TIMER_CREATE
+   here */
+#undef USE_TIMER_CREATE
+#endif /* solaris2_HOST_OS */
+
 #if defined(USE_TIMER_CREATE)
 #  define ITIMER_SIGNAL SIGVTALRM
 #elif defined(HAVE_SETITIMER)





More information about the ghc-commits mailing list