[CMake] Cross compile + shared libs problem

Frederik Deweerdt deweerdt at free.fr
Tue Apr 1 18:06:27 EDT 2008


On Tue, Apr 01, 2008 at 10:12:20PM +0200, Alexander Neundorf wrote:
> On Tuesday 01 April 2008, you wrote:
> > On Sat, Mar 29, 2008 at 12:25:45AM +0100, Alexander Neundorf wrote:
> > > On Tuesday 25 March 2008, you wrote:
> > > ...
> > >
> > > > I validated the general approach this morning, should be ready by
> > > > tomorrow.
> > >
> > > News ?
> >
> > Sorry, I couldn't quite save time to make a nice platform file. Would
> > you accept the following Rtems.make so that at least CMAKE_SYSTEM_NAME ==
> > "Rtems" works?
> 
> Hmm, no, that's a bit too little yet.
> If this is really enough to have apps and libs build for rtems, yes. If not, 
> we can do that later.
> If you have questions, just ask :-)
Well, I didn't figure out what should go to Platform, and what should
go to Toolchain. In fact the target is processor + bsp [1]. Should we make
a Toolchain per processor + bsp?

[1] Board Support Package, for example for sparc:
    * ERC32 with FPU
    * SPARC Instruction Simulator (sis)
    * leon2
    * leon3 
> 
> > I'm sorting out some setup problems, so I've not managed to prepare
> > a Rtems.make file that's able to generate executables (There are a
> > few linking flags and objdump magic that seem to be standard in Rtems
> > developemnt).
> 
> What do you need to do with objdump ?
Err, objcopy, my bad. A first pass does a bunch of --remove-section=, and a
second one does a -O binary with the resulting elf file. Then a "bin2boot"
utility is used to build the final bootable .exe file.

i386-rtems4.7-objcopy -O elf32-i386 --remove-section=.rodata --remove-section=.comment --remove-section=.note --strip-unneeded o-optimize/stub_server.elf o-optimize/stub_server.exe
i386-rtems4.7-objcopy -O binary o-optimize/stub_server.elf o-optimize/stub_server.bin
/opt/rtems/rtems4.7/i386-rtems4.7/pc386/build-tools/bin2boot -v o-optimize/stub_server.bt 0x00097E00 /opt/rtems/rtems4.7/i386-rtems4.7/pc386/lib/start16.bin 0x00097C00 0 o-optimize/stub_server.bin 0x00100000 0
Plus, there are a few magic numbers there which use I need to figure out.

Thanks,
Frederik


More information about the CMake mailing list