针对iMX.53交叉编译的DirectFB - 在启动时崩溃

时间:2012-10-11 00:56:29

标签: linux arm cross-compiling cortex-a8 directfb

尝试在基于运行Linux 2.6.35.3的i.MX53处理器(ARM Cortex-A8内核)(由飞思卡尔提供)的嵌入式系统中使用directfb。

我在i686 debian主机系统上安装了交叉编译器。交叉编译器来自embedian.org档案,是gcc-4.3-arm-linux-gnueabi包(arm-linux-gnueabi-gcc (Debian 4.3.2-1.1) 4.3.2)。这是随glibc 2.7提供的。这是与我的目标系统上的版本不同的版本,即glibc 2.11,尽管我的阅读表明它们应该是兼容的。

经过对系统映像中已存在的库的大量实验,我成功地编译了directfb 1.6.2。由于我没有为已安装的库提供pkg-config信息这一事实,这很复杂,但我最终设法说服它使用以下configure命令行进行编译:

TOP=`realpath ../..`
PKG_CONFIG_PATH=${TOP}/ext/libpng-1.5.13/ \
LIBPNG_CFLAGS=-I${TOP}/include \
LIBPNG_LDFLAGS="-L${TOP}/libs -lpng15 -lz" \
FREETYPE_CFLAGS=-I${TOP}/include \
FREETYPE_LIBS="-L${TOP}/libs -lfreetype" \
LIBS="-lgcc_s -lgcc -ldl -lstdc++ -lz" \
CFLAGS="-march=armv7-a" \
CXXFLAGS="-march=armv7-a" \
./configure CC=arm-linux-gnueabi-gcc CPPFLAGS=-I${TOP}/include LDFLAGS=-L${TOP}/lib \
   --build=i686-linux --host=arm-linux-gnueabi \
   --enable-static --disable-shared \
   --disable-freetype --enable-fbdev --disable-x11 \
   --with-gfxdrivers=none --with-inputdrivers=none

这成功构建,我可以在http://directfb.org/docs/DirectFB_Tutorials/simple.html基于简单的教程应用程序编译和链接示例应用程序 - 遗憾的是,当在目标系统上运行时,应用程序崩溃了SIGSEGV。 directfb中包含的一些工具也是如此,例如: dfbinfo。

这是我的测试应用程序崩溃的堆栈跟踪(当使用命令行arg“--dfb:fbdev = / dev / fb0”运行时):

#0  direct_map_lookup (map=0x0, key=0xdfd70) at map.c:298
#1  0x000b2d9c in direct_config_set (name=0xdfd70 "fbdev",
    value=0xdfd76 "/dev/fb0") at conf.c:542
#2  0x0009edc0 in dfb_config_set (name=0xdfd70 "fbdev",
    value=0xdfd76 "/dev/fb0") at conf.c:2024
#3  0x000a2dcc in parse_args (args=0x7ea80d53 "fbdev=/dev/fb0") at conf.c:297
#4  0x000a305c in dfb_config_init (argc=0x7ea80968, argv=0x7ea80964)
    at conf.c:2159
#5  0x0000cd58 in Display::Display ()
#6  0x0000ba94 in main ()

作为参考,在崩溃之前在应用程序中执行的唯一与directfb相关的代码直接从教程代码中复制:

Display::Display(int argc, char ** argv)
{
   DFBSurfaceDescription dsc;       
   DFBCHECK (DirectFBInit (&argc, &argv));  
   // ... crash occurs during execution of the line above
}

直接从我的main函数调用,传递原始的未修改的argc和argv。

我在/ usr / local / lib中的目标系统上安装了directfb库,在/ usr / local / bin中安装了二进制文件,并创建了/usr/local/share/directfb-1.6.2(包含cursor.dat和decker.dgiff)以及文档中建议的/etc/fb.modes。

关于我做错了什么的任何建议?

1 个答案:

答案 0 :(得分:0)

从git.directfb.org读取conf.cmaps.c的源代码并检查您的堆栈......

#0  direct_map_lookup (map=0x0, key=0xdfd70) at map.c:298
#1  0x000b2d9c in direct_config_set (name=0xdfd70 "fbdev", value=0xdfd76 "/dev/fb0") at conf.c:542

map为null。哪个应该在map.c:295断言,但看起来像是禁用但反而在298崩溃

hash = map->hash( map, key, map->ctx );

之前的电话是在conf.c:542,

ConfigOption *option = direct_map_lookup( config_options, name );

表示config_options为null。仅在该文件中搜索它被分配到文件的位置为__D_conf_init()

我对directfb一无所知,但看起来您需要直接或间接致电__D_conf_init