[m-dev.] for review: work-around for lcc bug
Fergus Henderson
fjh at cs.mu.OZ.AU
Thu Jan 11 20:16:36 AEDT 2001
On 10-Jan-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> This looks a bit like a bug in this version of lcc and/or glibc, since
> libc.a includes references to libgcc.a, but lcc isn't linking in libgcc.a.
I've confirmed that this is indeed a bug in this version of lcc:
`lcc -static' reports the same spurious link error even for the
following strictly conforming ANSI/ISO C program:
#include <stdlib.h>
double pi() {
return strtod("3.14", NULL);
}
int main() {
return 0;
}
I've posted a bug report to comp.compilers.lcc (which is apparently
the official channel for such things).
Here's a proposed work-around. Does this look OK?
----------
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.)
Workspace: /home/pgrad/fjh/fs/roy2/mercury
Index: compiler/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/Mmakefile,v
retrieving revision 1.35
diff -u -d -r1.35 Mmakefile
--- compiler/Mmakefile 2000/12/11 05:38:45 1.35
+++ compiler/Mmakefile 2001/01/11 09:07:53
@@ -42,7 +42,7 @@
MERCURY_TRACE_LIB_MODS="$(BROWSER_DIR)/$(BROWSER_LIB_NAME).init" \
MERCURY_MKINIT=$(UTIL_DIR)/mkinit $(SCRIPTS_DIR)/c2init
ML = MERCURY_C_LIB_DIR=. $(SCRIPTS_DIR)/ml
-MLFLAGS = --mercury-libs none
+MLFLAGS = --shared --mercury-libs none
MLLIBS = $(TRACE_DIR)/lib$(TRACE_LIB_NAME).$A \
$(BROWSER_DIR)/lib$(BROWSER_LIB_NAME).$A \
$(LIBRARY_DIR)/lib$(STD_LIB_NAME).$A \
Index: profiler/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/profiler/Mmakefile,v
retrieving revision 1.18
diff -u -d -r1.18 Mmakefile
--- profiler/Mmakefile 2000/10/31 07:54:04 1.18
+++ profiler/Mmakefile 2001/01/11 09:10:23
@@ -40,7 +40,7 @@
MERCURY_TRACE_LIB_MODS="$(BROWSER_DIR)/$(BROWSER_LIB_NAME).init" \
MERCURY_MKINIT=$(UTIL_DIR)/mkinit $(SCRIPTS_DIR)/c2init
ML = MERCURY_C_LIB_DIR=. $(SCRIPTS_DIR)/ml
-MLFLAGS = --mercury-libs none
+MLFLAGS = --shared --mercury-libs none
MLLIBS = $(TRACE_DIR)/lib$(TRACE_LIB_NAME).$A \
$(BROWSER_DIR)/lib$(BROWSER_LIB_NAME).$A \
$(LIBRARY_DIR)/lib$(STD_LIB_NAME).$A \
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list