Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-1423

Android ndk18 not working with static c++ runtime

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 1.13.0
    • 1.13.0, 1.12.2
    • Toolchains: Clang/LLVM
    • None
    • Android
    • bd1fbf43096d372a671d10bfe3b9fb227104bdde (qbs/qbs/1.13)

    Description

      When linking application with Android.ndk.appStl: "c+_static"  i have many "undefined reference" errors for libc+_static.a library (log is in attachment).

      Seems like those symbols are located in ndk-bundle/sources/cxx-stl/llvm-libc+/libs/arm64-v8a/libc+abi.a.

      But I can not link it from my application code because qbs orders libraries in wrong way in this case, and error does not go away.

      as a quick fix I have patched android-gcc.qbs file like this

      staticLibraries: {
       var libs = ["gcc"];
       if (staticStlFilePath)
           //libs.push(staticStlFilePath);
             libs.push(staticStlFilePath, FileInfo.joinPaths(stlLibsDir, staticLibraryPrefix + "c++abi" + staticLibrarySuffix));
             return libs;
       }
      

      with such fix it links successfully.

      Attachments

        For Gerrit Dashboard: QBS-1423
        # Subject Branch Project Status CR V

        Activity

          People

            kandeler Christian Kandeler
            nsk Mikhail Fedotov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes