fluid-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [fluid-dev] OSX 10.6 build symbol problem


From: Pedro Lopez-Cabanillas
Subject: Re: [fluid-dev] OSX 10.6 build symbol problem
Date: Thu, 5 Jan 2012 14:47:27 +0100
User-agent: KMail/1.13.5 (Linux/2.6.34.10-0.4-desktop; KDE/4.4.4; i686; ; )

On Wednesday 04 January 2012, Jeff Kearns wrote:
> Hi,
> I'm having problems with Fluidsynth on a iMac Snow Leopard project.  

I don't fully understand your scenario. Your build host is a Mac OSX 10.6 
(Snow Leopard), right? That implies an Intel x86-64 CPU. Your target host is a 
Mac OSX 10.5 (Leopard) with an Intel i386 32bit CPU. You want to produce 
executables and libraries on the build host that would also run on the target 
host without recompiling. That means double architecture binaries (i386 + 
x86_64). Please clarify if I am wrong with these assumptions.

> Briefly, I'm building it to use with LMMS. I previously built a  
> working LMMS, FluidSynth, Qsynth, QJackctl, GTK Glib and gthread on a  
> PPC Mac, I want the works on a i386 machine now. So starting with the  
> same Glib-2.3.0 installed,

FluidSynth requires glib-2.6.5 or later. Your version (2.3.0) is not 
supported. The "configure" script may be broken when checking the version 
numbers, but anyway it is deprecated and should be avoided. Use CMake instead.

> Fluid compiles,links,and looks healthy.  
> Except for the following warnings during the final linking:
> 
> In file included from /usr/local/include/glib-2.0/glib/gasyncqueue.h:34,
>                   from /usr/local/include/glib-2.0/glib.h:34,
>                   from ../src/utils/fluidsynth_priv.h:25,
>                   from fluidsynth.c:29:
> /usr/local/include/glib-2.0/glib/gthread.h: In function  
> ‘g_once_init_enter’:
> /usr/local/include/glib-2.0/glib/gthread.h:347: warning: implicit  
> declaration of function ‘__sync_synchronize’
> In file included from ../src/synth/fluid_event_queue.h:26,
>                   from ../src/synth/fluid_synth.h:35,
>                   from bindings/fluid_filerenderer.c:27:
> ../src/utils/fluid_ringbuffer.h: In function  
> ‘fluid_ringbuffer_next_inptr’:
> ../src/utils/fluid_ringbuffer.h:76: warning: implicit declaration of  
> function ‘__sync_fetch_and_add’
> 
> also:
> In file included from /usr/local/include/readline/readline.h:36,
>                   from bindings/fluid_cmd.c:34:
> /usr/local/include/readline/rltypedefs.h: At top level:
> /usr/local/include/readline/rltypedefs.h:34: warning: function  
> declaration isn’t a prototype
> /usr/local/include/readline/rltypedefs.h:35: warning: function  
> declaration isn’t a prototype
> /usr/local/include/readline/rltypedefs.h:36: warning: function  
> declaration isn’t a prototype
> /usr/local/include/readline/rltypedefs.h:37: warning: function  
> declaration isn’t a prototype
> In file included from bindings/fluid_cmd.c:34:
> /usr/local/include/readline/readline.h:381: warning: function  
> declaration isn’t a prototype
> 
> 
> So I proceed with Qsynth, which also compiles and links,but has  
> immediate fatal error on execution:
> 
> Dyld Error Message:
>    Symbol not found: ___sync_synchronize
>    Referenced from: /gtk/audio-32/lib/libfluidsynth.1.dylib
>    Expected in: flat namespace
> 
>    libfluidsynth Symbol not found: ___sync_synchronize
> 
> (I presume  __sync_fetch_and_add would also not be found if the launch  
> wasn't immediately fatal.)
> So the question is why or where are these symbols/functions missing?

__sync_synchronize() and __sync_fetch_and_add() are GCC built-ins:

http://gcc.gnu.org/onlinedocs/gcc-4.2.4/gcc/Atomic-Builtins.html

FluidSynth relies on glib for these low level functions, and glib probably 
relies on the compiler or system functions, depending on the version, 
configuration settings and platform capabilities.

> (even though they're not, and I thought flat namespace was deprecated  
> or for static only, oh well.
> 
> By the way, exactly what version of Glib is required for Fluid-1.1.5?
> I see that Glib >=2.6.5 is checked, but I had Glib 2.28.8, (from a  
> JHBuild of GTK, way newer than 2.6.5) rejected so I built Glib 2.30,  
> accepted on the PPC and on Snow Leopard, it built Fluid against 2.3.0  
> glib and gthread as I said but Qsynth spit it out. (but not on the  
> PPC, same versions. everything works there.)

Indeed, glib and gthread >= 2.6.5 is the requirement. I am successfully using 
glib-2.26 on a Mac OSX 10.5, and glib-2.24 on a Linux machine. 

I've used on my Mac the following command to configure glib and produce 
universal (i386+ppc) builds:

CFLAGS="-O0 -g -D_POSIX_C_SOURCE=200112L -arch i386 -arch ppc \
  -isysroot /Developer/SDKs/MacOSX10.4u.sdk -I/usr/local/include" \
  LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk \
  -arch i386 -arch ppc -L/usr/local/lib" \
 ./configure --prefix=/usr/local --disable-dependency-tracking 

You probably want to add the "x86_64" architecture, so your arguments would 
include "-arch i386 -arch x86_64", in case you want an universal build.

You also need to install the right packages under /Developer/SDKs/ on your 
build host. The example above was using the "MacOSX10.4u.sdk" (10.4 
universal), in your case, be sure you have installed and referenced the 
correct SDK, like for instance "MacOSX10.5.sdk".

> I'm not sure what to try next, I need to ensure Fluid is working  
> before I build LMMS. I didn't use CMake because I need to force a i386  
> build of everything so that this whole mess will be portable to  
> OSX10.5 32-bit Mac-mini, the iMac defaults to 64-bit and CMake will  
> too, it rejects changes as invalid. Also because I need to steer Fluid  
> to link with the right 32-bit dependancies.
> Perhaps my glib and gthread are too new?

CMake can be used in Mac OSX to build multi-architecture (universal) binaries. 
Just use the right arguments, for instance a 4-way build:

CMAKE_OSX_ARCHITECTURES="ppc;ppc64;i386;x86_64"
CMAKE_OSX_DEPLOYMENT_TARGET="10.5"
CMAKE_OSX_SYSROOT="/Developer/SDKs/MacOSX10.5.sdk"

I recommend you to run the cmake-gui program instead of the command line 
version to save typing errors. It also shows other handy build options, you 
may not be aware of them.

> By the way, I downloaded a few apps that came as a Mac bundle using  
> fluidsynth, unfortunately all of them had a x64_86 or non Jack enabled  
> versions. (jOrgan,VLC), none of the libs I looked at contained
> (from: nm -j libfluidsynth.1.dylib -->
> ___sync_fetch_and_add  or
> ___sync_synchronize
> 
> Well, mine does.
> The only difference in symbols between the two libfluids I built  
> against the same glib and gthread is this:
> 
> iMac i386:
> 26:
> ___stdoutp
> ___sync_fetch_and_add
> ___sync_synchronize
> __fluid_evt_heap_free
> ...
> 737:
> _ftell
> _g_atomic_int_exchange_and_add
> _g_clear_error
> ...
> last:
> _write$UNIX2003
> dyld_stub_binder
> 
> 
> ibook PPC:
> 27:
> ___stdoutp
> __fluid_evt_heap_free
> ...
> 736:
> _ftell
> _g_atomic_int_add
> _g_atomic_int_exchange_and_add
> _g_atomic_int_get
> _g_atomic_int_set
> _g_atomic_pointer_get
> _g_atomic_pointer_set
> _g_clear_error
> ...
> last:
> _write$UNIX2003
> 
> Any ideas would be greatly appreciated.
> Thanks, Josh K
> 
> 
> _______________________________________________
> fluid-dev mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/fluid-dev
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]