在共享主机上编译32位linux的git [英] Compile git for 32-bit linux on shared hosting
问题描述
我需要在一个廉价的共享主机上设置Git客户端,使用一个没有名字的32位Linux发行版。 GCC不可用,所以我无法在服务器上编译它。我有我的处置2其他64位Linux服务器和一个OSX笔记本电脑,我可以尝试交叉编译一个二进制。但我似乎不能得到它的编译正确;当我把二进制文件推送到32位服务器时,它说它无法运行可执行文件。它看起来从其他来源,如我需要添加-arch i386和/或-m32到./configure或使命令工作32位,但我想我不正确使用它们。
I need to set up the Git client on a cheap shared hosting, with a no-name 32-bit Linux distribution. GCC isn't available so I can't compile it on the server. I do have at my disposal 2 other 64-bit Linux servers and an OSX laptop which I could try to cross-compile a binary on. But I can't seem to get it to compile correctly; when I push the binaries to the 32-bit server it says it can't run the executable. It looks from other sources like I need to add "-arch i386" and/or "-m32" to the ./configure or make commands to work for 32-bit, but I guess I'm not using them correctly. Anyone know how to do this, or alternately, where to find a universal 32-bit Git binary?
感谢
推荐答案
你最好的办法是尝试编译git作为一个静态二进制。您的二进制文件可能有不同的共享库版本(甚至不安装所有依赖项)。
Your best bet is trying to compile git as a static binary. Your binary probably have different shared libraries versions (or even, not all dependencies installed).
此链接:
提供有关如何将git构建为静态二进制文件的信息。
Provides information on how to build git as a static binary.
a href =http://stackoverflow.com/questions/1272357/how-to-compile-a-32-bit-binary-on-a-64-bit-linux-machine-with-gcc-cmake/1272408# 1272408> stackoverflow answer 提供了有关如何从64位主机交叉编译它的信息。
This stackoverflow answer provides information on how to cross compile it from a 64 bit host.
希望这有助于。
这篇关于在共享主机上编译32位linux的git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!