gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 04:21:22 24 4
gpt4 key购买 nike

尝试获取一个可工作的 directfb,用于基于运行 Linux 2.6.35.3(由 Freescale 提供)的 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 中包含的一些工具也是如此,例如dfb信息。

这是我的测试应用程序崩溃的堆栈跟踪(当使用命令行参数“--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
}

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

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

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

最佳答案

阅读 conf.c 的源代码和 maps.c来自 git.directfb.org 并检查你的堆栈...

#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 为空。应该在 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

关于linux - 针对 iMX.53 交叉编译的 DirectFB - 启动时崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12830668/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com