[En-Nut-Discussion] How is the tracer.c compiled? (was RE: Ethernut 3 linking problem: multiple definitions and undefined references)

José Vallet jose.vallet at hut.fi
Thu Feb 19 10:51:39 CET 2009


OK, going forward with the problem about undefined reference to 
`NutTraceTerminal'

José Vallet wrote:
> __________________
> ../NutDAC/lib/libndterm.a(nut-cmds-term.o): In function 
> `nut_cmds_register_cmds':
> nut-cmds-term.c:(.text+0x30): undefined reference to `NutTraceTerminal'
> __________________
> 
> do I have to do something special in Ethernut3 in order to use the trace 
> utilities?

In the source code of the tracer (os/tracer.c) one can find the 
following comment

\note  Only supported on AVR-GCC platform

followed by the following preprocessor statement

#if defined(__GNUC__) && defined(__AVR__)

It is seems clear then that the tracer is only available for the AVR 
architecture.

However, while checking the os/Makefile I cannot find any reference to 
tracer.c, and still it is included in libnutos.a for the AVR 
architecture. And still I can find this in the Makefile

#Add support for memory banks on AVR architecture
ifeq ($(ARCH), avr)
     SRC2 += bankmem.c
endif

which makes me think that a somehow "natural" solution would have been 
to use the line
SRC2 += bankmem.c tracer.c

As a side note, we can find tracer.c in the os/Makefile used in the 
document "Playing the Nut/OS Configuration Game" to explain the 
compilation process. Obviously there has been changes with time.

The only files with a reference to "tracer.c" that I have found in the 
nut directory are os/tracer.c and conf/os/os.nut. So is the magic 
happening in conf/os/os.nut?

This is a mystery to me. Could somebody explain me how the tracer.c is 
then compiled and included in the libnutos.a for the AVR arch? Just for 
the pleasure of learning :-)

Thanks!

José



More information about the En-Nut-Discussion mailing list