无法交叉编译SDL2_ttf到arm-linux

时间:2016-04-17 21:26:14

标签: sdl-2 buildroot

我正在使用CrossTool NG和Buildroot来创建rootfs。我正在尝试将SDL2_ttf添加到该rootfs。

我导出以下环境变量 CC =臂的linux-GCC

CPPFLAGS = -I / home / peter / igep2015 / 94SDLttf / pmtstaging / usr / include -I / home / peter / igep2015 / 09Buildroot / buildroot-2016.02-TRY5 / output / staging / usr / include -I / home /彼得/ igep2015 / 94SDLttf / pmtstaging的/ usr /包括/对FreeType2

CFLAGS = - SYSROOT = /家庭/彼得/ igep2015 / 09Buildroot / buildroot的-2016.02-TRY5 /输出/主机的/ usr / armeb-buildroot的-Linux的gnueabi / SYSROOT /

LDFLAGS = -L /家庭/彼得/ igep2015 / 94SDLttf / pmtstaging / usr / lib中/

***************************输出******************* ************** ld.bfd:在搜索-lpthread时跳过不兼容的/usr/lib/i386-linux-gnu/libpthread.so

/usr/local/xtools/arm-unknown-linux-gnueabi/lib/gcc/arm-unknown-linux-gnueabi/5.1.0 /../../../../臂-unknown- linux-gnueabi / bin / ld.bfd:在搜索-lpthread时跳过不兼容的/usr/lib/i386-linux-gnu/libpthread.a

/usr/local/xtools/arm-unknown-linux-gnueabi/lib/gcc/arm-unknown-linux-gnueabi/5.1.0 /../../../../臂-unknown- linux-gnueabi / bin / ld.bfd:找不到/lib/libpthread.so.0

/usr/local/xtools/arm-unknown-linux-gnueabi/lib/gcc/arm-unknown-linux-gnueabi/5.1.0 /../../../../臂-unknown- linux-gnueabi / bin / ld.bfd:找不到/usr/lib/libpthread_nonshared.a

collect2:错误:ld返回1退出状态

当我添加-L / Buildroot库或-L / arm-linux库以便找到libpthread时,。/ configure失败。复制libpthread ... pmtstaging / usr / lib无效。我已成功将libfreetype和libpng12添加到pmtstaging。另外,我将libSDL2和libz从Buildroot复制到pmtstaging。

有没有人成功地将已编译的SDL2_ttf交叉到arm-linux?可以吗?

2 个答案:

答案 0 :(得分:1)

您应该真正向Buildroot邮件列表提交补丁,即使它们不能完全运行,以便其他人可以帮助您。询问有关在任何地方都无法获得的代码的问题不会给你很多答案。

答案 1 :(得分:0)

要交叉编译SDL_ttf,必须更改Buildroot sysroot中的2个链接描述文件   - libc.so
  - libpthread.so

Can't access Buildroot staging libraries via ./configure when cross compiling. It fails on test compile.
 为什么。

更改     /home/peter/igep2015/09Buildroot/buildroot-2016.02-TRY5/output/host/usr/armeb-buildroot-linux-gnueabi/sysroot/usr/lib/libc.so
来自:

/* GNU ld script
    Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
OUTPUT_FORMAT(elf32-littlearm)
 GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a  AS_NEEDED ( /lib/ld-linux.so.3 ) )

TO:

/* GNU ld script
   Use the shared library, but some functions are only in  
   the static library, so try that secondarily.  */   
OUTPUT_FORMAT(elf32-littlearm)  
GROUP ( ../../lib/libc.so.6 libc_nonshared.a  AS_NEEDED ( ../../lib/ld-linux.so.3 ) )

更改
    /home/peter/igep2015/09Buildroot/buildroot-2016.02-TRY5/output/host/usr/armeb-buildroot-linux-gnueabi/sysroot/usr/lib/libpthread.so
来自:

/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
OUTPUT_FORMAT(elf32-littlearm)
GROUP ( /lib/libpthread.so.0 /usr/lib/libpthread_nonshared.a )

TO:

/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
OUTPUT_FORMAT(elf32-littlearm)
GROUP ( ../../lib/libpthread.so.0 libpthread_nonshared.a )

现在是正常的 的./configure
使
make DESTDIR = install

此示例假定libpng和freetype已安装在Buildroot登台目录之外的pmtstaging中 - 尽管它可能只使用Buildroot登台sysroot并删除对pmtstaging的引用。

export PATH=$PATH:/usr/local/xtools/arm-unknown-linux-gnueabi/bin/ 
export CC=arm-linux-gcc
export CFLAGS="-v -Wl,--verbose"        ###optional for debugging
export CPPFLAGS="-I/home/peter/igep2015/94SDLttf/pmtstaging/usr/include -I/home/peter/igep2015/09Buildroot/buildroot-2016.02-TRY5/output/host/usr/armeb-buildroot-linux-gnueabi/sysroot/usr/include -I/home/peter/igep2015/94SDLttf/pmtstaging/usr/include/freetype2"
export LDFLAGS="-L/home/peter/igep2015/09Buildroot/buildroot-2016.02-TRY5/output/host/usr/armeb-buildroot-linux-gnueabi/sysroot/lib  -L/home/peter/igep2015/09Buildroot/buildroot-2016.02-TRY5/output/host/usr/armeb-buildroot-linux-gnueabi/sysroot/usr/lib  -L/home/peter/igep2015/94SDLttf/pmtstaging/usr/lib"  
./configure --host=arm-linux --prefix=/usr --with-freetype-prefix=/home/peter/igep2015/94SDLttf/pmtstaging/usr  
make
make DESTDIR=/home/peter/igep2015/94SDLttf/pmtstaging/  install