ELF crt* files

lange92 at 2067.resnet.uni.edu lange92 at 2067.resnet.uni.edu
Wed Aug 15 04:55:50 UTC 2001


Hi all,
  I am attempting another fresh build of gnat/rtems from scratch, and
discovered that in addition to the online docs at oarcorp.com, it's
required to patch (-p0) the gcc sources with the gnat patch. patching
binutils is also beneficial, but the bit_ada script will complete without
it being patched (though the tools might not be terribly useful.) The
patch for newlib is so small it's downright trivial and appears to be
something which could be ignored, having built it both ways.
  However, there's still the annoying part about ld requiring the crti.o
file to compile the rtems-4.5.0 package. Building with either the manual
configure-make procedure, or the bit_rtems script produces the same
result: after 11+ minutes of building, it aborts, again demanding the
crti.o (which means it would later ask for crtn, crtbegin, and crtend. I
know, ELF.)
  I found a solution to that problem. I modified
rtems-4.5.0/c/src/tests/samples/Makefile.in, changing

SUBDIRS = hello ticker base_sp unlimited minimum $(MP_TESTS)   $(CPLUSPLUS_TESTS) $(FP_TESTS)
to
SUBDIRS =

thereby skipping compilation of the test programs. After that the entire
bit_rtems script ran fine (compilation takes right at 45 minutes on an
800Mhz PII.)

I was hoping that the appropriate crt*.o files would be generated during
the execution of bit_ada or bit_rtems, so I could insert the proper
binaries and re-enable the tests.

A monster grep appears to indicate that the crti.o file should have been
compiled as a part of binutils, but the only crt* file that is produced
in the whole process is crt0.o.

Having found that very fascinating Makefile in the archive, I built
everything as ELF (i386-elf) this time, with no modifications except to
i386ex/startup/linkcmds:115, as documented previously. Since I eliminated
the building of the tests to avoid the crti/crtn nonsense, my first test
will be the hello_world_ada example application, combined with the
Makefile in the archive.

I'm also considering the necessity of the old lilo patch to get things
working. I'll play with that after the hello_world_ada test.

DanL




More information about the users mailing list