[m-rev.] diff: fix linker problems with mmc --make on x86

Julien Fischer juliensf at csse.unimelb.edu.au
Thu Aug 10 14:39:49 AEST 2006


I have a regression test for the following bug but integrating it into the
test suite is a bit tricky so I'll do that as a separate change - I want
to commit this bit now because it's holding up work on cadmium.

Estimated hours taken: 6
Branches: main, release

Fix a bug reported by Greg Duck.  On x86 systems mmc --make was not building
static executables by default, but was linking in shared versions of some
libraries.  This won't work correctly on x86 machines because of our use of
the register ebx as a global register in non-pic code(***).  The following
patch causes mmc --make to invoke the linker with the same default settings as
mmake on x86 machines.

*** Obviously it works fine in those grades that do not use global registers.

scripts/Mercury.config.in:
 	The default values for the `--linkage' and `--mercury-linkage'
 	options on x86 should be `static' not `shared'.

Julien.

Index: scripts/Mercury.config.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/Mercury.config.in,v
retrieving revision 1.13
diff -u -r1.13 Mercury.config.in
--- scripts/Mercury.config.in	2 Feb 2006 00:03:28 -0000	1.13
+++ scripts/Mercury.config.in	10 Aug 2006 03:39:58 -0000
@@ -115,5 +115,7 @@
  		@MCFLAGS_FOR_CC@ \
  		$(MERCURY_DEFAULT_OPT_LEVEL) \
  		@MMC_USE_SYMLINKS_OPT@ \
-		@LIBGRADE_OPTS@ 
+		@LIBGRADE_OPTS@  \
+		--linkage @DEFAULT_LINKAGE@ \
+		--mercury-linkage @DEFAULT_LINKAGE@


--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list