[MLton] self-compiled mlton on redhat 9

Gerard Milmeister gemi@bluewin.ch
Sun, 02 Nov 2003 13:31:43 +0100


--=-qZSgT69IOK46a3t/HLHG
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

On Sat, 2003-11-01 at 00:19, Stephen Weeks wrote:
> > I would like to create an rpm for Fedora. I installed
> > the binary rpm, and compiled mlton using this and a .spec
> > file from the src rpm, a little adapted along the Fedora 
> > guidelines. Everything seems to work, I can the install the
> > freshly created rpm. But the I want to build it again using
> > the new binary. On the first call mlton grinds to halt, eats
> > all the memory up, but doesn't do anything further.
> > What can be the problem?
> 
> Hi Gerard.  I'm sorry for the delayed reply.  Thanks for looking into
> packaging MLton for Fedora.  We'd love to see MLton get in there.
> 
> Unfortunately, I can't figure out the problem from what you've told
> us.  Here are some questions and things to try.
> 
> How much memory does your machine have?
2.4GHz Pentium with 1GB memory

> What version of MLton were you using?  (20030716 I assume)
that's right
> 
> Does the binary RPM that you built compile anything successfully?
> Could you try it on all the regressions for us?
> 
> Try running the compile with -verbose 3 to see where it hangs.
Ok I let the build run through. It compiles correctly, also all
the regressions.
Here are the times of the complete build:
994.87s user 138.22s system 15% cpu 2:01:49.77 total
That's an awful long time, and as you can see, it spent most of
the time thrashing around, and the computer was quite unresponsive
during the time.
The first patch replaces the -m flags for the gcc compiler with
-f flags. Maybe you should do this in the source distribution.
The second patch replaces verbose 1 with verbose 3. I think this
is a good idea, so that one sees the progress when building the
package.

Ah yes, you should consider using a regular versioning scheme.
As it stands now, the package name using offical Fedora rules
is this: mlton-0.0-0.fdr.1.20030716, and it is quite ugly.

Regards
-- 
Gérard Milmeister
Tannenrauchstrasse 35
8038 Zürich
gemi@bluewin.ch

--=-qZSgT69IOK46a3t/HLHG
Content-Disposition: attachment; filename=mlton.spec
Content-Type: text/plain; name=mlton.spec; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

%define releasedate 20030716

Name: 		mlton
Version: 	0.0
Release: 	0.fdr.1.%{releasedate}
Epoch:		0
Summary:	An optimizing compiler for the Standard ML programming language
Group: 		Development/Languages
License: 	GPL
Source: 	http://www.mlton.org/download/mlton-20030716-1.src.tgz
Patch:		mlton-flags.patch
Patch1:		mlton-verbose.patch
URL: 		http://www.mlton.org/
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:	mlton, gmp-devel >= 0:4.1.2, tetex-latex

%description
MLton is a whole-program optimizing compiler for the Standard ML programming
language.

%prep
%setup -q -n %{name}-%{releasedate}
%patch -p1
%patch1 -p1

%build
make all VERSION=%{releasedate} 

%install
rm -rf ${RPM_BUILD_ROOT}
make install DESTDIR=${RPM_BUILD_ROOT} \
        VERSION=%{releasedate} \
        TMAN=${RPM_BUILD_ROOT}%{_mandir}/man1 \
        TBIN=${RPM_BUILD_ROOT}%{_bindir} \
        TLIB=${RPM_BUILD_ROOT}%{_libdir}/mlton \
        TDOC=`pwd`/docs \

%clean
rm -fr ${RPM_BUILD_ROOT}

%files
%defattr(-,root,root)
%doc docs/*
%{_bindir}/*
%{_mandir}/*
%{_libdir}/mlton

%changelog
* Thu Oct 23 2003 Gerard Milmeister <milmei@ifi.unizh.ch> - 0:0.0-0.fdr.1.20030716
- First Fedora release

--=-qZSgT69IOK46a3t/HLHG
Content-Disposition: attachment; filename=mlton-flags.patch
Content-Type: text/plain; name=mlton-flags.patch; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

--- mlton-20030716/mlton/main/main.sml.flags	2003-10-23 15:55:05.000000000 +0200
+++ mlton-20030716/mlton/main/main.sml	2003-10-23 15:55:53.000000000 +0200
@@ -425,11 +425,11 @@
 	     * Align the start of functions to the next power-of-two greater
 	     * than N, skipping up to N bytes.
 	     *)
-	    "-malign-functions=5",
+	    "-falign-functions=5",
 	    (* Align branch targets to a power-of-two boundary. *)
-	    "-malign-jumps=2",
+	    "-falign-jumps=2",
 	    (* Align loops to a power-of-two boundary. *)
-	    "-malign-loops=2",
+	    "-falign-loops=2",
             (* Assume the defaults for the machine type when scheduling
 	     * instructions.
 	     * pentiumpro is the same as i686.
--- mlton-20030716/runtime/Makefile.flags	2003-10-23 15:51:43.000000000 +0200
+++ mlton-20030716/runtime/Makefile	2003-10-23 16:00:24.000000000 +0200
@@ -12,7 +12,7 @@
 ARCHFLAGS = -fomit-frame-pointer
 
 ifeq ($(HOST_ARCH), x86)
-ARCHFLAGS += -mcpu=pentiumpro -malign-loops=2 -malign-jumps=2 -malign-functions=5
+ARCHFLAGS += -mcpu=pentiumpro -falign-loops=2 -falign-jumps=2 -falign-functions=5
 endif
 ifeq ($(HOST_ARCH), sparc)
 ARCHFLAGS += -Wa,-xarch=v8plusa -fcall-used-g5 -fcall-used-g7 -funroll-all-loops -m32 -mv8 -mcpu=ultrasparc

--=-qZSgT69IOK46a3t/HLHG
Content-Disposition: attachment; filename=mlton-verbose.patch
Content-Type: text/plain; name=mlton-verbose.patch; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

--- mlton-20030716/mlton/Makefile.verbose	2003-11-01 19:58:46.000000000 +0100
+++ mlton-20030716/mlton/Makefile	2003-11-01 19:59:11.000000000 +0100
@@ -23,7 +23,7 @@
 ifeq (old,$(shell PATH=$(BIN):$$PATH; $(MLTON) -v >/dev/null 2>&1 && echo old))
   EXTRA_FLAGS = -v -o $(AOUT)
 else
-  EXTRA_FLAGS = -verbose 1 -output $(AOUT)
+  EXTRA_FLAGS = -verbose 3 -output $(AOUT)
 endif
 
 .PHONY: all

--=-qZSgT69IOK46a3t/HLHG--