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

"cxxStandardLibrary: libc++" only works when clang is build against libc++abi on linux

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 1.4.2
    • Fix Version/s: 1.7.0
    • Component/s: General
    • Labels:
      None
    • Commits:
      5df820e8fb170edf0fdce14a38385155f3b63cd7

      Description

      Libc++ can be build against many different C++ ABI libraries (see http://libcxx.llvm.org/). Therefore qbs should either determine the ABI library itself or offer configuration.

      As a workaround I currently set "cpp.cxxStandardLibrary: undefined" and add the needed flags myself to cxxFlags and linkerFlags. While this seems to compile and link fine, qbs prints this warning: "WARNING: Conflicting scalar values" when using other modules that use "cxxStandardLibrary" like qt.

      If selection of the ABI library can not be automated then I think you should add a "cxxAbiLibrary" property similar to "cxxStandardLibrary". Im currently using this:

      property string cxxAbiLibrary: "libsupc++"
      PropertyOptions {
              name: "cxxAbiLibrary"
              allowedValues: [ "libsupc++", "libc++abi", "libcxxrt" ]
              description: "version of the C++ABI library to use"
      }
      ...
      cpp.dynamicLibraries: {
              if ( qbs.toolchain.contains( "clang" ) && cxxStandardLibrary === "libc++" ) {
                  if ( cxxAbiLibrary === "libsupc++" ) {
                      return [ "supc++" ]
                  } else if ( cxxAbiLibrary === "libc++abi" ) {
                      return [ "c++abi" ]
                  } else if ( cxxAbiLibrary === "libcxxrt" ) {
                      return [ "cxxrt" ]
                  }
              }
          }
      

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            kandeler Christian Kandeler
            Reporter:
            cstoitner Christian Stoitner
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes