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: 80
Branches: main
A first implementation of the inter-module analysis framwork.
Currently only unused argument analysis is supported.
The current inter-module analysis scheme using `.trans_opt' files
has some major limitations. The compilation dependencies introduced
by `.trans_opt' files are too complicated for Mmake without major
limitations on which modules can use the contents of which `.trans_opt'
files. Also, the `.trans_opt' file system only computes greatest fixpoints,
which is often too weak to find opportunities for optimization.
A better solution is to provide a library which manually handles
the dependencies introduced by inter-module analysis, and can deal with
the complications introduced by cyclic module dependencies.
TODO:
- support other analyses, e.g. termination, type specialization
- dependency tracking and invalidation after source modifications
- garbage collection of unused versions
- least fixpoint analyses
analysis/Mmakefile:
analysis/mer_analysis.m:
analysis/analysis.m:
analysis/analysis.file.m:
The analysis library.
analysis/README:
Description and design documentation.
Mmake.workspace:
Mmakefile:
compiler/Mmakefile:
tools/bootcheck:
Link the analysis library into mercury_compile.
compiler/hlds_module.m:
Store analysis information in the module_info.
compiler/options.m:
doc/user_guide.texi:
Add an option `--intermodule-analysis'.
compiler/mercury_compile.m:
Call the analysis library to write the gathered
information at the end of a compilation.
compiler/unused_args.m:
Call the analysis library to retrieve information
about imported procedures. This replaces code which
used the `.opt' files.
Change the names created for unused arguments procedures
to include the arguments removed, rather than a sequence
number. I think Zoltan is working on a change to name
mangling, so I haven't updated the demangler.
compiler/prog_util.m:
Generate the new predicate names for unused_args.m.
library/std_util.m:
Add a polymorphic version of unit, which is useful
for binding type variables.
compiler/modules.m:
scripts/Mmake.vars.in:
Clean up files created by the analysis framework
in `mmake realclean'.
util/mdemangle.c:
profiler/demangle.m:
Document the change in the name mangling of procedures with
unused arguments.
configure.in:
Check for state variables and fixes for some typeclass bugs.
tests/warnings/Mmakefile:
tests/warnings/unused_args_analysis.{m,exp}:
Test case.
Estimated hours taken: 2
Branches: main
scripts/canonical_grade.sh-subr:
Fix a bug where passing il or java as the argument to
./canonical_grade --grade <grade> was returning "hl".
Estimated hours taken: 1
Branches: main, release
scripts/gud.el:
Fix the regexp which matches a procedure specification so that
it matches procedures which are contained in sub-modules.
Estimated hours taken: 0.25
Branches: main
scripts/Mmakefile:
Fix a bug introduced in Zoltan's recent change to the main branch:
delete a reference to the "install_cgi_scripts" target, since that
target no longer exists.
Estimated hours taken: 1
Branches: main, release
scripts/Mmake.rules:
compiler/compile_target_code.m:
Be consistent about using `-' rather than `/' for options to cl.
Use `-o ' rather than `-link -out:'.
Ensure that `-o' comes before $(MS_CL_LIBS).
Resynchronize the release branch with the main branch.
Estimated hours taken: 1
Branches: main, release
Search /usr/local/lib for shared libraries. This fixes
problems linking debugging executables on mundroo.
configure.in:
aclocal.m4:
Check for /usr/local/lib.
scripts/ml.in:
Document why we don't default to static linking for
all libraries on Solaris/x86.
Estimated hours taken: 0.5
Branches: main
Fix a bug in my previous change to fix a bug in fjh's previous change.
Revert back to using '/out:', and instead add the flag '/link' so that '/out:'
is passed to the linker instead to avoid problems compiling the library.
scripts/Mmake.rules:
compiler/compile_target_code.m:
Add '/link' before the '/out:'.
scripts/Mmake.rules:
Also add fjh's change for /LD to other rules building .dlls.
Estimated hours taken: 0.5
Branches: main
Fix a bug in fjh's previous change where we are passing the linker
flag for naming the output file to the C compiler, not the C compiler
flag.
scripts/Mmake.rules:
'-o' is the flag for naming the output file for the C compiler.
Estimated hours taken: 0.5
Branches: main
scripts/Mmake.rules:
When invoking $(MS_CL) to create DLLs, use the option "/LD" which
is documented in the help message, rather than the (undocumented?)
options "-link -noentry mscoree.lib -dll".
Estimated hours taken: 0.25
Branches: main
Fix "cygpath: command not found" errors with `mmake --use-mmc-make'.
configure.in:
bindist/bindist.configure.in:
scripts/Mmake.vars.in:
Check that `cygpath' exists, rather than hard-coding
it in Mmake.vars.in.
Estimated hours taken: 1
Branches: main
Make --c-debug work correctly when using MSVC as your C compiler.
compiler/compile_target_code.m:
scripts/mgnuc.in:
Use /Zi when --c-debug is enabled and we are using MSVC for
our C compiler.
scripts/ml.in:
Pass /DEBUG to the linker when --c-debug is enabled and we
are using MSVC for our C compiler.
runtime/Mmakefile:
Pass --c-debug to mgnuc rather than passing -g through to the
underlying C compiler.
Estimated hours taken: 3
Branches: main
Fix a bug where `mercury.dll' was not being found by the C# compiler.
when you configured with a non-MS C compiler. This bug broke
tests/hard_coded/foreign_type in grade il.
configure.in:
bindist/bindist.build_vars.in:
Rename CYGPATH as FIX_PATH_FOR_CC.
scripts/Mmake.vars.in:
Rename CYGPATH as FIX_PATH_FOR_CC,
and add new variables FIX_PATH_FOR_CL and FIX_PATH_FOR_CSC.
The new variables are currently hard-wired as `cygpath -w',
since currently we only support the MS versions of CL and CSC.
Also, change the definition of MERC_DLL_DIR to use $(GRADE)
rather than hard-coding "ilc".
scripts/Mmake.rules:
Use the new variables, rather than $(CYGPATH).
Also, update various comments, and delete the unnecessary version
number from the MS_VC7_INCLUDES_DIR and MS_VC7_INCLUDES variable
names.
scripts/ml.in:
Use @FIX_PATH_FOR_CC@ rather than @CYGPATH@.
Estimated hours taken: 3
Branches: main
Fix a bug where `mercury.dll' was not being found by the C# compiler.
when you configured with a non-MS C compiler. This bug broke
tests/hard_coded/foreign_type in grade il.
configure.in:
bindist/bindist.build_vars.in:
Rename CYGPATH as FIX_PATH_FOR_CC.
scripts/Mmake.vars.in:
Rename CYGPATH as FIX_PATH_FOR_CC,
and add new variables FIX_PATH_FOR_CL and FIX_PATH_FOR_CSC.
The new variables are currently hard-wired as `cygpath -w',
since currently we only support the MS versions of CL and CSC.
Also, change the definition of MERC_DLL_DIR to use $(GRADE)
rather than hard-coding "ilc".
scripts/Mmake.rules:
Use the new variables, rather than $(CYGPATH).
Also, update various comments, and delete the unnecessary version
number from the MS_VC7_INCLUDES_DIR and MS_VC7_INCLUDES variable
names.
scripts/ml.in:
Use @FIX_PATH_FOR_CC@, rather than @CYGPATH@.
Estimated hours taken: 0.75
Branches: main
scripts/Mmake.rules:
boehm_gc/Mmakefile:
runtime/Mmakefile:
library/Mmakefile:
trace/Mmakefile:
Run $(RANLIB) on the installed libraries.
This is needed on MacOS 10.1, where the linker checks the date
stamp on the .a file, refusing to link if this date is greater
than the date when ranlib was run. Since installing the
libraries with `cp' updates their timestamp, we need to rerun ranlib.
scripts/Mmake.rules:
Change some hard-coded occurrences of `.a' to `.$A'. This is
probably needed to make things work properly when building with MSVC.
Estimated hours taken: 1
Branches: main
Change things so that LIBGRADES includes the default grade.
This fixes a bug that sometimes caused the libraries not to be
installed in the default grade, e.g. when $(GRADE) is set in Mmake.params.
configure.in:
Don't delete $(GRADE) from $(LIBGRADES).
Mmakefile:
scripts/Mmake.rules:
compiler/make.program_target.m:
Change the loops over $(ALL_LIBGRADES) so that they skip $(GRADE).
scripts/Mmake.vars.in:
Delete an bogus assignment setting LIBGRADES to empty, since it
wasn't being used (LIBGRADES was being assigned again below).
Update the documentation for LIBGRADES.
Estimated hours taken: 3
Branches: main
Avoid warnings with gcc 3.1, 3.1.1 and 3.2: don't add -I/usr/local/include for
gcc. Also don't add -I/usr/local/include or -L/usr/local/lib if those
directories don't exist, because that too can result in annoying warnings.
configure.in:
Move the code to check whether to add -I/usr/local/include from
configure.in to a new macro MERCURY_CHECK_LOCAL_INCL_DIRS in
aclocal.m4, so that it can also be used by
bindist/bindist.configure.in.
Also, don't add /usr/local/lib to LIBS if that doesn't exist.
aclocal.m4:
Define the new macro.
Change that code so that it does not add -I/usr/local/include
if the C compiler is GCC, or if /usr/local/include doesn't exist.
Record whether or not to add -I/usr/local/include in a new autoconf
substitution variable ALL_LOCAL_INCL_DIRS.
bindist/bindist.configure.in
Call the new macro.
scripts/mgnuc.in:
Use @ALL_LOCAL_INCL_DIRS@ rather than -I$MERCURY_LOCAL_C_INCL_DIR or
-I/usr/local/include. (The ability to set the MERCURY_LOCAL_C_INCL_DIR
environment variable was not documented and was not used anywhere else
in the Mercury distribution.)
Estimated hours taken: 0.1
Branches: main
scripts/mgnuc.in:
Fix missing ";;" in case statement.
(This only showed up when trying to build GCC-related grades
with a non-GCC C compiler.)
Branches: main
Estimated hours taken: 0.25
scripts/Mmake.rules:
scripts/Mmake.vars.in:
Define ERR_REDIRECT in Mmake.vars.in, rather than Mmake.rules,
so that it can be overridden by the user's Mmakefile.
Branches: main
Estimated hours taken: 1
scripts/Mmake.rules:
Make the redirection of errors into `.err' files configurable,
by abstracting out the code to redirect errors into a variable
ERR_REDIRECT. By default the behaviour remains the same, but if
you run `mmake ERR_REDIRECT=', then errors will not be redirected.
Estimated hours taken: 6
Branches: main
Support shared libraries on mundroo.
configure.in:
Add support for shared libraries on x*86-*-solaris2.*.
boehm_gc/Makefile:
Compile mach_dep.c with $(CFLAGS_FOR_PIC), like we do all the
other C files in this directory. This is needed for Solaris/x86,
and should hopefully be harmless on other systems.
scripts/ml.in:
Make static linking the default for x*86-*-solaris2.*,
for the same reason as for Linux.
Also, pass -L/usr/local/lib, even when `--mercury-libs none' or
`--no-mercury-stdlib-dir' is specified. This is needed to ensure
that we find libreadline.a when building the Mercury standard
library, if libreadline.a is installed in /usr/local/lib.
(The Mercury configure script searches /usr/local/lib.)
runtime/Mmakefile:
trace/Mmakefile:
Include -L/usr/local/lib in LDFLAGS, for the same reason as above.
Estimated hours taken: 2
Branches: main
runtime/mercury_regs.h:
Allow "__ppc__" as another alternative to "__powerpc__" and "_POWER"
for recognizing Power PC processors.
scripts/mgnuc.in:
If $COMPILER is "unknown" (e.g. because $CC is "cc"),
don't disable grades such as "reg.gc".
Estimated hours taken: 2
Branches: main
Add a new grade component, .decldebug. It is as proposed on mercury-developers,
minus the implications about I/O tabling. Those will come later.
compiler/options.m:
Add a new option, --decl-debug, that switches on declarative debugging.
compiler/trace_params.m:
The procedure that converts strings representing trace levels to trace
levels themselves now has an extra argument, which gives the value of
the --decl-debug option. If set, it raises the minimum trace level,
and turn explicitly specifying trace levels `shallow' and `deep'
into errors (since they are not sufficient for declarative debugging).
compiler/handle_options.m:
Pass the value of the --decl-debug option to trace_params, and handle
the errors that may result. Handle the implications of --decl-debug
and the .decldebug grade component.
compiler/compile_target_code.m:
Define MR_DECL_DEBUG when invoking the C compiler if --decl-debug is
set.
runtime/mercury_conf_param.h:
Document MR_DECL_DEBUG, which is defined iff the grade is a .decldebug
grade.
runtime/mercury_grade.h:
Take MR_DECL_DEBUG into account when computing the grade component
related to debugging.
Update the list of places that need to be modified when adding new
grade components.
doc/user_guide.texi:
Document --decl-debug and the .decldebug grade component.
Document the events used by declarative debugging, since Mark didn't.
Fix some minor unrelated omissions.
scripts/init_grade.sh-subr:
scripts/parse_grade_options.sh-subr:
scripts/final_grade.sh-subr:
scripts/canonical_grade.sh-subr:
scripts/mgnuc.in:
scripts/ml.in:
Add a new shell variable, decl_debug, to represent the value of
MR_DECL_DEBUG, and handle it as appropriate.
tests/debugger/Mmakefile:
Do not execute shallow traced tests in .decldebug grades, since we
don't support shallow tracing in such grades.
Specify --trace decl instead of --trace deep in .decldebug grades
when compiling the other tests, since we don't support --trace deep
in .decldebug grades.
Estimated hours taken: 10
Branches: main
In the presence of foreign code the `.opt' and `.trans_opt' files
aren't grade independent, so install them in grade-dependent
directories.
scripts/Mmake.vars.in:
Define $(INSTALL_GRADE_INT_DIR), which holds `.opt'
and `.trans_opt' files.
Pass the extra libraries to mmc using `--ml' and `--mld'
(`--mercury-library' and `--mercury-library-directory')
options, rather than just a `-I' option. This is needed
so that $(INSTALL_GRADE_INT_DIR) is searched for `.opt'
files before $(INSTALL_INT_DIR)
Fix a bug -- the `-I' options for libraries should
go in CFLAGS, not MGNUCFLAGS.
scripts/Mmake.rules:
Create INSTALL_GRADE_INT_DIR in the install_grade_dirs target.
compiler/modules.m:
Install `.opt' and `.trans_opt' files in $(INSTALL_GRADE_INT_DIR).
`.int0' files are needed by `.opt' files for sub-modules, so
install them.
<module>.int0s now only contains the names of modules with sub-modules
(this is needed to avoid attempting to install nonexistent `.int0'
files).
compiler/handle_options.m:
Add $(INSTALL_GRADE_INT_DIR) for each `--mercury-library' option
to `--intermod-directories'.
Mmakefile:
scripts/Mmake.vars.in:
scripts/Mmake.rules:
Simplify the code to copy/remove the grade dependent files
before building the libraries in a new grade when installing.
Copy/remove all grade-dependent files, including `.opt' files
and `.dv' files.
Estimated hours taken: 0.25
Branches: main
A couple of additional parts of my change to add support for the
MPS garbage collector which I forgot to commit in my previous change.
util/mkinit.c:
Define the stack_bottom parameter of `mercury_init' to have type
`void *' rather than `char *', and make sure that it is word-aligned.
MPS requires that it be word-aligned.
scripts/mgnuc.in:
Handle the new `mps' GC method.
Estimated hours taken: 0.25
Branches: main
scripts/mgnuc.in:
Fix a bug in my previous change: handle the case where $gc_method
is `boehm' rather than `conservative', and pass -DMR_BOEHM_GC
as well as -DMR_CONSERVATIVE_GC.
Estimated hours taken: 20
Branches: main
Add support for interfacing Mercury with the MPS garbage collector.
This change is broken into three parts:
1. Import version 1.100.1 of the MPS kit into the Mercury
CVS repository, in the directory `mps_gc'.
2. Make some changes to the MPS kit for Mercury,
to support fully-conservative collection and tagged pointers,
and to wrap it in an interface that is similar to that of
the Boehm collector.
3. Modify the rest of the Mercury implementation
to support linking with the MPS kit instead
of the Boehm collector. This involved defining
`mps' as a new GC method and a new grade component.
This is part 3 of 3.
Mmake.workspace:
Include the MPS directories in the header file and library search
paths.
tools/bootcheck:
Link the mps_gc directory into the stage2 and stage3 directories.
Mmake.workspace:
runtime/Mmakefile:
scripts/ml.in:
For *.mps grades, link in mps.a.
(XXX ml.in is linking in libmps.a, which is wrong.)
runtime/Mmakefile:
trace/Mmakefile:
In the rule for `check_headers', which checks macro namespace
cleanliness, allow names to start with `MPS_' or `mps_'.
runtime/RESERVED_MACRO_NAMES:
Add `mercury_mps_h', which is used by mps_gc/code/mercury_mps.h
for its header guard. (Normally it would be better to use
uppercase for header guard macro names, but that would be
inconsistent with the coding style used in mps_gc/code.)
scripts/canonical_grade.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
scripts/canonical_grade.sh-subr:
Handle the new `mps' GC method and grade component.
compiler/globals.m:
compiler/options.m:
doc/user_guide.texi:
Replace gc_method `conservative' with two alternatives
`boehm' and `mps'. ("--gc conservative" is still allowed,
and treated as equivalent to "--gc boehm".)
Add new function `gc_is_conservative' to globals.m.
compiler/mercury_compile.m:
compiler/handle_options.m:
Use `gc_is_conservative' rather than `= conservative'.
compiler/handle_options.m:
Handle the "mps" grade component.
(XXX need to document this in options.m and user_guide.texi)
compiler/compile_target_code.m:
Pass the appropriate C defines for the new GC methods.
compiler/mercury_compile.m:
Wrap the work-around for a Boehm GC bug inside `#ifndef MR_MPS_GC'.
library/array.m:
Use GC_FREE() rather than GC_free().
This is needed for two reasons:
- so that it works with MPS, which only defines GC_FREE
- so that it works with then Boehm collector when
GC debugging is enabled
library/benchmarking.m:
Output GC statistics for the MPS collector.
runtime/mercury.h:
runtime/mercury_heap.h:
runtime/mercury_init.h:
runtime/mercury_memory.h:
If MR_MPS_GC is defined, use mercury_mps.h rather than gc.h.
runtime/mercury_conf_param.h:
Add configuration macros MR_BOEHM_GC and MR_MPS_GC.
Set MR_CONSERVATIVE_GC if either of these is set.
Default to MR_BOEHM_GC if only MR_CONSERVATIVE_GC is set.
runtime/mercury_context.h:
runtime/mercury_deep_copy.h:
runtime/mercury_engine.h:
runtime/mercury_float.h:
runtime/mercury_heap.h:
Explictly #include "mercury_conf.h", so that
MR_CONSERVATIVE_GC will be set properly before it is tested.
runtime/mercury_grade.h:
Handle the .mps grade component.
runtime/mercury_memory.c:
runtime/mercury_wrapper.c:
runtime/mercury_memory_handlers.c:
Move the call to MR_setup_signals() earlier in the
initialization sequence, so that the MPS signal handlers
get installed after our signal handlers. This is needed
because our signal handlers assume that any signals that
they can't handle are fatal errors, which interfere's
with MPS's use of signal handlers for memory barriers.
runtime/mercury_wrapper.c:
Add code to initialize the MPS collector.
Put code which is specific to the Boehm collector inside
#ifdef MR_BOEHM_GC rather than #ifdef MR_CONSERVATIVE_GC.
runtime/mercury_wrapper.h:
Update a comment.
Estimated hours taken: 0.1
Branches: main
scripts/mgnuc.in:
runtime/mercury_grade.h:
The code to pass the grade dependent C macros to the C compiler
recently moved from mercury_compile.m to compile_target_code.m,
so update the pointers to places that need to be changed when a
new grade is added.
Estimated hours taken: 0.1
Branches: main
scripts/Mmake.vars.in:
Add lib*.install to the list of targets that should
be handled by mmc with `--use-mmc-make'.
Estimated hours taken: 0.25
Branches: main, release
scripts/mmc:
Use `DEFAULT_MCFLAGS=${DEFAULT_MCFLAGS-...}' rather than
`DEFAULT_MCFLAGS=${DEFAULT_MCFLAGS=...}'. The latter form
causes /bin/sh on mundroo (Solaris/x86 2.8) to crash when
the RHS of the assignment is very long.
Estimated hours taken: 10
Branches: main
Library installation with `mmc --make'.
compiler/make.m:
compiler/make.program_target.m:
Handle `mmc --make lib<module>.install'.
compiler/options.m:
Add an option `--use-grade-subdirs', which causes
all grade-dependenent files to be placed in
`Mercury/<grade>/<ext>s' subdirectories, even
those files that are intended for use by the user.
`--use-grade-subdirs' is not documented because it
is only intended for use in library installation
with `mmc --make' (it doesn't work at all with Mmake).
Documenting it would require documenting (and setting
in stone) the layout of the `Mercury' directory, which
is probably a bad idea.
Mmake.workspace:
compiler/handle_options.m:
scripts/Mmake.rules:
Header files are now always searched for using the plain
file name (not Mercury/mihs/module.mih), so add a
`--c-include-directory' option to search Mercury/mihs
in the current directory.
compiler/modules.m:
compiler/intermod.m:
compiler/make.module_dep_file.m:
compiler/mercury_compile.m:
compiler/mlds_to_c.m:
compiler/trans_opt.m:
Handle `--use-grade-subdirs' in module_name_to_file_name.
Add module_name_to_search_file_name, which should be
used to generate the names of files that might be part
of an installed library. This is needed because installation
and local directory hierarchies have a different layout,
A better long-term fix would be to change things so that
the installation and local directory layouts are the same.
compiler/make.util.m:
compiler/make.dependencies.m:
compiler/make.module_target.m:
Add an extra argument to get_target_timestamp and
get_file_name to specify whether the file should
be searched for.
compiler/options_file.m:
scripts/Mmake.vars.in:
Handle the LIBGRADES and INSTALL_PREFIX make variables.
doc/user_guide.texi:
Remove the statement that library installation is
not supported with `mmc --make'.
Estimated hours taken: 1.5
Branches: main
Fix the code to add extra initialization functions to library/mer_std.init.
compiler/options.m:
doc/user_guide.texi:
compiler/compile_target_code.m:
Rename the `--make-init-file-command' as `--extra-init-command'.
This should now only generated the extra entries in the `.init'
file, not the whole file.
scripts/Mmake.vars.in:
compiler/modules.m:
Allow $(EXTRA_INIT_COMMAND) as the Mmake equivalent
of `--extra-init-command'. Append the output of
$(EXTRA_INIT_COMMAND) to the `.init' file.
library/Mmakefile:
Set EXTRA_INIT_COMMAND rather than overriding the
libmer_std.init rule.
Estimated hours taken: 0.1
Branches: main
scripts/Mmake.vars.in:
compiler/handle_options.m:
Fix a bug -- the grade-specific `inc' directory
for an installed library must be searched first.
`.mih' files are installed into the non-grade-specific
directory to avoid adding an extra entry in VPATH,
but those files won't necessarily be the right ones
for the current grade.
Estimated hours taken: 0.2
Branches: main
scripts/Mmake.rules:
compiler/modules.m:
In the presence of foreign code the `.opt' and `.trans_opt' files
aren't grade independent, so pass $(ALL_GRADEFLAGS) to mmc
when creating them.
Estimated hours taken: 1.5
Branches: main
My change to fix the handling of target specific MCFLAGS
variables didn't work with `--split-c-files'.
compiler/modules.m:
Fix some bugs in the handling of `--split-c-files':
- Make `--split-c-files' work where the module name doesn't
match the file name.
- $(MCFLAGS-module) wasn't being passed to mmc when `module.dir/*.o'
were being rebuilt (it was being passed when the files were
being built from scratch).
scripts/Mmake.rules:
The pattern rule for `%.dir/*.o' is now redundant, so remove it.
Estimated hours taken: 1
Branches: main
scripts/Mmake.vars.in:
The code to look up the target-specific MCFLAGS variable
assumed that mmc is always invoked by a pattern rule, which
isn't true if the module name doesn't match the file name.
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: 0.5
Branches: main
scripts/Mmake.rules:
Avoid generating interface files for the library in
the compiler directory by stripping the directory
from the module name passed to mmc.
Estimated hours taken: 0.25
Branches: main
Fix a bug in my change to generate grade dependent header files.
The `.mih' files weren't being installed for the default grade.
scripts/Mmake.rules:
Run `lib<main_module>.install_grade_hdrs' for
all grades, including the default grade.
Mmakefile:
library/Mmakefile:
libmer_std.install_grade_hdrs is now run by
libmer_std.install_library, so it doesn't
need to be explicitly invoked here.
Estimated hours taken: 25
Branches: main
Fix problems with the compiler-generated header files:
1. the header files are grade dependent, but the header files
can only be installed for one grade.
2. the generated header files can clash with system headers.
To solve these problems, the compiler now generates a
grade dependent `.mih' file containing the declarations
needed when a module is imported in a high-level C code
grade, and a grade independent `.mh' file, which contains
the prototypes for `:- pragma export' declarations.
compiler/export.m:
Generate a `.mh' rather than a `.h' file for the `:- pragma export'
declarations.
Allow the header file generated by export.m to be used with
`--high-level-code'.
compiler/modules.m:
library/Mmakefile:
Add a module.install_grade_hdrs target to install the `.mih'
files in a grade-dependent directory.
compiler/arg_info.m:
compiler/hlds_out.m:
compiler/hlds_pred.m:
Make it easier to tell if the arg_info field of the proc_info
has been set.
compiler/mlds_to_c.m:
Include both the `.mh' and `.mih' files for imported modules.
The type used as the return value for a semidet procedure
exported to C is `MR_bool', not `MR_Word'.
compiler/mlds_to_c.m:
compiler/modules.m:
Don't add a `mercury.' prefix to the standard library
header file names. They can't clash with the system
headers any more.
compiler/mercury_compile.m:
compiler/mlds_to_c.m:
Use export.m to generate the header file for `:- pragma export'
declarations even in hlc grades.
compiler/mlds.m:
compiler/ml*.m:
Distinguish between the `.mh' and `.mih' files
in `mlds__import's.
compiler/handle_options.m:
scripts/Mmake.vars.in:
scripts/mgnuc.in:
Add C include directory options for the installed grade
dependent `.mih' files.
Mmakefile:
scripts/Mmake.rules:
s/h/mih/ in the commands to save the grade dependent
files when installing the library grades.
compiler/make.m:
compiler/make.dependencies.m:
compiler/make.module_target.m:
compiler/make.util.m:
Handle dependencies on `.mh' and `.mih' files.
NEWS:
doc/user_guide.texi:
Document the change.
Estimated hours taken: 1
Branches: main
Handle LDFLAGS and LD_LIBFLAGS with `mmc --make'.
compiler/options.m:
doc/user_guide.texi:
Add `--ml-flags' as a synonym for `--link-flags'.
Add `--ld-flags' and `--ld-libflags', which are the
options corresponding to the LDFLAGS and LD_LIBFLAGS
Mmake variables.
Add a comment that the `--output-file' option is
ignored with `mmc --make'.
compiler/options_file.m:
Handle LDFLAGS and LD_LIBFLAGS.
Handle MLLIBS correctly. MLLIBS contains `-l' options
(which can be handled by mmc), not flags for ml.
The value of LIBRARIES (which contains Mercury libraries
to link with) now comes before MLLIBS, because Mercury
libraries depend on C libraries, but C libraries usually
don't depend on Mercury libraries.
compiler/compile_target_code.m:
Pass the value `--ldflags' or `--ld-libflags' to ml.
scripts/Mmake.vars.in:
Add LDFLAGS and LD_LIBFLAGS to the options file
passed to the options file passed to `mmc --make'
on standard input.