README.MS-VisualC:
When using MSVC as the C compiler and building on MSYS2, the
configuration type must not be "*-pc-msys". (That configuration
type is used for building programs for use with MSYS itself, not
native executables.)
README.MS-VisualC:
Remove reference to the Windows SDK v7.1a, as it is not required
with v7.6.10.
Change the wording about supported CPU architecture with MSVC.
README.CSharp:
README.Java:
The foreign_proc examples here would result in a purity error.
Fix them so they do not.
README.Cygwin:
Update URLs.
README.AIX:
Delete the bit about the -ansi option; we no longer pass that to
the C compiler anyway.
README.MinGW:
README.MS-VisualC:
Fix grammar.
library/getopt.m
library/getopt_io.m:
The first argument of the long_option predicate is a string,
not a character (as the comment in getopt.m as said since
1996!)
README.MS-VisualC:
Fix a doubled-up word.
Fix some problems that were preventing the system from compiling properly with
MSVC.
(1) Visual Studio 2013 no longer includes the files NtWin32.Mak and Win32.Mak
which are required for building the Boehm GC with MSVC. (This appears to be an
issue with upstream Boehm as well.) The workaround here is to reference the
copies of this files included with the Windows 7 SDK. (This appears to be the
official Microsoft workaround for dealing with this problem for now.)
(2) Disable support for `--c-debug' when using MSVC. Using this option causes
MSVC to emit .pdb (Program Data Base), that contain the symbol information for
an object files. This causes a variety of problems:
(i) parallel builds are contending for the vc*.pdb file shared by all the
object files in a directory causing compilation to abort. (Compiling with
the -FS option is another solution to this -- it causes the compiler to
serialize access to the .pdb file -- but at the cost of slowing down
compilation.)
(ii) .pdb files are not cleaned up by realclean; compilation will abort
if a pdb file generated by a different version of MSVC is encountered.
(iii) we don't install the .pdb files alongside the libraries anyway.
This can be a source of linker warnings. (And shutting up the Microsoft
linker seems to be very difficult indeed ...)
(iv) compiling with -Zi (apparently) inhibits some C compiler optimizations.
Compiling with the older -Z7 (MSVC 7 style debugging info) option is another
alternative. Using that option causes MSVC to include symbol information in
the object files, instead of in a separate file.
For now (i.e. the 14.01 release), disabling `--c-debug' for MSVC is the
simplest way of addressing the above issues.
README.MS-VisualC:
Describe the problem with NtWin32.Mak and Visual Studio 2013 and
provide two possible workarounds.
Mention that `--c-debug' is not currently supported with MSVC and how
to re-enable it.
Simplify some of the instructions for setting up the build environment.
configure.ac:
scripts/mgnuc.in:
Disable `--c-debug' with MSVC.
scripts/prepare_install_dir.in:
Copy all makefile fragments for nmake into the boehm_gc directory for
the library grade installation. (This is in case the user copies
NtWin32.Mak etc into the boehm_gc directory as per the second of
the workarounds in README.MS-VisualC.)
slice/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
mfilterjavac/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
Clean up any .pdb files. Note that one is generated for each
executable (regardless of whether -Zi is given to cl or not).
In addition, if -Zi is given to cl, there will be file named
vc<version>.pdb generated (where <version> is the version of MSVC being
used.)
Branches: main, 11.07
Set the host and target environment types at configuration time. By default,
they were both set to "posix" but that is no longer compatible with building
the csharp grade using the Microsoft compiler.
configure.in:
Set the environment type to "cygwin" on Cygwin, to "msys" on MinGW
and to "posix" otherwise. (For Mercury installations that work with
the Windows command interpreter, it will need to be manually set to
"windows".)
scripts/Mercury.config.in:
Set the environment type. (We set the target and host separately
so that is easier for installers to automatically modify this file.)
README.MS-VisualC:
Conform to the above change.
Branches: 11.07, main
Improve and update documentation of the MSVC port.
Add batch files for invoking mdb and mprof; avoid problem with mercury.bat.
README.MS-VisualC:
Rewrite this file, it was very much out-of-date.
The major changes are:
+ we now describe how to set up a Cygwin or MSYS shell
with MSVC available.
+ the source distribution now works with MSVC.
+ a list of the limitations of the MSVC port has been added.
+ a description of how to set up the compiler so that it
works from the Windows command prompt has been added.
scripts/mercury/mercury.bat.in:
Delete support for the MERCURY_COMPILER and MERCURY_CONFIG_DIR
enviorment variables; the handling of them in this batch file
doesn't appear to be portable across different versions of
Windows and it's more important that this file work in the
normal case. (Keeping it simple is the way to ensure this.)
scripts/mdb.bat.in:
scripts/mprof.bat.in:
Templates for invoking mdb and mprof on Windows.
(I'm not sure how to reproduce all the functionality of the mdb
script in a batch file, so the command line options provided by
the mdb script aren't currently replicated here.)
configure.in:
scripts/Mmakefile:
Add the new batch files.
scripts/Mercury.config.in:
Use the Windows-style installation prefix on Cygwin systems.
browser/util.m:
Use the conventional name for the I/O state.
Use don't-care variables for the I/O state in foreign procs.
This avoids suprious warnings from MSVC.
Estimated hours taken: 0.5 (by Jonathan Morgan) + 0.2 (by myself)
Branches: main
README.Cygwin:
Put angle brackets around URLs.
README.Dotnet:
Put angle brackets around URLs and fix inconsistent indentation.
Mention that the IL backend has been tested on .NET 1.1, as well
as 1.0.
Fix the C# foreign_proc example so that it is valid Mercury.
README.MinGW:
README.MS-VisualC:
Mention that the Visual C backend may need the Platform SDK.
Don't be so specific about the Mercury version.
s/ie/i.e./
Estimated hours taken: 2
Branches: main
Allow at configure time to build the compiler so that it uses the MS
Visual C runtime by default.
This is needed here at MC to build some components which require
linking against the MS Visual C runtime versus the standard C runtime.
configure.in:
Add the option --with-msvcrt so that the
scripts/mgnuc.in:
If we wish to use the MS Visual C runtime, then we need to
define GC_NOT_DLL when we are not in a parallel grade, as
otherwise the header files for boehm_gc decide the collector
must've been built as a DLL, which isn't true.
scripts/ml.in:
Pass /MD to the linker so that it links against the MS Visual C
runtime, if required.
README.MS-VisualC:
Document the --with-msvcrt option.
Estimated hours taken: 0.25
Branches: main
Changes suggested by fjh review comments.
README.MS-VisualC:
Document TMPDIR better.
trace/mercury_trace_source.c:
Change the loop counter from int to a long, just in case we
one day target a 16bit system.
Estimated hours taken: 0.25
Branches: main
Avoid a fixed limitation in the MSVC C compiler where switches can
only have a maximum size of 512 branches.
compiler/handle_options.m:
When using MSVC as the C compiler set max_jump_table_size to
be 512.
README.MS-VisualC:
Remove documentation about setting the max_jump_table_size
option as it is now done automatically.
Estimated hours taken: 6
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 and set the environment variable TMP to avoid problems
where nmake can't open a temporary file.
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.
Estimated hours taken: 5
Branches: main
Bootstrap the main branch using the MS Visual C compiler.
README.MS-VisualC:
Document that TMPDIR environment variable needs to be set.
configure.in:
boehm_gc/Mmakefile:
runtime/mercury_conf.h.in:
runtime/mercury_stack_trace.c:
trace/mercury_trace.c:
trace/mercury_trace_internal.c:
trace/mercury_trace_source.c:
trace/mercury_trace_spy.c:
configure.in:
Check for the _snprintf, sleep and Sleep functions and the
windows.h header.
runtime/mercury_conf.h.in:
Add #defines for the _snprintf, sleep and Sleep functions and
windows.h header.
boehm_gc/Mmakefile:
Compile the collector with debugging turned off so that when linking
the debugger with the compiler you don't get duplicate definitions
for the C std lib symbols (the debug versions and the release
versions).
runtime/mercury_stack_trace.c:
trace/mercury_trace_internal.c:
trace/mercury_trace_spy.c:
Use _snprintf if snprintf doesn't exist.
trace/mercury_trace.c:
Report an error if we attempt to use the external debugger when it's
not enabled.
trace/mercury_trace_source.c:
Use the correct version of sleep for the environment that we are
compiling in and if it doesn't exist busy wait for hopefully
long enough.