Compile git for 32-bit Linux on shared hosting

I need to set up the Git client on a cheap shared hosting with a 32-bit untitled Linux distribution. GCC is not available, so I can not compile it on the server. I have at my disposal 2 other 64-bit Linux servers and an OSX laptop, which I could try to cross-compile the binary. But I cannot get it to compile correctly; when I push the binaries to a 32-bit server, it says that it cannot run the executable. This looks from other sources, such as I need to add "-arch i386" and / or "-m32" to. / configure or make the commands work for 32-bit, but I think I'm using them incorrectly. Does anyone know how to do this, or alternately, where to find the universal 32-bit git binary?

thanks

+7
git linux compilation 32-bit
source share
3 answers

It is best to try to compile git as a static binary. Your binary probably has different versions of shared libraries (or even not all dependencies are installed).

This link:

How to build git for a host without a compiler

Provides information on how to build git as a static binary.

This https://stackoverflow.com/a/4646905/5168321 contains this information on how to compile it from a 64 bit host.

Hope this helps.

+9
source share

Honestly, if it were me, I would just run 32-bit Linux on the VM and compile there.

+1
source share

OS X is not going to work - it is designed to create Mach-O binaries with the syscall OS X interface, not Linux ELF files.

Using -m32 in CLFAGS will help, but most importantly, use -static. Static binaries are much more portable.

If this fails, indicate how it happened.

+1
source share

All Articles