针对嵌入式 Arm 交叉编译 Qt:找不到 libpthread.so.0

发布于 2024-11-07 05:32:33 字数 1441 浏览 0 评论 0原文

我正在尝试为嵌入式arm设备(飞思卡尔处理器)交叉编译Qt和WebKit。我有一个 arm-none-linux-gnueabi 工具链。

Qt 实际上已编译,但我在尝试编译演示时遇到了问题,特别是 WebKit 演示,这正是我所追求的。

我遇到的第一个问题是找不到 libjscore,这是由于 Qt 处理静态构建的方式而导致的错误。事实证明,您可以复制该库并且它可以工作,请参阅 此处

现在编译再次中断,说找不到 libpthread.so.0,这似乎是工具链问题而不是 Qt 问题。

在我的工具链中搜索目录树,有几个libpthreads。 查找 | 的副本grep libpthread 命令的输出如下供参考。

./arm-none-linux-gnueabi/sysroot/vfp/lib/libpthread-2.5.so
./arm-none-linux-gnueabi/sysroot/vfp/usr/lib/libpthread_nonshared.a
./arm-none-linux-gnueabi/sysroot/vfp/usr/lib/libpthread.a
./arm-none-linux-gnueabi/sysroot/vfp/usr/lib/libpthread.so_orig
./arm-none-linux-gnueabi/sysroot/vfp/usr/lib/libpthread.so
./arm-none-linux-gnueabi/sysroot/lib/libpthread-2.5.so
./arm-none-linux-gnueabi/sysroot/usr/lib/libpthread_nonshared.a
./arm-none-linux-gnueabi/sysroot/usr/lib/libpthread.a
./arm-none-linux-gnueabi/sysroot/usr/lib/libpthread.so_orig
./arm-none-linux-gnueabi/sysroot/usr/lib/libpthread.so

那么链接器似乎有什么奇怪的地方?另外,需要符号链接什么来创建libpthread.so.0

注意:_libpthread.so_orig_ 和 libpthread.so 遵循此 修复

非常感谢任何帮助或建议。我已经用头撞墙两天了。

谢谢

I am trying to cross compile Qt with WebKit for an embedded arm device (freescale processor). I have a arm-none-linux-gnueabi toolchain.

Qt actually compiled, but I have run into problems when trying to compile the demos, in particular the WebKit ones, which is really what I am after.

The first problem I was having was that libjscore was not found, which was an error due to the way Qt handles static builds. Turns out you can copy the library and it works, see here.

Now compilation breaks again saying it can not find libpthread.so.0, which would seem to be a toolchain problem rather than a Qt problem.

Searching the directory tree in my toolchain, there are several libpthreads. A copy of the find | grep libpthread command's output is below for reference.

./arm-none-linux-gnueabi/sysroot/vfp/lib/libpthread-2.5.so
./arm-none-linux-gnueabi/sysroot/vfp/usr/lib/libpthread_nonshared.a
./arm-none-linux-gnueabi/sysroot/vfp/usr/lib/libpthread.a
./arm-none-linux-gnueabi/sysroot/vfp/usr/lib/libpthread.so_orig
./arm-none-linux-gnueabi/sysroot/vfp/usr/lib/libpthread.so
./arm-none-linux-gnueabi/sysroot/lib/libpthread-2.5.so
./arm-none-linux-gnueabi/sysroot/usr/lib/libpthread_nonshared.a
./arm-none-linux-gnueabi/sysroot/usr/lib/libpthread.a
./arm-none-linux-gnueabi/sysroot/usr/lib/libpthread.so_orig
./arm-none-linux-gnueabi/sysroot/usr/lib/libpthread.so

So it seems that there is something weird with the linker? Also, what needs to be symlinked to create the libpthread.so.0?

Note: the _libpthread.so_orig_ and libpthread.so follow this fix.

Any help or suggestions are much appreciated. I've been banging my head against a wall for two days now.

Thanks

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

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

发布评论

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

评论(2

梦醒灬来后我 2024-11-14 05:32:33

一般来说,您应该确保您构建的(或已经为您构建的)工具链与其构建时的路径完全相同。库 (*.so *.a) 也应该位于相同的原始路径中。它应该如下所示:

/bin
<路径>/usr/lib
/lib

这些文件夹不应移动。工具链可执行文件位于“bin”中,它查找的库位于“../usr/lib 和 ../lib”中。此外, 可能会以某种方式硬编码到您的 gcc 二进制文件中。移动它似乎会破坏东西。

In general, you should make sure that the toolchain you built (or has been built for you) is in the same exact path it was built at. The libraries (*.so *.a) should also be in the same original path. It should look like this:

<path>/bin
<path>/usr/lib
<path>/lib

Those folders should not be moved. The toolchain executables are in "bin" and the libraries it looks for are in "../usr/lib and ../lib". Also, <path> may be hard-coded into your gcc binaries in some fashion. Moving it around seems to break things.

霊感 2024-11-14 05:32:33

目标是树莓派PI
我将目标 lib 目录复制到 myuserdirectory
将 /usr/lib 定位到我的交叉编译器 /usr/lib/ 目录
目标 /lib 我的交叉编译器 /lib/ 目录

我创建了两个符号链接:

ln -s /yourcrosscompilerusrlibdirectory /usr/lib/arm-linux-gnueabihf
ln -s /yourcrosscompilerusrdirectory /lib/arm-linux-gnueabihf

它对我有用
libpthread 位于 /yourcrosscompilerusrlibdirectory

Target is a raspberry PI
I copy target lib directory to myuserdirectory
target /usr/lib to my crosscompiler /usr/lib/ directorie
target /lib my crosscompiler /lib/ directorie

I create two symbolic link:

ln -s /yourcrosscompilerusrlibdirectory /usr/lib/arm-linux-gnueabihf
ln -s /yourcrosscompilerusrdirectory /lib/arm-linux-gnueabihf

and it's work for me
libpthread are in /yourcrosscompilerusrlibdirectory

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