Martin, Martin von Gagern wrote:
Glad to hear there is a new version. I tried to write a gentoo ebuild for this. As the gentoo way is to compile everything from source wherever possible, I tried to use the portable database. readport seemed to work all right, but BuildAll failed almost immediately:
It would be nice to get a package for gentoo but I don't think your approach is the best way to achieve it. There isn't any way to build Poly/ML from source: you need to use a database for the particular architecture if you want a functioning code-generator for that architecture. The "portable" database is really a porting aid to allow Poly/ML to run on a new architecture. It can also be used for architectures where there currently isn't a code-generator. The process of porting then involves writing a code-generator and various machine-dependent modules. Crucially, there is a stage where the run-time system must support both interpreted code and the target machine code with calling between them.
Mapping ./ML_dbase poly: gc.c:477: CopyStackFrame: Assertion `new_stack->p_nreg == 6' failed.
This is the result of running a version of the driver program compiled for the i386 architecture with the portable database. You can make this work by editing the configure script so that it doesn't recognise the architecture you are on and defaults to the portable version.
The mlsource and basis sources are provided for information and for users who want to compile modified versions. Most people would be expected to download the appropriate database and the driver code .
Next I tried to get things working using DB420.i386.unix. Compilation worked all right, but afterwards I got a notice from the Gentoo portage system warning me that the poly binary uses an executable stack. http://www.gentoo.org/proj/en/hardened/gnu-stack.xml As this might cause some trouble in the future, I tried to fix the issue with the attached changes. For i386.unix things worked out, but someone shoult test on other systems and architectures.
Does gentoo report that poly uses an executable stack or that it includes a module with no stack marking? I don't think the Unix stack ever contains code but Poly/ML does run its own stacks within the heap. The heap contains code as well so there may be pages that contain both executable code and stack.
Next question: is it possible to cross-compile polyml? Most Gentoo ebuilds support crosscompilation, although I never did this so far.
No. That would be a lot of work.
I'm also wondering about this interpreted version as a fallback solution. How should I set the CodeCons symlink to get such a version?
The interpreted version is slightly different from the other code-generators. Instead of making a symlink to CodeCons you need to create GCode as a copy of or link to GCode.int. See mlsource/MLCompiler/CodeTree/README.txt .
Is ist correct that in the call "poly ML_dbase < BuildAll.sml" the file ML_dbase does already contain a database which will be overwritten / appended?
Correct.
Is there some way to get a "clean" database without starting from a previous one in the same file?
No.
I think the best solution is to use the existing databases and treat them as architecture-dependent source. You then just compile the driver when doing the installation. There's no need to download "mlsource" or "basis" at all.
Regards, David.