构建覆盆子pi链接错误的Qt库时出错

时间:2016-07-03 01:55:58

标签: qt

在为raspberry pi 3构建qt库时是否有人遇到此错误?

   .windy-demo {
        width: 60%;
        margin: 40px auto;
        color: #aaa;
    }

    .windy-demo ul.wi-container {
        padding: 0;
        margin: 0;

        box-shadow: 0 1px 1px rgba(0,0,0,0.1);
    }
    .windy-demo ul.wi-container li {
        display: block; /* Make list items to block in order to stretch 100% */
        overflow-y: hidden; /* Hides the scroll bar y-axis */
    }
    .windy-demo ul.wi-container li img {
        width: 100%; /* makes the image fit 100% of available space */
        height: auto;
    }
    .windy-demo h4 {
        padding: 0 10px;
        line-height: 26px;
        margin: 0;
    }
    .windy-demo ul.wi-container li {
        padding: 0;
        border: 10px solid #fff;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    #slider ......

我已阅读此链接(https://stackoverflow.com/questions/13626726/an-error-building-qt-libraries-for-the-raspberry-pi#=),但我无法找到任何线索。

这就是我正在尝试的......

在ubuntu 16.04上,gcc 5.3.1,

mount jessie

/ssd/rpi/rpi-tools2/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.gold: error: /ssd/rpi/tmp/qt-everywhere-opensource-src-5.7.0/qtbase/lib/libqtpcre.a(pcre16_chartables.o): unknown CPU architecture

修复库路径

sudo mount -o loop,offset=70254592 /ssd/rpi/2016-05-27-raspbian-jessie.img /mnt/rasp-pi-rootfs/

导出

./fixQualifiedLibraryPaths /mnt/rasp-pi-rootfs/ /ssd/rpi/rpi-tools2/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc

配置..

export RPI_TOOLCHAIN=/ssd/rpi/rpi-tools2/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-
export RPI_SYSROOT=/mnt/rasp-pi-rootfs

./configure -opengl es2 -c++std 11 -device linux-rpi3-g++ -fontconfig -device-option CROSS_COMPILE=$RPI_TOOLCHAIN -sysroot $RPI_SYSROOT -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt57pi -hostprefix /usr/local/qt57pi -v

1 个答案:

答案 0 :(得分:4)

使用参数“-no-use-gold-linker”再次运行configure。

问题似乎与使用ARMv8的黄金链接器有关。我已经更改了一个Makefile进行测试,将“-fuse-ld = gold”更改为“-fuse-ld = bfd”。 链接运行正常。

在qtbase / mkspecs / devices / linux-rpi3-vc4-g ++ / qmake.conf中,您可以查看评论:

# Example configure command below. We disable using the GNU gold
# linker as it apparently has issues with ARMv8. In the configure
# output check that "EGLFS GBM .......... yes" is present, otherwise
# eglfs will not be functional.
#
# ./configure -release -opengl es2 -device linux-rpi3-vc4-g++ \
#   -device-option CROSS_COMPILE=~/raspbian/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- \
#   -sysroot ~/raspbian/sysroot \
#   -prefix /usr/local/qt5pi -extprefix ~/raspbian/qt5pi -hostprefix ~/raspbian/qt5 \
#   -v -nomake examples -nomake tests -no-use-gold-linker