Estimated hours taken: 0.1
Branches: main
configure.in:
Record the set of library grades to install in a file named
.configured_library_grades. This is useful when you want to know
how many grades are still left to do during a "make install".
(In particular, do not use it when the C compiler is clang since that doesn't
support it on Mac OS X.)
configure.in:
For some reason the configure test for the __thread extension
is passing with clang on Mac OS X 10.7 even though it is
not supported. Don't allow __thread to be used if we are
using clang.
Branches: main, 11.07
Fix problems that prevent Mercury from building on Mac OS X
PowerPC machines.
(This should fix bug #255, although I don't have a machine
running Mac OS 10.4 so I can't check that.)
browser/Mmakefile:
mdbcomp/Mmakefile:
ssdb/Mmakefile:
Older versions of make (such as that shipped with
Mac OS X 10.3) only support conditionals with at
most one else branch: avoid using conditionals with
multiple else branches.
configure.in:
runtime/mercury_conf.h.in:
Define a macro if the header file sys/resource.h.
mdbcomp/shared_utilities.m:
Conditionally include sys/resource.h. It contains
declarations required by setrlimit on older versions
of Mac OS X.
Branches: main
Do not attempt to use setrlimit on systems that do not support it.
configure.in:
Test for the presence of the setrlimit function
runtime/mercury_conf.h.in:
Define the macro MR_HAVE_SETRLIMIT if setrlimit is
present.
mdbcomp/shared_utilities.m:
Only attempt to modify the stack limit if MR_HAVE_SETRLIMIT
is defined.
Use don't-care variables for the I/O state in the foreign_proc.
(Avoids warnings from MSVC.)
Branches: main, 11.07
Set the host and target environment types at configuration time. By default,
they were both set to "posix" but that is no longer compatible with building
the csharp grade using the Microsoft compiler.
configure.in:
Set the environment type to "cygwin" on Cygwin, to "msys" on MinGW
and to "posix" otherwise. (For Mercury installations that work with
the Windows command interpreter, it will need to be manually set to
"windows".)
scripts/Mercury.config.in:
Set the environment type. (We set the target and host separately
so that is easier for installers to automatically modify this file.)
README.MS-VisualC:
Conform to the above change.
Branches: main
Don't make the choice of whether MR_THREAD_SAFE is defined in parallel grades
in the configure script. There's no reason to do so and handling it
differently from the other grade component macros is just confusing.
compiler/compile_target_code.m:
scripts/mgnuc.in:
If we are in a parallel grade then define MR_THREAD_SAFE.
configure.in:
Don't include -DMR_THREAD_SAFE in the value of CFLAGS_FOR_THREADS.
Branches: main
A step towards getting compilation with the MacPorts version of the MinGW cross
compiler working on Mac OS X. It's not clear that this is terribly useful as
the version of mingw-gcc in MacPorts is ancient (3.4.5). (I will also try
using the nognu port, maybe that is more recent.)
configure.in:
When checking whether the Mercury compiler is up-to-date, pass options
appropriate to the build compiler, not the host one. This avoids
problems where the build Mercury compiler doesn't support --linkage
static but the host one does.
Use AC_CHECK_TOOL to check for ar in the non-MSVC case. This means
the correct host type prefix will get attached when cross compiling.
(The prefix is for MacPorts mingw-gcc is not a standard host triplet,
it's simply i386-mingw.)
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.07
Avoid a dodgy GCC optimization on Mac OS X.
configure.in:
Disable GCC's -ftree-vrp optimization on Mac OS X with
GCC 4.2 since it causes code in the hlc.gc grade to be
miscompiled.
Branches: main, 11.07
configure.in:
The MinGW port of texi2dvi is now works.
(The use of tex2dvi was disabled on MinGW six years ago because
the then current version went into a loop.)
Branches: 11.07, main
Improve and update documentation of the MSVC port.
Add batch files for invoking mdb and mprof; avoid problem with mercury.bat.
README.MS-VisualC:
Rewrite this file, it was very much out-of-date.
The major changes are:
+ we now describe how to set up a Cygwin or MSYS shell
with MSVC available.
+ the source distribution now works with MSVC.
+ a list of the limitations of the MSVC port has been added.
+ a description of how to set up the compiler so that it
works from the Windows command prompt has been added.
scripts/mercury/mercury.bat.in:
Delete support for the MERCURY_COMPILER and MERCURY_CONFIG_DIR
enviorment variables; the handling of them in this batch file
doesn't appear to be portable across different versions of
Windows and it's more important that this file work in the
normal case. (Keeping it simple is the way to ensure this.)
scripts/mdb.bat.in:
scripts/mprof.bat.in:
Templates for invoking mdb and mprof on Windows.
(I'm not sure how to reproduce all the functionality of the mdb
script in a batch file, so the command line options provided by
the mdb script aren't currently replicated here.)
configure.in:
scripts/Mmakefile:
Add the new batch files.
scripts/Mercury.config.in:
Use the Windows-style installation prefix on Cygwin systems.
browser/util.m:
Use the conventional name for the I/O state.
Use don't-care variables for the I/O state in foreign procs.
This avoids suprious warnings from MSVC.
reviews.
The configure script now supports the --without-hwloc option to disable the use
of hwloc, even if it is installed.
configure.in:
Allow the use of libhwloc to be disabled with the --without-hwloc option.
Distribute the autoconf macros for pkg-config with Mercury.
This allows mercury to be compiled from CVS on hosts that don't have these
macros in their autoconf installation.
acinclude.m4:
m4/mercury.m4:
Moved acinclude.m4 to m4/mercury.m4. This file contains mercury-specific
macros.
m4/pkg.m4:
Copied pkg.m4 from the autoconf installation on taura. This file contains
pkg-config macros.
INSTALL_CVS:
Mmakefile:
tools/test_mercury:
When calling aclocal pass the -I m4 option.
tools/bootcheck:
Create a link to the m4 directory when setting up stage directories.
Fix static linking with mmc --make and hwloc.
compiler/compile_target_code.m:
Conform to changes in scripts/ml.in (where static linking and hwloc is
already handled correctly).
compiler/options.m:
Create new options so that Mercury.config can tell mmc what options are
needed for linking to hwloc.
scripts/Mercury.config:
Pass hwloc linking options to the compiler.
Branches: main, 11.07
Fix a typo in the configure script.
configure.in:
When adding trailing grades, don't add the grade
BEST_LLDS_BASE_GRADE.debug.gc since (1) this is not
trailing grade and (2) the name is not canonical (and
in fact duplicates a grade added elsewhere.)
configure.in:
scripts/ml.in:
Determine and use the static linking options for hwloc when ml is invoked
with --static.
More robust detection of when to use the hwloc linking options is now used.
+ Now pins threads intelligently on SMT systems by balancing threads among
cores.
+ performs fewer migrations when pinning threads (If a thread's current
CPU is a valid CPU for pinning, then it is not migrated).
+ Handle cases where the user requests more threads than available CPUs.
+ Handle cases where the process is restricted to a subset of CPUs by its
environment. (for instance, Linux cpuset(7))
This is largely made possible by the hwloc library
http://www.open-mpi.org/projects/hwloc/ However, hwloc is not required and the
runtime system will fall back to sched_setaffinity(), it will simply be less
intelligent WRT SMT.
runtime/mercury_context.h:
runtime/mercury_context.c:
Do thread pinning either via hwloc or sched_setaffinity. Previously only
sched_setaffinity was used.
Update thread-pinning algorithm, this:
Include the general thread pinning code only if MR_HAVE_THREAD_PINNING is
defined.
Use a combination of sysconf and sched_getaffinity to detect the number of
processors when hwloc isn't available. This makes the runtime compatible
with Linux cpuset(7) when hwloc isn't available.
configure.in:
Mmake.common.in:
Detect presence of the hwloc library.
configure.in:
Detect sched_getaffinity()
aclocal.m4:
acinclude.m4:
Move aclocal.m4 to acinclude.m4, the aclocal program will build aclocal.m4
and retrieve macros from the system and the contents of acinclude.m4.
Mmakefile:
Create a make target for aclocal.m4.
runtime/Mmakefile:
Link the runtime with libhwloc in low-level C parallel grades.
Include CFLAGS for libhwloc.
scripts/ml.in:
Link programs and libraries with libhwloc in low-level C parallel grades.
runtime/mercury_conf.h.in:
Define MR_HAVE_HWLOC when it is available.
Define MR_HAVE_SCHED_GETAFFINITY when it is available.
runtime/mercury_conf_param.h:
Define MR_HAVE_THREAD_PINNING if either hwloc or [sched_setaffinity and
sched_getaffinity] are available.
runtime/mercury_thread.c:
runtime/mercury_wrapper.c:
Only call MR_pin_thread and MR_pin_primordial_thread if
MR_HAVE_THREAD_PINNING is defined.
runtime/mercury_thread.h:
runtime/mercury_context.h:
Move the declaration of MR_pin_primordial_thread to mercury_context.h from
mercury_thead.h since it's definition is in mercury_context.c.
Require MR_HAVE_THREAD_PINNING for the declaration of
MR_pin_primordial_thread.
runtime/mercury_wrapper.c:
Conform to changes in mercury_context.h
INSTALL_CVS:
tools/test_mercury
Run aclocal at the right times while testing Mercury.
Branches: main, 11.07
Suppress the MSVC banner message, e.g. pass -nologo to cl, by default.
configure.in:
Do the above for mmc --make.
scripts/mgnuc.in:
Do the above for mmake.
Fix a couple of typos.
Branches: main, 11.07
Don't use -o when creating executables with MSVC. (For some silly
reason its been deprecated and we have to use -Fe instead.)
Note that mmc --make already uses -Fe with MSVC, this change only
affects mmake.
configure.in:
scripts/Mmake.vars.in:
Define a new variable, EXEFILE_OPT, whose variable gives the option
used to name executables.
compiler/write_deps_file.m:
Use the above variable instead of hardcoding the option to be
"-o".
Branches: main, 11.07
Only force -O0 for old versions of clang; more recent versions do not encounter
problems when compiling Mercury generated C code.
configure.in:
scripts/mgnuc.in:
As above.
README.clang:
Conform to the above change.
Branches: main, 11.07
More Visual C related stuff.
compiler/globals.m:
Allow the C compiler type string for Visual C to have the form
"msvc_<VERSION>" as well as "cl_<VERSION>". Support for the
latter form will eventually be dropped.
configure.in:
Avoid pattern matching on the value of CC; it isn't a reliable
way of telling what the C compiler is.
Use the "-" form of options for MSVC in more places.
scripts/ml.in:
Use the "-" form of options for MSVC.
Branches: 11.07, main
Fix problems with mmc --make and Visual C.
compiler/compiler_target_code.m:
The "-o" option has been deprecated in Visual C, and we need to
use "-Fe" to name executables.
Fix an incomplete comment.
configure.in:
Use the dash form for MS linker options rather than the forward
slash form. (The latter don't work with the MSYS shell.)
Branches: main, 11.07
Make the low-level C .par grades work on MinGW.
configure.in:
On MinGW set the target architecture to i686 in .par grades
so that the GCC built-in atomic ops are available.
Branches: main, 11.07
Avoid warnings about functions that don't return in the runtime
with MSVC.
Avoid a warning in the configure script with MSVC.
configure.in:
The cygpath tool is only required with MSVC when using
Cygwin as the build environment; don't emit an error message
about this on other systems, e.g. MingGW.
runtime/mercury_std.h:
Redefine MR_NO_RETURN so that it works with both GCC/Clang
and Visual C.
runtime/mercury_misc.h:
runtime/mercury_engine.c:
Conform to the above change to MR_NO_RETURN.
runtime/mercury_bootstrap.h:
Delete the redefinition of NO_RETURN; any code that still
uses is not going to work for a variety of other reasons.
Branches: main, 11.07
Various fixes for MSVC.
configure.in:
Use -link instead of /link with MSVC since the latter
form causes trouble for MSYS.
scripts/ml.in:
As above, but for the -DEBUG option.
scripts/parse_ml_options.sh-subr.in:
Don't strip executables on MinGW for the moment.
(XXX We should re-enable this for the MinGW / GCC
combination and probably also check what the current
situation on Cygwin and Darwin is.)
library/store.m:
Shut up a warning from MSVC about a local variable
that is used without being initialised.
Branches: main, 11.07
Fix an XXX related to clang and shared libraries on Mac OS X.
configure.in:
Use clang not gcc on Mac OS X for building shared libraries when using
clang as a C compiler.
Delete support for using flat namespaces with dylibs. This was
only necessary for creating dylibs that would work on Mac OS X 10.2
and before; now it's no longer worth maintaining the code in the
configure script that allowed it.
README.MacOS:
Conform to the above change.
Branches: main, 11.07
Support using clang as a C compiler with Mercury -- currently only
tested on Mac OS X.
Clean up the handling of C compilers in the configure script.
configure.in:
Improve this script's ability to distinguish between different
types of C compiler. In particular, ensure that a clear
distinction is maintained between clang and gcc.
Fix an old XXX: don't rely on pattern matching on the value
of $CC to determine the C compiler type. This is particularly
error prone now since one compiler is named "clang" and another
"cl".
Set optimization and warning flags for clang.
(XXX this is currently very conservative; we need to go through
them and work out what good defaults might be.)
Don't link against libgcc if we are using clang.
(XXX I don't think this is really necessary for gcc either in
the great majority of cases.)
Mark spots that still need updating with "XXX CLANG"; I will
look into these separately.
aclocal.m4:
Add a new macro that determines the C compiler type based
on what builtin macros are defined -- unlike AC_PROG_CC
this macro correctly distinguishes between gcc and clang.
Add two new macros that determine version information for
clang and for Visual C.
scripts/mgnuc.in:
scripts/ml.in:
Handle clang
README.MacOS:
Mention that clang can be used with Mercury on Mac OS X.
Branches: main
Check that the bootstrap compiler supports `where type_is_abstract_enum'
syntax, as that now shows up in ROTD snapshots.
configure.in:
As above.
Branches: main, 11.07
Improve support for building the Visual C port in MSYS.
configure.in:
scripts/mgnuc.in:
Use the -OPT form for cl command line options
instead of the /OPT form. The latter confuses
the MSYS shell.
Branches: main, 11.07
configure.in:
Don't emit warnings about being unable to create named pipes on
MinGW, since MinGW doens't currently provide (working) support
for doing that.
Estimated hours taken: 2
Branches: main
configure.in:
Add a new option, --enable-additional-libgrades=grade1,grade2
that allows users to specify a list of grades to ADD to the
automatically configured list, rather than replacing it.
Print the list of grades to be installed at the end, where the user
is much more likely to see it. Also move an associated warning.
Print an estimate of the time required for installation (which can
be a crude estimate only due to variations in machine speeds),
along with a message about how it can be sped up.
Branches: main, 11.01
Revert custom setting of HBLKSIZE in parallel grades on Linux.
It was already reverted on other systems due to problems with it not working.
If Boehm GC is configured to use mmap/munmap, it aborts with the following
message when GC_free is called:
Duplicate large block deallocation of 0x7f2769f10000
configure.in:
As above.
Branches: main, 11.01
Disable installation of low-level C .par grades on MinGW.
The use of pthreads-win32 and gcc's __thread extension results in
linking problems.
configure.in:
As above.
Branches: main, 11.01
Avoid a problem that was causing exception handlers to not work on MinGW /
Windows XP in the hlc grades.
configure.in:
scripts/mgnuc.in:
Avoid the use of gcc's -fomit-frame-pointer option on MinGW.
It interferes with the correct operation of setjmp / longjmp.
(It does *not* interfere with gcc's __builtin_{set,long}jmp, so
maybe exceptions should be implemented using those where possible.)
library/backjump.m:
Unrelated change: fix some broken debugging code.
Branches: main
Only modify the value of Boehm GC HBLKSIZE macro on Linux.
Attempting this modification on other system, e.g. Mac OS X and
MinGW, results in a system that doesn't work.
configure.in:
Define a new configure variable, BOEHM_MISC_CFLAGS_FOR_THREADS,
that can be used to pass C compiler flags to the Boehm collector
in parallel grades on a system specific basis.
On Linux, modify the value of HBLKSIZE when building the collector
in parallel grades.
Mmake.common.in:
Delete the hardcoded setting of HBLKSIZE and use the new configure
variable.
Fix a comment.
Branches: main, 10.04
Support the use of the pthreads-win32 library on MinGW systems.
(This is based on the patch provided by Sergey Khorev.)
The main change is to remove the assumption in the runtime code
that POSIX thread handles are integers; in the pthreads-win32 library
they are not.
With this change the hlc.par.gc grade will work on Windows / MinGW.
(The low-level C parallel grades will require further work.)
configure.in:
Configure the Boehm GC to use pthreads-win32 if that is being used
to provide threads for the runtime on MinGW.
Delete the --with-pthreads-win32 option; it is no longer needed.
Add a new option --with-gc-pthreads-win32 that forces the Boehm GC
to use pthreads-win32. This is the default for MinGW anyway, the option
is intended for use by developers using pthreads-win32 in other ways,
e.g. with MSVC.
runtime/mercury_thread.h:
Add a new macro / function (depending on the implementation of pthreads)
that returns the "null" thread.
Add a new macro MR_thread_equal() that tests two thread handles
for equality.
runtime/mercury_thread.c:
Provide implementations of MR_null_thread().
Add a macro, for use within this module, that returns the id
of a thread in a form suitable for use in debugging messages.
runtime/mercury_engine.c:
runtime/mercury_context.c:
runtime/mercury_wrapper.c:
runtime/mercury_thread.c:
Use MR_null_thread() instead of NULL or 0.
Use MR_thread_equal() instead of directly comparing thread handles.
Branches: main, 10.04
Have configure check for the use of the pthreads-win32 library on MinGW. (In
the future we may also want to do this in the case where Cygwin is being used
to cross-compile a native Windows version of Mercury, although this change
doesn't handle that case.)
runtime/mercury_conf.h.in:
Add a new configuration macro that is defined if the threads
library is pthreads-win32.
configure.in:
If POSIX threads are available and we are on MinGW check if we are
using pthreads-win32 (which should be the case sice AFAIK there
isn't a readily available alternative).
aclocal.m4:
Add a new macro that checks if the threads library is
pthreads-win32.
Estimated hours taken: 0.2
Branches: main
configure.in:
When --enable-trail-grades is specified, ensure that the best
LLDS debug grade with .trseg is also installed.
Add the new option --disable-old-prof-grades, which disables
the non-deep profiling grades (such as .prof and .memprof).
Sort the list of installed libgrades, to make it easier to see
how far an installation has gotten. Since this also allows the removal
of any duplicate grades, the code that adds grades to the list doesn't
have to be constructed specifically to rule out such duplicates.
Branches: main
Use mkstemp() to implement `io.make_temp' where possible. The current
implementation generates highly predictable file names which is a problem for
security. More importantly for us, the generated names are based on the
initial process ID only, so if the process forks a lot of child processes which
each want to make temporary files, this will lead to conflicts (e.g. mmc --make
with high enough number of jobs).
configure.in:
library/io.m:
Check for mkstemp(), #defining MR_HAVE_MKSTEMP if it exists.
runtime/mercury_conf.h.in:
Use mkstemp() to implement `io.make_temp' where possible.
Branches: main, 10.04
Fix a configuration problem on Cygwin.
(Note this affects compilers that produce exectuables that rely on cygwin.dll,
no those that are just using Cygwin as environment for cross-compiling to
native Windows.)
configure.in:
Don't pass `--linkage static' on Cygwin hosts when checking for
an up-to-date mmc since the static version of libgcc_s may not
be present.