LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Running new binary into older distro (https://www.linuxquestions.org/questions/linux-software-2/running-new-binary-into-older-distro-4175592411/)

coltson 10-28-2016 05:21 AM

Running new binary into older distro
 
Hi, I have a program (amule) from a newer distro that I would like to run into a older distribution. I had successfully done the opposite before (running older binary into newer distro) and didn't know when I begin that forward compatibility was a problem in Linux. I started by copying all the dynamic libs that the binary depend upon to a special directory together with the executable file. Then I added that directory to ld.conf.so and executed ldconfig. Finally I tried to run it with ./exec_name. And received
Quote:

./amule
./amule: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by ./amule)
./amule: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.15' not found (required by /media/34GB/Arquivos-de-Programas-Linux/Amule/libcrypto++.so.9)
./amule: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by /media/34GB/Arquivos-de-Programas-Linux/Amule/libcrypto++.so.9)
./amule: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.15' not found (required by /media/34GB/Arquivos-de-Programas-Linux/Amule/libwx_gtk2u_adv-2.8.so.0)
./amule: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by /media/34GB/Arquivos-de-Programas-Linux/Amule/libwx_gtk2u_core-2.8.so.0)
./amule: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.15' not found (required by /media/34GB/Arquivos-de-Programas-Linux/Amule/libwx_baseu_net-2.8.so.0)
./amule: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.15' not found (required by /media/34GB/Arquivos-de-Programas-Linux/Amule/libwx_baseu-2.8.so.0)
All that even with the copy of libc.so.6 being from the system where I copied the binary.

Trying to run ./lib.so.6 give me this message
Quote:

./libc.so.6: error while loading shared libraries: unexpected PLT reloc type 0x2a
.

I trowed these two error message in a engine search and found that you need to use the ld-linux.so.2 from the buiding system. So I copied ld-2.15.so from the newer distro to the directory where the amule binary and the other libraries are and created an ld-linux.so.2 symbolic link to it. Finally I tried
Quote:

./ld-linux.so.2 amule
but I received
Quote:

amule: error while loading shared libraries: amule: cannot open shared object file: No such file or directory
So how I should proceed, what did I wrong, should I manipulate some library environment variable?

P.S: I was also receiving
Quote:

./amule: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by ./amule)
, which I solved by copying the libstdc++ from the newer distro to the new directory and then calling ldconfig, but when I do that, no program from the old distro that was written in c++ could work, so I need a solution with ld-linux.so.2

Thanks for any help.

business_kid 10-28-2016 10:11 AM

You are in for major suffering trying to do it that way.

I would recommend trying the old binary in a chroot. That way, you could have 2 versions of glibc installed one in the chroot, one for the base system. The chroot cannot access / on the system.

Linuxfromscratch uses a chroot, and you could benefit by reviewing chapters 4 - 6 in the book
http://www.linuxfromscratch.org/lfs/view/stable/

They cope with the opposite problem - the base system may have an older incompatible glibc than the one being built, but the isolation is the same. You will need a chroot with old glibc and anything else required. This will be a major pain to create and a greater issue to maintain going forward, so if there are options I'd consider them.

ondoho 10-28-2016 01:05 PM

thhat said, i hink there are one or two programs that create this environment for you, sortof like the old "portable" approach.
if only i could remember the name...
i remember i once managed to use a newer gimp version on debian stable with that.
fairly easy to do, but somewhat clunky.
i think one would need to create that container first on a system where amule works.


Quote:

Originally Posted by coltson (Post 5624011)
All that even with the copy of libc.so.6 being from the system where I copied the binary.

you mean you actually replaced your libc file with an older version???
:eek:

on a sidenote, amule's filesharing protocol is a zombie. 99% (i guess) of all filesharing happens over bittorrent protocol.


All times are GMT -5. The time now is 01:05 AM.