Search
Primary links
Please donate to libfreevec to ensure its continuing development! Donations are done via Paypal.
HOWTO: Using libfreevec using LD_PRELOAD
markos — Tue, 19/08/2008 - 13:18
Ok, let's suppose you've downloaded libfreevec, built it successfully and now you want to use it for the whole system, without recompiling the whole system to use the library! Is it possible? Thanks to a glibc feature you can!
There are two ways to do that:
- one is to use the LD_PRELOAD environment variable, eg. at boot time, but there is a more elegant way to do this.
- by use of the /etc/ld.so.preload file, which is most likely distro-agnostic, so that the dynamic loader ld.so loads libfreevec before any other library (including libc.so).
The 2nd is a much more elegant solution, IMHO, and I've been using it for months with no problems whatsoever. So, after you install the library somewhere (by default it's installed in /usr/local/lib/) you could just do a:
echo /usr/local/lib/libfreevec_libc.so > /etc/ld.so.preload
Beware it has to be the libfreevec_libc.so and not the libfreevec.so as the 2nd one prefixes each function with vec_ and is only useful to someone that wants to use the library explicitly -for whatever reason.
The next application you will load you will use the AltiVec functions in libfreevec! Enjoy! :)
Note: This has a slight overhead which would reduce some of the performance in the functions, but would still prove a good move in most cases.
loader problems on ps3
Andrei.hu — Tue, 23/09/2008 - 13:31Hi
I have tried to make libfreevec accessible on my PS3 (it
runs YDL 6.0). When I start gdb, loader gives me the following error:
I have created a simple application and check loaded libraries, everything seems ok:
Does anybody know why i see those messages? Most probably it's not a big issue as i have seen the message only for gdb so far.
Not sure, but 32-bit or 64-bit gdb?
markos — Fri, 26/09/2008 - 22:40So far libfreevec doesn't work with 64-bit binaries, perhaps gdb is a 64-bit binary? Not sure really why this is so with your setup, gdb here works fine (at least on all the 32-bit systems I tested it), I'll try to test with a 64-bit system later on.