[PD] cyclone-0.1-alpha1, s_loader.c, and MacOSX

Adam T. Lindsay atl at comp.lancs.ac.uk
Thu Nov 21 14:56:03 CET 2002


Krzysztof Czaja said this at Wed, 20 Nov 2002 20:07:48 +0100:

>This is very much an alpha release, to be used by fellow coders,
>or the very brave of all Pdiers.  It is known to crash or behave
>wildly.

Krzysztof,

Well, compilation on Mac OS X went *extremely* easily... absolutely no
code changes necessary, and minimal flag changes in Makefile.common. (I'm
blown away by your build system.) Once I got the libraries to work with
PD (more below), the test patches gave very plausible results (but I
don't know the behavior of the Max objects well enough to verify the mis-
features).

Miller, here's where you come in...

But the test patches didn't work with PD right away. I tried opening
something like Borax-test.pd and crashed with the following result:

 dyld: /usr/local/pd/bin/pd multiple definitions of symbol _hammer_checkint
 ./Borax.pd_darwin definition of _hammer_checkint
 ./funbuff.pd_darwin definition of _hammer_checkint

The same function was included in two externals, and they clobbered each
other when loaded by PD/Mac. Krzysztof, PD/Linux doesn't work that way, right?

Not having a Linux box to compare with, I assumed that this wasn't
supposed to be happening, and rather than trying to figure out how to
package hammer and sickle as libraries, I took a look at s_loader.c. I
poked in a few places, and as a lucky guess, I added the following flag
to line 116 or so in s_loader:
ret = NSLinkModule( image, filename, NSLINKMODULE_OPTION_BINDNOW +
NSLINKMODULE_OPTION_PRIVATE); 

A new PD made from this works well with cyclone. I haven't tested for ill
effects in enough other places yet. A bunch of questions fall out of this:
Is changing PD the right approach in this case?
Is the Linux behavior the one we want to emulate?
Does this screw anything else up?

I've attached my Makefile.darwin (replace Makefile.common in cyclone with
a link to this), in case others want to experiment.

adam

PS. from the Mach-O Runtime Architecture PDF, page 123:
NSLINKMODULE_OPTION_PRIVATE
  Do not add the global symbols from the module to the global
  symbol list. Instead, you must use the NSLookupSymbolInModule
  (page 128) function to obtain symbols from this module.
<http://developer.apple.com/techpubs/macosx/DeveloperTools/MachORuntime/
MachORuntime.pdf>



-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay                      atl at comp.lancs.ac.uk
 Computing Dept, Lancaster University   +44(0)1524/594.537
 Lancaster, LA1 4YR, UK             Fax:+44(0)1524/593.608
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/octet-stream
Size: 8481 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20021121/84fd5d44/attachment.obj>


More information about the Pd-list mailing list