Estimated hours taken: 0.25
Enable the options --c-flag-to-name-object-file and --object-file-extension.
These changes are tagged with bootstrap_20000707_obj_ext.
configure.in:
The bootstrap compiler is only recent enough if it accepts the
--object-file-extension flag.
scripts/mmc.in:
Used the autoconfed values to set -c-flag-to-name-object-file and
--object-file-extension defaults.
Estimated hours taken: 8
When generating the .dv and .dep files use autoconfed settings for
such things as: object and library file extensions, and how to create a
library. Change the compiler Mmakefiles to handle files with the new
extensions.
compiler/modules.m:
When generating the '.dv' and '.dep' files use '.$O' and '.$A'
instead of '.o' and '.a'. Use $EXT_FOR_EXE when generating the
realclean target, as you need to pass the full file name to rm.
Use $AR_LIBFILE_OPT when creating libraries.
scripts/Mmake.vars.in:
Set the value EXT_FOR_EXE, which is the extension which must be
placed on executables.
Mmakefile:
library/Mmakefile:
runtime/Mmakefile:
scripts/Mmake.rules:
tools/bootcheck:
trace/Mmakefile:
Use '.$O' for '.o' and '.$A' for '.a'.
util/Mmakefile:
You need to remove PROGFILENAMES not PROGS, as PROGFILENAMES
includes the executable extension.
Estimated hours taken: 0.1
mmc.in:
We cannot just comment out the --c-flag-to-name-object-file and
--object-file-extension flags, as that destroys the line
continuations. Instead remove the options from inside the execs,
and leave them with a comment that they need to enabled when a
compiler that understands these flags bootstraps.
Estimated hours taken: 0.1
scripts/mmc.in:
Fix a bootstraping problem, the options --c-flag-to-name-object-file
and --object-file-extension can't be set by the mmc.in script until
a compiler exists that recognises them, so comment them out. The
defaults for these flags are the unix flags.
Estimated hours taken: 16
Changes needed to get
mmc --grade hlc.gc file.m
producing an executable, using MSVC as the compiler.
compiler/options.m:
Add the flags --c-flag-to-name-object-file and
--object-file-extension. --c-flag-to-name-object-file is the flag
the C compiler uses to name object files (ie -o for gcc, /Fo for
MSVC). --object-file-extension is the extension used by object
files on the current system.
compiler/mercury_compile.m:
Use the values of --c-flag-to-name-object-file and
--object-file-extension to generate the command line to compile
C files.
scripts/mmc.in:
Set the default values of the two new flags from the autoconfed
settings.
configure.in:
Set the value for CYGPATH, a utility which transforms between unix
and window paths. This is just echo under unix.
scripts/ml.in:
Use the autoconfed extension for the library files.
Use the autoconfed flag to add a path to list of directories to be
searched for libraries.
Make static libraries the default on cygwin systems.
Factor out the code which determines all the flags to be passed to
the linker.
Add an autoconfed variable LINK_OPT_SET which is the flag used to
indicate that all the options following this flag are to be passed
on to the linker.
Use the autoconfed setting for CYGPATH to transform the path to
static libraries into the correct format.
Estimated hours taken: 0.25
compiler/llds_out.m:
Document output_c_file_intro_and_grade in the interface.
compiler/mlds_to_c.m:
Document that ANSI/ISO C doesn't support empty arrays and
structures, so the handling of them by mlds_to_c may not be
correct.
s/NULL/0/ when initializing empty arrays, to make it more likely
that the C compiler will accept the initialization.
compiler/passes_aux.m:
In invoke_shell_command call sh instead of bash.
scripts/mgnuc.in:
Use the value of $COMPILER instead of $CC when determining the C
compiler.
Estimated hours taken: 0.1
Fix a bug on dec-alpha-osf3.2 where
mgnuc -c mercury_accurate_gc.c -omercury_accurate_gc.c
gives the error
mips-tfile:mercury_accurate_gc.o: No such file or directory
configure.in:
Set OBJFILE_OPT to be "-o " on unix systems. Note the trailing
space.
scripts/Mmake.vars.in:
Quote OBJFILE_OPT to ensure that the trailing space is preserved.
Estimated hours taken: 2
Name library files with the default extension for the system used.
Mmake.common.in:
Record the default extension for library files.
Add the variable BOEHMGC_MAKEFILE only needed for building the
compiler.
scripts/Mmake.vars.in:
Delete BOEHMGC_MAKEFILE as it is only needed for building the
compiler.
configure.in:
Define the default for EXT_FOR_SHARED_LIB to be the extension
for libraries defined in Mmake.common.
boehm_gc/NT_MAKEFILE:
Use .lib instead of .a, seeing we only use this Makefile for
building the library on win32 systems.
Mmakefile:
boehm_gc/Mmakefile:
browser/Mmakefile:
compiler/Mmakefile:
library/Mmakefile:
runtime/Mmakefile:
trace/Mmakefile:
Use the variable defined in Mmake.common for the extension of
library files.
Estimated hours taken: 40
Allow compilation of the mercury compiler *ONLY* in the grade hlc.gc
using the Microsoft Visual C++ compiler (MSVC). This is still
work-in-progress.
configure.in:
Test to see whether or not we are using the Microsoft compiler.
Don't fail if we can't interpret return values from system.
boehm_gc/Mmakefile:
Use NT_MAKEFILE if we are using MSVC.
boehm_gc/NT_MAKEFILE:
Apply the the changes to boehm_gc/Makefile to this file.
browser/Mmakefile:
library/Mmakefile:
runtime/Mmakefile:
trace/Mmakefile:
Use the correct executable to create libraries.
Use AR_LIBFILE_OPT to name the library.
compiler/llds_out.m:
Export output_c_file_intro_and_grade so that the correct header can
be placed at the start of each C file.
compiler/mlds_to_c.m:
Output the header at the start of each C file, so that configure
doesn't delete the file when checking the compatability with
the configured settings.
When initializing empty arrays place a dummy entry in the array, so
that the MSVC compiler generates a symbol for that array.
compiler/passes_aux.m:
Add invoke_shell_command. This predicate wraps commands with
a bash -c 'command ' when shell scripts aren't supported by the
target system.
compiler/mercury_compile.m:
compiler/modules.m:
Use invoke_shell_command instead of invoke_system_command for shell
scripts.
library/io.m:
Call _unlink in io_rename_file, when compiling with MSVC.
runtime/mercury_wrapper.c:
Initialise MR_runqueue_head so that the segment containing this
variable is registered with the garbage collector. This stops
intermittent failures of the GC_is_visible() test.
runtime/mercury_conf.h.in:
Define MR_WIN32 when we are using MSVC.
runtime/mercury_memory.c:
runtime/mercury_memory_handlers.c:
runtime/mercury_memory_zones.c:
runtime/mercury_prof.c:
runtime/mercury_reg_workarounds.c:
runtime/mercury_reg_workarounds.h:
runtime/mercury_signal.c:
runtime/mercury_timing.c:
runtime/mercury_timing.h:
runtime/mercury_trace_base.c:
util/mkinit.c:
Only include unistd.h and sys/times.h when they exist.
MSVC doesn't have SIGBUS so #ifdef sections which refer to it.
scripts/Mmake.rules:
Use /Fo instead of -o to generate .o files if compiling with MSVC.
scripts/Mmake.vars.in:
Define AR to use the autoconfed executable for linking.
scripts/mgnuc.in:
Only add option -Wno-uninitialized if we are using gcc.
util/Mmakefile:
Explicitly locate the getopt src, and use it in compiling the
utilities.
Estimated hours taken: 1
compiler/options.m:
doc/user_guide.texi:
scripts/init_grade_options.sh-subr:
Document the -H and --high-level-code options and the
associated `hlc' grade.
NEWS:
Document the MLDS back-end.
HISTORY:
Add a section on "MLDS back-end history".
Estimated hours taken: 0.25
Mmakefile:
scripts/Mmake.rules:
In the rule for `install_grades', invoke `install_hdrs',
so that we install the header files too, not just the
`.a' and `.so' files. This is needed for MLDS grades.
Estimated hours taken: 0.1
scripts/Mmake.rules:
Fix a bug in Fergus' last change which broke the
`lib%.install_grades' target. Run `mmake <module>.depend'
rather than `mmake lib<module>.depend'.
Estimated hours taken: 3
Change the Mmake rules for `mmake install' so that they install the
compiler-generated header files for MLDS grades.
compiler/modules.m:
Generate a new rule for `lib<module>.install_hdrs' in the `.dep' files.
If --high-level-code is enabled, this rule installs the header
files, otherwise it does nothing.
scripts/Mmake.rules:
Make `lib<module>.install' depend on `lib<module>.install_hdrs'.
library/Mmakefile:
- Override the default definition of `mercury.hs', so that
the header file names include the `mercury.' prefix that
the MLDS back-end uses for header files in the standard library.
- Simplify the code by using the automatically generated rule for
`liblibrary.install_ints' rather than hand-coding it, and by
using `install_lib_dirs' and `install_grade_dirs' (which
are defined by scripts/Mmake.rules) rather than hand-coding
a rule for `install_dirs'.
Mmakefile:
scripts/Mmake.rules:
scripts/mercury_cleanup_install:
In the rules for `mmake install_grades', make sure to move
the `.h' and `.dep' files out of the way too, like we do for the
`.c', `.o', etc. files, since the contents of the `.h' and `.dep'
files now depend on the grade.
Estimated hours taken: 0.25
scripts/c2init.in:
Fix a bug in the handling of the `--aditi' option -- it was
performing a shift even though `--aditi' does not take an
argument.
Estimated hours taken: 1
Modify the Mmake rules to install libraries so that the user can
specify commands to copy files and make directories. This is useful
if the user wants more control over the ownership and permissions of
the created files and directories.
scripts/Mmake.rules:
compiler/modules.m:
Use $(INSTALL) to copy a file into its installed location.
Use $(INSTALL_MKDIR) to create directories.
scripts/Mmake.vars.in:
Set the default value of INSTALL to `cp' and
INSTALL_MKDIR to `mkdir -p'.
doc/user_guide.texi:
Document the new Mmake variables.
Estimated hours taken: 6
More work on the MLDS back-end.
runtime/mercury.c:
Fix a cut-and-paste bug in the code for compare/3:
I forgot to add `break' after each case of a `switch' statement.
library/builtin.m:
library/private_builtin.m:
Replace the hand-coded definition of builtin_{compare,unify}_pred
in builtin.m with ordinary Mercury clauses in private_builtin.m.
This ensures that it works with the MLDS back-end.
(It also means that these procedures call error/1 rather than
MR_fatal_error(), so you get an exception rather than a
program abort.)
runtime/mercury.h:
runtime/mercury.c:
Add declarations and definitions of the compare and unify
procedures for the builtin types. (For some types,
the definitions here are still just stubs.)
runtime/mercury.h:
runtime/mercury.c:
runtime/mercury_init.h:
Add some hacks to work-around the current lack of support
for `pragma export'.
runtime/mercury_type_info.c:
If MR_HIGHLEVEL_CODE is defined, don't #include "mercury_imp.h",
since it is not needed.
runtime/mercury_wrapper.c:
runtime/mercury_wrapper.h:
runtime/mercury_init.h:
util/mkinit.c:
scripts/c2init.in:
Add support for the MLDS back-end to the program start-up
code.
Estimated hours taken: 1
Some fixes to the Mmake auto-dependency support for
the MLDS back-end.
scripts/Mmake.rules:
When creating the dependencies, pass $(ALL_GRADEFLAGS) to mmc,
since the `--high-level-code' option, which is a grade option
(it corresponds to the `hlc' base grade) affects the dependencies.
compiler/mlds_to_c.m:
Put the `#include' statements in the `.c' files rather than
in the `.h' files.
Estimated hours taken: 1
Add some options to ml for use in linking programs which use Aditi.
The Aditi API library uses threads internally, so programs which use
it must link with the thread libraries.
scripts/ml.in:
Add option `--use-thread-libs' to link with the thread libraries
when the Mercury code doesn't use coroutining/parallelism,
but a C library does.
For DEC OSF/1 use `-lpthreads -lmach -lc_r' to link in the threads
libraries.
Estimated hours taken: 1
Fix a bug where tools/bootcheck was failing the
tests/hard_coded/split_c_files test case.
scripts/mmc.in:
Add a new environment variable MERCURY_MC_ALL_C_INCL_DIRS
which can be used to override MERCURY_C_INCL_DIR;
it is similar to the MERCURY_ALL_C_INCL_DIRS used by mgnuc,
except that it should contain `--c-include-directory' options
rather than `-I' options.
tools/bootcheck:
Pass down MERCURY_MC_ALL_C_INCL_DIRS,
just like the way we pass down MERCURY_ALL_C_INCL_DIRS.
Estimated hours taken: 0.75
Fix some bugs in the MLDS back-end support.
scripts/parse_grade_options.sh-subr:
Fix a bug: s/high_level/highlevel/g
scripts/final_grade_options.sh-subr:
Ensure that --high-level-code disables the use of the low-level
gcc extensions, as is done in compiler/handle_options.m.
Estimated hours taken: 0.25
scripts/Mmakefile:
Fix a permissions problem: don't fail if `chmod u+w' fails.
That can happen even if the file is writable, if you don't
own it; if the failure is really going to cause a problem
then the problem will be detected when we try to write
to the file (e.g. next time it is installed).
Estimated hours taken: 3
Added some extra dependencies to the generated `.d' files, so that local
`.int', `.opt', etc. files shadow the installed versions properly (e.g. for
when you're trying to build a new version of an installed library).
This saves the user from having to add these explicitly if they have
multiple libraries installed in the same installation hierarchy which
aren't independent (e.g. one uses another).
This change is necessary due to the way the combination of search paths
and pattern rules works in Make.
compiler/modules.m:
Generate the extra dependencies when writing `.d' files.
scripts/Mmake.rules:
Deleted some obsoleted dependency rules.
Estimated hours taken: 0.75
scripts/mtags:
Handle module qualifiers properly: module-qualify all symbols, and then
output tags for the fully module-qualified version and also for any
partially qualified or unqualified versions of each symbol.
Estimated hours taken: 3
Implement new grades and options for the MLDS back-end.
compiler/options.m:
Rename --highlevel-c as --highlevel-code.
Add new option --highlevel-data.
compiler/mercury_compile.m:
scripts/mgnuc.in:
Convert the grade options --highlevel-code,
--highlevel-data, and --gcc-nested-functions
into C flags -DMR_HIGHLEVEL_CODE, -DMR_HIGHLEVEL_DATA,
and -DMR_USE_GCC_NESTED_FUNCTIONS respectively.
compiler/handle_options.m:
scripts/parse_grade_options.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/final_grade_options.sh-subr:
scripts/ml.in:
Add new grades `hl', `hlc', `hl_nest', and `hlc_nest'.
Add code to handle the new options and grades.
scripts/ml.in:
If --high-level-code is set, then don't invoke the
demangler, since it doesn't (yet) understand the new
name mangling scheme.
Estimated hours taken: 24
Ensure that the none.gc and none grades compile using a compiler
other than gcc. This is not completely tested as lcc on linux can't
generate code for boehm_gc, and 'cc -std1' on the alpha runs out of
memory while trying to link the compiler. However the compiler does
bootstrap using just gcc and also with lcc with boehm_gc compiled by
gcc.
configure.in:
-Wl,opt1,opt2 syntax is not supported by lcc instead use -Wlopt1
-Wopt2.
compiler/export.m:
Only output a label declaration if that label is exported, as the
static label declarations are not legal C.
library/io.m:
compiler/stack_layout.m:
Replace escape sequence \x with \\x in pragma c code.
library/array.m:
library/std_util.m:
Define what the struct is before using it, so the correct size for the
struct can be calculated.
library/private_builtin.m:
Replace escape sequence \x with \\x in pragma c code.
Ensure that there is at least one local variable so that the
structure definition for holding the local vars contains something.
runtime/mercury_faultaddr.h:
Remove an unnecessary cast.
runtime/mercury_reg_workarounds.h:
#include sys/time.h for FD_ZERO().
runtime/mercury_stack_trace.h:
Remove an extraneous ',' which was causing warnings.
Estimated hours taken: 0.25
Fix a problem reported by Luke Evans <Luke.Evans@seagatesoftware.com>.
scripts/Mmakefile:
Make sure that we make the previously installed mdbrc
(if any) writable before trying to install the new mdbrc.
Estimated hours taken: 0.75
Fix a problem where `ml --shared' was trying to create a so_locations
file in `../so_locations'; that is ugly, and causes trouble if the
parent directory is not writable, for example.
configure.in:
Mmake.common.in:
Add a new variable SO_LOCATIONS_DIR, defined (for compilation
of the Mercury compiler itself) as equal to $(MERCURY_DIR),
which is the root of the Mercury source distribution tree.
Change the definition of LINK_SHARED_OBJECT so that it uses
that variable rather than hard-coding `../'.
This required splitting LINK_SHARED_OBJECT into two variables,
one for Mmake and one for Bourne shell, since the two languages
have different syntaxes for referencing variables.
scripts/ml.in:
Use LINK_SHARED_OBJECT_SH rather than LINK_SHARED_OBJECT.
bindist/bindist.configure.in:
bindist/bindist.build_vars.in:
Pass down the value of the new LINK_SHARED_OBJECT_SH variable.
Estimated hours taken: 6
Improve the Emacs mdb interface, in particular by using
the new mdb line number support.
scripts/gud.el:
Find the source location by parse the line numbers that mdb
prints, rather than using tags to find the current source
location.
Add support for setting a breakpoint on the current line.
Also add a few other commands to the MDB menu, in particular
the commands for interactive queries and a command to list
all the current aliases.
Ensure that the program execution buffer is displayed
when you start, so that if you type the wrong command name,
the error message is visible rather than in a buffer that
is not displayed.
Estimated hours taken: 0.5
scripts/gud.el:
Fix a bug: the code was depending on the `first' and `second'
functions, which are defined only if you load the `viper'
package. The fix is to use `car' and `cdr' instead.
Estimated hours taken: 0.5
scripts/ml.in:
Wait for the demangler to exit before exiting.
This avoids confusing output when `mmake' exits before
the demangler has finished its output.
Estimated hours taken: 5
Fix potential problems with the way we were handling grade components: the
places that know about grade components were not being kept totally in sync.
This change fixes previous damage and aims to prevent future damage.
The file runtime/mercury_grade.h contains a list of all the files in the
compiler that know about grade components. All these files now process the
grade components in the same order, so that they can be checked for consistency
more easily.
runtime/mercury_grade.h:
Add the list.
runtime/mercury_conf_param.h:
Remove a comment about an obsolete grade component.
scripts/init_grade_options.sh-subr:
Remove initializations of variables that do not correspond to grade
components, add missing initializations of shell variables that do
correspond to grade components, and concentrate the grade options
component of usage messages here, to prevent double maintenance.
Update list of user scripts.
scripts/final_grade_options.sh-subr:
Add missing initializations in processing the --grade superoption.
Standardize the order of processing options, and the indentation.
Update list of user scripts.
scripts/c2init.in:
Take the usage message for grade component options from
init_grade_options.sh-subr.
scripts/mgnuc.in:
Take the usage message for grade component options from
init_grade_options.sh-subr.
Standardize the order of processing grade options, and separate the
processing of grade options and non-grade options.
scripts/ml.in:
Take the usage message for grade component options from
init_grade_options.sh-subr.
Standardize the order of processing grade options. Process some missing
ones.
compiler/handle_options.m:
Standardize the order of processing grade options.
Remove code to handle an obsolete grade component.
Estimated hours taken: 0.75
configure.in:
Check for -lnsl, since on i386-pc-solaris2.7 that is needed
for the socket stuff.
scripts/ml.in:
Link with -lnsl if necessary.
Estimated hours taken: 0.25
scripts/ml.in:
Pass the new `--explain-link-errors' option to mdemangle.
This may cause bootstrapping problems if you try to compile
with a version of `mdemangle' that doesn't support that option.
So I've tagged the old version of scripts/ml.in with the tag
`bootstrap_19991029_mdemangle' to make bootstrapping easier.
Estimated hours taken: 0.1
scripts/Mmake.rules:
Minor efficiency improvment in the rules for *.install and
*.install_grades: use `{ ...; }' rather than `( ... )', to
avoid creating unnecessary processes.
Estimated hours taken: 30
Added built-in mmake support for installing user libraries.
Mmake.common.in:
Moved the definitions of many of the generic install directories
(plus FULLARCH and LIBGRADES) to scripts/Mmake.vars.in, so they
can be used for things other than just the Mercury compiler.
compiler/modules.m:
Added code to generate appropriate lib<module>.install* targets.
Improved the dependency list generated for the lib<module> target to
include intermodule optimisation files if and only if the
appropriate flags have been set (previously it always depended on
the `.opt' files, but never on the `.trans_opt' files).
scripts/Mmake.rules:
Added some rules for use when installing libraries.
scripts/Mmake.vars.in:
Added the definitions of many of the generic install directories
(plus FULLARCH and LIBGRADES) from Mmake.common.in.
Added support for overriding and/or adding to the definition of
LIBGRADES on a per-library basis.
scripts/mercury_cleanup_install:
New script, for cleaning up after failed installs.
scripts/Mmakefile:
Added `mercury_cleanup_install' to the list of scripts to be
installed.
bindist/Mmakefile:
bindist/bindist.Makefile.in:
Added `mercury_cleanup_install' and `vpath_find' to the list of
utilities included in and installed by a binary distribution. These
are used by some of the install targets.
doc/user_guide.texi:
Documented the new features.
extras/references/Mmakefile:
extras/references/samples/Mmakefile:
Changed to exploit/test new features.
Estimated hours taken: 0.5
Fix a problem where the test cases were sometimes failing
if old /tmp/mmake* directories were left lying around.
scripts/ml.in:
scripts/mmake.in:
When creating the temporary directory, if mkdir fails (e.g.
because that directory already exists), then try again with a
different directory name. Only report an error if it fails 20
times in a row.
Estimated hours taken: 0.25
scripts/ml.in:
Undo a previous change: don't pass --explain-link-errors to
$MDEMANGLE yet, since it causes bootstrapping problems.
Estimated hours taken: 1
Improve the error messages for linking objects compiled in different grades.
util/mdemangle.c:
Check for `MR_grade_*' and `MR_runtime_grade', and if they are
found, print out a message explaining the cause of the problem.
But only do that if a new option `--explain-link-errors' is set,
so that this message will only come out when you get a message
from the linker, not when you invoke mdemangle manually e.g.
via `nm *.o | mdemangle'.
scripts/ml.in:
Pass the new `--explain-link-errors' option to mdemangle.
Estimated hours taken: 0.75
Mmakefile:
*/Mmakefile:
*/*/Mmakefile:
*/*/*/Mmakefile:
Use `clean_local' instead of `clean' and `realclean_local' instead
of `realclean' where appropriate. This is necessary now that
`realclean' does not depend on `clean'.