[mercury-users] undefined reference to `MR_grade_v1_asm_fast_tags2' ????

Marko Schuetz marko at ki.informatik.uni-frankfurt.de
Fri May 28 17:00:36 AEST 1999


>>>>> "Fergus" == Fergus Henderson <fjh at cs.mu.OZ.AU> writes:

[...]

Fergus> Ah.  I think the problem is due to the the use of shared
Fergus> libraries on FreeBSD with Intel *86.  Mercury has been ported
Fergus> to FreeBSD before, with shared libraries, but perhaps that was
Fergus> a non-x86 system.  Getting PIC shared libraries to work with
Fergus> Mercury on Intel *86 is a little bit complicated, because of
Fergus> the way the Mercury compiler and PIC code both want to use the
Fergus> same register.  For details, see the README.Linux file.  For
Fergus> FreeBSD, I think the situation will be the same as for Linux.
Fergus> If my diagnosis is correct, the problem that you are observing
Fergus> arises because `ml' (the Mercury linker) does not use static
Fergus> linking by default for FreeBSD the way it does for Linux.

Fergus> Please try both

Fergus> 	(1) adding `MLFLAGS = --static' to your Mmakefile
Fergus> 	[This will give you a statically linked executable.]

kind% ./hello_world 
Hello, World!

Fergus> and	

Fergus> 	(2) adding `MLFLAGS = --shared' and adding
Fergus> 	`MGNUCFLAGS = --pic-reg' to your Mmakefile
Fergus> 	[This should give you a dynamically linked executable
Fergus> 	that uses shared libraries.]

Fergus> and let us know if these solve the problem.

kind% ./hello_world           
/usr/libexec/ld-elf.so.1: Undefined symbol "address_of_init_gc" referenced from COPY relocation in ./hello_world

Fergus> If (1) solves your problem, then you might want to try the attached
Fergus> patch out.  (cd scripts; patch < ml.in.patch; mmake install)
Fergus> This patch would make static linking the default for FreeBSD too.

Do the above results imply that shared libs will not work with
FreeBSD???

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