我使用 arm-bcm2708 工具链进行交叉编译。
现在我想构建 debian 包。
$ dpkg-buildpackage -rfakeroot -us -uc
我遇到了错误
... (ELF format: 'elf32-littlearm'; RPATH: '') dpkg-shlibdeps: error: cannot continue due to the error above Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file. To help dpkg-shlibdeps find private libraries, you might need to set LD_LIBRARY_PATH.
我不想在 pi 上构建它。那么如何在 PC 上交叉编译 RPi debian 包呢?
最佳答案
第一种方法是使用与 Raspberry Pi Debian 相同的主机 Debian 发行版。例如 7.0。添加 deb http://www.emdebian.org/debian/unstable main
到您的 /etc/apt/sources.list
并安装工具链:
apt-get update
apt-get install emdebian-archive-keyring
apt-get install gcc-4.7-arm-linux-gnueabihf g++-4.7-arm-linux-gnueabihf
apt-get install build-essential git debootstrap u-boot-tools
通过xapt然后你可以安装交叉编译的依赖项。或许到时候你就可以使用 dpkg-buildpackage
了。
替代方案:
您可以转换您的包以使用 CMake并使用 CPack生成 deb 文件。这种方法也适用于其他发行版,如 openSuSe、Fedora。
更新:
由于 Emdebian 发行版更新已经停止,建议切换到较新的 Debian 版本并使用 multiarch功能。
关于debian - 如何为 ARM Raspberry Pi 交叉编译 debian 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21564768/