MIPS平台交叉编译libSDL的问题

发布于 2024-10-03 20:21:42 字数 1325 浏览 5 评论 0原文

我试图为我的 mips 平台编译 libSDL-1.2.14。
但它并不成功。

这些是我尝试过的步骤:

  1. export PATH=/opt/mips-4.3/bin:$PATH
  2. 进入 libSDL-1.2.14 源文件夹。
  3. 给出了“./configure --prefix=/usr/local/SDL_Lib --host=mips-linux-gnu”
  4. 执行了“make”命令

这是收到的错误:

cc1:警告:包括位置 “/usr/include” 不安全 交叉编译
./src/audio/dma/SDL_dmaaudio.c:在 函数“DMA_WaitAudio”: ./src/audio/dma/SDL_dmaaudio.c:167: 错误:在类中找不到寄存器 重新加载“asm”时出现“COP3_REGS”
./src/audio/dma/SDL_dmaaudio.c:167: 错误:“asm”操作数不可能 约束条件:* [build/SDL_dmaaudio.lo] 错误 1

​​但后来我通过给出以下命令重新配置了 make 文件:

  1. make clean
  2. ./configure --prefix=/usr/local/SDL_Lib --host=mips-linux-gnu CPPFLAGS=-I /opt/mips-4.3/mips-linux-gnu/libc/usr/include/
  3. make

注意:/opt/mips-4.3/mips-linux-gnu/libc/usr/include/ - 这是您可以找到的路径mips 平台的 select.h 文件。 它包含宏 FD_ZERO 和 FD_SET 的定义。

我仍然遇到同样的错误。

cc1:警告:包括位置 “/usr/include” 不安全 交叉编译
./src/audio/dma/SDL_dmaaudio.c:在 函数“DMA_WaitAudio”:
./src/audio/dma/SDL_dmaaudio.c:167: 错误:在类中找不到寄存器 重新加载“asm”时出现“COP3_REGS”
./src/audio/dma/SDL_dmaaudio.c:167: 错误:“asm”操作数不可能 约束条件:* [build/SDL_dmaaudio.lo] 错误 1

​​请帮助我提供一些有价值的指示。

谢谢,

I was trying to compile libSDL-1.2.14 for my mips platform.
But it was not successful.

These were the steps that I tried out :

  1. export PATH=/opt/mips-4.3/bin:$PATH
  2. Went inside the libSDL-1.2.14 source folder.
  3. Gave a "./configure --prefix=/usr/local/SDL_Lib --host=mips-linux-gnu"
  4. Executed the "make" command

This was the error received :

cc1: warning: include location
"/usr/include" is unsafe for
cross-compilation
./src/audio/dma/SDL_dmaaudio.c: In
function 'DMA_WaitAudio':
./src/audio/dma/SDL_dmaaudio.c:167:
error: can't find a register in class
'COP3_REGS' while reloading 'asm'
./src/audio/dma/SDL_dmaaudio.c:167:
error: 'asm' operand has impossible
constraints make: *
[build/SDL_dmaaudio.lo] Error 1

But then i reconfigured the make file by giving the following commands :

  1. make clean
  2. ./configure --prefix=/usr/local/SDL_Lib --host=mips-linux-gnu CPPFLAGS=-I/opt/mips-4.3/mips-linux-gnu/libc/usr/include/
  3. make

NOTE : /opt/mips-4.3/mips-linux-gnu/libc/usr/include/ - This is the path where you can locate the select.h file for the mips Platform.
It contains the definitions of the macros FD_ZERO and FD_SET.

Still I am getting the same error.

cc1: warning: include location
"/usr/include" is unsafe for
cross-compilation
./src/audio/dma/SDL_dmaaudio.c: In
function 'DMA_WaitAudio':
./src/audio/dma/SDL_dmaaudio.c:167:
error: can't find a register in class
'COP3_REGS' while reloading 'asm'
./src/audio/dma/SDL_dmaaudio.c:167:
error: 'asm' operand has impossible
constraints make: *
[build/SDL_dmaaudio.lo] Error 1

Please help me with some valuable pointers.

Thanks,
Sen

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

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

发布评论

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

评论(1

傻比既视感 2024-10-10 20:21:42

首先,不要将交叉编译器的路径设置为 PATH 的第一部分,而将其设置为最后部分:

export PATH=$PATH:<path to cross-compiler>

这样更安全。其次,运行./configure --help以获取所有选项。如果它更聪明的话,该错误消息会说如下:

  1. 您正在尝试交叉编译,因为您正在设置 --host 标志,
  2. 但是您没有更改任何其他选项来查找包含和库对于目标环境,
  3. 我将默认使用 /usr/include
  4. 但这是针对主机系统的,在交叉编译时将不起作用

检查您需要设置哪些其他配置选项来告诉配置脚本在哪里可以找到 .h文件(包含)和目标的库。这些通常与您下载的交叉编译器一起提供。另外,您可能应该在运行 configure 之前将 CROSS_COMPILE 环境变量设置为交叉编译器前缀。前缀是交叉编译器中 gcc 之前的部分,假设您使用 GCC 作为交叉编译器。

First, don't set the path to the cross-compiler as the first part of your PATH, set it as last:

export PATH=$PATH:<path to cross-compiler>

It's safer this way. Second, run ./configure --help to get all the options. What that error message would say if it was smarter is the following:

  1. You're trying to cross-compile since you're setting the --host flag
  2. But you're not changing any of the other options for where to find includes and libs for the target environment
  3. I'm going to use /usr/include by default
  4. But that's for the host system which will not work when cross-compiling

Check what other configure options you need to set to tell the configure script where to find the .h files (includes) and the libraries for your target. These usually come with the cross-compiler that you download. Also, you should probably set the CROSS_COMPILE environment variable to the cross-compiler prefix before running configure. The prefix is the part before gcc in a cross-compiler, assuming you're using GCC as your cross-compiler.

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