0

试图让一个工作的 directfb 用于基于运行 Linux 2.6.35.3(由飞思卡尔提供)的 i.MX53 处理器(这是一个 ARM Cortex-A8 内核)的嵌入式系统。

我在 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 信息这一事实使情况变得复杂,但我最终设法说服它使用以下配置命令行进行编译:

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。

这是我的测试应用程序崩溃的堆栈跟踪(使用命令行参数“--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 和 /usr/local/bin 中的二进制文件中安装了 directfb 库,并创建了 /usr/local/share/directfb-1.6.2(包含 cursor.dat 和 decker.dgiff ) 以及文档中建议的 /etc/fb.modes 。

关于我做错了什么有什么建议吗?

4

1 回答 1

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.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直接或间接调用。

于 2012-10-11T07:25:42.493 回答