-1

I have an (xxx.so) shared library file and its based on powerpc linux. now i want to use it in our project but first we need to convert it to X86 or X64 shared library for pc linux. anyone can help me about this? Is it possible?

Claudio
  • 10,614
  • 4
  • 31
  • 71
  • 3
    You can't convert a precompiled binary. Assuming the source does not have any platform dependent code or has platform support for x86, then you need to recompile the library from source with an x86 target compiler. – kaylum Dec 09 '15 at 10:43
  • You can try to [decompile](http://stackoverflow.com/questions/2306972/is-there-any-way-to-decompile-linux-so) and recompile the resulting source code. – orkoden Dec 09 '15 at 11:30
  • Find the x64 release, or download the source code, and compile on your x64 machine. – Eric Dec 09 '15 at 11:44
  • how i can decompile and recompile it? i tried REC & retdec.com but returned source code was not usable. – AliAhwazTop Dec 09 '15 at 11:47

2 Answers2

1

You can't: a binary file resulting from compilation of a C/C++ program is compiled for a specific Instruction Set Architecture. Since the two platforms have different instructions sets, you cannot convert the library of an architecture to the other. You need therefore to recompile the library.

Claudio
  • 10,614
  • 4
  • 31
  • 71
1

First I would say that if you are trying to use functions from a library on one linux to another then there is a very good chance the library is available (somewhere) for your target machine. The odds are that the source code should be available.

If the library is specific to tat version of Linux then you should not be using it for cross platform work.

That said in principle you can :

  • Run the powerpc version of linux on an x86 or x64 system using a VM.
  • Try the the decompile-recompile route already suggested to you.
  • Write your own equivalent library for the target.
  • See if anyone has written a binary translation application for this purpose.

But if the library you want to use is simply not available for the system you are targeting, then you quite simply should not be trying to use it. It's practically suicidal programming practice.