The main objective of this change is to get bootchecks in the csharp
and java grades to actually build the slice, profiler, deep_profiler
and mfilterjavac directories, which (due to the bug this diff fixes)
they weren't doing before.
However, since one side effect of this change is to eliminate
one source of annoying warnings from mmake about references to undefined
variables, a subsidiary objective is to eliminate other sources of such
warnings as well, which mostly come from the rules for making tags files.
browser/Mmakefile:
deep_profiler/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
When creating stage 3, the bootcheck builds, in each directory,
only the files that it wants to compare against their stage 2 versions.
This means that it wants to build all the .c, .cs or .java files,
which it does via the cs, css and javas mmake targets.
The correct definitions of the rules of these targets depends on
whether mmc --make is being used or not, so we need at least two
sets of definitions: one for mmc --make, and for no mmc --make,
and conditionally selecting the appropriate one. The latter definition
has the problem that it refers to mmake variables that are intended
to be defined in .dv files created by mmc --generate-dependencies,
but until that has been run, those mmake variables are undefined.
Until now, the only directories that had both the mmc --make
and the no mmc --make definitions were the ones needed to build
the compiler. Bootchecks in the csharp and java grades, which
always use --make make, got errors when they tried to build
the directories that bootcheck builds after the compiler:
the slice, profiler, deep_prof and mfilterjavac directories.
This diff ensures that all directories we build in bootcheck
get all both versions of the os, cs, css, and javas targets.
In fact, they get two subversions of the no mmc --make version:
one for use in the presence of .dv files, and one for use in their
absence. The latter just builds the .dv files and invokes mmake
again. This avoids one source of warnings about undefined mmake
variables.
To avoid another source, make the rules for tags files and their
proxies depends on *.m instead of mmake variables such as $(mcov.ms),
since this makes sense even before making dependencies. The only price
is that any untracked Mercury source files in the directory have to
either be given some other suffix, or moved somewhere else.
Where relevant, make the mtags invocation prefer the master versions
of files that are copied from the mdbcomp directory to other directories,
since this is the only writeable version.
Make the os and cs rules consistently NOT build the _init.[co] files.
The way we use those files in bootcheck, we never need them;
when we need them, the right target to give is the executable anyway.
In the slice directory, don't put mcov between mtc_union and mtc_diff.
Eliminate unnecessary duplication, e.g. of sources in rules.
Eliminate double negatives in conditionals.
Fix formatting.
Mmake.common.in:
bindist/Mmakefile:
bytecode/Mmakefile:
compiler/Mmakefile:
doc/Mmakefile:
grade_lib/Mmakefile:
robdd/Mmakefile:
samples/Mmakefile:
scripts/Mmakefile:
tools/Mmakefile:
trace/Mmakefile:
util/Mmakefile:
Add "ft=make" to vim modelines. This is redundant for the files whose
names is Mmakefile, but it is needed for Mmake.common.
tools/bootcheck:
Build the deep_profiler and mfilterjavac directories in stage 2.
Build the slice, profiler, deep_profiler and mfilterjavac directories
in stage 3. (We already used to build slice and profiler in stage 2.)
Compare target language files in the stage 2 and stage 3 versions
of the slice, profiler, deep_profiler and mfilterjavac directories,
to make bootcheck a tougher test. This requires copying these directories
to stage 3, instead of just linking them.
Don't make dependencies in a directory if we had already done them
earlier.
mfilterjavac/Mmakefile:
Add targets for building C# and Java files.
slice/Mmakefile:
Include the modules of the mcov and mtc_diff programs in the
existing targets for building C, C# and Java files.
deep_profiler/Mmakefile:
profiler/Mmakefile:
These makefiles already had targets for building C# and Java files.
Fix grammar and/or indentation.
compiler/Mmakefile:
Fix grammar and/or indentation.
tools/bootcheck:
Build the dependencies for auxiliary programs, and the programs themselves,
in the browser and profiler directories.
Mmakefile:
Provide targets for bootcheck to use to make dependencies for the
auxiliary programs in the browser and profiler directories.
browser/Mmakefile:
Take the two aux programs in this directory out of the "all" target.
Due to past bitrot, one gets errors during compilation, the other
during linking. (The "all" target is not used by default, which is why
this has not been a problem.)
Add depend_aux and aux targets that should build these programs
if they are ever fixed. The aux target is empty for now; the depend_aux
target does make dependencies for both aux programs (since that still
works, and we want to keep it that way).
profiler/Mmakefile:
Add depend_aux and aux targets that build the one auxiliary program
in this directory that works now. Add a comment about the other program
that doesn't.
profiler/Mmakefile:
Compile the demangle_test program every time.
Note that the atsort_callgraph program should also have been compiled
every time; it would have prevented its bitrot.
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
Add the 'css' target for building the C# source files.
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
mdbcomp/mdbcmp/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
As above (required for stage 3).
Delete residual references to the IL backend.
Don't accidently strip the ".exe" extension from the deep profiler executables
on Windows when installing them. (Deep profiling doesn't really work on
Windows, which is why this hasn't been noticed until now.)
compiler/Mmakefile:
mfilterjavac/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
Add an uninstall target in these directories.
Delete a stray reference to the IL backend.
deep_profiler/Mmakefile:
Fix the issue mentioned above w.r.t the ".exe" extension.
We install mdprof_cgi in (potentially) two locations, make
sure we (attempt to) uninstall them both.
Update the uninstall target to handle the other executables in
this directory.
doc/Mmakefile:
Make the uninstall target remove the manual pages.
Mmakefile:
Invoke uninstall targets in directories where we previously didn't.
compiler/mlds_to_il.m:
compiler/mlds_to_ilasm.m:
compiler/mlds_to_managed.m:
compiler/il_peephole.m:
compiler/ilasm.m:
compiler/ilds.m:
Delete the modules making up the MLDS->IL code generator.
compiler/globals.m:
compiler/prog_data.m:
Delete IL as a target and foreign language.
compiler/prog_io_pragma.m:
Delete the max_stack_size/1 foreign proc attribute. This was only
ever required by the IL backend.
compiler/options.m
Delete options used for the IL backend.
compiler/write_deps_file.m:
Don't generate mmake targets for .il files etc.
compiler/*.m:
Conform to the above changes.
compiler/notes/compiler_design.html
compiler/notes/work_in_progress.html
Conform to the above changes.
library/*.m:
Delete IL foreign_proc and foreign_export pragmas.
README.DotNet:
Delete this file.
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
mdbcomp/Mmakefile:
mfilterjavac/Mmakefile:
profiler/Mmakefile:
runtime/Mmakefile:
slice/Mmakefile:
Conform the above changes.
configure.ac:
Don't check that IL is a supported foreign language when performing the
up-to-date check.
Delete the '--enable-dotnet-grades' option.
scripts/Mmake.vars.in:
Delete variables used for the IL backend (and in on case by the Aditi
backend).
scripts/Mercury.config.bootstrap.in:
scripts/Mercury.config.in:
scripts/Mmake.rules:
scripts/canonical_grade.sh-subr:
tools/bootcheck:
Delete stuff related to the 'il' and 'ilc' grades.
doc/reference_manual.texi:
Delete the documentation of the 'max_stack_size' option.
doc/user_guide.texi:
Delete stuff related to the IL backend.
tests/hard_coded/csharp_test.{m,exp}:
tests/invalid/foreign_type_missing.{m,err_exp}:
tests/valid/csharp_hello.m:
Delete these tests: they are no longer relevant.
tests/hard_coded/equality_pred_which_requires_boxing.m:
tests/hard_coded/foreign_import_module.m:
tests/hard_coded/foreign_import_module_2.m:
tests/hard_coded/foreign_type.m:
tests/hard_coded/foreign_type2.m:
tests/hard_coded/foreign_type3.m:
tests/hard_coded/intermod_foreign_type2.m:
tests/hard_coded/lp.m:
tests/hard_coded/user_compare.m:
tests/invalid/foreign_type_2.m:
tests/invalid/foreign_type_missing.{m,err_exp}:
tests/invalid/foreign_type_visibility.m:
tests/invalid/illtyped_compare.{m,err_exp}:
tests/submodules/external_unification_pred.m
tests/valid/big_foreign_type.m
tests/valid/solver_type_bug.m
tests/valid_seq/foreign_type_spec.m
tests/valid_seq/intermod_impure2.m
Delete IL foreign_procs where necessary.
tests/hard_coded/Mmakefile
tests/invalid/Mercury.options
tests/invalid/Mmakefile
tests/submodules/Mmakefile
tests/valid/Mercury.options
tests/valid/Mmake.valid.common
tests/valid/Mmakefile
tests/valid_seq/Mmakefile
tests/valid_seq/Mercury.options
Conform to the above changes.
If the compiler and (most of) the other tools are built in the Java grade then
have the install target also install the Java archives for the executables.
compiler/Mmakefile:
deep_profiler/Mmakefile:
mfilterjavac/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
As above. (The ones for the deep profiling tools are are probably
a bit useless in practice, but the others should all work.)
This file-specific setting will override a default setting of expandtabs
in $HOME/.vimrc.
*/Makefile:
*/Mmakefile:
As above.
tests/hard_coded/.gitignore:
Don't ignore the purity subdir. This ignore must have been left over
from when purity.m was a test in hard_coded, not hard_coded/purity,
and it ignored an executable, not a directory.
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.)
browser/Mmakefile:
compiler/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
Delete .ss and .pic_ss targets.
These were only required for the GCC backend.
Branches: main, 11.07
Make the slice, profiler and deep_profiler directories compile in the csharp
grade.
deep_profiler/Mmakefile:
profiler/Mmkefile:
slice/Mmakefile:
Point the C# compiler towards the stdlib assembly.
Branches: main
Let Mercury be built with a MinGW cross-compiler.
tools/configure_mingw_cross:
Add shell script to prepare for cross-compilation.
README.MinGW-cross:
Document how to use the shell script.
configure.in:
Mmake.common.in:
Set a new variable CROSS_COMPILING.
Set FULLARCH and BUILD_C_PROGS_FOR_BUILD_SYSTEM variables
to be passed to the Boehm GC build system.
Use $host-ar for AR when cross-compiling.
m4/mercury.m4:
Determine gcc version with gcc -dumpversion instead of building
a program and running it.
Don't run test for mercury_cv_cc_type if set explicitly.
Mmake.workspace:
Use the default c2init and mkinit when cross-compiling.
The copies in the util directory would not be usable then.
boehm_gc/Mmakefile:
Pass configured values of AR, RANLIB down to sub-make.
boehm_gc/Makefile.direct:
boehm_gc/build_atomic_ops.sh:
Use configured value from Mmake.common for HOSTCC.
Pass --host when configuring libatomic_ops.
util/Mmakefile:
Make tools with .exe suffixes on Windows.
Mmakefile:
Use the bootstrap compiler to build libgrades when cross-compiling.
Conform to changed target names in the util directory.
compiler/Mmakefile:
deep_profiler/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
Conform to changed target names in the util directory.
Makefile:
Clean .exe files on Windows.
Branches: main, 11.01
Make building stage 1 of the Mercury system work with the java grade.
compiler/Mmakefile:
deep_profiler/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
In non-C grades override any attempts to link against object
files or archives.
Compile with --allow-stubs where things still rely on C
foreign procs and there are no alternative definitions
currently available.
Branches: main
Add support for the `csharp' grade to `mmc --make', and make it possible to
install the `csharp' grade with `mmake install'.
Also some miscellaneous fixes.
configure.in:
Require a recent enough bootstrap compiler that recognises C# as a
language for `pragma foreign_type'.
Mmakefile:
Use `mmc --make' to install the standard library in csharp grade.
aclocal.m4:
Search for the Mono C# compiler `gmcs', which is required for generics
at this time. Prefer it over the DotGNU C# compiler, which I have not
tested.
Search for `mono'. If found, it will be used in shell scripts to
launch executables generated via the csharp backend.
Remove "MS_" prefixes on the variables MS_CSC and MS_ILASM, which are
not Microsoft-specific. More importantly, it should be less likely to
make the mistake of adding an extra underscore to CSCFLAGS and
ILASMFLAGS.
README.DotNet:
Conform to variable renamings.
compiler/compile_target_code.m:
Add new linked target types `csharp_executable', `java_launcher' and
`erlang_launcher', instead of overloading `executable'.
Link with `mer_std.dll' and other libraries when generating C#
executables. There is no `mer_rt.dll'.
Pass "/debug" to the C# compiler if `--target-debug' is set.
Create a shell script to launch the executable if necessary.
Delete an unused predicate `standard_library_directory_option'.
compiler/file_names.m:
`.cs' and `.cs_date' are grade-dependent.
compiler/handle_options.m:
Force `.exe' as the executable file extension in csharp grades.
Make the `erlang' grade component imply the same options as MLDS
grades.
compiler/make.m:
Classify executable target types based on the compilation target.
compiler/make.module_target.m:
Handle `mmc --grade csharp --make <target>.dll'.
compiler/make.program_target.m:
Install library DLLs in csharp grades.
Make clean targets remove files for csharp grades.
Conform to changes.
compiler/make.util.m:
Add a stub foreign type.
Conform to changes.
compiler/module_cmds.m:
Factor out code to generate the shell scripts which launch programs
compiled in Java, Erlang and C# grades.
compiler/options.m:
Add `cli_interpreter' option to remember the name of the program which
should be used to run CLI (.NET) programs.
Add C#-related options to the help message.
compiler/options_file.m:
Remove "MS_" prefixes on MS_ILASM_FLAGS and MS_CSC_FLAGS, and remove
the extra underscore before "FLAGS". In all uses of the variables,
they were spelt without the extra underscore.
doc/user_guide.texi:
Document options and file types related to the C# grade.
library/Mmakefile:
Pass `mercury_dotnet.cs' to the C# compiler when building the standard
library. Suppress some warnings.
Allow stubs in this directory for csharp grade.
Conform to variable renamings.
library/builtin.m:
Uncomment foreign language pragmas for C#.
Handle null values in C# implementation of `deep_copy'.
library/private_builtin.m:
library/string.m:
Compare strings by ordinals in C#, instead of culture-specific rules.
Although the latter is allowed according to the documentation, it is
likely to slower, and cause confusion when porting between backends.
Handle negative index in string.set_char.
library/rtti_implementation.m:
Uncomment foreign language pragmas for C#.
`System.Type.GetType' only searches the current executing assembly or
in mscorlib for a type. As we have to be able to find types in other
assemblies (e.g. mer_std.dll or user DLLs), explicitly search through
a list of assemblies.
library/thread.semaphore.m:
Uncomment foreign language pragmas for C#.
Fix missing class qualification.
library/array.m:
library/bitmap.m:
library/bool.m:
library/dir.m:
library/exception.m:
library/io.m:
library/mutvar.m:
library/par_builtin.m:
library/region_builtin.m:
library/store.m:
library/thread.m:
library/time.m:
library/univ.m:
library/version_array.m:
Uncomment foreign language pragmas for C#.
mdbcomp/rtti_access.m:
Add type and procedure stubs.
runtime/mercury_dotnet.cs.in:
Override `Equals(object)' methods in `TypeCtorInfo_Struct' and
`TypeInfo_Struct' classes. This requires we override `GetHashCode' as
well.
Handle nulls arguments to `Equals' methods as is the expected behaviour.
Override `ToString' in `TypeCtorInfo_Struct' to produce more useful
output during debugging.
scripts/Mercury.config.in:
Record the configured CLI_INTERPRETER and pass that to the compiler as
a flag.
Conform to variable renamings.
scripts/Mmake.vars.in:
Pass value of CSCFLAGS from Mmake through to `mmc --make'.
Conform to variable renamings.
scripts/Mercury.config.bootstrap.in:
scripts/Mmake.rules:
Conform to variable renaming.
scripts/canonical_grade.sh-subr:
scripts/final_grade_options.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
Canonicalise high-level code, high-level-data, C# target code to the
`csharp' grade.
Handle erlang grades like other grades.
scripts/prepare_install_dir.in:
Copy `.cs' files from the runtime directory when preparing an install
directory.
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
runtime/Mmakefile:
slice/Mmakefile:
ssdb/Mmakefile:
trace/Mmakefile:
Do as other non-C grades in this directory.
Conform to variable renamings.
tests/hard_coded/foreign_enum_dummy.m:
tests/hard_coded/sub-modules/non_word_mutable.m:
tests/hard_coded/sub-modules/sm_exp_bug.m:
Make these tests work in C#.
tests/mmc_make/Mmakefile:
Update a regular expression to account for `mmc --make' writing
"Making rebuild.exe" on platforms where the .exe suffix is not normally
used.
tests/mmc_make/complex_test.exp2:
Add alternative output (minor difference in floating point precision).
tests/debugger/Mmakefile:
tests/debugger/declarative/Mmakefile:
tests/general/structure_reuse/Mmakefile:
tests/hard_coded/Mmakefile:
tests/hard_coded/sub-modules/Mmakefile:
tests/par_conj/Mmakefile:
tests/stm/Mmakefile:
Disable some tests in the csharp grade.
tests/invalid/Mmakefile:
Disable some tests in the csharp grade.
Enable a test which should work in java grades.
tests/valid/Mmakefile:
Do as other non-C grades in this directory.
When testing the csharp grade in this directory, produce only the C#
target files for now.
tests/run_one_test:
Don't compress a failing test case executable when the executable is
actually only a shell script.
Estimated hours taken: 0.2
Branches: main
compiler/Mmakefile:
Fix an old bug. The action for the target "tags_file_exists", which is
implicitly remade whenever we rebuild the compiler, used to always
touch .compiler_tags. This led the "tags" target to believe that
the tags file (whose logical timestamp .compiler_tags represents)
is at least as new as all the .m files, causing it to not actually
remake the tags file, even when it should have.
We now touch .compiler_tags only when rebuilding the tags file.
*/Mmakefile:
Make the actions for tags follow the scheme in compiler/Mmakefile
where needed.
Estimated hours taken: 120
Branches: main
There are some modification for the nondet transformation. When a retry of a
nondet procedure A is asked during the execution of the program, a choicepoint
is left behind and the execution start the retry on procedure B. When the retry
on B is finished, the compiler come back at the choicepoint and finish the call
of the procedure A. This give a wrong number of event.
The proposed solution is: when a retry is asked in a nondet procedure named A
at an exit port, the debugger do not execute any operation until it reach the
fail of the procedure A. It is only at this moment that the execution of B
begin.
If user use a predicate like solutions.unsorted_solutions, he will obtain more
than one time the same solution. The use of solutions is right because it
remove the duplicates
Determinism failure tranformed:
% detism_failure:
%
% p(...) :-
% promise_<original_purity> (
% (
% CallVarDescs = [ ... ],
% impure call_port(ProcId, CallVarDescs),
% <original body>
% ;
% % preserve_backtrack_into
% impure fail_port(ProcId, CallVarDescs, DoRetry),
% (
% DoRetry = do_retry,
% p(...)
% ;
% DoRetry = do_not_retry,
% fail
% )
% )
% ).
Determinism erroneous transformed:
% p(...) :-
% promise_<original_purity> (
% (
% CallVarDescs = [ ... ],
% impure call_port(ProcId, CallVarDescs),
% <original body>,
% )
% ).
analysis/Mmakefile:
Delete the LINK_STDLIB_ONLY=yes line as we need to link with the
libmer_ssdb if source-to-source debugging is enabled.
browser/util.m:
At the browser prompt, use io.read_line_as_string instead of
functions in the trace library to read input if the trace library is
not linked in.
compiler/mercury_compile.m:
Move the ssdb transformation to after the higher order specialisation
pass to work around a compiler abort. The higher order specialisation
removes predicates which are used to "force the production of
user-requested type specializations, since they are not called from
anywhere and are no longer needed". Let `p' be such a procedure, and
the specialised version be `p1'. Then remove `p'. But due to the ssdb
transformation, `p1' will contain a call to `p', in order to support
retry.
I'm not sure where the ssdb transform should go. I assume as early as
possible.
compiler/ssdebug.m:
- Transform procedures with `failure' and `erroneous' determinisms.
- Funny modes are not managed
I think we can and should handle `unused' arguments as well, but
later.
profiler/Mmakefile:
Link with the mer_ssdb library.
ssdb/Mercury.options:
Link with the mer_browser library to support browsing of terms.
ssdb/ssdb.m:
- 4 new event for the nondet procedure are now use. They are :
ssdb_call_nondet, ssdb_exit_nondet, ssdb_fail_nondet,
and ssdb_redo_nondet. In the same way, an different event handler
has been created to managed each of them.
The ssdb_redo event was no more useful.
- The old structure debugger_state has been divided in different
mutable variables to allow more flexibility.
- The old breakpoint list are now a map with (module_name, pred_name)
as key and the breakpoint structure as value.
- The depth is now compute with the stack depth, it is easier to manage
and more flexible.
- Some new command have been added: delete/enable/disable breakpoint,
break info, finish N, retry N, browse X
deep_profiler/DEEP_FLAGS.in:
deep_profiler/.mgnuc_copts:
deep_profiler/Mmakefile:
tests/.mgnuc_copts.ws:
tests/WS_FLAGS.ws:
Search in the ssdb directory for files.
analysis/Mmakefile:
browser/util.m:
compiler/mercury_compile.m:
compiler/ssdebug.m:
library/private_builtin.m:
profiler/Mmakefile:
ssdb/Mercury.options:
ssdb/ssdb.m:
tests/.mgnuc_copts.ws:
tests/WS_FLAGS.ws:
Back out Olivier's last change; it broke the compiler.
Estimated hours taken: 1
Branches: main
Final release of version 1 of the ssdb.
analysis/Mmakefile:
browser/util.m:
compiler/mercury_compile.m:
compiler/ssdebug.m:
library/private_builtin.m:
profiler/Mmakefile:
ssdb/Mercury.options:
ssdb/SSDB_FLAGS.in:
ssdb/ssdb.m:
tests/.mgnuc_copts.ws:
tests/WS_FLAGS.ws:
Estimated hours taken: 6
Branches: main
Add more documentation for the Erlang backend.
Make it possible to configure and install the Erlang backend without too
much manual tweaking.
NEWS:
Mention the Erlang backend.
README.Erlang:
Add installation and other notes for Erlang.
doc/reference_manual.texi:
doc/user_guide.texi:
Add documentation for Erlang.
aclocal.m4:
configure.in:
Check that the bootstrap compiler knows about the
builtin_compound_{eq,lt} builtins, and understands
--erlang-native-code.
Make configure check for Erlang tools.
Add configure --enable-erlang-grade option. Erlang support
is disabled by default.
scripts/Mercury.config.in:
Add `--erlang-compiler <erl>' and `--erlang-interpreter <erlc>'
options to be set by configure.
analysis/ANALYSIS_FLAGS.in:
compiler/COMP_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
Add `--erlang-include-directory <dir>/Mercury/hrls' options so that
the compiler can find Erlang header files from other subdirectories.
compiler/Mercury.options:
library/Mercury.options:
Work around bugs in the HiPE compiler when compiling two modules.
Delete the workaround that was necessary while bootstrapping
builtin_compound_{eq,lt}.
compiler/options.m:
Add notes that two options to check that the compiler is recent enough
won't be recognised because they begin "no-" prefixes, and we have
to use "--no-no-" instead.
compiler/options_file.m:
Support ERLANG_FLAGS, EXTRA_ERLANG_FLAGS variables in options files to
be the same as passing --erlang-flags.
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
runtime/Mmakefile:
slice/Mmakefile:
trace/Mmakefile:
Make the build system do the same things in the Erlang grade as for
the IL and Java grades.
scripts/final_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
Make these scripts know about the erlang grade so that parts of the
build system won't abort on seeing it.
Estimated hours taken: 12
Branches: main
Remove most of the junk from the command lines executed by make when building
the compiler and by bootcheck when building test cases. We do this by moving
the junk into files consulted via the --flags option.
After this change, it is actually possible to see in a glance not just which
files are being compiled but also with which options. The size of the output
(measured in bytes) from a bootcheck is now only about 40% of what is was
before.
configure.in:
Remember the path to the bootstrap compiler and the flags it should be
invoked with separately. Put the flags into the FLAGS files in various
directories.
Test whether the default install directory actually exists, so that
the -L and -R linker options referring to this directory are passed
to the C compiler only if it does.
Mmake.common.in:
Comment out a bunch of additions of MCFLAGS, the ones whose contents
are now in FLAGS files.
Conform to the changes in configure.in.
Add a template rule for the dependencies of the FLAGS files.
Mmake.workspace:
Comment out a bunch of additions of MCFLAGS, the ones whose contents
are now in FLAGS files. In some cases, add references to the FLAGS
files.
Mmakefile:
When rebuilding Mmake.common, rebuild only Mmake.common, not all files
created by configure.
analysis/ANALYSIS_FLAGS.in:
browser/MDB_FLAGS.in:
compiler/COMP_FLAGS.in:
deep_profiler/PROF_FLAGS.in:
library/LIB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
profiler/DEEP_FLAGS.in:
slice/SLICE_FLAGS.in:
tests/TESTS_FLAGS.in:
Add these files, which each contain the junk flags (the flags which are
the same on every invocation and mostly just clutter up compiler
command lines) that are needed on each compiler invocation in the
relevant directory. Besides the results of configuration (word size
etc), and the paths to other parts of the system, these files mostly
control which warnings are enabled.
Restrict the list of directories in -I options to what is sensible;
for example, don't specify -I../analysis in the deep_profiler
directory.
*/.nocopyright:
Don't require copyright notices in FLAGS files, since that would make
them invalid.
library/INTER_FLAGS:
Add this file, which contains the flags enabled with intermodule
optimization.
tests/WS_FLAGS.ws:
Add this file. Unlike the .in files, which processed by config.status
based on the results of autoconfiguration, this one is processed to
specify the location of the workspace being tested.
analysis/Mmakefile:
browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
profiler/Mmakefile:
tests/Mmakefile:
Include the relevant directory's FLAGS file on the command line, to
replace all the additions to MCFLAGS in ../Mmake.common and in
../Mmake.workspace, and in some cases, the directory-specific Mmakefile
itself.
Build the directory's FLAGS file before executing the depend target,
since most compiler options beyond --generate-dependencies come from
there.
Delete the FLAGS files generated by config.status when doing "make
clean".
tests/Mmakefile:
Allow the environment to define DIFF_OPTS.
runtime/Mmakefile:
Use an option to tell config.status what to rebuild, not some
environment variables.
tests/invalid/Mercury.options:
For two test cases, reset an option that is set in tests/WS_FLAGS,
to match the options the affected tests were compiled with before.
tests/invalid/*.err2:
Update these expected files to account for the use of error_util
in error messages by previous changes to the compiler. These expected
output files are used only with --use-subdirs.
tests/warnings/Mmakefile:
For all test cases, reset an option that is set in tests/WS_FLAGS,
to match the options the tests were compiled with before.
scripts/prepare_tmp_dir_grade_part
Copy the flags files when creating the subdirectories of tmp_dir.
scripts/mgnuc.in:
Provide a mechanism, a per-directory .mgnuc_opts file, for specifying
the options that are required for every C file in a directory. The
intention is to use this for -I../library etc, but this is not done
yet; one thing at a time.
tools/bootcheck:
Copy the FLAGS files when creating stage2 and stage3.
Don't specify the compiler options that are now in FLAGS files.
Fill in the location of the workspace in tests/WS_FLAGS before running
the tests.
Provide a mechanism (a file ~/.bootcheck_diff_opts) to allow the user
to specify what options to invoke diff with.
Move the setting of MMAKE_USE_SUBDIRS and MMAKE_USE_MMC_MAKE after
we have built stage1, and always copy the profilers if --use-subdirs
is set. The old ways of doing things caused problems if bootcheck
was given --use-subdirs but stage1 doesn't use subdirs: the bootcheck
modified the stage1 slice, profiler and deep_profiler directories.
Estimated hours taken: 1
Branches: main
Allow users to ensure that tags files always exist in the relevant directories
by setting the environment variable ALWAYS_MMAKE_TAGS_FILE.
runtime/Mmakefile:
trace/Mmakefile:
library/Mmakefile:
browser/Mmakefile:
compiler/Mmakefile:
profiler/Mmakefile:
deep_profiler/Mmakefile:
If TAGS_FILE_EXISTS is set to tags_file_exists, then make the default
action ensure the existence of the tags file. It would be too
expensive to remake the tags file every time mmake is run, but
just testing for its existence is cheap enough.
Fix the formatting of some rules.
Mmake.common.in:
Set TAGS_FILE_EXISTS to tags_file_exists if the environment variable
ALWAYS_MMAKE_TAGS_FILE is set.
Fix some documentation.
Estimated hours taken: 0.5
Branches: main
Some Mmakefile tweaks for grade java.
boehm_gc/Mmakefile:
browser/Mmakefile:
trace/Mmakefile:
Don't try to build the boehm_gc, browser, or trace directories
in grade java.
compiler/Mmakefile:
profiler/Mmakefile:
deep_profiler/Mmakefile:
Avoid dependencies on *.$A files in grade java.
Estimated hours taken: 1
Branches: main
analysis/Mmakefile:
compiler/Mmakefile:
browser/Mmakefile:
profiler/Mmakefile:
Add `ils' target, for use by tools/bootcheck.
library/Mmakefile:
Add a missing dependency to ensure that we build all of the
`.int*' files for the `il' grade (it was forgetting to build
`library.int3').
Also, add a target to build the library as an executable,
so that you can run PEverify on it (PEverify doesn't
work properly on multi-file assemblies unless they
are executables).
Estimated hours taken: 3
Branches: main
Various fixes for the .NET back-end.
compiler/Mmakefile:
For IL grades, use editbin to set the stack size to 100M,
since the default (1M) is too small.
Also, don't try to build mlds_to_gcc in IL grades -- gcc.m won't
compile, because the IL grades don't support the C interface.
library/Mmakefile:
Add some missing dependencies.
profiler/Mmakefile:
deep_profiler/Mmakefile:
Conditionalize some dependencies that were bogus for IL grades.
library/.cvsignore:
compiler/.cvsignore:
profiler/.cvsignore:
deep_profiler/.cvsignore:
analysis/.cvsignore:
browser/.cvsignore:
samples/.cvsignore:
Various minor updates to ignore files produced when building in
IL grades.
Estimated hours taken: 20
Branches: main
Make it easier to use shared libraries on x86 with
`mmc --make'.
There is now a third kind of object file, `.lpic_o'.
These files are compiled with `--pic-reg' but not with
CFLAGS_FOR_PIC, so they can be linked with shared Mercury
libraries.
On x86, executables which are linked with shared Mercury
libraries now depend on $(main_module.lpic_os), not
$(main_module.os).
This doesn't work with Mmake because ml doesn't know
which libraries are Mercury libraries, so it can't
link with the static versions of those libraries if
MERCURY_LINKAGE is set to "static".
configure.in:
bindist/bindist.configure.in:
bindist/bindist.build_vars.in:
Work out whether `.lpic_o' files are needed.
compiler/modules.m:
Add `.lpic_o' to the list of grade or architecture
dependent files.
NEWS:
README.Linux:
compiler/options.m:
doc/user_guide.texi:
Document MERCURY_LINKAGE, LINKAGE, --linkage,
--mercury-linkage and -R.
compiler/options_file.m:
compiler/make.program_target.m:
Handle LINKAGE and MERCURY_LINKAGE variables.
Allow LIBGRADES, LINKAGE and MERCURY_LINKAGE to be target-specific.
scripts/mmc.in:
Set up the default linkage using the MERCURY_LINKAGE
variable.
compiler/compile_target_code.m:
Build `.lpic_o' files.
Work out which type of object files to link with.
When linking statically with Mercury libraries,
find the absolute pathname for the `.a' file
for each Mercury library, and pass that to ml,
rather than just using `-lname'.
Pass `-R' options to ml for each `-R' option to mmc.
compiler/make.module_target.m:
compiler/make.program_target.m:
compiler/mercury_compile.m:
Specify which type of object files to build.
compiler/make.program_target.m:
compiler/make.module_target.m:
Make sure all generated object files are cleaned up.
compiler/prog_io.m:
Add a better message for files which can't be found.
compiler/make.util.m:
Add `.lpic_o' to the list of extensions.
compiler/Mmakefile:
profiler/Mmakefile:
deep_profiler/Mmakefile:
Pass `--linkage shared' to mmc (`--shared' is in MLFLAGS).
tests/Mmakefile:
tests/mmc_make/Mmakefile:
tests/mmc_make/Mercury.options:
tests/mmc_make/complex_test.{m,exp}:
tests/mmc_make/hello.{m,exp}:
Test `mmc --make'.
tests/lib/complex*.m:
The complex numbers library from the extras distribution,
for use in the mmc_make tests.
Estimated hours taken: 5
Branches: main
Allow tools/bootcheck to be run using `mmake --use-mmc-make'.
The tests don't work yet.
compiler/make.m:
compiler/make.module_target.m:
Handle targets such as `<module>.cs' and `<module>.ints',
which are used when building stage 3.
Mmake.common.in:
*/Mmakefile:
*/Mercury.options:
Add Mercury.options files to pass module-specific flags to
`mmc --make'.
Avoid triggering the .DEFAULT rule introduced with `--use-mmc-make'
for optional files like Mmake.params.
compiler/modules.m:
Build the interface files when building a library in IL grades,
for consistency with C grades.
library/Mmakefile:
Improve performance by removing the dependency on the interface
files when building the library. The files are now always built
by the libmer_std target.
Pass the command to build libmer_std.init to `mmc --make'.
tools/bootcheck:
Add an option `--use-mmc-make'.
Copy the Mercury.options files into the stage2 and stage3 directories.
scripts/Mmake.rules:
Don't include the rules for `.dep' files with `--use-mmc-make'.
Include the rule for `--convert-to-mercury' even with `--use-mmc-make'.
compiler/Mmakefile:
tools/bootcheck:
tools/binary_step:
`mmc --make' doesn't handle `<module>_init.c' targets, so
don't make the `cs' target depend on `top_level_init.c'.
As far as I can tell, that dependency is only present so
that the stage2 and stage3 compilers have the same set of
C files. bootcheck and binary_step now only compare `.c'
files which are present in the stage3 directory.
Estimated hours taken: 8
Branches: main
Factor out the common Mmake code to set up the mmc, mgnuc
and ml flags when building the Mercury compiler and libraries.
Use options, not environment variables. This will make it simpler
to use `mmc --make' to compile the compiler.
Mmake.workspace:
Similar to tools/lmc. Sets up Mmake variables to
use the library files in a workspace rather than
an installed library.
configure.in:
Check for the `--no-mercury-stdlib-dir' mmc option.
Bootstrap CVS tag: bootstrap_20020429_stdlib_dir
Mmake.common.in:
*/Mmakefile:
Move common code into Mmake.workspace.
browser/Mmakefile:
library/Mmakefile:
Avoid invoking the linker explicitly when creating
libraries of Mercury code. That won't work well
with `mmc --make'.
tools/bootcheck:
tests/Mmake.common:
Use Mmake.workspace instead of setting up environment
variables in bootcheck.
scripts/Mmake.vars.in:
mmc compiles split C files to object code itself,
so pass `--cflags "$(ALL_CFLAGS)"' to mmc when
compiling with `--split-c-files'.
browser/interactive_query.m:
Use `mmc --make' when compiling the query. This is needed
to make tests/debugger/interactive_query.m work when linking
against a workspace using options rather than environment
variables. This also fixes a bug -- mmc options were being
passed to ml.
Clean up after the query.
tests/debugger/Mmakefile:
tests/debugger/interactive.inp:
tests/debugger/interactive.inp.subdirs:
tests/debugger/interactive.inp.nosubdirs:
tests/debugger/interactive.exp:
tests/debugger/interactive.exp2:
Generate the input file to this test so that MCFLAGS
and MC_MAKE_FLAGS (from Mmake.workspace) are used when
compiling queries.
tests/debugger/Mmakefile now sets SHELL to /usr/local/bash
to allow the use of $(...) style command substitution
(`...` style command substitution can't be nested).
tests/warnings/Mmakefile:
tests/dppd/Mmakefile:
Include tests/Mmake.common.
tools/*:
scripts/c2init.in:
scripts/ml.in:
Update the lists of files containing the library names.
Estimated hours taken: 1
Link with the shared version of the C standard library,
rather than linking the C library in statically.
This works around an lcc bug with static linking.
compiler/Mmakefile:
profiler/Mmakefile:
Add `--shared' to `MLFLAGS'.
The overrides the default `--static' on Linux.
(Since we name all the Mercury libraries that we link with
explicitly, this only affects the way we link with the C
library, not with the Mercury runtime or standard library.)
Estimated hours taken: 4
This is part 2 of a change that provides a register of all the types defined
in the program.
util/mkinit.c:
After part 1 of this change, each compiler-generated module has three
initialization functions: the old one (to register label addresses
etc), one to register type_ctor_infos, and one to register module
layouts for the debugger. However, only the first was invoked from
the mkinit generated <mainmodule>_init.c file.
This change invokes the other two as well. One complication is that
hand-written "modules" do not have the two new kinds of initialization
functions, so only their first initialization function should be
called. We do this by requiring those "modules" to have one of two
specific forms: an initial prefix of either sys_init or
mercury_sys_init.
scripts/c2init.in:
Rerrange the mechanism we use to allow the overriding of the locations
of the init files to be passed to mkinit. The previous mechanism used
a single environment variable, MERCURY_MOD_LIB_MODS, to hold the names
of these init files. While the default setting of this variable was
conditional on whether the --trace option was given to c2init
(including the init file for the browser only with --trace),
there was no way to override the default value in a similarly
conditional manner. This is now a problem, because including the
browser init file in the list of init files passed to mkinit will
cause mkinit to emit code that causes the browser's modules to be
linked in, without also linking in the libraries (e.g. -ldl) on which
the browser depends. The reason why this hasn't bitten us earlier
is that the code that drags in the browser was #ifdef'ed out
in the first initialization function; the reason why it would
bite us now is that it is *not* #ifdef'ed out in the second
initialization function (the one that register type_ctor_infos).
The new mechanism uses two environment variables, MERCURY_MOD_LIB_MODS
and MERCURY_TRACE_LIB_MODS, with the first normally containing
the filenames of the init files of the runtime and library directories
and the second the filename of the init file of the browser directory.
The value of the second environment variable is passed to mkinit
only if c2init is invoked with the --trace flag.
There is also a new environment variable MERCURY_TRACE_LIB_DIR,
which has a role parallel to MERCURY_MOD_LIB_DIR.
compiler/Mmakefile:
profiler/Mmakefile:
tools/bootcheck:
Specify the filename of the browser init file in
MERCURY_TRACE_LIB_MODS.
library/array.m:
library/builtin.m:
library/private_builtin.m:
library/std_util.m:
Add code to initialization functions to register the type_ctor_infos
of hand-defined types.
Note that this code is in the usual initialization function, the one
called by do_init_modules(). Putting this code in a separate
initialization function that is called by do_init_modules_type_tables()
would require complicating mkinit.c considerably.
runtime/mercury_wrapper.c:
Make do_init_modules_type_tables() call do_init_modules(), so that
calling do_init_modules_type_tables() guarantees the registration
of all the type_ctor_infos in the program, including the hand-defined
ones.
runtime/mercury_context.c:
Make the name of the handwritten module follow the convention now
required by mkinit.
Estimated hours taken: 0.25
Fix a bug in the Mercury 0.9 binary distribution.
bindist/bindist.Makefile.in:
Change EMACS_SCRIPTS to INSTALL_EMACS_SCRIPTS,
to match the name used in the install_emacs_scripts rule.
Estimated hours taken: 3
Support installing both `.par' and non-`.par' versions of the GC library.
scripts/ml.in:
Change the code for computing which version of the GC library
to link in so that it also takes the `.par' grade component
into account, rather than just the `.prof' grade component.
Add new options `--print-gc-grade' (for use by the top-level
Mmakefile) and `--print-grade' (for symmetry).
Mmakefile:
When invoking sub-makes in the boehm_gc directory,
pass down GC_GRADE instead of PROF.
Compute the GC_GRADE value using `scripts/ml ... --print-gc-grade`
rather than computing it manually, since this avoids code duplication.
boehm_gc/Mmakefile:
boehm_gc/Makefile:
boehm_gc/NT_MAKEFILE:
s/gc$(PROF)/$(GC_GRADE)/g
runtime/Mmakefile:
trace/Mmakefile:
browser/Mmakefile:
bytecode/Mmakefile:
library/Mmakefile:
compiler/Mmakefile:
profiler/Mmakefile:
Change the code for computing which version of the GC library
to link in so that it also takes the `.par' grade component
into account, rather than just the `.prof' grade component.
Estimated hours taken: 0.25
browser/Mmakefile:
compiler/Mmakefile:
profiler/Mmakefile:
Add `-I$(LIBRARY_DIR)' to ALL_C_INCL_DIRECTORIES, since this
is needed for the MLDS back-end, which generates a C header file
for each module in the library.
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'.
Estimated hours taken: 3
Improve build and installation on MS-Windows.
configure.in:
Mmake.common.in:
Set extension for executables (.exe for Windows, nothing
otherwise).
Detect presence of perl, makeinfo, texi2dvi and dvips.
Mmakefile:
README.MS-Windows:
Remove old preinstall and postinstall hacks for windows.
compiler/Mmakefile:
profiler/Mmakefile:
util/Mmakefile:
Use the extension for executables when installing.
doc/Mmakefile:
Don't generate documentation unless the appropriate tools
are available. Use the auto-detection of perl,
makeinfo, texi2dvi and dvips to build documentation.
doc/generate_mdb_doc:
Don't insist on rm being in /bin
Estimated hours taken: 1
browser/Mmakefile:
compiler/Mmakefile:
library/Mmakefile:
profiler/Mmakefile:
runtime/Mmakefile:
trace/Mmakefile:
util/Mmakefile:
Simplify the code by deleting unnecessary uses of $(EXTRA_*), etc.
This is now handled once and for all in scripts/Mmake.vars, and
so it doesn't need to be separately handled by */Mmakefile.
This patch also fixes an annoyance where if you set EXTRA_CFLAGS,
the flags that you set were being passed to mgnuc twice.
Estimated hours taken: 2
Simplify the Mmakefiles. Fix a few minor latent bugs.
*/Mmakefile:
- Factor out some common code by defining a new variable M_ENV
which holds settings of environment variables for mmc, mgnuc, etc.
- For consistency, always override MERCURY_C_ALL_INCL_DIRS rather
than passing extra `-I' options to mgnuc.
- Make sure to always include `$(BOEHM_GC)/include' in the search path,
so that it will work if we try to compile with `-O6'.
- Make sure to always include `--cflags $(ALL_CFLAGS)' in MCS, so
that the EXTRA_CFLAGS etc. will get passed down to gcc via mmc.
- Make sure that the Mmakefiles in all directories set
all the MC* variables: MCPI, MCSI, MCOI, MCTOI, etc.
Estimated hours taken: 0.25
profiler/Mmakefile:
Link the profiler with the `trace' and `browser' libraries.
This is needed in case you try to build the profiler
with debugging enabled.
Estimated hours taken: 10
Introduce two new directories, trace and browser, containing libraries
holding the C and Mercury code of the debugger respectively. (Although
the browser directory does not have a browser in it yet, the browser
should soon become its biggest component.) Take the opportunity to
rename the existing libraries, for consistency.
After this change, the linking order becomes:
the object of the auto-generated init file
program object files
trace library (libmer_trace.a)
browser library (libmer_browser.a)
standard library (libmer_std.a)
runtime library (libmer_rt.a)
Boehm collector (libgc.a)
To avoid circularities, libraries cannot contain direct calls to
any routines that are defined in libraries (or object files) that
occur earlier in the above list. Any such calls must be made into
indirect calls via function pointers.
In particular, there was a circularity caused by the library calling
MR_trace() which invokes the tracer which in turn invokes the
library. This circularity was broken by having MR_trace(),
which is defined in the runtime, call the tracer indirectly via
a global variable named MR_trace_func_ptr. This global variable
is initialized by the auto-generated *_init.c file.
To avoid linking in the tracer even when it is not being used,
this global variable is only set to point to MR_trace_real()
if you're using a debugging grade or if c2init was invoked
with the `-t' flag. Otherwise it is set to MR_trace_fake()
which just prints an error message telling the user to
rebuild the executable with debugging enabled.
Makefile.DLLs:
Reserve random locations for the two new libraries. Whether they work
will be decided by testing on Windows.
Mmake.common.in:
Add variables naming the new directories, and create variables
naming the libraries.
Mmakefile:
Add targets for the new directories, and modify existing rules
as appropriate.
browser/Mmakefile:
Mmakefile for the new directory, modelled on library/Mmakefile.
browser/browser_library.m:
Umbrella file for the new directory, modelled on library/library.m.
{browser,library}/debugger_interface.m:
Moved this file from library to browser without change.
browser/help.m:
A new module for the help system of the debugger. Not yet used.
compiler/Mmakefile:
Update to refer to the new directories and libraries where
appropriate.
compiler/mercury_compile.m:
If we are doing tracing, then pass -t instead of -i to c2init.
compiler/modules.m:
When generating the .dep file, get the grade flags passed to c2init.
doc/Mmakefile:
Remove the special treatment of library/debugger_interface.m.
library/Mmakefile:
Update to refer to the new directories and libraries where
appropriate, and to conform to the new name of the library.
library/library.m:
Do not import debugger_interface.
profiler/Mmakefile:
Update to refer to the new directories and libraries where
appropriate.
runtime/Mmakefile:
Update to refer to the new directories and libraries where
appropriate, and to conform to the new name of the library.
Remove references to files being moved to the trace directory.
runtime/mercury_init.h:
Refer to the automatically generated dll header file by its new name
(renamed because the runtime library is renamed).
Add declarations to support the new global variable MR_trace_func_ptr.
runtime/mercury_memory_handlers.c:
runtime/mercury_memory_zones.c:
runtime/mercury_misc.c:
Remove inappropriate #includes of "mercury_trace.h", and substitute
a #include of "mercury_trace_base.h" if necessary.
{runtime,trace}/mercury_trace.[ch]:
{runtime,trace}/mercury_trace_external.[ch]:
{runtime,trace}/mercury_trace_internal.[ch]:
Move these files from the runtime to the trace directory.
The only changes are the removal from mercury_trace.h of declarations
added to runtime/mercury_trace_base.h, and the change from MR_trace
to MR_trace_real.
runtime/mercury_trace_base.[ch]:
Define MR_trace(), which does an indirect call through
MR_trace_func_ptr if the event should be traced.
Define MR_trace_fake, which just prints an error message.
Its address will be assigned to MR_trace_func_ptr if tracing
is not enabled.
Define the types needed by the signature of MR_trace.
Fix an old bug: s/MERCURY_TRACE_PERMANENT_H/MERCURY_TRACE_BASE_H/.
runtime/mercury_wrapper.[ch]:
Add the new global variable MR_trace_func_ptr.
scripts/c2init.in:
Add a new option, -t/--trace, which enables tracing by causing the
address of MR_trace_real to be assigned to MR_trace_func_ptr.
Have this option be implied by the grade. Also have the old option
-i (need initialization code) be implied by the grade, as well as by
-t.
scripts/ml.in:
Include the new libraries in the link command.
tests/debugger/Mmakefile:
Include -t instead of -i in the list of c2init options. (-t implies
-i.)
tools/bootcheck:
Copy and build the new directories as appropriate. The trace directory
is treated like the runtime, the browser directory is treated like the
library.
trace/Mmakefile:
Mmakefile for the new directory, modelled on runtime/Mmakefile.
util/mkinit.c:
Add the new option -t, as discussed above.
Mmakefile for the new directory, modelled on runtime/Mmakefile.
util/Mmakefile:
Specify -O0, since with the default optimization level, gcc on
cyclone ignores the assignment of TRUE to need_tracing when -t is
given (!!!).
Estimated hours taken: 6
Fix some problems with the `--use-subdirs' option.
The compiler itself now compiles and bootstraps fine with --use-subdirs.
compiler/modules.m:
Put `.h' files in the source directory, rather than
in the `Mercury/hs' subdirectory.
compiler/mercury_compile.m:
scripts/Mmake.rules:
If `--use-subdirs' is enabled, pass `-I.' to the C compiler,
so that #include statements work relative to the source directory
rather than relative to the `Mercury/cs' subdirectory.
scripts/Mmake.vars.in:
Define $(cs_subdir), $(os_subdir) etc. variables;
these are set to the directory to use for .c, .o, etc. files,
(including the trailing `/'), or to the empty string,
if --use-subdirs is not set.
scripts/Mmake.rules:
Use $(cs_subdir), $(os_subdir) etc. to avoid the code
duplication created by my previous change to handle
--use-subdirs.
Also add lots of comments, and reorder the code
in a more logical order.
Mmakefile:
library/Mmakefile:
compiler/Mmakefile:
profiler/Mmakefile:
tests/term/Mmakefile:
tests/valid/Mmakefile:
Use $(cs_subdir), $(os_subdir) etc. to fix a few hard-coded
file-names (e.g. *.dep, *_init.[co], tree234.o) that were
used in some of the rules.
library/Mmakefile:
Add `rm -f tags' to the rule for `mmake realclean'.
tools/bootcheck:
Add `--use-subdirs' option (defaults to setting of the
MMAKE_USE_SUBDIRS environment variable).
Change the code which compares the stage2 & stage3 C files
to use the appropriate location for them based on the
setting of this option.
Estimated hours taken: 12
Add support for stack dumps, do a stack dump from error/1.
compiler/Mmakefile:
library/Mmakefile:
profiler/Mmakefile:
runtime/Mmakefile:
Insert EXTRA_MGNUCFLAGS before CFLAGS or EXTRA_CFLAGS
becasue mgnuc stops processing its options when it
encounters a non-mgnuc option.
library/require.m:
Call MR_dump_stack if error is called.
runtime/Mmakefile:
runtime/mercury_imp.h:
Add #includes of new files.
runtime/mercury_type_info.h:
Remove conditional definition of MR_STATIC_CODE_ADDRESSES
(moved into mercury_conf.h.in).
runtime/mercury_accurate_gc.h:
Remove stack_layout stuff, leave this file for accurate
GC specific definitions.
runtime/mercury_conf.h.in:
Add conditional definitions of MR_INSERT_LABELS,
MR_USE_STACK_LAYOUTS, MR_NEED_INITIALIZATION_CODE and
MR_STATIC_CODE_ADDRESSES, depending on various other options.
runtime/mercury_goto.h:
Insert labels into label table if MR_INSERT_LABELS is defined,
rather than NATIVE_GC.
util/mkinit.c:
Initialize if MR_NEED_INITIALIZATION_CODE is defined, rather than
NATIVE_GC.
runtime/mercury_stack_layout.h:
All the old stack layout definitions from mercury_accurate_gc.h.
Add code for MR_DETISM_DET_CODE_MODEL.
runtime/mercury_stack_trace.c:
runtime/mercury_stack_trace.h:
Implement MR_dump_stack which just provides a dump of the stack
as far as possible.
Set MR_INSERT_LABELS and MR_USE_STACK_LAYOUTS if MR_STACK_TRACE
is set.
runtime/mercury_grade.h:
Add _strce if stack tracing is enabled in the grade. This
might not be a permanent change.
runtime/mercury_ho_call.c:
Remove unused label declarations.
scripts/mgnuc.in:
Add --stack-trace and --no-stack-trace options.
Consolidate some duplicate code.
Estimated hours taken: 0.5
Fix a bug that broke grades `*.gc.prof.tr'.
runtime/Mmakefile:
library/Mmakefile:
compiler/Mmakefile:
profiler/Mmakefile:
When deciding whether to link with -lgc or -lgc_prof,
match against `*.gc*.prof*' rather than `*.gc*.prof'.
^
runtime/Mmakefile:
library/Mmakefile:
compiler/Mmakefile:
profiler/Mmakefile:
Match $(GRADE) against `*.gc*' rather than `*.gc', so that it
will link in the GC library for grades such as `asm_fast.gc.tr'.