9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] setmalloctag in cc.a?
@ 2006-12-31 17:53 Micah Stetson
  2006-12-31 19:51 ` Charles Forsyth
       [not found] ` <66f4993796d468c324e7cd31e6c8c74e@proxima.alt.za>
  0 siblings, 2 replies; 11+ messages in thread
From: Micah Stetson @ 2006-12-31 17:53 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] setmalloctag in cc.a?
  2006-12-31 17:53 [9fans] setmalloctag in cc.a? Micah Stetson
@ 2006-12-31 19:51 ` Charles Forsyth
  2007-01-01  1:29   ` Micah Stetson
       [not found] ` <66f4993796d468c324e7cd31e6c8c74e@proxima.alt.za>
  1 sibling, 1 reply; 11+ messages in thread
From: Charles Forsyth @ 2006-12-31 19:51 UTC (permalink / raw)
  To: 9fans

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

something else in libc calls it, and it can't load both malloc definitions.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] setmalloctag in cc.a?
  2006-12-31 19:51 ` Charles Forsyth
@ 2007-01-01  1:29   ` Micah Stetson
  2007-01-01  6:19     ` Micah Stetson
  2007-01-01 10:18     ` Charles Forsyth
  0 siblings, 2 replies; 11+ messages in thread
From: Micah Stetson @ 2007-01-01  1:29 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> >/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?
>
> something else in libc calls it, and it can't load both malloc definitions.

Hum.  I looked for that and didn't see it...  I'll check again.

Micah


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] setmalloctag in cc.a?
  2007-01-01  1:29   ` Micah Stetson
@ 2007-01-01  6:19     ` Micah Stetson
  2007-01-01 10:18     ` Charles Forsyth
  1 sibling, 0 replies; 11+ messages in thread
From: Micah Stetson @ 2007-01-01  6:19 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> > something else in libc calls it, and it can't load both malloc definitions.
>
> Hum.  I looked for that and didn't see it...  I'll check again.

I did miss it.  It's getenv().

Thanks,

Micah


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] setmalloctag in cc.a?
  2007-01-01  1:29   ` Micah Stetson
  2007-01-01  6:19     ` Micah Stetson
@ 2007-01-01 10:18     ` Charles Forsyth
  1 sibling, 0 replies; 11+ messages in thread
From: Charles Forsyth @ 2007-01-01 10:18 UTC (permalink / raw)
  To: 9fans

>Hum.  I looked for that and didn't see it...  I'll check again.

getenv


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] setmalloctag in cc.a?
       [not found] ` <66f4993796d468c324e7cd31e6c8c74e@proxima.alt.za>
@ 2007-01-02  5:39   ` Micah Stetson
  2007-01-03  4:06     ` lucio
  0 siblings, 1 reply; 11+ messages in thread
From: Micah Stetson @ 2007-01-02  5:39 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> Hmm, I note I have omitted "os" and compiled "libc" successfully.

I did see the trouble with 'os', looks like some files are missing to
me, but I wanted to put together something to program my little AVR
before I worried about it.

> And do you have any samples to test the suite on?  I must confess that
> the lack of documentation is seriously trying my rather limited
> resourcefulness.

Hadn't gotten that far yet.  I'm only getting a few minutes here and
there to look at it.  I was planning to blink some LEDs with the
assembler before I got too concerned about the rest.  I was looking
over avr/os/l.s for guidance.  In any event, my first goal is to throw
something together to talk to the chip using my El Cheapo
parallel-port adapter.

Micah


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] setmalloctag in cc.a?
  2007-01-02  5:39   ` Micah Stetson
@ 2007-01-03  4:06     ` lucio
  2007-01-03 16:44       ` Micah Stetson
  0 siblings, 1 reply; 11+ messages in thread
From: lucio @ 2007-01-03  4:06 UTC (permalink / raw)
  To: 9fans

> Hadn't gotten that far yet.  I'm only getting a few minutes here and
> there to look at it.  I was planning to blink some LEDs with the
> assembler before I got too concerned about the rest.  I was looking
> over avr/os/l.s for guidance.  In any event, my first goal is to throw
> something together to talk to the chip using my El Cheapo
> parallel-port adapter.

You have noticed that Inferno has an STK-500 programmer interface in
/dis/avr/burn.dis?  Sadly, I'm stuck with an STK-200 for a while, but
I'm hoping to improve on that.  Of course, no large memory devices
this side, just yet, either.

++L



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] setmalloctag in cc.a?
  2007-01-03  4:06     ` lucio
@ 2007-01-03 16:44       ` Micah Stetson
  2007-02-06  4:46         ` Lucio De Re
  0 siblings, 1 reply; 11+ messages in thread
From: Micah Stetson @ 2007-01-03 16:44 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> You have noticed that Inferno has an STK-500 programmer interface in
> /dis/avr/burn.dis?  Sadly, I'm stuck with an STK-200 for a while, but
> I'm hoping to improve on that.  Of course, no large memory devices
> this side, just yet, either.

Charles pointed that out to me yesterday, and I've given it a quick
look.  It'll need some modification to work with a parallel-port
programmer.  It looks like the STK-200 uses a similar parallel-port
interface to what I've got.  I'll let you know if I get something
working, but no promises -- I don't have much time to give this little
project.

Micah


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] setmalloctag in cc.a?
  2007-01-03 16:44       ` Micah Stetson
@ 2007-02-06  4:46         ` Lucio De Re
  2007-02-06  5:41           ` Lucio De Re
  0 siblings, 1 reply; 11+ messages in thread
From: Lucio De Re @ 2007-02-06  4:46 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Wed, 2007-01-03 at 08:44 -0800, Micah Stetson wrote:
> > You have noticed that Inferno has an STK-500 programmer interface in
> > /dis/avr/burn.dis?  Sadly, I'm stuck with an STK-200 for a while, but
> > I'm hoping to improve on that.  Of course, no large memory devices
> > this side, just yet, either.
> 
> Charles pointed that out to me yesterday, and I've given it a quick
> look.  It'll need some modification to work with a parallel-port
> programmer.  It looks like the STK-200 uses a similar parallel-port
> interface to what I've got.  I'll let you know if I get something
> working, but no promises -- I don't have much time to give this little
> project.
> 
I just remembered (I happened to be going through my mailbox to make it
a bit easier to handle and your message popped up), that I also own an
Atmel Butterfly.  It has a built-in bootstrap loader, although I confess
I remember little of the scant documentation I read a long time ago.  I
just thought I'd mention it and use the opportunity to keep in touch.

++L

PS: Excuse the mailer, I'm out of the office.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] setmalloctag in cc.a?
  2007-02-06  4:46         ` Lucio De Re
@ 2007-02-06  5:41           ` Lucio De Re
  2007-02-06  6:31             ` Bruce Ellis
  0 siblings, 1 reply; 11+ messages in thread
From: Lucio De Re @ 2007-02-06  5:41 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> I just remembered (I happened to be going through my mailbox to make it
> a bit easier to handle and your message popped up), that I also own an
> Atmel Butterfly.  It has a built-in bootstrap loader, although I confess
> I remember little of the scant documentation I read a long time ago.  I
> just thought I'd mention it and use the opportunity to keep in touch.
> 
> ++L
> 
> PS: Excuse the mailer, I'm out of the office.
> 
Oops!  Bitten by the "reply-to" setting in 9fans.  Please accept my
apologies, everyone.

++L




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [9fans] setmalloctag in cc.a?
  2007-02-06  5:41           ` Lucio De Re
@ 2007-02-06  6:31             ` Bruce Ellis
  0 siblings, 0 replies; 11+ messages in thread
From: Bruce Ellis @ 2007-02-06  6:31 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

well i was surprised by setmalloctag when first introduced.
it's good.  but if you have your own malloc then you have to stub it,
it can do nothing or something good.  ozinferno (Rel C) got screwed
by this but simply fixed.  simple answer, if you have your own malloc
then think about how you can use setmalloctag to your advantage.
or just stub it and ignore it's functionality.

brucee

On 2/6/07, Lucio De Re <lucio@proxima.alt.za> wrote:
> > I just remembered (I happened to be going through my mailbox to make it
> > a bit easier to handle and your message popped up), that I also own an
> > Atmel Butterfly.  It has a built-in bootstrap loader, although I confess
> > I remember little of the scant documentation I read a long time ago.  I
> > just thought I'd mention it and use the opportunity to keep in touch.
> >
> > ++L
> >
> > PS: Excuse the mailer, I'm out of the office.
> >
> Oops!  Bitten by the "reply-to" setting in 9fans.  Please accept my
> apologies, everyone.
>
> ++L
>
>
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-02-06  6:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-31 17:53 [9fans] setmalloctag in cc.a? Micah Stetson
2006-12-31 19:51 ` Charles Forsyth
2007-01-01  1:29   ` Micah Stetson
2007-01-01  6:19     ` Micah Stetson
2007-01-01 10:18     ` Charles Forsyth
     [not found] ` <66f4993796d468c324e7cd31e6c8c74e@proxima.alt.za>
2007-01-02  5:39   ` Micah Stetson
2007-01-03  4:06     ` lucio
2007-01-03 16:44       ` Micah Stetson
2007-02-06  4:46         ` Lucio De Re
2007-02-06  5:41           ` Lucio De Re
2007-02-06  6:31             ` Bruce Ellis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).