将SIP库移植到PSP的帮助
时间:2020-03-06 14:19:52 来源:igfitidea点击:
我目前正在尝试将SIP堆栈库(pjSIP)移植到PSP控制台(使用PSPSDK工具链),但是makefile文件存在太多麻烦(进行适当的更改并解决链接问题)。
有谁知道一本好的文字,书籍或者其他东西来获得有关移植库的一些见识?
该项目提供的有关移植的唯一文档似乎过于专注于主要操作系统。
解决方案
移植是特定于平台的,因此我认为我们不会找到很多有关该主题的一般文献。
在我的脑海中,我们可能会遇到一些事情:
- 字节序
- 字长
- 可用的图书馆
- 编译器差异
- 链接器差异(我们已经看到了这一点)
- 外围硬件差异
- ...
查看其他移植到PSP的库。在库的Linux版本和PSP版本之间进行比较应该可以看到。
另外,尝试了解POSIX与PSP的兼容性如何,这将告诉我们移植库的工作量。
我进行了更多研究,并在ps2dev论坛上找到了这篇文章:
The PSP is not a Unix system, and the pspsdk is not POSIX compliant. It's close in some places, but you can't expect to just take any code that compiles fine on a POSIX system and have it work. For example: pspsdk uses newlib, which lacks some of glibc's features and headers. libc is not linked by default, so typical autoconf tests will fail to build autoconf knows nothing about the PSP defining PSP_MODULE_INFO and running psp-fixup-imports on the executable are required, otherwise it won't run You should look at all of the other libraries and programs that have been ported (in the psp and pspware repositories). All SDL libs use autoconf, for example.
我认为这为我寻找的内容提供了更多细节,也表明了@ [Jonathan Arkell]的观点,即对已经移植的库的研究。
感谢答复。
PSP不是UNIX,也不兼容POSIX,但是开源工具链由gcc 4.3,bintutils 1.16.1和newlib 1.16组成。
大多数C库已经存在,并且可以编译大多数代码。仅通过使用以下参数调用configure脚本即可移植许多库:
LDFLAGS="-L$(psp-config --pspsdk-path)/lib -lc -lpspuser" ./configure --host psp --prefix=$(pwd)/../target/psp
但是,我们可能需要修补configure和configure.ac脚本,以了解主机mips allegrex(PSP cpu),然后搜索mips *-)行并将其克隆到allegrex,例如:
mips*-*-*) noconfigdirs="$noconfigdirs target-libgloss" ;; mipsallegrex*-*-*) noconfigdirs="$noconfigdirs target-libgloss" ;;
然后,我们运行make命令并希望newlib满足所有需求,如果没有,那么我们只需为缺少的功能创建替代项即可。