"Waldemar Kornewald" <Waldemar.Kornewald@xxxxxx> wrote: > > > > "Waldemar Kornewald" <Waldemar.Kornewald@xxxxxx> wrote: > > > > > Hi, > > > > > how can I produce a static lib in order to link my kernel > > > > > drivers/ > > > > > modules > > > > > against it? > > > > > Is there some Jamfile function for this in the OBOS tree? > > > > > > > > Yep, the astonishingly accurately named rule StaticLibrary. ;-) > > > > > > > > Usage: StaticLibrary <name_without_lib_and_extension> : < > > > > sources> ; > > > > > > Really? :)) > > > I thought there must be some settings like disabling templates > > > and > > > exceptions for drivers. How does the linker remove this code? > > > Can I really link my drivers against any static library? > > > > > Static libs are nothing more than a collection of .o files > > (an _ar_chive), the lib itself isn't linked to anything else. > > That's why if your lib uses libfoobar, you have to link the prog > > itself with libfoobar, unlike dynamic libs, which are themselves > > linked. > > But the code itself is compiled with exceptions. A call to "new" > might throw > an exception, but the driver has nothing that could handle this. Why > are > exceptions and templates turned off when compiling a driver then? Yep, unless you link against libgcc.a manually, you'll have to turn off exceptions and RTTI in the kernel. Templates are fine and their use is encouraged. :-) CU, Ingo