[CSOUND-DEV:3308] RE: load_opcodes.c
Date | 2003-11-07 01:58 |
From | "Michael Gogins" |
Subject | [CSOUND-DEV:3308] RE: load_opcodes.c |
I'm sorry, but I have only a little idea what you are saying means - what is the relation of the cmf stuff and mach-o stuff to BSD dlopen and dlsym? ============================================ Michael Gogins gogins at pipeline period com Irreducible Productions Silence, a language for programming music and sound Available at http://sourceforge.net/projects/silencevst/ ============================================ ----- Original Message ----- From: "Matt J. Ingalls" |
Date | 2003-11-07 05:27 |
From | stevenyi |
Subject | [CSOUND-DEV:3309] RE: load_opcodes.c |
Okay, after brushing up a bit with the Apple developer docs, I think I understand the situation with the load_opcodes.c a bit better. Mac has two types of libraries which they prefer to call bundles (they also have Frameworks, which are shared-libs bundled together with header files and docs, and Umbrella Frameworks, which are like bundles of bundles... yikes.) Carbon (cfm) bundles which are OS9 style, and Mach-O which are OSX style (they end in .dylib). Working with .dylibs is largely similar to working with linux .so's (they're built with gnu tools, granted, altered by Mac so that they behave *almost* like gnu stuff would on other platforms... another yikes), but the functions for loading .dylib's differ from BSD dlopen and dlsym. (There's more functions for working with libraries). http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachORuntime/2rt_mach-o_overview/index.html has the Overview information about Mach-O, as well as API reference for dynamic linking functions for dylib loading and symbol lookup. Now, the code from John ffitch and the dlcompat library from opendarwin are pretty much the same thing in that they wrap all of the Apple library loading functions to function like BSD dlopen, dlsym, dlerror. The dlcompat library, if I read correctly, used to be part of fink, which is a system to help port linux apps over to OSX. So, both the code from John ffitch and dlcompat would be used to wrap the Apple mach-o functions so that they can be loaded in a BSD/linux fashion. However, after figuring this all out, it seems that to be more architecturally clean, it would be better to instead of using the dl- wrappers would be to implement the csoundLoadLibrary, csoundCloseLibrary, and csoundGetLibrarySymbol directly for MACOSX, instead of reusing the Linux implementation of those functions. This would be for architectural clarity. It'd probably be easier to use the dlcompat stuff or figure out what's not working from what I copied over from John's file. Either way, reading through Apple's maze of Mach-O documentation has gotten me quite spun around. Will have to give it another go tomorrow or on the weekend! steven On Thu, 2003-11-06 at 17:58, Michael Gogins wrote: > I'm sorry, but I have only a little idea what you are saying means - what is > the relation of the cmf stuff and mach-o stuff to BSD dlopen and dlsym? |
Date | 2003-11-07 17:43 |
From | "Matt J. Ingalls" |
Subject | [CSOUND-DEV:3313] RE: load_opcodes.c |
as far as i remember the bundle stuff is simply just like michael's in the api, FindBundle(), LoadBundle(), FindFunction(), etc.. although as far as implementation, i think the linux code would be fine if it works, the only thing i would be concerned with is how the plugins would appear on the mac -- maybe its not really a problem, but was thinking a bundle is more "maclike" , i guess the bigger issue is where to put them? -m [will get more into this discussions/list/csound5 once im done with movinghell and get dsl back..] On Thu, 6 Nov 2003, stevenyi wrote: > Okay, after brushing up a bit with the Apple developer docs, I think I > understand the situation with the load_opcodes.c a bit better. > > Mac has two types of libraries which they prefer to call bundles (they > also have Frameworks, which are shared-libs bundled together with header > files and docs, and Umbrella Frameworks, which are like bundles of > bundles... yikes.) Carbon (cfm) bundles which are OS9 style, and Mach-O > which are OSX style (they end in .dylib). Working with .dylibs is > largely similar to working with linux .so's (they're built with gnu > tools, granted, altered by Mac so that they behave *almost* like gnu > stuff would on other platforms... another yikes), but the functions for > loading .dylib's differ from BSD dlopen and dlsym. (There's more > functions for working with libraries). > > http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachORuntime/2rt_mach-o_overview/index.html > > has the Overview information about Mach-O, as well as API reference for > dynamic linking functions for dylib loading and symbol lookup. > > Now, the code from John ffitch and the dlcompat library from opendarwin > are pretty much the same thing in that they wrap all of the Apple > library loading functions to function like BSD dlopen, dlsym, dlerror. > The dlcompat library, if I read correctly, used to be part of fink, > which is a system to help port linux apps over to OSX. So, both the > code from John ffitch and dlcompat would be used to wrap the Apple > mach-o functions so that they can be loaded in a BSD/linux fashion. > > However, after figuring this all out, it seems that to be more > architecturally clean, it would be better to instead of using the dl- > wrappers would be to implement the csoundLoadLibrary, > csoundCloseLibrary, and csoundGetLibrarySymbol directly for MACOSX, > instead of reusing the Linux implementation of those functions. This > would be for architectural clarity. It'd probably be easier to use the > dlcompat stuff or figure out what's not working from what I copied over > from John's file. > > Either way, reading through Apple's maze of Mach-O documentation has > gotten me quite spun around. Will have to give it another go tomorrow > or on the weekend! > > steven > > > > On Thu, 2003-11-06 at 17:58, Michael Gogins wrote: > > I'm sorry, but I have only a little idea what you are saying means - what is > > the relation of the cmf stuff and mach-o stuff to BSD dlopen and dlsym? > > |
Date | 2003-11-08 03:24 |
From | stevenyi |
Subject | [CSOUND-DEV:3314] RE: load_opcodes.c |
Hi All, I modified the ffitch OSX code a little bit (mostly just renamed the functions to adhere to the CsoundAPI names of csoundLoadLibrary, etc. as well as changed argument names to match the other implementations), #included the missing mach-o/dyld.h file, and moved some common headers out to the top. load_opcodes.c now compiles fine for OSX, though I haven't tested it as I got some errors in the linking stage for csound. I looked at code from PD for how it loads libraries and it uses the same mach-o library loading code (pretty much) as dlcompat and ffitch's code. Will try to finish getting past linking later this weekend and test out some opcode libs! steven On Fri, 2003-11-07 at 09:43, Matt J. Ingalls wrote: > as far as i remember the bundle stuff is simply just like michael's in the > api, FindBundle(), LoadBundle(), FindFunction(), etc.. > > although as far as implementation, i think the linux code would be fine if > it works, the only thing i would be concerned with is how the plugins > would appear on the mac -- maybe its not really a problem, but was > thinking a bundle is more "maclike" , i guess the bigger issue is where to > put them? > > -m [will get more into this discussions/list/csound5 once im done > with movinghell and get dsl back..] |
Date | 2003-11-12 19:15 |
From | "Matt J. Ingalls" |
Subject | [CSOUND-DEV:3316] RE: load_opcodes.c |
> bundles... yikes.) Carbon (cfm) bundles which are OS9 style, and Mach-O > which are OSX style (they end in .dylib). Working with .dylibs is cant you have mach-o .bundles too? |
Date | 2003-11-15 00:15 |
From | steven |
Subject | [CSOUND-DEV:3321] RE: load_opcodes.c |
Yeah, I think I was getting mixed up in terminology. I think this is what tripped me up: * Bundles are executable files that your program can load at runtime using dynamic linking functions. Bundles implement plug-in functionality, such as file format importers for a word processor. The term “bundle ” has two related meanings in Mac OS X: o the actual Mach-O file containing the executable code o a file package—a folder containing the Mach-O bundle file and associated resources. A file package bundle need not contain a Mach-O bundle file. The latter usage is the more common. However, unless otherwise specified, this book refers to the former. which, like most of the apple dev docs, continues to obfuscate everything in my head. =o steven Matt J. Ingalls wrote: >>bundles... yikes.) Carbon (cfm) bundles which are OS9 style, and Mach-O >>which are OSX style (they end in .dylib). Working with .dylibs is >> >> > >cant you have mach-o .bundles too? > > > > > |
Date | 2003-11-17 19:31 |
From | Anthony Kozar |
Subject | [CSOUND-DEV:3367] RE: load_opcodes.c |
On 11/6/03 8:25 PM, Matt J. Ingalls |