Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-107807

When building an application on Android using the android_app config then -shared is incorrectly included

    XMLWordPrintable

Details

    • Android

    Description

      When building an application on Android using the android_app config then -shared is incorrectly included. This causes it to be incorrectly built and as a result the binary created segfaults when started:

      The resulting binary is something that is both a ELF binary and a shared library, making it segfault when executed.
      
      More information:
      $ file ./hello-world
      ./hello-world: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=e818a2180e12b9e903de2ea396f7fbea34de997b, not stripped
      
      $ patchelf --print-interpreter ./hello-world
      patchelf: cannot find section '.interp'. The input file is most likely statically linked
      
      $ ./hello-world
      Segmentation fault 
      

      Removing -shared from the QMAKE_LFLAGS_APP part in qmake.conf for android-clang solves the problem.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-107807
          # Subject Branch Project Status CR V

          Activity

            People

              qtandroidteam Qt Android Team
              andysh Andy Shaw
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes