[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [rtl] Using libm in rt-space
The "neatest" solution is to take the source code for the functions you're
interested in and modify them to use whatever mechanism you want, either
printk() or no messages output at all.
Alternately, if I was going to use the wrapper-technique you describe, I'd
definitely allow an optional printk() output while I was debugging to see if
there are any hidden problems.
I believe that there are also ways to use a script-file to direct the loader
(ld which IIRC is used to actually do the 'linking') to substitute your own
entry point for one in the original module(s) so that you could then
seamlessly substitute _any_ routines for ones like fprintf(), malloc, etc.
Norm
----- Original Message -----
From: Jan Albiez <albiez@fzi.de>
To: RT Linux Mailinglist <rtl@rtlinux.org>
Sent: Monday, May 21, 2001 11:01 AM
Subject: [rtl] Using libm in rt-space
> Hoi !
>
> I try to use some mathematical function inside a rt-thread. At the
begining
> this didn't seemed to be a problem. I linked the libm.a (part of glibc)
> statically to my rt-module and everything was fine. The functions used
until
> this point had been the sine and the cosine functions.
>
> The problemarised the moment i used asin the first time. Somehow the
> designers of glibc have decided that some of the functions should make use
> of the classical standard error output via fputs and stderr. These symbols
> are (naturally) not available in rt-context. At the moment I just have
> defined myself a workaround of the form:
>
> int fputs(void) {
> return 1;
> }
>
> int stderr;
>
> which so far satisfies the linker, and works as far as i can see. But i
> don't think this is clean. Has anybody a better solution ?
>
> blue skies
> Jan
> --
> -- Jan Christian Albiez --
> -- FZI -- Haid-und-Neu-Str. 10-14 -- 76131 Karlsruhe -- +49 721 9654
206 --
> -- segmentation violation in module reality.o ...
> ... please shutdown your universe and
reboot --
>
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail majordomo@rtlinux.org OR
> echo "unsubscribe rtl <Your_email>" | mail majordomo@rtlinux.org
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/rtlinux/
>