So I'm starting to play with Charles Forsyth's zc compiler for Atmel
AVRs (/n/sources/contrib/forsyth/avr.9gz), but I get errors trying to
link zc:

8l  -o 8.out cgen.8 enam.8 list.8 mul.8 peep.8 reg.8 sgen.8 swt.8
txt.8 ../cc/cc.a8
malloc: /386/lib/libc.a(setmalloctag): redefinition: malloc
(1054)  TEXT    malloc+0(SB),$24
free: /386/lib/libc.a(setmalloctag): redefinition: free
(1098)  TEXT    free+0(SB),$12
realloc: /386/lib/libc.a(setmalloctag): redefinition: realloc
(1105)  TEXT    realloc+0(SB),$28
calloc: /386/lib/libc.a(setmalloctag): redefinition: calloc
(1134)  TEXT    calloc+0(SB),$24
mk: 8l  -o ...  : exit status=rc 985: 8l 987: error

I can fix this by adding the following lines to cc/compat.c:

void
setmalloctag(void*, ulong)
{
}

/sys/src/cmd/cc does this, but I don't understand why.  I don't see
any place where setmalloctag is called, so why is 8l trying to pull it
in?

Micah

Reply via email to