有关将 SIP 库移植到 PSP 的帮助

发布于 2024-07-05 16:54:07 字数 178 浏览 8 评论 0原文

我目前正在尝试将 SIP 堆栈库 (pjSIP) 移植到 PSP 控制台(使用 PSPSDK 工具链),但我在 makefile 方面遇到了太多麻烦(进行适当的更改并解决链接问题)。

有谁知道一本好的文本、书籍或其他东西可以深入了解移植库吗?

该项目提供的有关移植的唯一文档似乎过于专注于主要操作系统。

I'm currently trying to port a SIP stack library (pjSIP) to the PSP Console (using the PSPSDK toolchain), but I'm having too much trouble with the makefiles (making the proper changes and solving linking issues).

Does anyone know a good text, book or something to get some insight on porting libraries?

The only documentation this project offers on porting seems too dedicated to major OS's.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

紫南 2024-07-12 16:54:07

我做了更多研究,并在 ps2dev 论坛上找到了这篇文章:

PSP 不是 Unix 系统,并且 pspsdk 不兼容 POSIX。 它在某些地方很接近,但是您不能指望只采用在 POSIX 系统上编译良好的任何代码并让它工作。 例如:

  • pspsdk 使用 newlib,它缺少 glibc 的一些功能和标头。
  • 默认情况下不链接 libc,因此典型的 autoconf 测试将无法构建
  • autoconf 对 PSP 一无所知
  • 需要定义 PSP_MODULE_INFO 并在可执行文件上运行 psp-fixup-imports,否则它将无法运行

您应该查看已移植的所有其他库和程序(在 psp 和 pspware 存储库中)。 例如,所有 SDL 库都使用 autoconf。

我认为这为我正在寻找的内容提供了更多细节,并且还显示了@[Jonathan Arkell]研究已移植库的观点。

感谢您的回复。

I did some more research and found this post at ps2dev forum:

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.

I think this delivers more detail into what I was looking for, and also show the @[Jonathan Arkell] point of looking into libraries that already been ported.

Thanks for your replies.

榕城若虚 2024-07-12 16:54:07

移植是非常特定于平台的,所以我认为您不会找到太多关于该主题的一般文献。

在我的脑海中,您可能会遇到一些事情:

  • 字节顺序、
  • 字大小
  • 、可用库、
  • 编译器差异、
  • 链接器差异(您已经看到了)、
  • 外围硬件差异
  • ……

Porting is very platform specific, so I don't think you will find much general literature on the subject.

Off the top of my mind, some things you may encounter:

  • endianness
  • word size
  • available libraries
  • compiler differences
  • linker differences (you've already seen that one)
  • peripheral hardware differences
  • ...
荆棘i 2024-07-12 16:54:07

查看移植到 PSP 的其他库。 在库的 Linux 版本和 PSP 版本之间进行差异应该会告诉你。

另外,尝试了解 PSP 的 POSIX 兼容性如何,这将告诉您移植库的工作有多大。

Look at other libraries that were ported over to the PSP. Doing diffs between a linux version of a library, and a PSP version should show you.

Also, try to get to know how POSIX compatible the PSP is, that will tell you how big the job of porting the library over is.

卷耳 2024-07-12 16:54:07

PSP 不是 UNIX,也不兼容 POSIX,但开源工具链由 gcc 4.3、bintutils 1.16.1 和 newlib 1.16 组成。

大多数 C 库已经存在并且可以编译大部分代码。 通过使用以下参数调用配置脚本即可移植许多库:

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 具有您需要的所有内容,如果没有,那么您只需要创建函数的替代项你失踪了。

The PSP is not UNIX and is not POSIX compliant, however the open source toolchain is composed by gcc 4.3, bintutils 1.16.1 and newlib 1.16.

Most of the C library is already present and can compile most of your code. Lots of libraries have been ported just by invoking the configure script with the following arguments:

LDFLAGS="-L$(psp-config --pspsdk-path)/lib -lc -lpspuser" ./configure --host psp --prefix=$(pwd)/../target/psp

However you might need to patch your configure and configure.ac scripts to know the host mips allegrex (the PSP cpu), to do that you search for a mips*--) line and clone it to the allegrex like:

mips*-*-*)
    noconfigdirs="$noconfigdirs target-libgloss"
    ;;
mipsallegrex*-*-*)
    noconfigdirs="$noconfigdirs target-libgloss"
    ;;

Then you run the make command and hope that newlib has all you need, if it doesn't then you just need to create alternatives to the functions you are missing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文