[mercury-users] undefined reference to `MR_grade_v1_asm_fast_tags2' ????
Fergus Henderson
fjh at cs.mu.OZ.AU
Thu May 27 23:51:14 AEST 1999
On 27-May-1999, Marko Schuetz <marko at ki.informatik.uni-frankfurt.de> wrote:
> kind% nm $d/i386-unknown-freebsd3.0/libmer_rt.a | grep -i grade
> mercury_grade.o:
> 00000000 R MR_grade_v1_asm_fast_gc_tags2
> 00000001 R MR_runtime_grade
> kind% nm $d/i386-unknown-freebsd3.0/libmer_rt.so | grep -i grade
> 0000c4f1 R MR_grade_v1_asm_fast_gc_tags2_picreg
> 0000c4f2 R MR_runtime_grade
> kind%
Ah. I think the problem is due to the the use of shared libraries on
FreeBSD with Intel *86. Mercury has been ported to FreeBSD before,
with shared libraries, but perhaps that was a non-x86 system.
Getting PIC shared libraries to work with Mercury on Intel *86 is a little bit
complicated, because of the way the Mercury compiler and PIC code both
want to use the same register. For details, see the README.Linux file.
For FreeBSD, I think the situation will be the same as for Linux.
If my diagnosis is correct, the problem that you are observing arises
because `ml' (the Mercury linker) does not use static linking by default
for FreeBSD the way it does for Linux.
Please try both
(1) adding `MLFLAGS = --static' to your Mmakefile
[This will give you a statically linked executable.]
and
(2) adding `MLFLAGS = --shared' and adding
`MGNUCFLAGS = --pic-reg' to your Mmakefile
[This should give you a dynamically linked executable
that uses shared libraries.]
and let us know if these solve the problem.
If (1) solves your problem, then you might want to try the attached
patch out. (cd scripts; patch < ml.in.patch; mmake install)
This patch would make static linking the default for FreeBSD too.
P.S.
In the version of README.Linux that shipped with Mercury 0.8 and 0.8.1,
there was a small mistake in README.Linux: where it says
`--mercury-libs shared', it should have said `--shared'.
(This only makes a difference if you are creating your own libraries.)
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post: mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the users
mailing list