Re: dynamic ELF -> static executable?



Dear Paul,

Thanks for the quick reply. At this point I am divided whether to proceed with the idea at all.

The humble goal was to install VNC (at least the server) on an a SE Linux AS 3.0 system for which there is only an unreliable 4.0.0 beta version RPM and where anyway I am only of the hundreds of average Joe users (no root access). I first tried to compile vnc 4.1.1 from source but turned out it requires compilation of the full XFree tree (to get the Xvnc executable), which is said to be complicated and fail with a fair chance. An alternative solution could have been to take a binary from somewhere else, say Fedora 4. The main issue there is that the SE Linux system is glibc-2.2, while Fedora uses version 2.3. I tried including via LD_LIBRARY_PATH all the Fedora 4 shared libraries that Xvnc is linked against (at least as reported via ldd), and even Fedora's ld-linux.so, but that did not work. This is why I hoped to create a static Xvnc executable and use that one. Size is a non-issue, what matters to me is "least action".

Now seeing all the complications, and the uncertainties with dynamic->static conversion and portability, I think I will just try to compile the Xvnc-patched X and see whether that works.

Too bad it looks like there is no free lunch in this business - must have been too naive...

Denes

---------------

Email from Paul Pluzhnikov on Dec 25, 2005 at 11:48pm:

molnard@xxxxxxxxxxxxxxxxx writes:

Is there a way to combinbe a dynamic ELF executable with the shared
libraries it refers to into a static

Yes (but it's a hack, and the resulting executable is huge): http://groups.google.com/group/gnu.gcc.help/browse_frm/thread/7dd333be29171843

The last message in the thread refers to reducebind.c http link
which has "gone cold". Searching google for reducebind.c however
gives more locations, this one is currently alive:
http://bismark.extracon.it/linux/teso/filemirror/reducebind.c

(and hence more portable) version of the executable?

The notion that static executables are more portable is a wrong (or at least miguided) one. You may wish to read this thread on the subject: http://groups.google.com/group/comp.os.linux.development.apps/browse_frm/thread/3cb7d8fbf9d82d7b

The linux loader does something quite similar but I

The linux loader does nothing of the sort.

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


.