Executable working in solaris but not in linux - linux

I have an executable in Solaris which when i migrate to linux doesn't work.
bash: ./client: cannot execute binary file
I came through some points that I need to recompile the code in linux to make it work, but the issue is I have only executable and no source code.
I wanted to decompile the code from executable in solaris, but couldn't find any decompiler in the environment
Can anyone suggest a way out. I am stuck here.
Help much appreciated.

There is no support for running a Solaris binary on Linux. Given the fact it seems the binary if for x86, your best option is to run it on a VM. Solaris is well supported on VirtualBox.

Related

Cross-compilation targeting Cygwin with Linux host

Is it possible to cross-compile a program targeting a Cygwin environment from a Linux/Unix host? I'm mostly trying to avoid using a Windows WM for building a collection of programs.
From the website:
Cygwin is not:
a way to run native Linux apps on Windows. You must rebuild your application from source if you want it to run on Windows.
mingw-w64 is not enough, I need a full POSIX platform. I'm also wondering if it's possible to target MSYS2.
Perhaps I'm not understanding correctly, and one doesn't need to compile in Cygwin but only mingw-w64 is necessary.
Thanks!
It is possible to compile for Cygwin from Linux.
The cygwin1.dll itself is built in such way.
Packages/libraries are available at:
https://copr.fedorainfracloud.org/coprs/yselkowitz/cygwin/
Of course only a minimal set of tools/libraries is available

is it possible to cross-compile from x86(x64) windows to x86(x64) linux?

I have been wonder about why x86(windows) to arm(linux) cross compile is possible but x86(windows) to x86(linux) cross compile is impossible or difficult only can use cygwin
As below link there is some cross-compiler for windows to arm from personal pc(x86), but there is no cross-compiler x86 to x86.
http://gnutoolchains.com/beaglebone/
why window(x86) to Debian(ARM) is available without cygwin , but window to Debian(x86) is difficult or must use cygwin?
Is this issue caused by POSIX size problem? The library size of Debian in ARM is little bit smaller than x86 ones?
I confuse....
I want to anyone clear to me.
Thank you for reading.
I installed WSL and then Debian as an Windows-App
directly under my Windows10 Home Edition.
Now I can open a Linux command prompt in every directory I want.
Installed g++ with apt-get (changed to root with "sudo su").
Using Mingw64 command prompt from the Git-Bash I can even use the same shell script
to compile console apps as Linux and Windows executables!

Compile python 3 script to standalone exe in Linux

Can a python 3 script be compiled in a linux environment in such a way as it can be run under Windows?
If so what compile tool? ie. py2exe or pyinstaller ect.
You're looking for cross-compilation, and the answer is no.
Can I package Windows binaries while running under Linux?
No, this is not supported. Please use Wine for this, PyInstaller runs fine in Wine. You may also want to have a look at this thread in the mailinglist. In version 1.4 we had build in some support for this, but it showed to work only half. It would require some Windows system on another partition and would only work for pure Python programs. As soon as you want a decent GUI (gtk, qt, wx), you would need to install Windows libraries anyhow. So it's much easier to just use Wine.
Can I package Windows binaries while running under OS X?
No, this is not supported. Please try Wine for this.
Can I package OS X binaries while running under Linux?
This is currently not possible at all. Sorry! If you want to help out, you are very welcome.
You may use Wine or the Windows Subsystem for Linux to attempt using PyInstaller to build stand-alone binaries for different operating systems, however, neither PyInstaller, nor Py2Exe, nor cx_freeze, nor any tool to my knowledge does this.
Effectively, in-order to do something like this, you would need a cross-compiler such as MinGW or VC++ for Linux, and integrate it into PyInstaller, which is very far outside of the scope of the project. It is much easier to use WINE or having a dual-boot system or multiple development computers.

How to generate an executable file that can run both on macOS and Linux

I generate an executable file on macOS and now I want to run it on Linux.
I already have my Makefile and I use that to make the executable file on macOS(using gcc). But when I run it on Linux, I got an error message: "./executable: cannot execute binary file". Can anyone help me with solving this problem?
You will have to compile the executable again on Linux in order to create a binary that runs on Linux.
Unless you setup a cross-compile environment for Linux on MacOSX (using Linux in a Virtual Machine will be easier though), then you could compile for Linux there.
Either way you will end up with 2 different binaries. You can't create a single binary that will run on both Linux and MacOSX.

How to run ELF binary file on cygwin

I'm new to cygwin but I am having a bit of a trouble.
I have Linux ELF compiled binary file, and is there a way to lunch it under cygwin a simple way, like windows binary for example .\a.exe
from https://www.cygwin.com/
Cygwin is not:
a way to run native Linux apps on Windows. You must rebuild your
application from source if you want it to run on Windows.
If you want to run a ELF binary you need a VM with Linux inside

Resources