On Tue, 29 Mar 2005, Amir Binyamini wrote:

> I made some tests with setting LD_LIBRARY_PATH and LD_PRELOAD (before
> sending my fisrt post
> in this thread) and they failed; (I had a crash in run time).Again , I
> don't think the details are important because I made many tries and I am not
> an expert in glibc;
> Hpwever,If somebody have success in compiling and running hello_world with a
> new glibc which is installed
> in a private (non-system) folder, I will appreciate telling us how.

a-ha. so you refuse to talk, do you? well, we haev methods that'll make
you sing!

first thing - you need to make sure gcc does not link in the system's
standard C library. it has a flag named '-nostdlib', which excludes
linking of these files.

second, you need to tell it to do link the private copy of the standard C
library that you've compiled.

third, you'll need to link in gcc's 'crt1.o' object file, which contains
the code that performs runtime initialization of a C source file. on my
(very very old) system, it is found at
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o, which is
actually /usr/lib/crt1.o .

after you get this done, run 'ldd' on the resulting binary - see where it
points to. if it points to the wrong glibc, set LD_LIBRARY_PATH to have
the privave glibc's 'lib' library at the front, and check again with
'ldd'. tweak it until finally ldd points to the right glibc.

as for 'ld.so' - you can avoid using it, by compiling with the '-static'
flag. don't say "but i need it linked dynamically" - you'll get that
solved later, after you solve the static linking issues, first.

finally, if you still don't manage to get these things done, and you come
here with "i don't want to write what i tried, because i tried many things
and it must be a straightforward thing to do" - we'll send ScsiMan after
you, and then you'll be bound to talk - you have been warned...

do note that last i did such things was several years ago, and i have no
intentions of compiling a glibc library here now just because _you_ are
too lazy to give the details and to make the experimentation.

-- 
guy

"For world domination - press 1,
 or dial 0, and please hold, for the creator." -- nob o. dy

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to