[m-rev.] for review: hlc.par.gc with MSVC
Peter Ross
pro at missioncriticalit.com
Sat Oct 26 00:21:36 AEST 2002
Hi,
===================================================================
Estimated hours taken: 5
Branches: main
Get the hlc.par.gc grade compiling with MSVC 7.0.
README.MS-VisualC:
Update the documentation to reflect that we can use MSVC 7.0
as well.
boehm_gc/Mmakefile:
Use a different makefile if we are compiling in a parallel
grade.
boehm_gc/gc.mak:
Update the make file to build libpar_gc.dll instead of gc.dll.
runtime/mercury_builtin_types.c:
One of the header-files imported redefines VOID as void, so
#undef VOID.
Add valid returns to the functions which call MR_fatal_error
so as to stop the C compiler from complaining.
Index: README.MS-VisualC
===================================================================
RCS file: /home/mercury1/repository/mercury/README.MS-VisualC,v
retrieving revision 1.3
diff -u -r1.3 README.MS-VisualC
--- README.MS-VisualC 24 Oct 2002 16:30:29 -0000 1.3
+++ README.MS-VisualC 25 Oct 2002 14:14:54 -0000
@@ -2,10 +2,19 @@
INTRODUCTION
-Mercury is in the process of being ported to use the Microsoft Visual
-C++ 6
-compiler. However not all dependencies on Cygwin have been removed and
-cygwin is still required for installation (see README.MS-Windows).
+Mercury has been ported to use the Microsoft Visual C++ compiler. It
+has been tested with both version 6.0 and 7.0. However not all
+dependencies on Cygwin have been removed and cygwin is still required
+for installation (see README.MS-Windows).
+
+-----------------------------------------------------------------------------
+
+NOTES ABOUT MVSC 7.0
+
+The version of nmake that ships with MSVC 7.0 (Visual Studio.NET) is
+unable to compile the thread version of the Boehm garbage collector.
+You need to find to use the version of nmake which comes with MSVC
+6.0.
-----------------------------------------------------------------------------
@@ -13,10 +22,7 @@
To use MSVC to build the compiler issue the following configure command.
-CC='CL /nologo' CPP='CL /nologo /E' configure
-
-configure defaults to using the hlc.gc grade as this is the only grade
-currently supported.
+CC='CL /nologo' CPP='CL /nologo /E' ./configure
Also ensure that the environment variable TMPDIR points to a valid directory.
@@ -59,8 +65,8 @@
4. make install
DO NOT USE THE SOURCE DISTRIBUTION TO BUILD THE MS-VisualC VERSION OF
-THE COMPILER!! CONFIGURE DOES NOT DETERMINE THAT THE PRE-BUILT C FILES
-ARE INCOMPATIBLE IT JUST TRIES TO USE THEM ANYWAY.
+THE COMPILER!! CONFIGURE DOES NOT DETERMINE THAT THE PRE-BUILT C
+FILES ARE INCOMPATIBLE IT JUST TRIES TO USE THEM ANYWAY.
-----------------------------------------------------------------------------
@@ -88,11 +94,9 @@
NONE.* GRADES
-Are not supported yet! But if they were and you have a file with
-a large
-switch in it you need to pass the following flag to mmc
+The following flag needs to be passed to the compiler, when compiling
+in the none.* grades to avoid a limitation in the C compiler.
--max-jump-table-size 512
-
-----------------------------------------------------------------------------
Index: boehm_gc/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/boehm_gc/Mmakefile,v
retrieving revision 1.23
diff -u -r1.23 Mmakefile
--- boehm_gc/Mmakefile 24 Oct 2002 16:30:32 -0000 1.23
+++ boehm_gc/Mmakefile 25 Oct 2002 14:14:54 -0000
@@ -40,15 +40,23 @@
ifeq ("$(USING_MICROSOFT_CL_COMPILER)", "yes")
+ifeq ("$(GC_GRADE)", "par_gc")
+submake: force
+ MAKEFLAGS=""; export MAKEFLAGS; \
+ nmake -f "gc.mak" CFG="gc - Win32 Release"
+ mv Release/libpar_gc.dll Release/libpar_gc.lib .
+else
submake: force
MAKEFLAGS=""; export MAKEFLAGS; \
nmake -f NT_MAKEFILE nodebug=1 gc.lib; \
cp gc.lib libgc.lib
+endif
clean_local:
- rm -f *.obj gc.lib libgc.$A libpar_gc.$A libpar_gc.dll
+ rm -rf Release/ Debug/
+ rm -f *.obj gc.lib libgc.lib libpar_gc.lib libpar_gc.dll
-else
+else
submake: force
MAKEFLAGS=""; export MAKEFLAGS; \
Index: boehm_gc/gc.mak
===================================================================
RCS file: /home/mercury1/repository/mercury/boehm_gc/gc.mak,v
retrieving revision 1.4
diff -u -r1.4 gc.mak
--- boehm_gc/gc.mak 25 Jul 2002 09:02:46 -0000 1.4
+++ boehm_gc/gc.mak 25 Oct 2002 14:14:57 -0000
@@ -55,7 +55,7 @@
OUTDIR=.\Release
INTDIR=.\Release
-ALL : ".\Release\gc.dll" ".\Release\gc.bsc"
+ALL : ".\Release\libpar_gc.dll" ".\Release\libpar_gc.bsc"
CLEAN :
- at erase ".\Release\allchblk.obj"
@@ -72,12 +72,12 @@
- at erase ".\Release\dyn_load.sbr"
- at erase ".\Release\finalize.obj"
- at erase ".\Release\finalize.sbr"
- - at erase ".\Release\gc.bsc"
+ - at erase ".\Release\libpar_gc.bsc"
- at erase ".\Release\gc_cpp.obj"
- at erase ".\Release\gc_cpp.sbr"
- - at erase ".\Release\gc.dll"
- - at erase ".\Release\gc.exp"
- - at erase ".\Release\gc.lib"
+ - at erase ".\Release\libpar_gc.dll"
+ - at erase ".\Release\libpar_gc.exp"
+ - at erase ".\Release\libpar_gc.lib"
- at erase ".\Release\headers.obj"
- at erase ".\Release\headers.sbr"
- at erase ".\Release\mach_dep.obj"
@@ -149,7 +149,7 @@
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-BSC32_FLAGS=/nologo /o"$(OUTDIR)/gc.bsc"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)/libpar_gc.bsc"
BSC32_SBRS= \
".\Release\allchblk.sbr" \
".\Release\alloc.sbr" \
@@ -175,7 +175,7 @@
".\Release\typd_mlc.sbr" \
".\Release\win32_threads.sbr"
-".\Release\gc.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+".\Release\libpar_gc.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
$(BSC32) @<<
$(BSC32_FLAGS) $(BSC32_SBRS)
<<
@@ -186,8 +186,8 @@
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
odbccp32.lib /nologo /subsystem:windows /dll /incremental:no\
- /pdb:"$(OUTDIR)/gc.pdb" /machine:I386 /out:"$(OUTDIR)/gc.dll"\
- /implib:"$(OUTDIR)/gc.lib"
+ /pdb:"$(OUTDIR)/libpar_gc.pdb" /machine:I386 /out:"$(OUTDIR)/libpar_gc.dll"\
+ /implib:"$(OUTDIR)/libpar_gc.lib"
LINK32_OBJS= \
".\Release\allchblk.obj" \
".\Release\alloc.obj" \
@@ -213,7 +213,7 @@
".\Release\typd_mlc.obj" \
".\Release\win32_threads.obj"
-".\Release\gc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+".\Release\libpar_gc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
@@ -233,7 +233,7 @@
OUTDIR=.\Debug
INTDIR=.\Debug
-ALL : ".\Debug\gc.dll" ".\Debug\gc.bsc"
+ALL : ".\Debug\libpar_gc.dll" ".\Debug\libpar_gc.bsc"
CLEAN :
- at erase ".\Debug\allchblk.obj"
@@ -252,12 +252,12 @@
- at erase ".\Debug\finalize.sbr"
- at erase ".\Debug\gc_cpp.obj"
- at erase ".\Debug\gc_cpp.sbr"
- - at erase ".\Debug\gc.bsc"
- - at erase ".\Debug\gc.dll"
- - at erase ".\Debug\gc.exp"
- - at erase ".\Debug\gc.lib"
- - at erase ".\Debug\gc.map"
- - at erase ".\Debug\gc.pdb"
+ - at erase ".\Debug\libpar_gc.bsc"
+ - at erase ".\Debug\libpar_gc.dll"
+ - at erase ".\Debug\libpar_gc.exp"
+ - at erase ".\Debug\libpar_gc.lib"
+ - at erase ".\Debug\libpar_gc.map"
+ - at erase ".\Debug\libpar_gc.pdb"
- at erase ".\Debug\headers.obj"
- at erase ".\Debug\headers.sbr"
- at erase ".\Debug\mach_dep.obj"
@@ -332,7 +332,7 @@
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-BSC32_FLAGS=/nologo /o"$(OUTDIR)/gc.bsc"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)/libpar_gc.bsc"
BSC32_SBRS= \
".\Debug\allchblk.sbr" \
".\Debug\alloc.sbr" \
@@ -358,7 +358,7 @@
".\Debug\typd_mlc.sbr" \
".\Debug\win32_threads.sbr"
-".\Debug\gc.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+".\Debug\libpar_gc.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
$(BSC32) @<<
$(BSC32_FLAGS) $(BSC32_SBRS)
<<
@@ -369,8 +369,8 @@
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
odbccp32.lib /nologo /subsystem:windows /dll /incremental:no\
- /pdb:"$(OUTDIR)/gc.pdb" /map:"$(INTDIR)/gc.map" /debug /machine:I386\
- /out:"$(OUTDIR)/gc.dll" /implib:"$(OUTDIR)/gc.lib"
+ /pdb:"$(OUTDIR)/libpar_gc.pdb" /map:"$(INTDIR)/libpar_gc.map" /debug /machine:I386\
+ /out:"$(OUTDIR)/libpar_gc.dll" /implib:"$(OUTDIR)/libpar_gc.lib"
LINK32_OBJS= \
".\Debug\allchblk.obj" \
".\Debug\alloc.obj" \
@@ -396,7 +396,7 @@
".\Debug\typd_mlc.obj" \
".\Debug\win32_threads.obj"
-".\Debug\gc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+".\Debug\libpar_gc.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
@@ -477,7 +477,7 @@
/pdb:"$(OUTDIR)/gctest.pdb" /machine:I386 /out:"Release/gctest.exe"
LINK32_OBJS= \
".\gctest\Release\test.obj" \
- ".\Release\gc.lib"
+ ".\Release\libpar_gc.lib"
".\Release\gctest.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
@@ -569,7 +569,7 @@
/pdb:"$(OUTDIR)/gctest.pdb" /map:"$(INTDIR)/gctest.map" /debug /machine:I386\
/out:"Debug/gctest.exe"
LINK32_OBJS= \
- ".\Debug\gc.lib" \
+ ".\Debug\libpar_gc.lib" \
".\gctest\Debug\test.obj"
".\Debug\gctest.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
@@ -658,7 +658,7 @@
".\cord\Release\de.obj" \
".\cord\Release\de_win.obj" \
".\cord\Release\de_win.res" \
- ".\Release\gc.lib"
+ ".\Release\libpar_gc.lib"
".\Release\de.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
@@ -751,7 +751,7 @@
".\cord\Debug\de.obj" \
".\cord\Debug\de_win.obj" \
".\cord\Debug\de_win.res" \
- ".\Debug\gc.lib"
+ ".\Debug\libpar_gc.lib"
".\Debug\de.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
Index: runtime/mercury_builtin_types.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_builtin_types.c,v
retrieving revision 1.3
diff -u -r1.3 mercury_builtin_types.c
--- runtime/mercury_builtin_types.c 22 Aug 2002 06:51:18 -0000 1.3
+++ runtime/mercury_builtin_types.c 25 Oct 2002 14:14:57 -0000
@@ -62,6 +62,8 @@
** Define MR_TypeCtorInfos for the builtin types
*/
+#undef VOID
+
MR_DEFINE_TYPE_CTOR_INFO(builtin, int, 0, INT);
MR_DEFINE_TYPE_CTOR_INFO(builtin, character, 0, CHAR);
MR_DEFINE_TYPE_CTOR_INFO(builtin, string, 0, STRING);
@@ -144,6 +146,8 @@
mercury__builtin____Unify____void_0_0(MR_Void x, MR_Void y)
{
MR_fatal_error("called unify/2 for `void' type");
+
+ return MR_TRUE;
}
MR_bool MR_CALL
@@ -158,24 +162,32 @@
{
MR_fatal_error(
"called unify/2 for `private_builtin:heap_pointer' type");
+
+ return MR_TRUE;
}
MR_bool MR_CALL
mercury__builtin____Unify____func_0_0(MR_Func x, MR_Func y)
{
MR_fatal_error("called unify/2 for `func' type");
+
+ return MR_TRUE;
}
MR_bool MR_CALL
mercury__builtin____Unify____pred_0_0(MR_Pred x, MR_Pred y)
{
MR_fatal_error("called unify/2 for `pred' type");
+
+ return MR_TRUE;
}
MR_bool MR_CALL
mercury__builtin____Unify____tuple_0_0(MR_Tuple x, MR_Tuple y)
{
MR_fatal_error("called unify/2 for `tuple' type");
+
+ return MR_TRUE;
}
MR_bool MR_CALL
@@ -215,6 +227,8 @@
MR_Mercury_TypeClass_Info x, MR_Mercury_TypeClass_Info y)
{
MR_fatal_error("called unify/2 for `typeclass_info' type");
+
+ return MR_TRUE;
}
MR_bool MR_CALL
@@ -223,6 +237,8 @@
MR_Mercury_Base_TypeClass_Info x, MR_Mercury_Base_TypeClass_Info y)
{
MR_SORRY("unify for base_typeclass_info");
+
+ return MR_TRUE;
}
/*---------------------------------------------------------------------------*/
@@ -405,6 +421,8 @@
mercury__builtin__do_unify__void_0_0(MR_Box x, MR_Box y)
{
MR_fatal_error("called unify/2 for `void' type");
+
+ return MR_TRUE;
}
MR_bool MR_CALL
@@ -425,12 +443,16 @@
mercury__builtin__do_unify__func_0_0(MR_Box x, MR_Box y)
{
MR_fatal_error("called unify/2 for `func' type");
+
+ return MR_TRUE;
}
MR_bool MR_CALL
mercury__builtin__do_unify__pred_0_0(MR_Box x, MR_Box y)
{
MR_fatal_error("called unify/2 for `pred' type");
+
+ return MR_TRUE;
}
MR_bool MR_CALL
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list