Support OS X 10.3
!PortAudio currently does not support OS X 10.3. The dependence on 10.4 is due to Memory barriers which are more reliable in 10.4 than they are in 10.3. It might be possible to use weak linking to support 10.3, albeit without memory barriers, but the situation is not clear. Other options have been discussed on the mailing list.
Leave a comment
on 2006-12-19 05:10 *
By bejayoharen
A bit more:
There are known bugs in the hardware implementation of asm volatile("sync":::"memory"), which OSMemoryBarrier (only available in OS 10.4) works around.
Assuming OSMemoryBarrier() is weak linked, the correct solution (supporting the best memory barriers available at runtime), including optimization for OS X 10.4, is probably to use something like this:
{{{
This could be compiled on OS X 10.4 and should run on 10.3, provided the makefile was changed in a few ways:
Define minimum deployment level of 10.2 so that weak linking is supported:
MACOSX_DEPLOYMENT_TARGET:=10.2
export MACOSX_DEPLOYMENT_TARGET
Other things may be required as described here:
http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html
There are known bugs in the hardware implementation of asm volatile("sync":::"memory"), which OSMemoryBarrier (only available in OS 10.4) works around.
Assuming OSMemoryBarrier() is weak linked, the correct solution (supporting the best memory barriers available at runtime), including optimization for OS X 10.4, is probably to use something like this:
{{{
- define PaUtil_FullMemoryBarrier() do { __biultin_expect(OSMemoryBarrier != NULL, true) ? OSMemoryBarrier() : asm volatile("sync":::"memory") } while(false)
- define PaUtil_ReadMemoryBarrier() do { __biultin_expect(OSMemoryBarrier != NULL, true) ? OSMemoryBarrier() : asm volatile("sync":::"memory") } while(false)
- define PaUtil_WriteMemoryBarrier() do { __biultin_expect(OSMemoryBarrier != NULL, true) ? OSMemoryBarrier() : asm volatile("sync":::"memory") } while(false)
This could be compiled on OS X 10.4 and should run on 10.3, provided the makefile was changed in a few ways:
Define minimum deployment level of 10.2 so that weak linking is supported:
MACOSX_DEPLOYMENT_TARGET:=10.2
export MACOSX_DEPLOYMENT_TARGET
Other things may be required as described here:
http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html