Rob Arthan wrote:
Matthew, That looks suspiciously like the "execute bit" problem. Did you include -segprot POLY rwx rwx to the linker? See the last line of (the updated) http://www.polyml.org/FAQ.html#standalone
On that point, I recall having some problems caused by using "cc" rather than "c++". Was that an illusion?
I wouldn't have thought that using "cc" rather than "c++" would have an effect on the Bus Error and the fix for it. It would probably simplify finding the C++ libraries.
To just explain: the Bus Error arises because the linker has removed execute permission from the segment containing the code produced by Poly/ML and exported. It is actually exported with read, write and execute permissions set in the Mach-O header but for some reason the Mac OS X linker removes the execute permission unless it's explicitly set with the segprot option. This isn't a problem in 32-bit mode which doesn't seem to enforce execute permission but causes a Bus Error in 64-bit mode. It would probably be better if Poly/ML exported the code as a read/execute "text" segment but the current RTS needs write access in some circumstances.
Regards, David