I've been hitting my head against a wall with something which I originally thought would have been easy:
We've developed an algorithm that we now want to compile and distribute as a static library, to be linked against, instead of compiling & linking straight from the source code.
This works, but produces code that runs much slower than the original compiled code, to the point of causing severe buffer underruns (same code, only linked as a packaged static library, rather than straight from the object files)
Our newly introduced linking step (to build the library) looks something like this:
ar rcs libsomething.a a.o b.o c.o
Is there something special we need to do to make the library "realtime-ready" or something? I'm fresh out of ideas!
UPDATE: This was solved by linking with the following pattern: LDLIBS=-lrt -lsomething -lrt
(in other words, linking librt
before and after our custom lib.