how to compile library for use without OS ?

I am writing a library for ARM. My work station is running Debian and Gentoo Linux on x86.

The target is an ARM dragonball. It has a bootstrap, and shall not have any OS.

My library is written in POSIX C98, compiled under Linux.

The bootstrap is created by some one else using C++ and IAR on Windows.

I need to produce a static library, so that the other company, let me call them Zoro, can link my lib with their bootstrap, and call my functions.

Since I can cross compile to produce a static library, and can provide Zoro with a header file, I really think it should be easy for me to write a lib, and provide a header, the problem is that I have no clue how to

- cross compile for ARM from x86

- create a static library for use with direct boot strap

- how Zoro shall call and include my lib in their project.

I have already written dynamic libs for Linux.

The problem is that i dont know how to:

- cross compile

- create a lib for standalone use (without OS)

- write a bootstrap in C++ and call funtions inside my lib

Zoro will call my lib, but I shall tell them how to do so.

I hope I have been clear, feel free to ask back about any fuzzy point.

--
DEMAINE Benoit-Pierre (aka DoubleHP ) http://www.demaine.info/
\_o< If computing were an exact science, IT engineers would not have work >o_/
Reply to
DEMAINE Benoit-Pierre
Loading thread data ...

Linux

with a

provide a

For bootstrap ideas, search for programs called locators. They take the compiler output and resolve all of the relocation references needed to load the programs into memory. Usually the OS will handle that when it executes programs, but it has to be done before the program can actually run. Most have samples of the bootstrap utilities needed to run on bare silicon.

Bob McConnell N2SPP

Reply to
Bob McConnell

with a

provide a

Static libraries are basically a callection of objects in a single archive file. When Zoro calls and uses any of your library functions, their linker will pull out the object and add it to the objects it is linking.

Most tools chains will/should have a static library archive tool. If not, you might be able to use a GNU AR for ARM. (Comes in the bintools package, I think, but I may be wrong.)

Static libraries are completely different to dynamic. Dynamic libs usually have one copy of the code in one place that is loaded on demand, code from a static library is included in all the programs that use it.

Just like any other function, just make sure they have the static library in the list of files to be linked.

Regards,

NBB

Reply to
NBBhav

Give Zoro the sources as they seem to have the needed knowledge.

--
42Bastian
Do not email to bastian42@yahoo.com, it's a spam-only account :-)
Use @monlynx.de instead !
Reply to
42Bastian Schick

my source is written in Posix-C98 for GCC, their compiler (which is different) may not be compatible, but I hope binary static library are.

--
DEMAINE Benoit-Pierre (aka DoubleHP ) http://www.demaine.info/
\_o< If computing were an exact science, IT engineers would not have work >o_/
Reply to
DEMAINE Benoit-Pierre

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.