在共享主机上为 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 位,但我想我没有正确使用它们.任何人都知道如何做到这一点,或者,在哪里可以找到通用的 32 位 Git 二进制文件?
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.
这个stackoverflow 答案 提供了有关如何从 64 位主机交叉编译它的信息.
This stackoverflow answer provides information on how to cross compile it from a 64 bit host.
希望这会有所帮助.
这篇关于在共享主机上为 32 位 linux 编译 git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!