[MLton-devel] Request for advice for patch: FreeBSD 5.x Support

Jesper Louis Andersen jlouis@mongers.org
Tue, 22 Jul 2003 23:13:40 +0100


I have compiled up a patch which enables MLton to build on FreeBSD 5.x:

(see end of mail for patch)

The first patch applies the flag-changes that has occured with the
change from GCC2.95.x to GCC3.x. Mainly it is just flags that have been
pushed around. What nags me here is that I cannot change it since it
would probably make GCC2.95.x unable to compile the runtime environment.

So my question is: What should we do in order to apply the patch below?
One could make a flag for the compiler type and then supply the correct
flags depending on the compiler type. But I think the approach would
lead to bloat in the Makefile structure. Just applying such cases
headlessly would end up being unmaintainable, so is there a better way
yet, or should the re-ordering be postponed?

The second patch is more fair. FreeBSD5.x sys/resources.h include uses
struct timeval for it's resources. This is defined in sys/time.h but
does not get included by default. It is up to the programmer to include
that file, should he include resources.h. There are 2 scenarios here:
Either all resources implementations use struct timeval and thus they
all also need struct timeval. In that case I request we just include it,
since it would not be an error on other architectures. In the other
case, I suggest we wrap it inside #ifdef __FreeBSD__ or appropriate
define clauses. 

Question: Wrap or leave?

When I have the answers, I will provide the corrected patch to be
included in the CVS tree.

Intermediate patch follows:

diff -ur mlton-cvs/mlton/runtime/Makefile mlton-freebsd5/runtime/Makefile
--- mlton-cvs/mlton/runtime/Makefile	Thu Jun 26 05:28:20 2003
+++ mlton-freebsd5/runtime/Makefile	Tue Jul 22 22:06:45 2003
@@ -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


diff -ur mlton-cvs/mlton/runtime/gc.h mlton-freebsd5/runtime/gc.h
--- mlton-cvs/mlton/runtime/gc.h	Sat Jul 19 03:23:28 2003
+++ mlton-freebsd5/runtime/gc.h	Tue Jul 22 22:09:09 2003
@@ -17,6 +17,7 @@
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <sys/time.h>
 #include <sys/resource.h>
 
 #include "my-lib.h"


-- 
j. 



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel