Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. error "relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `__stack_chk_guard@@GLIBC_2.17'" in QT5.8.0 source building with Cross compiler aarch64

error "relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `__stack_chk_guard@@GLIBC_2.17'" in QT5.8.0 source building with Cross compiler aarch64

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 3 Posters 10.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alex_wang
    wrote on last edited by
    #1

    hi,
    I compile QT5.8.0 source with Cross compiler aarch64:
    Linux: Ubuntu 14.04
    Cross compiler: gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu
    QT: 5.8.0
    configure:
    ./configure
    -v
    -opensource
    -confirm-license
    -device-option CROSS_COMPILE=/home/suma/GUI/gcc/gcc-linaro/bin/aarch64-linux-gnu-
    -device linux-jetson-tx1-g++
    -prefix /usr/local/qt5
    -extprefix /home/suma/GUI/qt/qt5
    -hostprefix /home/suma/GUI/qt/qt5-host
    -nomake examples
    -nomake tests
    -opengl es2
    -sysroot /home/suma/tx1/Linux_for_Tegra/rootfs
    make :
    when create libQt5Core.so.5.8.0 (qt-everywhere-opensource-src-5.8.0/qtbase/src/corelib),
    I encounter a error like below:
    ../lib/gcc/aarch64-linux-gnu/6.2.1/../../../../aarch64-linux-gnu/bin/ld: /home/suma/tx1/Linux_for_Tegra/rootfs/lib/aarch64-linux-gnu/libz.a(compress.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol __stack_chk_guard@@GLIBC_2.17' can not be used when making a shared object; **recompile with -fPIC** ../lib/gcc/aarch64-linux-gnu/6.2.1/../../../../aarch64-linux-gnu/bin/ld: /home/suma/tx1/Linux_for_Tegra/rootfs/lib/aarch64-linux-gnu/libz.a(compress.o)(.text+0x10): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol __stack_chk_guard@@GLIBC_2.17'
    ../lib/gcc/aarch64-linux-gnu/6.2.1/../../../../aarch64-linux-gnu/bin/ld: final link failed: Bad value
    collect2: error: ld returned 1 exit status
    make: *** [../../lib/libQt5Core.so.5.8.0] Error 1

    QT5.8.0 makefile like this :
    CFLAGS = -pipe -mtune=cortex-a57.cortex-a53 -march=armv8-a --sysroot=/home/suma/tx1/Linux_for_Tegra/rootfs -O2 -fvisibility=hidden -Wall -W -D_REENTRANT -fPIC $(DEFINES)
    CXXFLAGS = -pipe -mtune=cortex-a57.cortex-a53 -march=armv8-a --sysroot=/home/suma/tx1/Linux_for_Tegra/rootfs -O2 -std=c++1z -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -Wvla -Wdate-time -D_REENTRANT -fPIC $(DEFINES)
    LFLAGS = -Wl,-rpath-link,/home/suma/tx1/Linux_for_Tegra/rootfs/usr/lib -Wl,-rpath-link,/home/suma/tx1/Linux_for_Tegra/rootfs/usr/lib/aarch64-linux-gnu -Wl,-rpath-link,/home/suma/tx1/Linux_for_Tegra/rootfs/usr/lib/aarch64-linux-gnu/tegra -Wl,-rpath-link,/home/suma/tx1/Linux_for_Tegra/rootfs/lib/aarch64-linux-gnu --sysroot=/home/suma/tx1/Linux_for_Tegra/rootfs -Wl,--no-undefined -Wl,--version-script,QtCore.version -Wl,-O1 -Wl,--enable-new-dtags -shared -Wl,-soname,libQt5Core.so.5

    so I have builded with -fPIC,but this error haved not solved.

    Any Ideas?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Alex_wang
      wrote on last edited by
      #2

      changing the path order of the linked libraries can fix my issue!
      error path:
      QMAKE_LIBDIR +=
      $$[QT_SYSROOT]/usr/lib
      $$[QT_SYSROOT]/lib/aarch64-linux-gnu
      $$[QT_SYSROOT]/usr/lib/aarch64-linux-gnu
      rigth path :
      QMAKE_LIBDIR +=
      $$[QT_SYSROOT]/usr/lib/aarch64-linux-gnu
      $$[QT_SYSROOT]/usr/lib
      $$[QT_SYSROOT]/lib/aarch64-linux-gnu
      Note :
      /usr/lib/_ (1)
      /usr/lib (2)
      /lib (end)

      1 Reply Last reply
      0
      • V Offline
        V Offline
        Vinced
        wrote on last edited by
        #3

        Changing the order didn't help for me.
        I had to choose the Qt version of the faulty library.
        In my case: -qt-libpng

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Colocolo
          wrote on last edited by
          #4

          hi @Vinced ,
          I have same issue, where did you choose the Qt version?
          Thank you

          1 Reply Last reply
          0
          • C Offline
            C Offline
            Colocolo
            wrote on last edited by
            #5

            Hi Alex_wang,

            where is makefine.inc? I cannot find down.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved