Re: [GHC] #7356: Building HEAD on Mac OS X 10.5 reports Undefined _pthread_threadid_np ref'd from _kernelThreadId in libHSrts_thr.a(OSThreads.thr_o)
#7356: Building HEAD on Mac OS X 10.5 reports Undefined _pthread_threadid_np ref'd from _kernelThreadId in libHSrts_thr.a(OSThreads.thr_o) --+- Reporter: thorkilnaur | Owner: igloo Type: bug | Status: closed Priority: normal | Milestone: 7.8.1 Component: Runtime System |Version: 7.7 Resolution: fixed| Keywords: Os: MacOS X | Architecture: x86 Failure: Building GHC failed | Difficulty: Unknown Testcase: | Blockedby: Blocking: |Related: --+- Changes (by igloo): * status: patch = closed * difficulty: = Unknown * resolution: = fixed * milestone: = 7.8.1 Comment: Applied, thanks -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7356#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #7356: Building HEAD on Mac OS X 10.5 reports Undefined _pthread_threadid_np ref'd from _kernelThreadId in libHSrts_thr.a(OSThreads.thr_o)
#7356: Building HEAD on Mac OS X 10.5 reports Undefined _pthread_threadid_np ref'd from _kernelThreadId in libHSrts_thr.a(OSThreads.thr_o) -+-- Reporter: thorkilnaur | Owner: igloo Type: bug | Status: patch Priority: normal | Component: Runtime System Version: 7.7 | Keywords: Os: MacOS X | Architecture: x86 Failure: Building GHC failed | Testcase: Blockedby: | Blocking: Related: | -+-- Comment(by ian@…): commit 0cb35b5514e6280ba330bd3a4acb8e6a71c300ff {{{ Author: Ian Lynagh i...@well-typed.com Date: Sat Dec 1 23:22:48 2012 + Mac OS X 10.6 needed for pthread_threadid_np(), fixes #7356 Based on a patch from Thorkil Naur. rts/posix/OSThreads.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7356#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #7356: Building HEAD on Mac OS X 10.5 reports Undefined _pthread_threadid_np ref'd from _kernelThreadId in libHSrts_thr.a(OSThreads.thr_o)
#7356: Building HEAD on Mac OS X 10.5 reports Undefined _pthread_threadid_np ref'd from _kernelThreadId in libHSrts_thr.a(OSThreads.thr_o) -+-- Reporter: thorkilnaur | Owner: igloo Type: bug | Status: patch Priority: normal | Component: Runtime System Version: 7.7 | Keywords: Os: MacOS X | Architecture: x86 Failure: Building GHC failed | Testcase: Blockedby: | Blocking: Related: | -+-- Changes (by spl): * owner: = igloo Comment: Just wondering what the status of this ticket is. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7356#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #7356: Building HEAD on Mac OS X 10.5 reports Undefined _pthread_threadid_np ref'd from _kernelThreadId in libHSrts_thr.a(OSThreads.thr_o)
#7356: Building HEAD on Mac OS X 10.5 reports Undefined _pthread_threadid_np ref'd from _kernelThreadId in libHSrts_thr.a(OSThreads.thr_o) -+-- Reporter: thorkilnaur | Owner: Type: bug | Status: patch Priority: normal | Component: Runtime System Version: 7.7 | Keywords: Os: MacOS X | Architecture: x86 Failure: Building GHC failed | Testcase: Blockedby: | Blocking: Related: | -+-- Changes (by PHO): * cc: pho@… (added) -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7356#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #7356: Building HEAD on Mac OS X 10.5 reports Undefined _pthread_threadid_np ref'd from _kernelThreadId in libHSrts_thr.a(OSThreads.thr_o)
#7356: Building HEAD on Mac OS X 10.5 reports Undefined _pthread_threadid_np ref'd from _kernelThreadId in libHSrts_thr.a(OSThreads.thr_o) -+-- Reporter: thorkilnaur | Owner: Type: bug | Status: patch Priority: normal | Component: Runtime System Version: 7.7 | Keywords: Os: MacOS X | Architecture: x86 Failure: Building GHC failed | Testcase: Blockedby: | Blocking: Related: | -+-- Changes (by thorkilnaur): * status: new = patch Comment: Added patch with a suggested fix for this problem. Best regards Thorkil -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7356#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #7356: Building HEAD on Mac OS X 10.5 reports Undefined _pthread_threadid_np ref'd from _kernelThreadId in libHSrts_thr.a(OSThreads.thr_o)
#7356: Building HEAD on Mac OS X 10.5 reports Undefined _pthread_threadid_np ref'd from _kernelThreadId in libHSrts_thr.a(OSThreads.thr_o) -+-- Reporter: thorkilnaur | Owner: Type: bug | Status: patch Priority: normal | Component: Runtime System Version: 7.7 | Keywords: Os: MacOS X | Architecture: x86 Failure: Building GHC failed | Testcase: Blockedby: | Blocking: Related: | -+-- Comment(by spl): The patch compiles for me on 10.5. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7356#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
[GHC] #7356: Building HEAD on Mac OS X 10.5 reports Undefined _pthread_threadid_np ref'd from _kernelThreadId in libHSrts_thr.a(OSThreads.thr_o)
#7356: Building HEAD on Mac OS X 10.5 reports Undefined _pthread_threadid_np ref'd from _kernelThreadId in libHSrts_thr.a(OSThreads.thr_o) -+-- Reporter: thorkilnaur | Owner: Type: bug | Status: new Priority: normal | Component: Runtime System Version: 7.7 | Keywords: Os: MacOS X | Architecture: x86 Failure: Building GHC failed | Testcase: Blockedby: | Blocking: Related: | -+-- On a Mac OS X 10.5 {{{ $ uname -a Darwin thorkil-naurs-intel-mac-mini.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386 $ }}} a build of recent HEAD (http://darcs.haskell.org/ghcBuilder/builders/tn23/731.html) reports {{{ inplace/bin/ghc-stage1 -o ghc/stage2/build/tmp/ghc-stage2 -static -H32m -O -hide-all-packages -i -ighc/. -ighc/stage2/build -ighc/stage2/build/autogen -Ighc/stage2/build -Ighc/stage2/build/autogen -optP-DGHCI -optP-include -optPghc/stage2/build/autogen/cabal_macros.h -package array-0.4.0.1 -package base-4.6.0.0 -package bytestring-0.10.1.0 -package directory-1.2.0.0 -package filepath-1.3.0.1 -package ghc-7.7.20121021 -package haskeline-0.7.0.3 -package process-1.1.0.2 -package transformers-0.3.0.0 -package unix-2.6.0.0 -fno-warn-name- shadowing -Wall -XHaskell98 -XForeignFunctionInterface -XUnboxedTuples -XFlexibleInstances -XMagicHash -XNondecreasingIndentation -XCPP -XPatternGuards -O2 -threaded -no-user-package-db -rtsopts -odir ghc/stage2/build -hidir ghc/stage2/build -stubdir ghc/stage2/build -hisuf hi -osuf o -hcsuf hc ghc/stage2/build/Main.o ghc/stage2/build/InteractiveUI.o ghc/stage2/build/GhciMonad.o ghc/stage2/build/GhciTags.o ghc/stage2/build/hschooks.o Undefined symbols: _pthread_threadid_np, referenced from: _kernelThreadId in libHSrts_thr.a(OSThreads.thr_o) ld: symbol(s) not found collect2: ld returned 1 exit status make[1]: *** [ghc/stage2/build/tmp/ghc-stage2] Error 1 make: *** [all] Error 2 }}} The reason seems to be (http://elliotth.blogspot.dk/2012/04/gettid-on-mac- os.html): Speaking of 10.6, there's also a non-portable pthread_threadid_np(3) that turns a pthread_t into a uint64_t. This gives the same values you'd get from thread_selfid(2). Again, this is unsupported in 10.5 and earlier. Best regards Thorkil -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7356 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #7356: Building HEAD on Mac OS X 10.5 reports Undefined _pthread_threadid_np ref'd from _kernelThreadId in libHSrts_thr.a(OSThreads.thr_o)
#7356: Building HEAD on Mac OS X 10.5 reports Undefined _pthread_threadid_np ref'd from _kernelThreadId in libHSrts_thr.a(OSThreads.thr_o) -+-- Reporter: thorkilnaur | Owner: Type: bug | Status: new Priority: normal | Component: Runtime System Version: 7.7 | Keywords: Os: MacOS X | Architecture: x86 Failure: Building GHC failed | Testcase: Blockedby: | Blocking: Related: | -+-- Changes (by spl): * cc: leather@… (added) Comment: Thanks for reporting this. I sent an email to ghc-cvs and Duncan Coutts on Oct 3 about this, but now that I have tried to search for a link to that email, I realize that I was using the wrong from email address. I traced the problem to the following commit: {{{ commit 647ae1cfbb5ea3e2d3b1541c2bc12ea5db321134 Author: Duncan Coutts Date: Tue Jul 3 19:18:46 2012 +0100 }}} I wonder if it's possible to modify kernelThreadId() to do something a bit more portable. I've seen references to the following options: 1. [http://elliotth.blogspot.nl/2012/04/gettid-on-mac-os.html pthread_self() (using the pointer)] 1. [http://stackoverflow.com/questions/1540603/mac-iphone-is-there-a-way- to-get-a-thread-identifier-without-using-objective-c pthread_mach_thread_np(pthread_self())] I'm not sure if either one is equivalent or better. I noticed pthread_self() is already used for osThreadId(). I have changed it locally to the second option, which compiles, but I haven't attempted to test threads. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7356#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs