[m-dev.] for review: generating C layout structures

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Jan 10 23:43:48 AEDT 2001


On 10-Jan-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 10-Jan-2001, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> > 
> > It looks like the compiler cannot bootstrap in grade none.gc on hg with lcc
> > even *before* my changes. I get the following error messages from ml after
> > linking in both the compiler and the profiler directories:
> > 
> > /usr/lib/libc.a(strtoll.o): In function `__strtoll_internal':
> > /usr/src/packages/BUILD/glibc-2.1/stdlib/strtol.c:342: undefined reference to `__udivdi3'
> > /usr/src/packages/BUILD/glibc-2.1/stdlib/strtol.c:343: undefined reference to `__umoddi3'
> > /usr/lib/libc.a(strtoull.o): In function `__strtoull_internal':
> > /usr/src/packages/BUILD/glibc-2.1/stdlib/strtol.c:342: undefined reference to `__udivdi3'
> > /usr/src/packages/BUILD/glibc-2.1/stdlib/strtol.c:343: undefined reference to `__umoddi3'
> > gmake[2]: *** [mercury_compile] Error 1
> 
> Hmm, the problem there looks like `libgcc.a' is needed but not being linked in.
> 
> I'll investigate this one, but in the mean time try adding
> 
> 	EXTRA_MLFLAGS = `gcc --print-libgcc-file-name`
> 
> to Mmake.params.

Sorry, make that

	EXTRA_MLLIBS = -lc `gcc --print-libgcc-file-name`
	        ^^^    ^^^

(The explicit `-lc' is needed because of the one-pass linker.)
I've confirmed that this does indeed solve the problem.

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.

-- 
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