[mercury-users] Re-definition of malloc
Julien Fischer
juliensf at cs.mu.OZ.AU
Wed Jun 21 23:20:08 AEST 2006
On Wed, 21 Jun 2006, Jonathan Morgan wrote:
> When trying to build the curs samples under Linux (Fedora Core 3,
> mercury-0.12.0), I get the following errors.
>
> /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../libc.a(malloc.o)(.text+0x1380):
> In function `free':
> : multiple definition of `free'
> Mercury/os/curs.o(.text+0x1800): first defined here
> /usr/bin/ld: Warning: size of symbol `free' changed from 9 in
> Mercury/os/curs.o to 175 in
> /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../libc.a(malloc.o)
> /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../libc.a(malloc.o)(.text+0x2c70):
> In function `malloc':
> : multiple definition of `malloc'
> Mercury/os/curs.o(.text+0x17b8): first defined here
> /usr/bin/ld: Warning: size of symbol `malloc' changed from 9 in
> Mercury/os/curs.o to 373 in
> /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../libc.a(malloc.o)
> /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../libc.a(malloc.o)(.text+0x30a0):
> In function `realloc':
> : multiple definition of `realloc'
> Mercury/os/curs.o(.text+0x17f4): first defined here
> /usr/bin/ld: Warning: size of symbol `realloc' changed from 9 in
> Mercury/os/curs.o to 531 in
> /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../libc.a(malloc.o)
> collect2: ld returned 1 exit status
> gmake: *** [demo] Error 1
>
> I presume that the problem is with the following code, re-defining
> *alloc in terms of GC_*ALLOC. Does anyone have any suggestions?
It looks like ld on that system is configured to treat multiple
definitions as a fatal error. You'll need to tell it that it isn't.
Something like the following at a guess:
EXTRA_LDFLAGS=--allow-multiple-definitions
Julien.
--------------------------------------------------------------------------
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