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

    • Bug
    • Resolution: Done
    • P2: Important
    • 1.7.0
    • 1.4.2
    • General
    • None
    • 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

            kandeler Christian Kandeler
            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