Compiling libdispatch on mac os x 10.6
Hi, I'm trying to get a working version of libdispatch on macosx 10.6 to use its semaphores implementation on osx < 10.6. Compiled with xcode/gcc 4.2.1 (Apple Inc. build 5664)/10.6 SDK and apple semaphore optimizations. Unfortunately when I run the dispatch_sema.c test it fails: Starting program: /Users/Accounts/mirko/src/libdispatch/testing/a.out Reading symbols for shared libraries +. done ================================================== [TEST] Dispatch Semaphore [PID] 22816 ================================================== Program received signal EXC_BAD_INSTRUCTION, Illegal instruction/operand. [Switching to process 22816] 0x000045b8 in _dispatch_worker_thread (context=0x9550) at /Users/Accounts/mirko/src/libdispatch/src/queue.c:413 413 while (!(next = head->do_next)) { If I link the test with the system dispatch implementation it runs without problems. Is there a way to compile correctly the library? Thank you. -- Ciao, Mirko
On Fri, 23 Jul 2010, Mirko Viviani wrote:
If I link the test with the system dispatch implementation it runs without problems. Is there a way to compile correctly the library?
Hi Mirko -- It's quite complex to use the externally distributed libdispatch with Mac OS X versions that include GCD support, as the integrated version conflicts with the externally linked version. I'm not sure what the best solution to this problem is, but it might involve symbol munging such that the external version offers similarly named symbols that do not conflict with the libSystem symbols. Possibly renaming all symbols when linking the library to libdispatch_ instead of dispatch_, allowing applications to select which implementation they're using? Just hand-waving, I'm afraid, but it would be useful if someone found a clean solution here that didn't involve rebuilding libSystem. Robert
participants (2)
-
Mirko Viviani
-
Robert Watson