rda@lemma-one.com wrote:
My first attempt to compile Poly/ML 5.2.1 on Snow Leopard (= MacOS X 10.6) resulted in an error due to a cast of a pointer to an int in libpolyml/x86_dep.cpp. There is a fix for this in the latest source, but the build then falls over as follows:
Rob, I had an email about this from Peter Homeier. Since I don't have access to a machine running this I can't test it directly. My feeling is that it is building the 64-bit version by default. Try grep SIZEOF_VOIDP config.h and see what it says. I have managed to build the 64-bit version on an older version of Mac OS X with the following: ./configure --build=x86_64-darwin CFLAGS='-arch x86_64 -O3' \ CXXFLAGS='-arch x86_64 -O3' CCASFLAGS='-arch x86_64' \ LDFLAGS='-segprot POLY rwx rwx'
This may work on 10.6. If so, some of the arguments may not actually be necessary and I'd like to know exactly which. I would expect that the CFLAGS, CXXFLAGS and CCASFLAGS can all be omitted if it is defaulting to 64-bit anyway. The LDFLAGS wasn't needed for the build itself but without it the resulting poly executable would SEGFAULT as soon as it was run. The problem was that the linker was ignoring the access rights in the object file itself and removing execute permission. This doesn't have any effect in 32-bit mode but in 64-bit mode it seems the processor was respecting the no-execute flag and failing. If this is needed it will have to be provided on any link step with your own code.
It may be possible to force 32-bit mode with ./configure CFLAGS='-arch i386 -O3' CXXFLAGS='-arch i386 -O3' \ CCASFLAGS='-arch i386'
Regards, David