Regarding Simple Makefile + OMK template alternative

Pavel Pisa ppisa4lists at pikron.com
Mon Jul 17 20:59:09 UTC 2006


Hello David,

On Monday 17 July 2006 09:15, robe0413 at flinders.edu.au wrote:
> /home/vipre/david/rtems-cc/bin/i386-rtems-gcc -o init init.o
> -I/home/vipre/david/rtems-os/i386-rtems/pc386/lib/include/
> /home/vipre/david/rtems-cc/bin/../lib/gcc-lib/i386-rtems/3.2.3/../../../../
>i386-rtems/bin/ld: warning: cannot find entry symbol _start; defaulting to
> 08048080
> init.o(.data+0x4): undefined reference to `miniIMFS_ops'
> init.o(.data+0x38): undefined reference to `console_initialize'
> init.o(.data+0x3c): undefined reference to `console_open'
> init.o(.data+0x40): undefined reference to `console_close'
> init.o(.data+0x44): undefined reference to `console_read'
> init.o(.data+0x48): undefined reference to `console_write'
> init.o(.data+0x4c): undefined reference to `console_control'
> /home/vipre/david/rtems-cc/bin/../lib/gcc-lib/i386-rtems/3.2.3/../../../../
>i386-rtems/lib/libc.a(exit.o): In function `exit':
> /home/vipre/david/rtems/tools/b-gcc/i386-rtems/newlib/libc/stdlib/../../../
>../../gcc-3.2.3/newlib/libc/stdlib/exit.c:80: undefined reference to `_exit'
> collect2: ld returned 1 exit status
> make: *** [init] Error 1

It seems to me, that you do not link your application with RTEMS
libraries. You need to add next line to the Makefile

  LDFLAGS += -B/home/vipre/david/rtems-os/i386-rtems/pc386/lib/ -specs bsp_specs -qrtems

Even that is not fully correct, because you should invoke GCC with
options specified in

  /home/vipre/david/rtems-os/i386-rtems/pc386/Makefile.inc



You can also try our OMK (OCERA Makefile) solution
if you have a little brave soul. Next URL points to template
which we use to start new applications.

  http://cmp.felk.cvut.cz/~pisa/rtems/rtems-omk-template.tar.gz

It requires to provide only pointer to installed RTEMS library directory
for your target in the "config.target" file. You would need to use
next pointer in the file "config.target" for your target probably:

  RTEMS_MAKEFILE_PATH=/home/vipre/david/rtems-os/i386-rtems/pc386/

The template provides base for building libraries and applications.
It can even link initialization contents for target filesystem
into application. The build is not controlled by Makefile files
but by Makefile.omk ones. Their syntax is modelled close to
Automake Makefile.am files but it is interpretted directly by GNU make.

There is one requirement for our Makefile.rules usage, you need
to use/update to GNU make-3.81 or newer. Older versions has bugs which
cannot be workaround easily for our concept.

The OMK concept can be used for many more targets then RTEMS alone.
The latest rules for all targets are stored in the next repository

  http://rtime.felk.cvut.cz/darcs/darcsweb.cgi?r=omk;a=summary

I would be very interested, if the concept could be review by
others. If it is found valuable, the template could be copied
to some RTEMS FTP contrib area or I can add some description
to the RTEMS Wiki.

I am little worried, what next line from 4.8 proposed changes
means to our future OMK use with RTEMS.
Would Makefile.inc be removed?

| *  Drop the Makefile fragments. Suggested by RalfCorsepius.

Best wishes and thanks for possible comments

              Pavel Pisa



More information about the users mailing list